@pega/lists-core 8.8.0 → 9.0.0-build.10.0
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/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/src/core/StateResolver.d.ts.map +1 -1
- package/lib/src/core/StateResolver.js +2 -1
- package/lib/src/core/StateResolver.js.map +1 -1
- package/lib/src/core/constants.d.ts +11 -101
- package/lib/src/core/constants.d.ts.map +1 -1
- package/lib/src/core/constants.js +6 -6
- package/lib/src/core/constants.js.map +1 -1
- package/lib/src/core/features/featureFactory.d.ts.map +1 -1
- package/lib/src/core/features/featureFactory.js +0 -1
- package/lib/src/core/features/featureFactory.js.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js +12 -5
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/autoSize.js.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +13 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +3 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js +3 -1
- package/lib/src/core/features/uIFeatures/beforeRender/busyIndicator.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +2 -3
- package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +6 -7
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +11 -3
- package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.js +4 -0
- package/lib/src/core/features/uIFeatures/beforeRender/rowHeight.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/beforeRender/stateSanitization.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +19 -0
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts +0 -2
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/index.js +0 -2
- package/lib/src/core/features/uIFeatures/index.js.map +1 -1
- package/lib/src/core/generators/ColumnGenerator.d.ts +1 -1
- package/lib/src/core/generators/ColumnGenerator.d.ts.map +1 -1
- package/lib/src/core/generators/ColumnGenerator.js +2 -1
- package/lib/src/core/generators/ColumnGenerator.js.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/ViewGenerator.d.ts.map +1 -1
- package/lib/src/core/generators/ViewGenerator.js +7 -2
- package/lib/src/core/generators/ViewGenerator.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/src/core/utils/condition-utils.js +1 -1
- package/lib/src/core/utils/condition-utils.js.map +1 -1
- package/lib/src/core/utils/util.d.ts +1 -0
- package/lib/src/core/utils/util.d.ts.map +1 -1
- package/lib/src/core/utils/util.js +7 -1
- package/lib/src/core/utils/util.js.map +1 -1
- package/lib/types/ApiContext.types.d.ts +32 -3
- 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 +36 -4
- package/lib/types/Meta.types.d.ts.map +1 -1
- package/lib/types/Meta.types.js +3 -0
- package/lib/types/Meta.types.js.map +1 -1
- package/lib/types/State.types.d.ts +21 -2
- 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 +3 -4
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts +0 -7
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.d.ts.map +0 -1
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js +0 -24
- package/lib/src/core/features/uIFeatures/beforeRender/resizeGroupedDragDropColumn.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiContext.types.js","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\nimport type { UtilityFunctions } from '../src/core/generators/viewUtilityMethods';\n\nimport type {\n Personalization,\n PersonalizationInfo,\n PersonalizedState,\n State,\n Group\n} from './State.types';\nimport type { Meta, RowAction, FieldDef } from './Meta.types';\n\n/**\n * Represents information about the currently active view in the repeating structures.\n */\ntype ActiveViewInfo = {\n /**\n * The unique identifier of the active view.\n */\n id: string | undefined;\n\n /**\n * The name of the active view.\n */\n name: string | undefined;\n\n /**\n * Indicates whether the active view has unsaved changes.\n */\n isDirty: boolean;\n};\n\nexport type RsApi = {\n /**\n * Refreshes the current view.\n * @see {@link UtilityFunctions.refreshView}\n */\n refreshView: UtilityFunctions['forceRefresh'];\n\n /**\n * Sets the record count in the view.\n * @see {@link UtilityFunctions.setRecordCount}\n */\n setRecordCount: UtilityFunctions['setRecordCount'];\n\n /**\n * Dispatches an action to the repeating structures with an payload.\n * @see {@link UtilityFunctions.dispatchAction}\n */\n dispatchAction: UtilityFunctions['dispatchAction'];\n\n /**\n * Retrieves information about the currently active view.\n * @returns The {@link ActiveViewInfo active view information} or `void` if unavailable.\n */\n getActiveViewInfo: () => ActiveViewInfo | void;\n\n /**\n * Sets hidden columns of the view.\n * @param columns - An array of column IDs to hide.\n * @param ootbColumns - .\n * @param ootbColumns.dragHandle - Whether to hide the drag-and-drop column.\n */\n setHiddenColumns?: (columns: string[], ootbColumns?: { dragHandle: boolean }) => void;\n\n /**\n * Sets Column order of the view.\n * @param columns - An array of column IDs to reorder.\n */\n setColumnOrder?: (columns: string[]) => void;\n\n /**\n * Sets the filters of the view.\n * @param filter - The filter condition to apply.\n */\n setFilter: (filter: Condition) => void;\n\n /**\n * Sets the groups of the view.\n * @param groups - The grouping configuration.\n */\n setGrouping?: (groups: Group[]) => void;\n\n /**\n * Sets the sorting order of the view.\n * @param {NonNullable<State['sortingOrder']>} sorts - The sorting configuration.\n */\n setSorting: (sorts: NonNullable<State['sortingOrder']>) => void;\n\n /**\n * Sets the column aliases of the view.\n * @param aliases - The column alias configuration.\n */\n setAliases: (aliases: State['columnAlias']) => void;\n\n /**\n * Sets the aggregation information of the view.\n * @param {State['aggregationInfo']} agg - The aggregation configuration.\n */\n setAggregations: (agg: State['aggregationInfo']) => void;\n\n /**\n * Sets the visibility of the row reorder field.\n * @param {boolean} visibility - Whether the row reorder field should be visible.\n */\n setRowReorderFieldVisibility: (visibility: boolean) => void;\n\n /**\n * Updates the visibility of specific columns.\n * @param {Object} columns - A mapping of column IDs to their visibility state.\n */\n updateColumnsVisibility: (columns: { [key: FieldDef['id']]: boolean }) => void;\n\n /**\n * Sets the conditional style formats of the view.\n * @param conditionalStyleFormats - The conditional style formats to apply.\n */\n setConditionalStyleFormats: (\n conditionalStyleFormats: NonNullable<State['conditionalStyleFormats']>\n ) => void;\n};\n\nexport interface ApiOptions {\n signal?: AbortSignal;\n /** Indicates current api triggered should invalidate the cache if any and reload the data. */\n invalidateCache?: boolean;\n /** A unique token or version identifier that changes whenever a refresh is triggered. Unlike a boolean `invalidateCache` flag, the `invalidateCacheToken` ensures that multiple APIs triggered\n in the same refresh cycle receive the same identifier. */\n invalidateCacheToken?: number;\n}\n// Aggregation response type\ntype AggregationTypeResp = 'avg' | 'max' | 'min' | 'nonNullCount' | 'sum';\n/** An object with key equal to {@link AggregationTypeResp aggregation type} and value is equal to the actual value of that aggregation type */\ntype AggregationOptions = {\n [agg in AggregationTypeResp]?: number | null;\n};\n/** An object where key is equal to the column id (i.e. {@link FieldDef.id id} in FieldDef) and value is equal to its {@link AggregationOptions Aggregation values} */\nexport type AggregationResp = {\n [columnId: string]: AggregationOptions;\n};\n\n// Grouping response type\nexport interface GroupedInfo {\n /** Value for the current group node. */\n name: null | string | number | boolean | Date; // Value for the current node\n /** # of data rows in this node */\n count: number;\n /** An optional data row from the group node that is used to process extra information required by group node */\n data?: RowData;\n /** Aggregation values of a column if applied */\n agg?: AggregationResp;\n /** Nested groups within the parent group node */\n children?: GroupedInfo[];\n}\n\nexport interface HierarchicalGroupedInfo extends Pick<GroupedInfo, 'count' | 'agg'> {\n info: RowData;\n children?: HierarchicalGroupedInfo[];\n}\n\nexport type AggregateValueResponse = {\n [columnId: string]: number | null;\n};\n/** An object where key is equal to column id i.e. {@link FieldDef.id id key in fieldDef} and value is equal to the aggregation value for the given aggregation */\nexport type AggregationResult = {\n [columnId: string]: number;\n};\n\nexport interface FetchDataResponse {\n /** An array of {@link RowData} */\n data: RowData[];\n /** An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n totalRecordCount?: number;\n /** @deprecated An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n filteredRecordCount?: number;\n}\n\ntype BulkAction = Pick<RowAction, 'id' | 'text'> & {\n /**\n * @param rowIds - The values for the {@link Meta.itemKey 'itemkey'} for given rows.\n * @param clearSelectionAndRefreshRowsCallback - A callback used to trigger deselection of all the selected rows and then call\n * {@link ApiContext.fetchRowsData 'fetchRowsData'} api of to fetch latest data for given rows, after action is completed.\n * @return {void} - void\n */\n onClick: (rowIds: string[], clearSelectionAndRefreshRowsCallback: () => void) => void;\n};\n\ninterface ConditionConfig {\n condition: Condition;\n data: RowData;\n}\n\nexport type PersonalizationResponse = Pick<Personalization, 'defaultPersonalization'> & {\n allPersonalizations: {\n [personalizationKey: string]: Pick<PersonalizationInfo, 'name'> & {\n personalizationState: PersonalizedState;\n };\n };\n};\n\nexport interface ApiContext {\n /**\n * This api is used to fetch a list of raw data rows (excluding aggregations) for a given group or at the top level when no groups.\n *Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#29) documentation** for more details.\n * @requireWhen Always\n * @invokedWhen filters are changed OR\\\n * search criteria is changed OR\\\n end user scrolls through the RS records OR\\\n sorting is changed OR\\\n forceRefresh is triggered by consumer OR\\\n groups are changed OR\\\n hierarchicalGroups are changed\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query(e.g. filter, sort, group criteria, paginationOptions).\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @param {ApiOptions} apiOptions - Extra api options provided by repeating structures,\n * for instance, abort signal handler is sent which can be attached to the native fetch call or any framework like axios. Repeating structures will use to cancel the api calls which might be using stale state, e.g. in case of progressive scroll.\n * @returns {Promise<FetchDataResponse>} - It should return a promise of type {@link FetchDataResponse} that should contain data as one key of type Array<{@link RowData}> to provide data for given query.\n */\n fetchData: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<FetchDataResponse>;\n\n /**\n * This api is used to fetch details for any group/sub-group ribbons in the RS. Should return labels, counts, aggregation values at each group node.This can sometimes be called even when there are no groups. Avoid running into exceptions in those cases.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#59) documentation** for more details.\n * @requireWhen {@link Meta.grouping 'grouping'} key is set to true in\n * @invokedWhen Grouping is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled. OR\\\n * aggregation is changed OR\\\n * forceRefresh of RS is triggered by consumer.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query. For e.g. use rsState.groups and rsState.aggregationInfo to determine the query.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields info for which data needs to be fetched.\n * @returns {GroupedInfo[]} - It should return a promise of type array of all the {@link GroupedInfo } for the specific field. It can also include nested groups in children key.\n */\n fetchGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<GroupedInfo[]>;\n\n /**\n * This api is used to fetch aggregation results for a given aggregation type(sum/min/max/count) on a field. This is called when aggregations are configured on one or more column.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#84) documentation** for more details.\n * @requireWhen {@link FieldDef.aggregation 'aggregation'} key is set to true for at least one FieldDef AND {@link FieldDef.type 'type'} key in FieldDef should be of number for that particular fieldDef.\n * @invokedWhen When aggregation is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to get current aggregations applied on the RS from aggregationInfo key in state. Apart from this current filters and search criteria can also be picked from state.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @returns {Promise<AggregationResult>} - It should return a promise of type {@link AggregationResult}\n */\n fetchAggregatedValues?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<AggregationResult>;\n\n /**\n * This api is used to fetch unique values available for a particular field. It is generally called for a field which has {@link FieldDef.filterPickList filterPickList} key set to true.The unique values are presented to the user while filtering.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#99) documentation** for more details.\n * @requireWhen {@link FieldDef.filterPickList filterPickList} key set to true for at least one FieldDef\n * @invokedWhen Picklist Filter is invoked by end user from FieldDef header action menu.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} columnId - This is equal to { @link FieldDef.id 'id'} key of the field for which unique values needs to be fetched.\n * @returns {Promise<Array<string | number | boolean | Date>>} It should return a promise of type array of unique values for a given fieldDef id.\n */\n fetchUniqueColValues?: (\n rsState: State,\n rsMeta: Meta,\n columnId: string,\n apiOptions: ApiOptions\n ) => Promise<(string | number | boolean | Date)[]>;\n\n /**\n * This api is used to fetch the latest data for a given row identified uniquely by {@link FieldDef.itemKey itemKey}.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen A {@link Meta.rowActions rowAction} is submitted by consumer of RS, as part of {@link RowAction. rowAction.onClick} 'refresRow' callback.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} key - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @param {string} value - The value for the given {@link Meta.itemKey 'itemKey'} for given row.\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for a given row.Only 0th index is considered from the array.\n */\n fetchRowData?: (\n rsState: State,\n rsMeta: Meta,\n key: string,\n value: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the latest data for given set of rows identified uniquely by itemKey in {@link FieldDef}. This is passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.clearSelectedRows clearSelectedRows} api.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen The bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {Array<string | number | boolean | Date>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @param itemKey - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for given rows.\n */\n fetchRowsData?: (\n rsState: State,\n rsMeta: Meta,\n rowIds: string[],\n itemKey: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the actions that is supported on rows of Repeating Structure. It is generally called when {@link Meta.editing 'editing'} is set to true.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen The end user clicks on 'RowActionMenu'.Once fetched it is not refetched.\n * @param {} uniqueKey - A unique identifier for a given row. This is equal to value for {@link Meta.itemKey 'itemKey'} in {@link RowData} data.\n * @returns - A promise of type Array of {@link RowAction}\n */\n fetchRowActionDetails?: (uniqueKey: string, rowContext: RowData) => Promise<RowAction[]>;\n\n /**\n * This api is used to submit the updated row data to apiContext. It is generally called when {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef to enable inline editing for a cell.\n * @requireWhen {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef.\n * @invokedWhen The end user is done editing the cell using inline editing.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param dataToSubmit - Updated row data to be submitted to apiContext\n * @returns It should return a promise of type {@link RowData} with the updated contents that is passed in {@link dataToSubmit} param.\n */\n submitData?: (\n rsState: State,\n rsMeta: Meta,\n dataToSubmit: RowData\n ) => Promise<{ rowData: RowData }>;\n\n /**\n * This api is used to submit moved records in a repeating structure. It is called when {@link Meta.moveListRecords 'moveListRecords'} is set to true. Repeating structure allow moving of records based on it's value.\n * @requireWhen {@link Meta.moveListRecords 'moveListRecords'} is set to true\n * @invokedWhen The move process is completed by end user this api is called to provide the info related to move records.\n * @param moveInfo - It is an object that contains sourceID(the data of {@link Meta.itemKey 'itemKey'} for the given row) that user has selected to move and\n * destinationID(the data of {@link Meta.itemKey 'itemKey'} for the given row) where the user has dropped the source row.\n * @returns It should return a promise of type object that contains a refresh key if set to true, repeating structures will trigger a refresh and fetch the whole data agin using {@link ApiContext.fetchData 'fetchData'} api\n */\n moveListRecords?: (moveInfo: {\n sourceID: string;\n destinationID: string;\n }) => Promise<{ refresh: boolean }>;\n\n /**\n * This api is used to fetch the bulkActions for a repeating structures if {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * This is called on demand, when the bulk action button in repeating structures is clicked. The button will be disabled till the time at least one record is not selected in repeating structures to trigger bulk action.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen End user clicks on 'Bulk actions' button in RS Toolbar.Once fetched it is not refetched.\n * @param {Array<string>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @returns A promise of type Array of {@link BulkAction}\n */\n fetchActions?: (rowIds: string[]) => Promise<BulkAction[]>;\n\n /**\n * This API is used to pass utility callbacks to the consumer. Consumers can use these callbacks at any point in the lifecycle of Repeating Structures to interact with them.\n *\n * @returns {void} This function does not return any value.\n */\n addCallbacks?: (\n /**\n * @param rsUtilityCallbacks - A set of callbacks exposed by Repeating Structures, including methods for interacting with the view and managing state.\n * See {@link RsApi} for the list of available callbacks.\n *\n */\n rsUtilityCallbacks: RsApi & {\n /**\n * @deprecated This method will be removed in future versions. Please use {@link RsApi.refreshView refreshView} instead.\n *\n * It is used to trigger a force refresh the data and re-fetch selections using apiContext.getSelectedRows api (if any of the selection mode is enabled) of repeating structures\n * @returns {void} void\n */\n forceRefresh: UtilityFunctions['forceRefresh'];\n }\n ) => void;\n\n /**\n * This api passes a unique identifier to apiContext to identify a repeating structure instance. This can be used to uniquely identify a RS instance in case of multiple RS instances.\n * @requireWhen Optional\n * @invokedWhen On Repeating structures mount to share current repeating structure instance identifier.\n * @param {string} rsID - A unique identifier\n * @returns {void} void\n */\n setRsID?: (rsID: string) => void;\n\n /**\n * This api is called to fetch all the personalizations for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen On Repeating structures mount to fetch all personalizations.\n * @returns {PersonalizationResponse} It should return all the personalizations.\n */\n fetchPersonalizations?: () => Promise<PersonalizationResponse>;\n\n /**\n * This api is called to update the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The updated personalization state.\n * @returns {void} void\n */\n updatePersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault?: boolean;\n markAsAppDefault?: boolean;\n name?: string;\n personalizationState?: PersonalizedState;\n }\n ) => Promise<void>;\n\n /**\n * This api is called to delete the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param personalizationKey - Unique identifier for a personalization.\n * @returns {void} void\n */\n deletePersonalization?: (personalizationKey: string) => Promise<void>;\n\n /**\n * This api is called to create the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user create a new personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The personalization state to be saved\n * @returns {void} void\n */\n createPersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault: boolean;\n name: string;\n personalizationState: PersonalizedState;\n }\n ) => Promise<string> | Promise<{ data: string }>;\n\n /**\n * This api is used to communicate selectedRows in the repeating structures to the consumer.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and whenever selection changes in RS.\n * @param {Array<RowData & { $selected: boolean }>} selectedRows The selectedRows that needs to be communicated.\n * @returns {Promise<void>} A promise\n */\n setSelectedRows?: (selectedRows: (RowData & { $selected: boolean })[]) => Promise<void>;\n\n /**\n * This api is used to get the selectedRows for the repeating structures from the consumer, to populate the selections in RS.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and RS requires current selected rows from the consumer.\n * @returns {Promise<Array<string>>} A promise of type array of unique identifiers for all the row. It is value of {@link Meta.itemKey 'itemKey'}\n */\n getSelectedRows?: () => Promise<string[]>;\n\n /** This api is used to communicate the clearance of all the selectedRows for the repeating structures to the consumer.\n * This is also passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.fetchRowsData fetchRowsData} api.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen In case of {@link Meta.selectionMode \"multi\"} selection mode, while toggling all the selections OR\\\n * while switching personalizations OR\\\n * when the bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @returns {Promise<void>} A promise\n */\n clearSelectedRows?: () => Promise<void>;\n\n /**\n * This api is used to fetch the hierarchical groups for an RS if {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef.\n * @requireWhen {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef\n * @invokedWhen Any change in filters, search criteria, hierarchichal groups, aggregations is detected in RS state or personalizations are toggled.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @returns {HierarchicalGroupedInfo[]} - It should return a promise of type array of all the {@link HierarchicalGroupedInfo } for the specific field. It can also include nested hierarchical groups in children key.\n */\n fetchHierarchicalGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<HierarchicalGroupedInfo[]>;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes visibleColumns apart from regular repeating structure state.\n * @requireWhen Optional\n * @invokedWhen After any action performed on Repeating structures that results in updating of state.\n * @param state Repeating structure state\n * @returns {void} void\n */\n stateUpdateCallback?: (state: PersonalizedState & { visibleColumns?: string[] }) => void;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes active personalization in RS apart from regular repeating structure state.\n * @requireWhen Optional\n * @param state Repeating structure state\n * @returns {void} void\n */\n setComponentState?: (state: PersonalizedState & { activePersonalization?: string }) => void;\n /**\n * This api is used to communicate repeating structure state to RS from consumer.\n * @requireWhen Optional\n * @returns RS state.\n */\n getComponentState?: () => Promise<PersonalizedState & { activePersonalization?: string }>;\n /** This api is called on click of 'Import data' option in repeating structures toolbar and should open a modal to allow import of data from a CSV file.\n * @requireWhen {@link Meta.showImportDataOption showImportDataOption} is set to true in Meta.\n * @invokedWhen \"Import data\" button is clicked in the repeating structures toolbar\n * @param {ModalManagerContextValue['create']} create - The function to create a modal in the current context {@link ModalManagerContextValue['create']}.\n * @returns {void} void\n */\n importCSVData?: (create: ModalManagerContextValue['create']) => Promise<void>;\n /** This api is called on click of 'Export to excel' option in repeating structures toolbar and should export the data into a excel file.\n * @requireWhen {@link Meta.showExportToExcelOption showExportToExcelOption} is set to true in Meta.\n * @invokedWhen \"Export to excel\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportData?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is called on click of 'Export to CSV' option in repeating structures toolbar and should export the data into a CSV file.\n * @requireWhen {@link Meta.showExportToCSVOption showExportToCSVOption} is set to true in Meta.\n * @invokedWhen \"Export to CSV\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportDataToCSV?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is used to communicate source and destinaltion row keys to apiContext during row-reordering operation.\n * @requireWhen {@link Meta.reorderItems reorderItems} is set to true and {@link Meta.moveListRecords moveListRecords} is set to false in Meta.\n * @invokedWhen Reordering operations is being performed on rows.\n * @param {string} sourceKey - the value of {@link Meta.itemKey 'itemKey'} for the given row that user has selected to move.\n * @param {string} destinationKey - the value of {@link Meta.itemKey 'itemKey'} for the given row where the user has dropped the source row.\n * @returns {void} void\n */\n applyRowReorder?: (sourceKey: string, destinationKey: string) => Promise<void>;\n\n /**\n * This API allows Repeating Structures to determine if a given `data` meets a specified `condition`. It is utilized in the following features if provided:\n * - `Conditional Formatting` - Optional. If `evaluateCondition` is not provided, Repeating Structures will evaluate the row condition on their own. Otherwise, this function will be used.\n *\n * @param {State} rsState - The state of the Repeating Structures.\n * @param {Meta} rsMeta - The meta information of the Repeating Structures.\n * @param {ConditionConfig} config - The configuration for the condition.\n * @returns {Promise<boolean> | boolean} - Returns `true` if the data satisfies the condition, otherwise `false`.\n */\n evaluateCondition?: (rsState: State, rsMeta: Meta, config: ConditionConfig) => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ApiContext.types.js","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\nimport type { UtilityFunctions } from '../src/core/generators/viewUtilityMethods';\n\nimport type {\n Personalization,\n PersonalizationInfo,\n PersonalizedState,\n State,\n Group,\n /* 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 `renderFormatter` for the given column.\n * @param columnId - Column ID\n * @param formatterName - ID of the formatter/renderer\n */\n setRenderFormatter: (columnId: string, formatterName: string) => 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"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Condition, DateFunctionsByType } from '@pega/cosmos-react-condition-builder';
|
|
2
2
|
import type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';
|
|
3
|
-
import type { OmitStrict } from '@pega/cosmos-react-core';
|
|
4
|
-
import type { ActivityObject } from '@pega/cosmos-react-work/lib/components/Timeline/Timeline.types';
|
|
3
|
+
import type { OmitStrict, StatusProps } from '@pega/cosmos-react-core';
|
|
5
4
|
import type { FilterConfig } from '../src/core/config/filterConfig';
|
|
6
5
|
import type Row from '../src/core/generators/RowGenerator';
|
|
7
6
|
import type { RowData } from '../src/core/generators/RowGenerator.types';
|
|
8
|
-
import type { AggregationType, SortDirection } from './State.types';
|
|
7
|
+
import type { AggregationType, GroupAdditionalField, SortDirection } from './State.types';
|
|
8
|
+
import type { RenderFormatterType } from './RsCoreBootArgs.types';
|
|
9
9
|
type CSSVariable = `--${string}`;
|
|
10
10
|
export interface RowAction {
|
|
11
11
|
/** A label to be displayed to end user for this action */
|
|
@@ -110,6 +110,9 @@ export interface ConditionalStyleFormat {
|
|
|
110
110
|
/** The {@link FieldDef.name name of the fieldDef} to which this style format is applied. */
|
|
111
111
|
fieldName: FieldDef['name'];
|
|
112
112
|
}
|
|
113
|
+
export declare const cellUpdateTrigger: {
|
|
114
|
+
readonly ROW_DENSITY_CHANGE: "rowDensityChange";
|
|
115
|
+
};
|
|
113
116
|
export interface FieldDef {
|
|
114
117
|
/** Actual field name in data */
|
|
115
118
|
name: string;
|
|
@@ -169,6 +172,8 @@ export interface FieldDef {
|
|
|
169
172
|
grouped?: boolean;
|
|
170
173
|
/** Choose date function {@link DateFunction} to group by when `grouped` is enabled for date/time field. Fallbacks to grouping by equality if undefined. */
|
|
171
174
|
groupedDateFunction?: DateFunction;
|
|
175
|
+
/** Additional field config for current field, if grouping is applied */
|
|
176
|
+
groupedAdditionalFields?: GroupAdditionalField[];
|
|
172
177
|
/** Allow resizing on this field
|
|
173
178
|
* @default true
|
|
174
179
|
*/
|
|
@@ -215,8 +220,30 @@ export interface FieldDef {
|
|
|
215
220
|
* The default one's that the Repeating structures provide out of the box
|
|
216
221
|
* are 'Copy Text', 'Paste Text' and 'Filter by this' */
|
|
217
222
|
contextMenuOptions?: ContextMenuOption[];
|
|
223
|
+
/** Optional name of a custom component to be rendered in the header cell of the column.
|
|
224
|
+
* The custom component should be provided via the render factory.
|
|
225
|
+
* If not specified, the default header cell renderer will be used. */
|
|
226
|
+
headerCellRenderer?: string;
|
|
218
227
|
/** Name of a custom component that is made available through the render factory. Check section on cellRenderer */
|
|
219
228
|
cellRenderer?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Configure additional events that explicitly trigger this field’s cell(s) to regenerate (re-render).
|
|
231
|
+
* If omitted or empty, the cell will not update automatically on these events.
|
|
232
|
+
*
|
|
233
|
+
* These are *explicit* triggers that require the consumer to specify them for the cell to update.
|
|
234
|
+
*
|
|
235
|
+
*
|
|
236
|
+
* Supported triggers include:
|
|
237
|
+
* - `rowDensityChange`: when the row height or density changes.
|
|
238
|
+
*
|
|
239
|
+
* **Caution:** Using this may cause rendering overhead as the cells will be re-generated(re-rendered).
|
|
240
|
+
*
|
|
241
|
+
* @examples
|
|
242
|
+
* ```json
|
|
243
|
+
* cellUpdateTriggers: ["rowDensityChange"]
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
cellUpdateTriggers?: (typeof cellUpdateTrigger)[keyof typeof cellUpdateTrigger][];
|
|
220
247
|
/** Format on the basis of this field data should be formatted. The formatter should be present in {@link RsCoreBootArgs.renderFormatterTypeMap renderFormatterTypeMap}. */
|
|
221
248
|
formatter?: string;
|
|
222
249
|
/** To enable autosize on this field.
|
|
@@ -302,6 +329,11 @@ export interface FieldDef {
|
|
|
302
329
|
* @default false
|
|
303
330
|
*/
|
|
304
331
|
disableFormatting?: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Formatter options for this specific field.
|
|
334
|
+
* If the field level formatters are provided then they will be given priority than RS level {@link RsCoreBootArgs.renderFormatterTypeMap formatters}.
|
|
335
|
+
*/
|
|
336
|
+
formatters?: RenderFormatterType[];
|
|
305
337
|
}
|
|
306
338
|
export declare const ROW_DENSITY: {
|
|
307
339
|
readonly SHORT: "1";
|
|
@@ -590,7 +622,7 @@ export interface Meta {
|
|
|
590
622
|
date?: TimelineFieldDef;
|
|
591
623
|
/** Timeline template status for display */
|
|
592
624
|
status?: TimelineFieldDef & {
|
|
593
|
-
getCustomContent?: (row: Row) =>
|
|
625
|
+
getCustomContent?: (row: Row) => StatusProps;
|
|
594
626
|
};
|
|
595
627
|
/** Timeline template icon for display */
|
|
596
628
|
icon?: TimelineFieldDef;
|
|
@@ -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,
|
|
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,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEvE,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,oBAAoB,EAAE,aAAa,EAAS,MAAM,eAAe,CAAC;AAEjG,OAAO,KAAK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EAAE,cAAc,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC;IACzE;;;;uEAImE;IACnE,aAAa,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE;QACjB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;KACxC,CAAC;IACF,8FAA8F;IAC9F,2BAA2B,CAAC,EAAE,MAAM,IAAI,CAAC;IACzC,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B"}
|
package/lib/types/Meta.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meta.types.js","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAsDA,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,MAAM;IACrB,SAAS,EAAE,WAAW;IACtB,iEAAiE;IACjE,GAAG,EAAE,KAAK;IACV,iBAAiB,EAAE,QAAQ;IAC3B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAyPX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;IACT,YAAY,EAAE,GAAG;CACT,CAAC;AAOX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;CACF,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACxB,CAAC","sourcesContent":["import type { Condition, DateFunctionsByType } from '@pega/cosmos-react-condition-builder';\nimport type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\nimport type { OmitStrict } from '@pega/cosmos-react-core';\nimport type { ActivityObject } from '@pega/cosmos-react-work/lib/components/Timeline/Timeline.types';\n\nimport type { FilterConfig } from '../src/core/config/filterConfig';\nimport type Row from '../src/core/generators/RowGenerator';\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { ApiContext } from './ApiContext.types';\nimport type { AggregationType, SortDirection, State } from './State.types';\nimport type RsCoreBootArgs from './RsCoreBootArgs.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype CSSVariable = `--${string}`;\n\nexport interface RowAction {\n /** A label to be displayed to end user for this action */\n text: string;\n /** An identifier to uniquely identify this action */\n id: string;\n /**\n * @param {RowData} rowContext - RowData where this row action is triggered.\n * @param refreshRow - A callback which can be used to trigger refreshRow\n * which will trigger 'fetchRowData' api of {@link ApiContext} to fetch latest data for a row, after action is completed.\n * @return {void} - void\n */\n onClick: (rowContext: RowData, refreshRow: () => void) => void;\n}\n\n// Meta and it's type START\ninterface Category {\n label: string;\n}\n\ninterface ContextMenuOption {\n id: string;\n icon?: string;\n label: string;\n show?: boolean;\n disabled?: boolean;\n onClick?: (target: HTMLElement) => void;\n}\n\nexport interface HierarchicalInfo {\n parentId?: string;\n materializedPathId?: string;\n targetId?: string;\n sortById?: string;\n columnId?: string;\n mode?: string;\n}\n\nconst CellAlign = {\n LEFT: 'left',\n RIGHT: 'right',\n CENTER: 'center'\n} as const;\n\nexport const FieldType = {\n TEXT: 'text',\n NUMBER: 'number',\n BOOLEAN: 'boolean',\n DATE_TIME: 'datetime',\n DATE: 'date',\n TIME: 'time',\n DATE_TIMELINE: 'Date',\n DATE_ONLY: 'Date only',\n // TODO: URL as a type is not needed. It can be merged with TEXT.\n URL: 'URL',\n ACTION_FIELD_TYPE: 'action',\n CUSTOM: 'custom',\n CURRENCY: 'currency'\n} as const;\n\nexport interface StyleFormat {\n /** A unique identifier for the style format. */\n id: string;\n /** The display name of the style format. */\n label: string;\n /** A collection of style properties that defines how the format will be applied. */\n config: {\n /** Background color to be applied.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n */\n backgroundColor: string;\n /**\n * Foreground (text) color to be applied.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n *\n * Optional\n */\n foregroundColor?: string;\n /**\n * An icon used as a visual indicator of the applied format.\n * Optional.\n */\n icon?: {\n /** The name of icon. */\n name: string;\n /** The color of icon.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n */\n color: string;\n };\n };\n}\n\n// For now, conditionalFormatting is exposed for fields only. In future, for rows the fieldName can be made optional.\nexport interface ConditionalStyleFormat {\n /** The condition that determines whether this style format should be applied. */\n condition: Condition;\n /** The ID of the style format, sourced from {@link RsCoreBootArgs.styleFormats}, that will be applied if the condition is met. */\n styleFormatId: StyleFormat['id'];\n /** The {@link FieldDef.name name of the fieldDef} to which this style format is applied. */\n fieldName: FieldDef['name'];\n}\n\nexport interface FieldDef {\n /** Actual field name in data */\n name: string;\n /** The type of the field will be used to derive cell renderer from {@link RsProps.renderFactory} */\n type: (typeof FieldType)[keyof typeof FieldType];\n /** Persistent ID of the field, typically the same as the name */\n id: string;\n /** A display name of that field */\n label: string;\n /**\n * Represents the category hierarchy of a field, if the field is nested within a parent property. The format should be an array of objects\n * where each index represents a level of the category hierarchy.\n * This structure is used to display the hierarchy of the field wherever necessary.\n * @example\n * ```json\n * [{label: 'categoryName'}]\n * ```\n */\n category?: Category[];\n /** Show {@link category} in header label. The header will be displayed in format {categoryName}.{label} where categoryName will be all the category's labels combined with .(dot) notation */\n showCategoryInHeaderLabel?: boolean;\n /** Defines Field whose value needs to be shown as HelperText e.g tooltip: 'pzDescription' field value for pyID field */\n tooltip?: string;\n /** Enable/Disable tooltip on column */\n showTooltip?: boolean;\n /** Width of the field in px */\n width?: number;\n /** Maximum width of the field in px */\n maxWidth?: number;\n /** Minimum width in pixels, field width cannot be resized below this threshold\n * @default 90\n */\n minWidth?: number;\n /** Allow filtering on this field\n * @default true\n */\n filter?: boolean;\n /** Filter popup presents a pick list to choose values from\n * @default false\n */\n filterPickList?: boolean;\n /** Allow sorting on this field\n * @default true\n */\n sort?: boolean;\n /** Allows sorting on load. If this property is present, then sortPriority is mandatory */\n sortDirection?: (typeof SortDirection)[keyof typeof SortDirection];\n /** Sets the priority on filed for multi sorting(1 takes highest precedence). Allows sorting on load. If this property is present, then sortDirection is mandatory */\n sortPriority?: number;\n /** Allow grouping on this field\n * @default true\n */\n grouping?: boolean;\n /** To set group order of the current field def */\n groupOrder?: number;\n /** To auto apply grouping on this field */\n grouped?: boolean;\n /** Choose date function {@link DateFunction} to group by when `grouped` is enabled for date/time field. Fallbacks to grouping by equality if undefined. */\n groupedDateFunction?: DateFunction;\n /** Allow resizing on this field\n * @default true\n */\n resize?: boolean;\n /** Allow reordering on this field\n * @default true\n */\n reorderFields?: boolean;\n /** Allow freezing of this field\n * @default true\n */\n freeze?: boolean;\n /** This field will resize to available excess width if set to true. Only first field definition will be honoured if configured on multiple fields. */\n fillAvailableSpace?: boolean;\n /** An asterisk will be added in the table header cell right after the label signifying it is required. */\n required?: boolean;\n /** Allow show/hide of this field\n * @default true\n */\n toggle?: boolean;\n /** Field shows in the view by default. Can be set to false to toggle it in later */\n show?: boolean;\n /** Show/hide field level Header action menu\n * @default true\n */\n showMenu?: boolean;\n /** Allow aggregation on this field\n * @default true\n */\n aggregation?: boolean;\n /** Allow combining of this field with other field\n * @default true\n */\n combineColumn?: boolean;\n /** Allow customizing column label and apply formatting\n * @default true\n */\n customizeColumn?: boolean;\n /** Disable context menu at cells of this field if set to true. Context menu is shown on right mouse click in the cell\n * @default false\n */\n noContextMenu?: boolean;\n /** This property extends options provided on right click in a cell context.\n * The default one's that the Repeating structures provide out of the box\n * are 'Copy Text', 'Paste Text' and 'Filter by this' */\n contextMenuOptions?: ContextMenuOption[];\n /** Name of a custom component that is made available through the render factory. Check section on cellRenderer */\n cellRenderer?: string;\n /** Format on the basis of this field data should be formatted. The formatter should be present in {@link RsCoreBootArgs.renderFormatterTypeMap renderFormatterTypeMap}. */\n formatter?: string;\n /** To enable autosize on this field.\n * @default true\n */\n autosize?: boolean;\n // TODO: Remove this parentPath field. Consumer should handle the corresponding logic.\n /** If a field is of type pageList, parentpath should contain the path of the parent to traverse the field. */\n parentPath?: string;\n // TODO: Remove this isPageListField field. Consumer should handle the corresponding logic.\n /** Set if the field is of type pageList */\n isPageListField?: boolean;\n /** Enable 'Hierarchical' display mode on column if hierarchicalInfo exists. */\n hierarchicalInfo?: HierarchicalInfo;\n /** Align cell to left/right/center. Values accepted: 'left', 'right', 'center' */\n cellAlign?: (typeof CellAlign)[keyof typeof CellAlign];\n /** Column name label in group header will be hidden when set to 'true'\n * @default false\n */\n hideGroupColumnNameLabel?: boolean;\n // TODO this is exposed to consumer but is not being considered. Check this.\n /** Filter options for various field type\n * @example\n * [\n {\n value: 'Equals',\n key: 'equals'\n },\n {\n value: 'Not equals',\n key: 'notEquals'\n },\n {\n value: 'After',\n key: 'greaterThan'\n },\n {\n value: 'Before',\n key: 'lessThan'\n },\n {\n value: 'On or after',\n key: 'greaterThanEquals'\n },\n {\n value: 'On or before',\n key: 'lessThanEquals'\n }\n ]\n */\n filterParams?: {\n value: string;\n key: string;\n }[];\n /** To enable inline editing for a field. */\n editable?: boolean;\n /** A read only extra info related to field can be preserved in meta.\\\n * This will never be manipulated by repeating structure, it will be passed as it is to {@link FieldDef.cellRenderer cellRenderer} as props as it is. */\n meta?: { [key: string | number | symbol]: any };\n /** A read only extra info related to field can be preserved in this.\\\n * This will never be manipulated by repeating structure, it will be passed as it is to {@link FieldDef.cellRenderer cellRenderer} as props as it is. */\n customObject?: { [key: string | number | symbol]: any };\n /** Indicates if the field is used as rowHeader for A11y of the row */\n isRowHeader?: boolean;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * A unique idHash.\n */\n idHash?: number;\n /** Indicates if this field is aggregated. If set to true, then first option from {@link Meta.aggregationType} will be picked as aggregation type for this field. */\n aggregated?: boolean;\n /** An array of conditional formats applied to the fieldDef.\n * @property {Condition} condition - The condition that determines whether the format should be applied.\n * @property {ConditionalStyleFormat} styleFormat - The {@link StyleFormat.id style format id} from `field` {@link RsCoreBootArgs.styleFormats styleFormats} applied to the cell if the condition evaluates to true.\n *\n * **Note**: *If the data satisfies multiple conditional style formats, the first matching conditional format will be used.*\n * */\n conditionalStyleFormats?: OmitStrict<ConditionalStyleFormat, 'fieldName'>[];\n /** Disables formatting on the field using {@link RsCoreBootArgs.renderFormatterTypeMap renderFormatterTypeMap}\n * @default false\n */\n disableFormatting?: boolean;\n}\nexport const ROW_DENSITY = {\n SHORT: '1',\n MEDIUM: '2',\n TALL: '3',\n WRAP_CONTENT: '4'\n} as const;\n\ntype DisplayDensity = {\n id: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY];\n name: string;\n};\n\nexport const REPEATING_STRUCTURE_TEMPLATES = {\n TABLE: 'Table',\n GALLERY: 'Gallery',\n TIMELINE: 'Timeline',\n MAP: 'Map'\n} as const;\n\nconst SELECTION_MODE = {\n SINGLE: 'single',\n MULTI: 'multi',\n MULTI_ON_HOVER: 'multi_on_hover'\n} as const;\n\ntype TimelineFieldDef = Partial<Pick<FieldDef, 'name' | 'label' | 'type' | 'meta'>>;\n\ntype DisplayFeature = {\n filter?: boolean;\n grouping?: boolean;\n sort?: boolean;\n};\n\n/** Meta input to RS */\nexport interface Meta {\n /** Metadata for fields */\n fieldDefs: FieldDef[];\n /** itemKey for data identification */\n itemKey: string;\n /** Preset id of the current preset/personalization. This will be used to uniquely identify the preset on which the current view is dervied from */\n id: string;\n /** Preset name of the current preset/personalization. This will be displayed to end user */\n name: string;\n /** Array of fields(extra) that should be included in the query prepared for different api's in {@link ApiContext}.\n * `lists-client-api` package implicitly appends this in `select` field while preparing the query.\n */\n patchQueryFields?: string[];\n /** Array denoting sort operation order.\n *\n * @default\n * ```json\n * ['asc', 'desc', null]\n * ```\n */\n sortOrder?: (string | null)[];\n /**\n * A collection of row density options that users can select to adjust the height of rows based on the chosen density.\n *\n * @default\n * ```json\n * [\n * { \"name\": \"Short\", \"id\": \"1\" },\n * { \"name\": \"Medium\", \"id\": \"2\" },\n * { \"name\": \"Tall\", \"id\": \"3\" },\n * { \"name\": \"Full content\", \"id\": \"4\" }\n * ]\n * ```\n */\n displayDensity?: DisplayDensity[];\n /**\n * Configuration for the height of the view.\n *\n * @default\n * ```json\n * {\n * minHeight: 600\n * }\n * ```\n */\n height?: {\n /** The minimum height in pixels for the view or 'auto' */\n minHeight?: number;\n /** Specifies an HTML element or a string query selector to which the view's height will be adjusted. If this property is used, the `height` property will be ignored */\n fitHeightToElement?: HTMLElement | string;\n /** Specifies an explicit height in pixels for the view. If set, the `fitHeightToElement` property will be ignored. */\n height?: number;\n /** A height adjustment value in pixels */\n deltaAdjustment?: number;\n /** If true, the height will be adjusted responsively on window resize, but only if `fitHeightToElement` is provided. */\n autoSize?: boolean;\n /** The maximum height for the view, specified in pixels or as a CSS variable (e.g., `--view-height`) */\n maxHeight?: number | string;\n /** CSS variable that defines the minimum threshold to be used in `maxHeight` calculations. If not provided, a default value of `25rem` will be used.\n *\n * Caution: Use carefully as setting this value too low can introduce usability issues on smaller screens.\n */\n maxHeightMinValueVariable?: CSSVariable;\n };\n /** Allow show/hide of fields\n *\n * @default true\n */\n toggleFieldVisibility?: boolean;\n /** Allow grouping on fields\n *\n * @default true\n */\n grouping?: boolean;\n /** Determines the view of a Repeating Structure\n *\n * @default 'Table'\n */\n template?: (typeof REPEATING_STRUCTURE_TEMPLATES)[keyof typeof REPEATING_STRUCTURE_TEMPLATES];\n /** Allow editing on fields and if enabled then row actions are also enabled.\n *\n * @default false\n */\n editing?: boolean;\n /** Allow deleting of rows.\n */\n deleting?: boolean;\n /** Allow personalization views\n * @default true\n */\n personalization?: boolean;\n /** Enable app default personalization options in Toolbar action menu.\n * If a personalization is set as App Default then that will be used as default personalization in repeating structures.\n * @default false\n * */\n enableAppDefault?: boolean;\n /**\n * Name to be shown for non personalized view.\n * @default 'Initial view'\n */\n nonPersonalizationViewName?: string;\n /** Allow field (column) reordering through a drag and drop action.\n * @default true\n */\n reorderFields?: boolean;\n /** Allow row reordering through a drag and drop action.\n * @default false\n */\n reorderItems?: boolean;\n /**\n * Allow to add a column for drag handle\n * @default false\n * @deprecated Use {@link rowReorderField}\n */\n dragHandle?: boolean;\n /**\n * Enables row reorder column. By default if enabled, it will be visible. To override the default behavior set show as false.\n */\n rowReorderField?: {\n show: boolean;\n };\n /**\n * Brings in a search widget to allow searching across all text type fields.\n * @default true\n */\n globalSearch?: boolean;\n /** Display toolbar on the view.\n * @default true\n */\n toolbar?: boolean;\n /** Display count in toolbar.\n * @default true\n */\n showCount?: boolean;\n /**\n * Row density id value from the \"displayDensity\" options prop above.\n * @default {@link ROW_DENSITY.SHORT}\n */\n defaultRowHeight?: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY];\n /**\n * Renders the 'Bulk actions' button in the table toolbar, which gets enabled on row selection.\n * @default false\n */\n allowBulkActions?: boolean;\n /**\n * Denotes the page size being passed in the case of rest backed data page\n * #JSDOC\n */\n pageSize?: number;\n /** Enables date-functions like MONTHS/WEEKS/... during Grouping and Filtering. ([Object structure](https://git.pega.io/projects/PS/repos/cosmos/browse/packages/cosmos-condition-builder/src/components/ConditionBuilder/ConditionBuilder.types.ts?until=dfcf607851276bfeb877e9fb2c8f55d4396fd8b7&untilPath=packages%2Fcosmos-condition-builder%2Fsrc%2Fcomponents%2FConditionBuilder%2FConditionBuilder.types.ts#79-85)) */\n dateFunctions?: DateFunctionsByType;\n /** Enabled Relative Dates, such as \"Last 7 days\" (Or) \"Current Year\", in filtering for the DateTime or Date_Only values\".\n * @default false\n */\n relativeDates?: boolean;\n /** Display footer on the view.\n * @default true\n */\n footer?: boolean;\n /**\n * Templates for dynamic fields (or) columns which are used to combine two columns with a template.\n * @default\n * ```json\n * [\n * { name: 'Comma separated', value: 'comma',selected: true },\n * { name: 'Space separated', value: 'space' },\n * { name: 'Multi line', value: 'multiline' },\n * { name: 'Forward slash', value: 'forwardslash' }\n * ]\n * ```\n */\n dynamicFieldTemplates?: {\n name: string;\n value: string;\n selected?: boolean;\n }[];\n /** Repeating Structure Title\n * @default '<label not set>'\n */\n title?: string;\n /** Repeating Structure Icon\n * @default 'picture'\n */\n icon?: string;\n /** Display Header Bar\n * @default false\n */\n headerBar?: boolean;\n /**\n * Display Respective Header Icons at field labels based on type\n * @default false\n */\n showHeaderIcons?: boolean;\n /** Indicates if freezing is allowed on Fields. */\n freezeFields?: boolean;\n /**\n * list of available static actions for an editable table with following properties\n * @example\n * ```json\n * [\n * {\n * text: 'Open in a new tab',\n * id: 'row-new-tab',\n * onClick: () => {}\n * }\n * ]\n * ```\n * @default\n * []\n */\n rowActions?: RowAction[];\n /** Decides type of row selection mode (radio for single/ checkbox for multi) possible values : single / multi / multi-on-hover */\n selectionMode?: (typeof SELECTION_MODE)[keyof typeof SELECTION_MODE];\n /** Displays select-all checkbox if selectionMode is multi-on-hover and the records count is not greater than threshold */\n selectionCountThreshold?: number;\n /** To Disable/Enable selection of rows */\n disableSelectionOnLoad?: boolean;\n /** To show asterisk(*) symbol on table header in case of Data Reference/Embedded views. (Note: This works perfectly if the personalization is off.) */\n requiredOnLoad?: boolean;\n /**\n * List of available static actions at table level (shown in toolbar/ headerbar) with following properties\n * [{ text: 'Add', tooltip: 'Add story', id: 'Add', onClick: () => {}}]\n */\n toolbarActions?: {\n text: string;\n id: string;\n onClick: () => void;\n tooltip: string;\n }[];\n /** Allow row reordering through a drag and drop action.\n * default value: false\n */\n moveListRecords?: boolean;\n\n /** Allow end user to refresh data of the repeating structures. Enabling this will show up `Refresh` action in repeating structures toolbar.\n * @default false\n */\n allowRefresh?: boolean;\n\n /** The height of repeating structure is calculated on this parameter if provided. */\n numberOfRows?: number;\n /** Display views of repeating structures with full or condensed toolbar.\n * @default false\n * Default shows full toolbar.\n */\n basicMode?: boolean;\n /** Timezone which is passed to formatter\n * @default 'America/New_York'\n */\n timezone?: string;\n /** Locale which is passed to formatter function\n * @default 'en-US'\n */\n locale?: string;\n timelineFields?: {\n /** Timeline template title for display */\n title?: TimelineFieldDef;\n /** Timeline template date for display */\n date?: TimelineFieldDef;\n /** Timeline template status for display */\n status?: TimelineFieldDef & { getCustomContent?: (row: Row) => ActivityObject['status'] };\n /** Timeline template icon for display */\n icon?: TimelineFieldDef;\n /** Timeline template content for display */\n content?: TimelineFieldDef;\n };\n /** Map template field ids for display */\n mapFieldIds?: {\n /** Map template location field id for display */\n location?: FieldDef['id'];\n /** Map template label field id for display */\n label?: FieldDef['id'];\n /** Map template content field id for display */\n content?: FieldDef['id'];\n };\n /** A unique key for injectable filters component.\n * This key will be sent to {@link RsCoreBootArgs.renderFactory renderFactory} as 'type' to get a renderer for the external filters.\n * The renderer will be shown between Repeating structures body and repeating structures toolbar.\n * This key should be used in {@link State.externalState externalState} to populate state related to externalFilters.\n */\n externalFilters?: string;\n /** This key is used to show the 'Import Data' action in the repeating structures toolbar. It will only work for Launchpad.\n * On click, it will call {@link ApiContext.importCSVData importCSVData} open a modal allowing the user to upload a file.\n */\n showImportDataOption?: boolean;\n /** This key is used to show 'Export to Excel' action in repeating structure toolbar.\n * On click of it, {@link ApiContext.exportData exportData} api is called to export repeating structures data into excel file. */\n showExportToExcelOption?: boolean;\n /** This key is used to show 'Export to CSV' action in repeating structure toolbar.\n * On click of it, {@link ApiContext.exportDataToCSV exportDataToCSV} api is called to export repeating structures data into CSV file. */\n showExportToCSVOption?: boolean;\n /** To enable 'Freeze columns' action in toolbar action menu. This action triggers freezing of columns.This toolbar action considers {@link FieldDef.freeze freeze} key in FieldDef too.\n * @default true\n */\n // TODO: meta.freezeFields and meta.enableFreezeColumns are checking the same thing. Evaluate if one can be removed.\n enableFreezeColumns?: boolean;\n /** To enable 'Auto size columns' action in toolbar action menu. This action triggers auto size of columns.\n * @default true\n */\n autoSizeColumns?: boolean;\n /** To enable 'Query info' action in toolbar action menu. This action shows query information.\n * @default false\n */\n showQueryInfo?: boolean;\n /** To enable 'Reset column widths' action in toolbar action menu. This action triggers reset of columns width to its default state.\n * @default true\n */\n resetColumnWidths?: boolean;\n /** To enable 'Row density' action in toolbar action menu. This action triggers a popover menu item to select row density.This toolbar action considers {@link Meta.displayDensity displayDensity} key in Meta too.\n * @default true\n */\n rowDensity?: boolean;\n /** To show/hide filter,sort,group action buttons from end user.\\\n * **Note**: Above features will still work, it is just not available to end user to trigger.\n * @default\n * ```json\n * {\n * filter: true,\n * grouping: true,\n * sort: true\n * }\n * ```\n */\n displayFeatures?: DisplayFeature;\n /** Enables error column. The column will be visible when dataErrors are present in {@link State.errors errors}.\n * @default false\n * @deprecated Use {@link rowErrorField}\n */\n showErrorField?: boolean;\n /**\n * Enables error column. By default if enabled, it will be hidden. To override the default behavior set show as true.\n * The column will be visible when dataErrors are present in {@link State.errors errors}.\n */\n rowErrorField?: {\n show: boolean;\n };\n /** Id of the custom renderer that should be used to display customized columns cells. */\n customFieldRenderer?: string;\n /** Id of the custom renderer that should be used to display header cells. */\n customHeaderRenderer?: string;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * The default config of the FieldDef. This is used to normalize each {@link FieldDef} properties with its default value.\n */\n defaultFieldDef?: OmitStrict<FieldDef, 'name' | 'type' | 'id' | 'label'>;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * A set of comparator map used for filter operation on columns. */\n comparatorMap?: FilterConfig['comparatorMap'];\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * Indicates if editing is enabled on Repeating structures.\n */\n editable?: boolean;\n /** A set of aggregation options available for a column on which the data can be aggregated.\n *\n * @default\n * ```json\n * {\n * number: ['Sum', 'Min', 'Max', 'Avg']\n * }\n * ```\n */\n aggregateOptions?: {\n [fieldType: string]: AggregationType[];\n };\n /** An optional change action that will be called whenever the personalization is switched. */\n personalizationChangeAction?: () => void;\n /** Predefined filters that will be applied on load of repeating structures. */\n filterExpression?: Condition;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Meta.types.js","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAsDA,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,MAAM;IACrB,SAAS,EAAE,WAAW;IACtB,iEAAiE;IACjE,GAAG,EAAE,KAAK;IACV,iBAAiB,EAAE,QAAQ;IAC3B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAyDX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,kBAAkB;CAC9B,CAAC;AAiOX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;IACT,YAAY,EAAE,GAAG;CACT,CAAC;AAOX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;CACF,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACxB,CAAC","sourcesContent":["import type { Condition, DateFunctionsByType } from '@pega/cosmos-react-condition-builder';\nimport type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\nimport type { OmitStrict, StatusProps } from '@pega/cosmos-react-core';\n\nimport type { FilterConfig } from '../src/core/config/filterConfig';\nimport type Row from '../src/core/generators/RowGenerator';\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { ApiContext } from './ApiContext.types';\nimport type { AggregationType, GroupAdditionalField, SortDirection, State } from './State.types';\nimport type RsCoreBootArgs from './RsCoreBootArgs.types';\nimport type { RenderFormatterType } from './RsCoreBootArgs.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\ntype CSSVariable = `--${string}`;\n\nexport interface RowAction {\n /** A label to be displayed to end user for this action */\n text: string;\n /** An identifier to uniquely identify this action */\n id: string;\n /**\n * @param {RowData} rowContext - RowData where this row action is triggered.\n * @param refreshRow - A callback which can be used to trigger refreshRow\n * which will trigger 'fetchRowData' api of {@link ApiContext} to fetch latest data for a row, after action is completed.\n * @return {void} - void\n */\n onClick: (rowContext: RowData, refreshRow: () => void) => void;\n}\n\n// Meta and it's type START\ninterface Category {\n label: string;\n}\n\ninterface ContextMenuOption {\n id: string;\n icon?: string;\n label: string;\n show?: boolean;\n disabled?: boolean;\n onClick?: (target: HTMLElement) => void;\n}\n\nexport interface HierarchicalInfo {\n parentId?: string;\n materializedPathId?: string;\n targetId?: string;\n sortById?: string;\n columnId?: string;\n mode?: string;\n}\n\nconst CellAlign = {\n LEFT: 'left',\n RIGHT: 'right',\n CENTER: 'center'\n} as const;\n\nexport const FieldType = {\n TEXT: 'text',\n NUMBER: 'number',\n BOOLEAN: 'boolean',\n DATE_TIME: 'datetime',\n DATE: 'date',\n TIME: 'time',\n DATE_TIMELINE: 'Date',\n DATE_ONLY: 'Date only',\n // TODO: URL as a type is not needed. It can be merged with TEXT.\n URL: 'URL',\n ACTION_FIELD_TYPE: 'action',\n CUSTOM: 'custom',\n CURRENCY: 'currency'\n} as const;\n\nexport interface StyleFormat {\n /** A unique identifier for the style format. */\n id: string;\n /** The display name of the style format. */\n label: string;\n /** A collection of style properties that defines how the format will be applied. */\n config: {\n /** Background color to be applied.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n */\n backgroundColor: string;\n /**\n * Foreground (text) color to be applied.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n *\n * Optional\n */\n foregroundColor?: string;\n /**\n * An icon used as a visual indicator of the applied format.\n * Optional.\n */\n icon?: {\n /** The name of icon. */\n name: string;\n /** The color of icon.\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n */\n color: string;\n };\n };\n}\n\n// For now, conditionalFormatting is exposed for fields only. In future, for rows the fieldName can be made optional.\nexport interface ConditionalStyleFormat {\n /** The condition that determines whether this style format should be applied. */\n condition: Condition;\n /** The ID of the style format, sourced from {@link RsCoreBootArgs.styleFormats}, that will be applied if the condition is met. */\n styleFormatId: StyleFormat['id'];\n /** The {@link FieldDef.name name of the fieldDef} to which this style format is applied. */\n fieldName: FieldDef['name'];\n}\n\nexport const cellUpdateTrigger = {\n ROW_DENSITY_CHANGE: 'rowDensityChange'\n} as const;\n\nexport interface FieldDef {\n /** Actual field name in data */\n name: string;\n /** The type of the field will be used to derive cell renderer from {@link RsProps.renderFactory} */\n type: (typeof FieldType)[keyof typeof FieldType];\n /** Persistent ID of the field, typically the same as the name */\n id: string;\n /** A display name of that field */\n label: string;\n /**\n * Represents the category hierarchy of a field, if the field is nested within a parent property. The format should be an array of objects\n * where each index represents a level of the category hierarchy.\n * This structure is used to display the hierarchy of the field wherever necessary.\n * @example\n * ```json\n * [{label: 'categoryName'}]\n * ```\n */\n category?: Category[];\n /** Show {@link category} in header label. The header will be displayed in format {categoryName}.{label} where categoryName will be all the category's labels combined with .(dot) notation */\n showCategoryInHeaderLabel?: boolean;\n /** Defines Field whose value needs to be shown as HelperText e.g tooltip: 'pzDescription' field value for pyID field */\n tooltip?: string;\n /** Enable/Disable tooltip on column */\n showTooltip?: boolean;\n /** Width of the field in px */\n width?: number;\n /** Maximum width of the field in px */\n maxWidth?: number;\n /** Minimum width in pixels, field width cannot be resized below this threshold\n * @default 90\n */\n minWidth?: number;\n /** Allow filtering on this field\n * @default true\n */\n filter?: boolean;\n /** Filter popup presents a pick list to choose values from\n * @default false\n */\n filterPickList?: boolean;\n /** Allow sorting on this field\n * @default true\n */\n sort?: boolean;\n /** Allows sorting on load. If this property is present, then sortPriority is mandatory */\n sortDirection?: (typeof SortDirection)[keyof typeof SortDirection];\n /** Sets the priority on filed for multi sorting(1 takes highest precedence). Allows sorting on load. If this property is present, then sortDirection is mandatory */\n sortPriority?: number;\n /** Allow grouping on this field\n * @default true\n */\n grouping?: boolean;\n /** To set group order of the current field def */\n groupOrder?: number;\n /** To auto apply grouping on this field */\n grouped?: boolean;\n /** Choose date function {@link DateFunction} to group by when `grouped` is enabled for date/time field. Fallbacks to grouping by equality if undefined. */\n groupedDateFunction?: DateFunction;\n /** Additional field config for current field, if grouping is applied */\n groupedAdditionalFields?: GroupAdditionalField[];\n /** Allow resizing on this field\n * @default true\n */\n resize?: boolean;\n /** Allow reordering on this field\n * @default true\n */\n reorderFields?: boolean;\n /** Allow freezing of this field\n * @default true\n */\n freeze?: boolean;\n /** This field will resize to available excess width if set to true. Only first field definition will be honoured if configured on multiple fields. */\n fillAvailableSpace?: boolean;\n /** An asterisk will be added in the table header cell right after the label signifying it is required. */\n required?: boolean;\n /** Allow show/hide of this field\n * @default true\n */\n toggle?: boolean;\n /** Field shows in the view by default. Can be set to false to toggle it in later */\n show?: boolean;\n /** Show/hide field level Header action menu\n * @default true\n */\n showMenu?: boolean;\n /** Allow aggregation on this field\n * @default true\n */\n aggregation?: boolean;\n /** Allow combining of this field with other field\n * @default true\n */\n combineColumn?: boolean;\n /** Allow customizing column label and apply formatting\n * @default true\n */\n customizeColumn?: boolean;\n /** Disable context menu at cells of this field if set to true. Context menu is shown on right mouse click in the cell\n * @default false\n */\n noContextMenu?: boolean;\n /** This property extends options provided on right click in a cell context.\n * The default one's that the Repeating structures provide out of the box\n * are 'Copy Text', 'Paste Text' and 'Filter by this' */\n contextMenuOptions?: ContextMenuOption[];\n /** Optional name of a custom component to be rendered in the header cell of the column.\n * The custom component should be provided via the render factory.\n * If not specified, the default header cell renderer will be used. */\n headerCellRenderer?: string;\n /** Name of a custom component that is made available through the render factory. Check section on cellRenderer */\n cellRenderer?: string;\n /**\n * Configure additional events that explicitly trigger this field’s cell(s) to regenerate (re-render).\n * If omitted or empty, the cell will not update automatically on these events.\n *\n * These are *explicit* triggers that require the consumer to specify them for the cell to update.\n *\n *\n * Supported triggers include:\n * - `rowDensityChange`: when the row height or density changes.\n *\n * **Caution:** Using this may cause rendering overhead as the cells will be re-generated(re-rendered).\n *\n * @examples\n * ```json\n * cellUpdateTriggers: [\"rowDensityChange\"]\n * ```\n */\n cellUpdateTriggers?: (typeof cellUpdateTrigger)[keyof typeof cellUpdateTrigger][];\n\n /** Format on the basis of this field data should be formatted. The formatter should be present in {@link RsCoreBootArgs.renderFormatterTypeMap renderFormatterTypeMap}. */\n formatter?: string;\n /** To enable autosize on this field.\n * @default true\n */\n autosize?: boolean;\n // TODO: Remove this parentPath field. Consumer should handle the corresponding logic.\n /** If a field is of type pageList, parentpath should contain the path of the parent to traverse the field. */\n parentPath?: string;\n // TODO: Remove this isPageListField field. Consumer should handle the corresponding logic.\n /** Set if the field is of type pageList */\n isPageListField?: boolean;\n /** Enable 'Hierarchical' display mode on column if hierarchicalInfo exists. */\n hierarchicalInfo?: HierarchicalInfo;\n /** Align cell to left/right/center. Values accepted: 'left', 'right', 'center' */\n cellAlign?: (typeof CellAlign)[keyof typeof CellAlign];\n /** Column name label in group header will be hidden when set to 'true'\n * @default false\n */\n hideGroupColumnNameLabel?: boolean;\n // TODO this is exposed to consumer but is not being considered. Check this.\n /** Filter options for various field type\n * @example\n * [\n {\n value: 'Equals',\n key: 'equals'\n },\n {\n value: 'Not equals',\n key: 'notEquals'\n },\n {\n value: 'After',\n key: 'greaterThan'\n },\n {\n value: 'Before',\n key: 'lessThan'\n },\n {\n value: 'On or after',\n key: 'greaterThanEquals'\n },\n {\n value: 'On or before',\n key: 'lessThanEquals'\n }\n ]\n */\n filterParams?: {\n value: string;\n key: string;\n }[];\n /** To enable inline editing for a field. */\n editable?: boolean;\n /** A read only extra info related to field can be preserved in meta.\\\n * This will never be manipulated by repeating structure, it will be passed as it is to {@link FieldDef.cellRenderer cellRenderer} as props as it is. */\n meta?: { [key: string | number | symbol]: any };\n /** A read only extra info related to field can be preserved in this.\\\n * This will never be manipulated by repeating structure, it will be passed as it is to {@link FieldDef.cellRenderer cellRenderer} as props as it is. */\n customObject?: { [key: string | number | symbol]: any };\n /** Indicates if the field is used as rowHeader for A11y of the row */\n isRowHeader?: boolean;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * A unique idHash.\n */\n idHash?: number;\n /** Indicates if this field is aggregated. If set to true, then first option from {@link Meta.aggregationType} will be picked as aggregation type for this field. */\n aggregated?: boolean;\n /** An array of conditional formats applied to the fieldDef.\n * @property {Condition} condition - The condition that determines whether the format should be applied.\n * @property {ConditionalStyleFormat} styleFormat - The {@link StyleFormat.id style format id} from `field` {@link RsCoreBootArgs.styleFormats styleFormats} applied to the cell if the condition evaluates to true.\n *\n * **Note**: *If the data satisfies multiple conditional style formats, the first matching conditional format will be used.*\n * */\n conditionalStyleFormats?: OmitStrict<ConditionalStyleFormat, 'fieldName'>[];\n /** Disables formatting on the field using {@link RsCoreBootArgs.renderFormatterTypeMap renderFormatterTypeMap}\n * @default false\n */\n disableFormatting?: boolean;\n /**\n * Formatter options for this specific field.\n * If the field level formatters are provided then they will be given priority than RS level {@link RsCoreBootArgs.renderFormatterTypeMap formatters}.\n */\n formatters?: RenderFormatterType[];\n}\n\nexport const ROW_DENSITY = {\n SHORT: '1',\n MEDIUM: '2',\n TALL: '3',\n WRAP_CONTENT: '4'\n} as const;\n\ntype DisplayDensity = {\n id: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY];\n name: string;\n};\n\nexport const REPEATING_STRUCTURE_TEMPLATES = {\n TABLE: 'Table',\n GALLERY: 'Gallery',\n TIMELINE: 'Timeline',\n MAP: 'Map'\n} as const;\n\nconst SELECTION_MODE = {\n SINGLE: 'single',\n MULTI: 'multi',\n MULTI_ON_HOVER: 'multi_on_hover'\n} as const;\n\ntype TimelineFieldDef = Partial<Pick<FieldDef, 'name' | 'label' | 'type' | 'meta'>>;\n\ntype DisplayFeature = {\n filter?: boolean;\n grouping?: boolean;\n sort?: boolean;\n};\n\n/** Meta input to RS */\nexport interface Meta {\n /** Metadata for fields */\n fieldDefs: FieldDef[];\n /** itemKey for data identification */\n itemKey: string;\n /** Preset id of the current preset/personalization. This will be used to uniquely identify the preset on which the current view is dervied from */\n id: string;\n /** Preset name of the current preset/personalization. This will be displayed to end user */\n name: string;\n /** Array of fields(extra) that should be included in the query prepared for different api's in {@link ApiContext}.\n * `lists-client-api` package implicitly appends this in `select` field while preparing the query.\n */\n patchQueryFields?: string[];\n /** Array denoting sort operation order.\n *\n * @default\n * ```json\n * ['asc', 'desc', null]\n * ```\n */\n sortOrder?: (string | null)[];\n /**\n * A collection of row density options that users can select to adjust the height of rows based on the chosen density.\n *\n * @default\n * ```json\n * [\n * { \"name\": \"Short\", \"id\": \"1\" },\n * { \"name\": \"Medium\", \"id\": \"2\" },\n * { \"name\": \"Tall\", \"id\": \"3\" },\n * { \"name\": \"Full content\", \"id\": \"4\" }\n * ]\n * ```\n */\n displayDensity?: DisplayDensity[];\n /**\n * Configuration for the height of the view.\n *\n * @default\n * ```json\n * {\n * minHeight: 600\n * }\n * ```\n */\n height?: {\n /** The minimum height in pixels for the view or 'auto' */\n minHeight?: number;\n /** Specifies an HTML element or a string query selector to which the view's height will be adjusted. If this property is used, the `height` property will be ignored */\n fitHeightToElement?: HTMLElement | string;\n /** Specifies an explicit height in pixels for the view. If set, the `fitHeightToElement` property will be ignored. */\n height?: number;\n /** A height adjustment value in pixels */\n deltaAdjustment?: number;\n /** If true, the height will be adjusted responsively on window resize, but only if `fitHeightToElement` is provided. */\n autoSize?: boolean;\n /** The maximum height for the view, specified in pixels or as a CSS variable (e.g., `--view-height`) */\n maxHeight?: number | string;\n /** CSS variable that defines the minimum threshold to be used in `maxHeight` calculations. If not provided, a default value of `25rem` will be used.\n *\n * Caution: Use carefully as setting this value too low can introduce usability issues on smaller screens.\n */\n maxHeightMinValueVariable?: CSSVariable;\n };\n /** Allow show/hide of fields\n *\n * @default true\n */\n toggleFieldVisibility?: boolean;\n /** Allow grouping on fields\n *\n * @default true\n */\n grouping?: boolean;\n /** Determines the view of a Repeating Structure\n *\n * @default 'Table'\n */\n template?: (typeof REPEATING_STRUCTURE_TEMPLATES)[keyof typeof REPEATING_STRUCTURE_TEMPLATES];\n /** Allow editing on fields and if enabled then row actions are also enabled.\n *\n * @default false\n */\n editing?: boolean;\n /** Allow deleting of rows.\n */\n deleting?: boolean;\n /** Allow personalization views\n * @default true\n */\n personalization?: boolean;\n /** Enable app default personalization options in Toolbar action menu.\n * If a personalization is set as App Default then that will be used as default personalization in repeating structures.\n * @default false\n * */\n enableAppDefault?: boolean;\n /**\n * Name to be shown for non personalized view.\n * @default 'Initial view'\n */\n nonPersonalizationViewName?: string;\n /** Allow field (column) reordering through a drag and drop action.\n * @default true\n */\n reorderFields?: boolean;\n /** Allow row reordering through a drag and drop action.\n * @default false\n */\n reorderItems?: boolean;\n /**\n * Allow to add a column for drag handle\n * @default false\n * @deprecated Use {@link rowReorderField}\n */\n dragHandle?: boolean;\n /**\n * Enables row reorder column. By default if enabled, it will be visible. To override the default behavior set show as false.\n */\n rowReorderField?: {\n show: boolean;\n };\n /**\n * Brings in a search widget to allow searching across all text type fields.\n * @default true\n */\n globalSearch?: boolean;\n /** Display toolbar on the view.\n * @default true\n */\n toolbar?: boolean;\n /** Display count in toolbar.\n * @default true\n */\n showCount?: boolean;\n /**\n * Row density id value from the \"displayDensity\" options prop above.\n * @default {@link ROW_DENSITY.SHORT}\n */\n defaultRowHeight?: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY];\n /**\n * Renders the 'Bulk actions' button in the table toolbar, which gets enabled on row selection.\n * @default false\n */\n allowBulkActions?: boolean;\n /**\n * Denotes the page size being passed in the case of rest backed data page\n * #JSDOC\n */\n pageSize?: number;\n /** Enables date-functions like MONTHS/WEEKS/... during Grouping and Filtering. ([Object structure](https://git.pega.io/projects/PS/repos/cosmos/browse/packages/cosmos-condition-builder/src/components/ConditionBuilder/ConditionBuilder.types.ts?until=dfcf607851276bfeb877e9fb2c8f55d4396fd8b7&untilPath=packages%2Fcosmos-condition-builder%2Fsrc%2Fcomponents%2FConditionBuilder%2FConditionBuilder.types.ts#79-85)) */\n dateFunctions?: DateFunctionsByType;\n /** Enabled Relative Dates, such as \"Last 7 days\" (Or) \"Current Year\", in filtering for the DateTime or Date_Only values\".\n * @default false\n */\n relativeDates?: boolean;\n /** Display footer on the view.\n * @default true\n */\n footer?: boolean;\n /**\n * Templates for dynamic fields (or) columns which are used to combine two columns with a template.\n * @default\n * ```json\n * [\n * { name: 'Comma separated', value: 'comma',selected: true },\n * { name: 'Space separated', value: 'space' },\n * { name: 'Multi line', value: 'multiline' },\n * { name: 'Forward slash', value: 'forwardslash' }\n * ]\n * ```\n */\n dynamicFieldTemplates?: {\n name: string;\n value: string;\n selected?: boolean;\n }[];\n /** Repeating Structure Title\n * @default '<label not set>'\n */\n title?: string;\n /** Repeating Structure Icon\n * @default 'picture'\n */\n icon?: string;\n /** Display Header Bar\n * @default false\n */\n headerBar?: boolean;\n /**\n * Display Respective Header Icons at field labels based on type\n * @default false\n */\n showHeaderIcons?: boolean;\n /** Indicates if freezing is allowed on Fields. */\n freezeFields?: boolean;\n /**\n * list of available static actions for an editable table with following properties\n * @example\n * ```json\n * [\n * {\n * text: 'Open in a new tab',\n * id: 'row-new-tab',\n * onClick: () => {}\n * }\n * ]\n * ```\n * @default\n * []\n */\n rowActions?: RowAction[];\n /** Decides type of row selection mode (radio for single/ checkbox for multi) possible values : single / multi / multi-on-hover */\n selectionMode?: (typeof SELECTION_MODE)[keyof typeof SELECTION_MODE];\n /** Displays select-all checkbox if selectionMode is multi-on-hover and the records count is not greater than threshold */\n selectionCountThreshold?: number;\n /** To Disable/Enable selection of rows */\n disableSelectionOnLoad?: boolean;\n /** To show asterisk(*) symbol on table header in case of Data Reference/Embedded views. (Note: This works perfectly if the personalization is off.) */\n requiredOnLoad?: boolean;\n /**\n * List of available static actions at table level (shown in toolbar/ headerbar) with following properties\n * [{ text: 'Add', tooltip: 'Add story', id: 'Add', onClick: () => {}}]\n */\n toolbarActions?: {\n text: string;\n id: string;\n onClick: () => void;\n tooltip: string;\n }[];\n /** Allow row reordering through a drag and drop action.\n * default value: false\n */\n moveListRecords?: boolean;\n\n /** Allow end user to refresh data of the repeating structures. Enabling this will show up `Refresh` action in repeating structures toolbar.\n * @default false\n */\n allowRefresh?: boolean;\n\n /** The height of repeating structure is calculated on this parameter if provided. */\n numberOfRows?: number;\n /** Display views of repeating structures with full or condensed toolbar.\n * @default false\n * Default shows full toolbar.\n */\n basicMode?: boolean;\n /** Timezone which is passed to formatter\n * @default 'America/New_York'\n */\n timezone?: string;\n /** Locale which is passed to formatter function\n * @default 'en-US'\n */\n locale?: string;\n timelineFields?: {\n /** Timeline template title for display */\n title?: TimelineFieldDef;\n /** Timeline template date for display */\n date?: TimelineFieldDef;\n /** Timeline template status for display */\n status?: TimelineFieldDef & { getCustomContent?: (row: Row) => StatusProps };\n /** Timeline template icon for display */\n icon?: TimelineFieldDef;\n /** Timeline template content for display */\n content?: TimelineFieldDef;\n };\n /** Map template field ids for display */\n mapFieldIds?: {\n /** Map template location field id for display */\n location?: FieldDef['id'];\n /** Map template label field id for display */\n label?: FieldDef['id'];\n /** Map template content field id for display */\n content?: FieldDef['id'];\n };\n /** A unique key for injectable filters component.\n * This key will be sent to {@link RsCoreBootArgs.renderFactory renderFactory} as 'type' to get a renderer for the external filters.\n * The renderer will be shown between Repeating structures body and repeating structures toolbar.\n * This key should be used in {@link State.externalState externalState} to populate state related to externalFilters.\n */\n externalFilters?: string;\n /** This key is used to show the 'Import Data' action in the repeating structures toolbar. It will only work for Launchpad.\n * On click, it will call {@link ApiContext.importCSVData importCSVData} open a modal allowing the user to upload a file.\n */\n showImportDataOption?: boolean;\n /** This key is used to show 'Export to Excel' action in repeating structure toolbar.\n * On click of it, {@link ApiContext.exportData exportData} api is called to export repeating structures data into excel file. */\n showExportToExcelOption?: boolean;\n /** This key is used to show 'Export to CSV' action in repeating structure toolbar.\n * On click of it, {@link ApiContext.exportDataToCSV exportDataToCSV} api is called to export repeating structures data into CSV file. */\n showExportToCSVOption?: boolean;\n /** To enable 'Freeze columns' action in toolbar action menu. This action triggers freezing of columns.This toolbar action considers {@link FieldDef.freeze freeze} key in FieldDef too.\n * @default true\n */\n // TODO: meta.freezeFields and meta.enableFreezeColumns are checking the same thing. Evaluate if one can be removed.\n enableFreezeColumns?: boolean;\n /** To enable 'Auto size columns' action in toolbar action menu. This action triggers auto size of columns.\n * @default true\n */\n autoSizeColumns?: boolean;\n /** To enable 'Query info' action in toolbar action menu. This action shows query information.\n * @default false\n */\n showQueryInfo?: boolean;\n /** To enable 'Reset column widths' action in toolbar action menu. This action triggers reset of columns width to its default state.\n * @default true\n */\n resetColumnWidths?: boolean;\n /** To enable 'Row density' action in toolbar action menu. This action triggers a popover menu item to select row density.This toolbar action considers {@link Meta.displayDensity displayDensity} key in Meta too.\n * @default true\n */\n rowDensity?: boolean;\n /** To show/hide filter,sort,group action buttons from end user.\\\n * **Note**: Above features will still work, it is just not available to end user to trigger.\n * @default\n * ```json\n * {\n * filter: true,\n * grouping: true,\n * sort: true\n * }\n * ```\n */\n displayFeatures?: DisplayFeature;\n /** Enables error column. The column will be visible when dataErrors are present in {@link State.errors errors}.\n * @default false\n * @deprecated Use {@link rowErrorField}\n */\n showErrorField?: boolean;\n /**\n * Enables error column. By default if enabled, it will be hidden. To override the default behavior set show as true.\n * The column will be visible when dataErrors are present in {@link State.errors errors}.\n */\n rowErrorField?: {\n show: boolean;\n };\n /** Id of the custom renderer that should be used to display customized columns cells. */\n customFieldRenderer?: string;\n /** Id of the custom renderer that should be used to display header cells. */\n customHeaderRenderer?: string;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * The default config of the FieldDef. This is used to normalize each {@link FieldDef} properties with its default value.\n */\n defaultFieldDef?: OmitStrict<FieldDef, 'name' | 'type' | 'id' | 'label'>;\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * A set of comparator map used for filter operation on columns. */\n comparatorMap?: FilterConfig['comparatorMap'];\n /**\n * @private\n * This is for internal purpose only. Value for this will not be considered.\n *\n * Indicates if editing is enabled on Repeating structures.\n */\n editable?: boolean;\n /** A set of aggregation options available for a column on which the data can be aggregated.\n *\n * @default\n * ```json\n * {\n * number: ['Sum', 'Min', 'Max', 'Avg']\n * }\n * ```\n */\n aggregateOptions?: {\n [fieldType: string]: AggregationType[];\n };\n /** An optional change action that will be called whenever the personalization is switched. */\n personalizationChangeAction?: () => void;\n /** Predefined filters that will be applied on load of repeating structures. */\n filterExpression?: Condition;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { OmitStrict } from '@pega/cosmos-react-core';
|
|
1
|
+
import type { ExcludeStrict, OmitStrict } from '@pega/cosmos-react-core';
|
|
2
2
|
import type { Condition, LeafCondition } from '@pega/cosmos-react-condition-builder';
|
|
3
3
|
import type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';
|
|
4
4
|
import type { personalizationProps } from '../src/core/reducers/personalizationReducer';
|
|
5
5
|
import type { RowData } from '../src/core/generators/RowGenerator.types';
|
|
6
|
-
import type { ROW_DENSITY, HierarchicalInfo, ConditionalStyleFormat } from './Meta.types';
|
|
6
|
+
import type { ROW_DENSITY, HierarchicalInfo, FieldDef, ConditionalStyleFormat } from './Meta.types';
|
|
7
7
|
/** Custom functions ungrouped type */
|
|
8
8
|
type Ungrouped = {
|
|
9
9
|
/**
|
|
@@ -95,6 +95,23 @@ export declare const GroupSortDirection: {
|
|
|
95
95
|
readonly ASC: "asc";
|
|
96
96
|
readonly DESC: "desc";
|
|
97
97
|
};
|
|
98
|
+
export type DateGroupAdditionalField = {
|
|
99
|
+
/** Additional field id reference as mentioned in {@link FieldDef.id fieldDef id}. */
|
|
100
|
+
id: FieldDef['id'];
|
|
101
|
+
/** Optional date function for {@link FieldType.DATE 'date'}/ {@link FieldType.DATE_TIME 'dateTime'} field. */
|
|
102
|
+
dateFunction?: DateFunction;
|
|
103
|
+
};
|
|
104
|
+
export type NumberGroupAdditionalField = {
|
|
105
|
+
/** Additional field id reference as mentioned in {@link FieldDef.id fieldDef id}. */
|
|
106
|
+
id: FieldDef['id'];
|
|
107
|
+
/** Optional aggregation for {@link FieldType.NUMBER 'number'} type field. */
|
|
108
|
+
aggregation?: ExcludeStrict<AggregationType, 'Avg'>;
|
|
109
|
+
};
|
|
110
|
+
/** Additional fields data for Group info. */
|
|
111
|
+
export type GroupAdditionalField = {
|
|
112
|
+
/** Additional field id reference as mentioned in {@link FieldDef.id fieldDef id}. */
|
|
113
|
+
id: FieldDef['id'];
|
|
114
|
+
} | DateGroupAdditionalField | NumberGroupAdditionalField;
|
|
98
115
|
/** Group configuration on Table state */
|
|
99
116
|
export interface Group {
|
|
100
117
|
/** Column ID */
|
|
@@ -111,6 +128,8 @@ export interface Group {
|
|
|
111
128
|
order: (typeof GroupSortDirection)[keyof typeof GroupSortDirection];
|
|
112
129
|
/** Current group level, starts with 0 for 1st level of grouping. */
|
|
113
130
|
level: number;
|
|
131
|
+
/** Additional field config for current group node */
|
|
132
|
+
additionalFields?: GroupAdditionalField[];
|
|
114
133
|
}
|
|
115
134
|
/** Sort configuration on Table state */
|
|
116
135
|
export interface Sort {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"State.types.d.ts","sourceRoot":"","sources":["../../types/State.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"State.types.d.ts","sourceRoot":"","sources":["../../types/State.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iFAAiF,CAAC;AAEpH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAIzE,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAEhB,QAAQ,EAIR,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAGtB,sCAAsC;AACtC,KAAK,SAAS,GACV;IACE;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,2CAA2C;IAC3C,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEN,oCAAoC;AACpC,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,oBAAoB,GACpB,cAAc,GACd,cAAc,CAAC;AAEnB,wDAAwD;AACxD,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAClD,GA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