@pega/lists-core 10.0.0-build.10.2 → 10.0.0-build.10.3

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 CHANGED
@@ -8,7 +8,7 @@ export { getMockColumn } from './src/core/test/junitMocks';
8
8
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
9
9
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
10
10
  export type { RsCoreTypes } from './types';
11
- export { ROW_DENSITY, FieldType } from './types/Meta.types';
11
+ export { ROW_DENSITY, FieldType, PRESET_STATE_KEYS } from './types/Meta.types';
12
12
  export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
13
13
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
14
14
  export { rowSelectColumnMeta } from './src/core/constants';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,eAAO,MACL,iBAAiB,qBACjB,wBAAwB,4BACxB,eAAe,oBACf,mBAAmB,uBACnB,wBAAwB,4BACxB,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,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ export const { UPDATE_DEBUG_INFO, TOGGLE_DISABLE_SELECTION, TOGGLE_REQUIRED, NOT
9
9
  export { getMockColumn } from './src/core/test/junitMocks';
10
10
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
11
11
  export { default as BaseA11y } from './src/core/a11y/BaseA11y';
12
- export { ROW_DENSITY, FieldType } from './types/Meta.types';
12
+ export { ROW_DENSITY, FieldType, PRESET_STATE_KEYS } from './types/Meta.types';
13
13
  export { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';
14
14
  export { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';
15
15
  export { rowSelectColumnMeta } from './src/core/constants';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibleFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta,\n rowDeleteColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS,\n SET_WARNING_MESSAGES\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n\nexport { rowSelectColumnMeta } from './src/core/constants';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibleFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta,\n rowDeleteColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS,\n SET_WARNING_MESSAGES\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType, PRESET_STATE_KEYS } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n\nexport { rowSelectColumnMeta } from './src/core/constants';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.d.ts","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAc,UAAU,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAgB9F,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,2BAA2B,CAAC;AAC7F,OAAO,KAAK,EAAoB,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGpF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,UAAU,KACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAChC,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;;IAwChC,6CAA6C;I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,CAAC;IAE9B;;;;;OAKG;gBAED,QAAQ,EAAE,eAAe,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU;IAoCxB;;;;;OAKG;IACH,QAAQ,GAAI,QAAQ,UAAU,KAAG,IAAI,CAgDnC;IAEF;;OAEG;IACH,QAAQ,cAEN;IAEF;;OAEG;IACH,gBAAgB,cAEd;IAEF;;;;OAIG;IACH,cAAc,GACZ,aAAa,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,UAI3E;CAoIH;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,UAAU,IAcrD,OAAO,KAAK,EAAE,kBAAkB,UAAU,gCAwBzD"}
@@ -54,6 +54,10 @@ export default class StateResolver {
54
54
  */
55
55
  #executePostStateUpdateCallbacks = () => {
56
56
  const { apiContext } = this.#rsInternal.getRsProps();
57
+ // A late (e.g. debounced) dispatch on an unmounted instance must not report its stale state
58
+ // through an `apiContext` that a newer instance may now share.
59
+ if (!this.#rsInternal.getRsStore().isMounted)
60
+ return;
57
61
  if (apiContext?.stateUpdateCallback) {
58
62
  apiContext.stateUpdateCallback({
59
63
  ...pickProperties(this.getState(), personalizationProps)
@@ -1 +1 @@
1
- {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC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M,YAAY,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAsB,EAAE,EAAE;QAC5F,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,cAAc;iBAC5B,UAAU,EAAE;iBACZ,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACrF,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAY,EAAE,gBAA4B,EAAE,EAAE;QAC1D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC;QAC/C,MAAM,YAAY,CAChB,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACzB;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,cAAc;SACrB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps)\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta,\n this.#rsInternal.getRsStore\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /**\n * Returns true if the lone queued FORCE_UPDATE action should be skipped (no-op optimization).\n */\n #skipForceUpdateAction = (): boolean => {\n if (this.#queuedActions.length !== 1) return false;\n const action = this.#queuedActions[0];\n if (action?.type !== ActionTypes.FORCE_UPDATE) return false;\n if (!('payload' in action)) return false;\n return !Object.keys(action.payload.forceUpdateFeatures ?? {}).length;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n const skipStaleActionExecution =\n 'takeLatestAction' in queuedAction &&\n queuedAction.takeLatestAction &&\n isStaleAction(queuedAction, this.#latestActions);\n\n if (skipStaleActionExecution) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (this.#skipForceUpdateAction()) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.visibleColumns\n ]\n );\n return response;\n };\n}\n"]}
1
+ {"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,OAAO,EACP,uBAAuB,EACvB,mBAAmB,IAAI,0BAA0B,EACjD,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAapD,kCAAkC;AAClC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,gDAAgD;IAChD,WAAW,CAAa;IAExB,0EAA0E;IAC1E,SAAS,CAAkB;IAE3B,8CAA8C;IAC9C,YAAY,CAAkE;IAE9E,yFAAyF;IACzF,iBAAiB,CAAmB;IAEpC,iEAAiE;IACjE,MAAM,CAAQ;IAEd,mFAAmF;IACnF,aAAa,CAAQ;IAErB,sDAAsD;IACtD,aAAa,CAAQ;IAErB,iDAAiD;IACjD,cAAc,CAAW;IAEzB,0CAA0C;IAC1C,4BAA4B,CAAW;IAEvC,kEAAkE;IAClE,iBAAiB,CAAwC;IAEzD,6FAA6F;IAC7F,cAAc,GAAG,IAAI,GAAG,EAAsB,CAA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AE,CAAC;YAClB,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAY,EAAE,gBAA4B,EAAE,EAAE;QAC1D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC;QAC/C,MAAM,YAAY,CAChB,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACzB;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,cAAc;SACrB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const { apiContext } = this.#rsInternal.getRsProps();\n // A late (e.g. debounced) dispatch on an unmounted instance must not report its stale state\n // through an `apiContext` that a newer instance may now share.\n if (!this.#rsInternal.getRsStore().isMounted) return;\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps)\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta,\n this.#rsInternal.getRsStore\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /**\n * Returns true if the lone queued FORCE_UPDATE action should be skipped (no-op optimization).\n */\n #skipForceUpdateAction = (): boolean => {\n if (this.#queuedActions.length !== 1) return false;\n const action = this.#queuedActions[0];\n if (action?.type !== ActionTypes.FORCE_UPDATE) return false;\n if (!('payload' in action)) return false;\n return !Object.keys(action.payload.forceUpdateFeatures ?? {}).length;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n const skipStaleActionExecution =\n 'takeLatestAction' in queuedAction &&\n queuedAction.takeLatestAction &&\n isStaleAction(queuedAction, this.#latestActions);\n\n if (skipStaleActionExecution) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (this.#skipForceUpdateAction()) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.visibleColumns\n ]\n );\n return response;\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { BeforeRenderFeatureProps } from '../../featureFactory';
2
- import type { Meta } from '../../../../../types/Meta.types';
2
+ import { type Meta } from '../../../../../types/Meta.types';
3
3
  import type { State } from '../../../../../types/State.types';
4
4
  /**
5
5
  * Returns visible OOTB column IDs.
@@ -24,7 +24,7 @@ export declare function convertMetaIntoState(meta: Meta): State;
24
24
  * 1. {@link RsProps.persistedInfo}
25
25
  * 2. Component state from {@link ApiContext.getComponentState}
26
26
  * 3. Personalized state from the preset
27
- * 4. {@link Meta}
27
+ * 4. {@link Meta} (including {@link Meta.presetState})
28
28
  */
29
29
  declare const _default: () => (featureProps: BeforeRenderFeatureProps) => void;
30
30
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"stateHydration.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/stateHydration.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAO9D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAU1D;AACD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAuB/E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,CA2FtD;AA+ED;;;;;;GAMG;+BAKuB,cAAc,wBAAwB;AAJhE,wBAQE"}
1
+ {"version":3,"file":"stateHydration.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/stateHydration.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAqB,KAAK,IAAI,EAAoB,MAAM,iCAAiC,CAAC;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAO9D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAU1D;AACD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAuB/E;AAaD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,CA4FtD;AA+ED;;;;;;GAMG;+BAKuB,cAAc,wBAAwB;AAJhE,wBAQE"}
@@ -2,6 +2,7 @@ import { actionHydrateState } from '../../../actions/actions';
2
2
  import { withMemoization, pickProperties, isEmpty, isRowDeleteFieldVisible, isRowSelectFieldEnabled, getVisibleColumnsFromHidden, getVisibleColumnsFromFieldDefs, isRowReorderFieldVisible, isRowErrorFieldVisible, isRowActionFieldEnabled } from '../../../utils/util';
3
3
  import { personalizationProps } from '../../../reducers/personalizationReducer';
4
4
  import { rowActionColumnMeta, rowDeleteColumnMeta, rowDragDropColumnMeta, rowErrorColumnMeta, rowSelectColumnMeta, TEMPLATES } from '../../../constants';
5
+ import { PRESET_STATE_KEYS } from '../../../../../types/Meta.types';
5
6
  import { getCurrentVersionedState } from '../../../reducers/versioning';
6
7
  /* eslint-enable @typescript-eslint/no-unused-vars */
7
8
  /**
@@ -49,6 +50,18 @@ export function hydrateVisibleColumnsStateSlice(meta, state) {
49
50
  visibleColumns
50
51
  };
51
52
  }
53
+ // Runtime whitelist: type checks alone don't stop JS consumers or intermediate values from
54
+ // passing keys (e.g. `template`) that must stay controlled by meta. Undefined values are skipped.
55
+ const pickPresetState = (presetState) => {
56
+ const picked = {};
57
+ if (!presetState)
58
+ return picked;
59
+ PRESET_STATE_KEYS.forEach(key => {
60
+ if (presetState[key] !== undefined)
61
+ Object.assign(picked, { [key]: presetState[key] });
62
+ });
63
+ return picked;
64
+ };
52
65
  /**
53
66
  * Converts given meta into the state structure.
54
67
  */
@@ -132,7 +145,8 @@ export function convertMetaIntoState(meta) {
132
145
  showHeaderIcons,
133
146
  selectedHeightOption,
134
147
  conditionalStyleFormats,
135
- visibleColumns
148
+ visibleColumns,
149
+ ...pickPresetState(meta.presetState)
136
150
  };
137
151
  }
138
152
  const hydrateComponentState = async ([{ getRsProps, getRsStore, dispatch, getState, getView }]) => {
@@ -204,7 +218,7 @@ const hydrate = ([{ getRsStore, getRsProps, getView, dispatch, getState }]) => {
204
218
  * 1. {@link RsProps.persistedInfo}
205
219
  * 2. Component state from {@link ApiContext.getComponentState}
206
220
  * 3. Personalized state from the preset
207
- * 4. {@link Meta}
221
+ * 4. {@link Meta} (including {@link Meta.presetState})
208
222
  */
209
223
  export default () => {
210
224
  const memoizedHydrateComponentState = withMemoization(hydrateComponentState);
@@ -1 +1 @@
1
- {"version":3,"file":"stateHydration.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/stateHydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,cAAc,EACd,OAAO,EACP,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBA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AClD,eAAe,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { actionHydrateState } from '../../../actions/actions';\nimport {\n withMemoization,\n pickProperties,\n isEmpty,\n isRowDeleteFieldVisible,\n isRowSelectFieldEnabled,\n getVisibleColumnsFromHidden,\n getVisibleColumnsFromFieldDefs,\n isRowReorderFieldVisible,\n isRowErrorFieldVisible,\n isRowActionFieldEnabled\n} from '../../../utils/util';\nimport { personalizationProps } from '../../../reducers/personalizationReducer';\nimport {\n rowActionColumnMeta,\n rowDeleteColumnMeta,\n rowDragDropColumnMeta,\n rowErrorColumnMeta,\n rowSelectColumnMeta,\n TEMPLATES\n} from '../../../constants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type { Meta } from '../../../../../types/Meta.types';\nimport type { State } from '../../../../../types/State.types';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type RsProps from '../../../RsProps';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\nimport { getCurrentVersionedState } from '../../../reducers/versioning';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Returns visible OOTB column IDs.\n *\n * @param meta - View meta containing field configuration.\n * @returns Array of visible OOTB column IDs.\n */\nexport function getVisibleOotbColumns(meta: Meta): string[] {\n const ootbColumns = [\n { enabled: isRowErrorFieldVisible(meta), id: rowErrorColumnMeta.field.id },\n { enabled: isRowReorderFieldVisible(meta), id: rowDragDropColumnMeta.field.id },\n { enabled: isRowSelectFieldEnabled(meta), id: rowSelectColumnMeta.field.id },\n { enabled: isRowActionFieldEnabled(meta), id: rowActionColumnMeta.field.id },\n { enabled: isRowDeleteFieldVisible(meta), id: rowDeleteColumnMeta.field.id }\n ] as const;\n\n return ootbColumns.filter(({ enabled }) => enabled).map(({ id }) => id);\n}\n/**\n * Resolves `visibleColumns` from state and appends enabled OOTB columns.\n *\n * @param meta - View meta containing fieldDefs and OOTB field config.\n * @param state - Current state to hydrate into.\n */\nexport function hydrateVisibleColumnsStateSlice(meta: Meta, state: State): State {\n let visibleColumns: string[];\n\n if (state.visibleColumns !== undefined) {\n // Use explicitly saved visibleColumns as-is.\n visibleColumns = [...state.visibleColumns];\n } else if (state.hiddenColumns !== undefined) {\n // Derive visibleColumns from fieldDefs minus hiddenColumns.\n visibleColumns = getVisibleColumnsFromHidden(meta, state.hiddenColumns);\n } else {\n // Fall back to fieldDefs where show is true.\n visibleColumns = getVisibleColumnsFromFieldDefs(meta);\n }\n\n // Append enabled OOTB columns that are not hidden.\n const ootbColumnIds = getVisibleOotbColumns(meta);\n visibleColumns.push(...ootbColumnIds);\n\n // TODO OOTB columns should not be part of the state.\n return {\n ...state,\n visibleColumns\n };\n}\n\n/**\n * Converts given meta into the state structure.\n */\nexport function convertMetaIntoState(meta: Meta): State {\n const sortingOrder: State['sortingOrder'] = [];\n const hiddenColumns: State['hiddenColumns'] = [];\n const visibleColumns: State['visibleColumns'] = [];\n let groups: NonNullable<State['groups']> = [];\n const aggregationInfo: State['aggregationInfo'] = [];\n const conditionalStyleFormats: State['conditionalStyleFormats'] = [];\n const { filterExpression, showHeaderIcons, defaultRowHeight } = meta;\n\n // default RowHeight as short\n // update selectedHeightOption if defaultRowHeight is set in meta\n const selectedHeightOption = meta.template === TEMPLATES.TABLE ? defaultRowHeight : undefined;\n\n // hydrate state with meta.fieldDefs\n meta.fieldDefs.forEach(fieldDef => {\n // hydrating sorting\n if (fieldDef.sort && fieldDef.sortPriority && fieldDef.sortDirection)\n sortingOrder.push({\n columnId: fieldDef.id,\n order: fieldDef.sortDirection,\n sequence: fieldDef.sortPriority\n });\n\n // hydrating column visibility\n // TODO: when hiddenColumns is deprecated removed it.\n if (!fieldDef.show) hiddenColumns.push(fieldDef.id);\n\n // hydrating visible columns\n if (fieldDef.show) visibleColumns.push(fieldDef.id);\n\n // hydrating aggregated Fields\n if (fieldDef.aggregated && (fieldDef.type === 'number' || fieldDef.type === 'currency')) {\n const aggregationType = meta.aggregateOptions?.[fieldDef.type]?.[0];\n\n if (aggregationType) {\n aggregationInfo.push({\n columnId: fieldDef.id,\n type: aggregationType\n });\n }\n }\n\n // hydrating grouping\n // consider sort direction of column for group order if its provided otherwise default to ascending.\n if (meta.grouping && fieldDef.grouping && fieldDef.grouped) {\n const level = fieldDef.groupOrder ?? groups.length;\n let order: NonNullable<State['groups']>[number]['order'] = 'asc';\n if (fieldDef.customGrouping) {\n order = 'custom';\n } else if (fieldDef.sort && fieldDef.sortDirection) {\n order = fieldDef.sortDirection;\n }\n groups.splice(level, 0, {\n columnId: fieldDef.id,\n order,\n level,\n dateFunction: fieldDef.groupedDateFunction,\n additionalFields: fieldDef.groupedAdditionalFields,\n customFunction: fieldDef.customGrouping\n });\n }\n\n if (fieldDef.conditionalStyleFormats) {\n conditionalStyleFormats.push(\n ...fieldDef.conditionalStyleFormats.map(conditionalStyleFormat => ({\n ...conditionalStyleFormat,\n fieldName: fieldDef.name\n }))\n );\n }\n });\n\n // BUG-752261 Maintaining sort sequence in state\n sortingOrder.sort((col1, col2) => col1.sequence - col2.sequence);\n\n if (meta.grouping === undefined) groups = [];\n\n return {\n ...(meta.template === TEMPLATES.GALLERY && {\n galleryLayout: meta.galleryConfig?.layout\n }),\n sortingOrder,\n hiddenColumns,\n groups,\n aggregationInfo,\n filterExpression,\n showHeaderIcons,\n selectedHeightOption,\n conditionalStyleFormats,\n visibleColumns\n };\n}\n\nconst hydrateComponentState = async ([{ getRsProps, getRsStore, dispatch, getState, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n let componentState;\n const rsProps = getRsProps();\n const rsStore = getRsStore();\n rsStore.componentState = null;\n if (rsProps?.apiContext?.getComponentState) {\n componentState = await rsProps?.apiContext?.getComponentState();\n }\n const { personalization } = getState();\n // if client set component state somewhere for persisting changes\n if (\n componentState &&\n Object.keys(componentState).length &&\n personalization &&\n componentState.activePersonalization\n ) {\n rsStore.componentState = componentState;\n const activeComponentState = pickProperties(componentState, personalizationProps);\n let hydratedState: State = {\n personalization: {\n ...personalization,\n active: componentState.activePersonalization\n },\n ...activeComponentState\n };\n\n // Resolve visible columns then apply OOTB column visibility.\n hydratedState = hydrateVisibleColumnsStateSlice(getView().meta, hydratedState);\n dispatch(actionHydrateState(hydratedState));\n }\n};\n\n// Todo: onLoad sorting, filterBy, GroupBy, Freeze, HiddenColumn,\n// the structure in meta and hydration of state from it\nconst hydrate = ([{ getRsStore, getRsProps, getView, dispatch, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const state = getState();\n const rsStore = getRsStore();\n const rsProps = getRsProps();\n const activePersonalization =\n state.personalization?.allPersonalizations?.[state.personalization?.active];\n\n let hydratedState: State = {};\n\n if (rsProps.persistedInfo && rsStore.presets[0].id === state.personalization?.active) {\n // Hydrate from persisted info.\n hydratedState = rsProps.persistedInfo;\n } else if (rsStore.componentState) {\n // Component state already applied by hydrateComponentState ,clear and skip.\n rsStore.componentState = null;\n return null;\n } else if (\n activePersonalization?.isPreset &&\n !isEmpty(activePersonalization.personalizationState ?? {})\n ) {\n // Preset has its own saved personalization,use it directly.\n hydratedState = activePersonalization.personalizationState ?? {};\n } else if (activePersonalization?.isPreset) {\n // If Preset has no saved personalization, derive initial state from meta.\n hydratedState = {\n template: getView().meta.template,\n presetId: getView().meta.id,\n ...convertMetaIntoState(getView().meta)\n };\n } else {\n return null;\n }\n\n hydratedState = getCurrentVersionedState(\n hydrateVisibleColumnsStateSlice(getView().meta, hydratedState)\n );\n return dispatch(actionHydrateState(hydratedState));\n};\n\n/**\n * Hydrates the repeating structure state on bootstrap, following this priority order:\n * 1. {@link RsProps.persistedInfo}\n * 2. Component state from {@link ApiContext.getComponentState}\n * 3. Personalized state from the preset\n * 4. {@link Meta}\n */\nexport default () => {\n const memoizedHydrateComponentState = withMemoization(hydrateComponentState);\n const memoizedHydrate = withMemoization(hydrate);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n memoizedHydrateComponentState([featureProps], []);\n memoizedHydrate([featureProps], [featureProps.getView().meta]);\n };\n};\n"]}
1
+ {"version":3,"file":"stateHydration.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/stateHydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,cAAc,EACd,OAAO,EACP,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAA+B,MAAM,iCAAiC,CAAC;AAKjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,qDAAqD;AAErD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAU;IAC9C,MAAM,WAAW,GAAG;QAClB,EAAE,OAAO,EAAE,sBAAsB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE;QAC1E,EAAE,OAAO,EAAE,wBAAwB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE;QAC/E,EAAE,OAAO,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAAE;QAC5E,EAAE,OAAO,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAAE;QAC5E,EAA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cesContent":["import { actionHydrateState } from '../../../actions/actions';\nimport {\n withMemoization,\n pickProperties,\n isEmpty,\n isRowDeleteFieldVisible,\n isRowSelectFieldEnabled,\n getVisibleColumnsFromHidden,\n getVisibleColumnsFromFieldDefs,\n isRowReorderFieldVisible,\n isRowErrorFieldVisible,\n isRowActionFieldEnabled\n} from '../../../utils/util';\nimport { personalizationProps } from '../../../reducers/personalizationReducer';\nimport {\n rowActionColumnMeta,\n rowDeleteColumnMeta,\n rowDragDropColumnMeta,\n rowErrorColumnMeta,\n rowSelectColumnMeta,\n TEMPLATES\n} from '../../../constants';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport { PRESET_STATE_KEYS, type Meta, type PresetState } from '../../../../../types/Meta.types';\nimport type { State } from '../../../../../types/State.types';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type RsProps from '../../../RsProps';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\nimport { getCurrentVersionedState } from '../../../reducers/versioning';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Returns visible OOTB column IDs.\n *\n * @param meta - View meta containing field configuration.\n * @returns Array of visible OOTB column IDs.\n */\nexport function getVisibleOotbColumns(meta: Meta): string[] {\n const ootbColumns = [\n { enabled: isRowErrorFieldVisible(meta), id: rowErrorColumnMeta.field.id },\n { enabled: isRowReorderFieldVisible(meta), id: rowDragDropColumnMeta.field.id },\n { enabled: isRowSelectFieldEnabled(meta), id: rowSelectColumnMeta.field.id },\n { enabled: isRowActionFieldEnabled(meta), id: rowActionColumnMeta.field.id },\n { enabled: isRowDeleteFieldVisible(meta), id: rowDeleteColumnMeta.field.id }\n ] as const;\n\n return ootbColumns.filter(({ enabled }) => enabled).map(({ id }) => id);\n}\n/**\n * Resolves `visibleColumns` from state and appends enabled OOTB columns.\n *\n * @param meta - View meta containing fieldDefs and OOTB field config.\n * @param state - Current state to hydrate into.\n */\nexport function hydrateVisibleColumnsStateSlice(meta: Meta, state: State): State {\n let visibleColumns: string[];\n\n if (state.visibleColumns !== undefined) {\n // Use explicitly saved visibleColumns as-is.\n visibleColumns = [...state.visibleColumns];\n } else if (state.hiddenColumns !== undefined) {\n // Derive visibleColumns from fieldDefs minus hiddenColumns.\n visibleColumns = getVisibleColumnsFromHidden(meta, state.hiddenColumns);\n } else {\n // Fall back to fieldDefs where show is true.\n visibleColumns = getVisibleColumnsFromFieldDefs(meta);\n }\n\n // Append enabled OOTB columns that are not hidden.\n const ootbColumnIds = getVisibleOotbColumns(meta);\n visibleColumns.push(...ootbColumnIds);\n\n // TODO OOTB columns should not be part of the state.\n return {\n ...state,\n visibleColumns\n };\n}\n\n// Runtime whitelist: type checks alone don't stop JS consumers or intermediate values from\n// passing keys (e.g. `template`) that must stay controlled by meta. Undefined values are skipped.\nconst pickPresetState = (presetState: Meta['presetState']): PresetState => {\n const picked: PresetState = {};\n if (!presetState) return picked;\n PRESET_STATE_KEYS.forEach(key => {\n if (presetState[key] !== undefined) Object.assign(picked, { [key]: presetState[key] });\n });\n return picked;\n};\n\n/**\n * Converts given meta into the state structure.\n */\nexport function convertMetaIntoState(meta: Meta): State {\n const sortingOrder: State['sortingOrder'] = [];\n const hiddenColumns: State['hiddenColumns'] = [];\n const visibleColumns: State['visibleColumns'] = [];\n let groups: NonNullable<State['groups']> = [];\n const aggregationInfo: State['aggregationInfo'] = [];\n const conditionalStyleFormats: State['conditionalStyleFormats'] = [];\n const { filterExpression, showHeaderIcons, defaultRowHeight } = meta;\n\n // default RowHeight as short\n // update selectedHeightOption if defaultRowHeight is set in meta\n const selectedHeightOption = meta.template === TEMPLATES.TABLE ? defaultRowHeight : undefined;\n\n // hydrate state with meta.fieldDefs\n meta.fieldDefs.forEach(fieldDef => {\n // hydrating sorting\n if (fieldDef.sort && fieldDef.sortPriority && fieldDef.sortDirection)\n sortingOrder.push({\n columnId: fieldDef.id,\n order: fieldDef.sortDirection,\n sequence: fieldDef.sortPriority\n });\n\n // hydrating column visibility\n // TODO: when hiddenColumns is deprecated removed it.\n if (!fieldDef.show) hiddenColumns.push(fieldDef.id);\n\n // hydrating visible columns\n if (fieldDef.show) visibleColumns.push(fieldDef.id);\n\n // hydrating aggregated Fields\n if (fieldDef.aggregated && (fieldDef.type === 'number' || fieldDef.type === 'currency')) {\n const aggregationType = meta.aggregateOptions?.[fieldDef.type]?.[0];\n\n if (aggregationType) {\n aggregationInfo.push({\n columnId: fieldDef.id,\n type: aggregationType\n });\n }\n }\n\n // hydrating grouping\n // consider sort direction of column for group order if its provided otherwise default to ascending.\n if (meta.grouping && fieldDef.grouping && fieldDef.grouped) {\n const level = fieldDef.groupOrder ?? groups.length;\n let order: NonNullable<State['groups']>[number]['order'] = 'asc';\n if (fieldDef.customGrouping) {\n order = 'custom';\n } else if (fieldDef.sort && fieldDef.sortDirection) {\n order = fieldDef.sortDirection;\n }\n groups.splice(level, 0, {\n columnId: fieldDef.id,\n order,\n level,\n dateFunction: fieldDef.groupedDateFunction,\n additionalFields: fieldDef.groupedAdditionalFields,\n customFunction: fieldDef.customGrouping\n });\n }\n\n if (fieldDef.conditionalStyleFormats) {\n conditionalStyleFormats.push(\n ...fieldDef.conditionalStyleFormats.map(conditionalStyleFormat => ({\n ...conditionalStyleFormat,\n fieldName: fieldDef.name\n }))\n );\n }\n });\n\n // BUG-752261 Maintaining sort sequence in state\n sortingOrder.sort((col1, col2) => col1.sequence - col2.sequence);\n\n if (meta.grouping === undefined) groups = [];\n\n return {\n ...(meta.template === TEMPLATES.GALLERY && {\n galleryLayout: meta.galleryConfig?.layout\n }),\n sortingOrder,\n hiddenColumns,\n groups,\n aggregationInfo,\n filterExpression,\n showHeaderIcons,\n selectedHeightOption,\n conditionalStyleFormats,\n visibleColumns,\n ...pickPresetState(meta.presetState)\n };\n}\n\nconst hydrateComponentState = async ([{ getRsProps, getRsStore, dispatch, getState, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n let componentState;\n const rsProps = getRsProps();\n const rsStore = getRsStore();\n rsStore.componentState = null;\n if (rsProps?.apiContext?.getComponentState) {\n componentState = await rsProps?.apiContext?.getComponentState();\n }\n const { personalization } = getState();\n // if client set component state somewhere for persisting changes\n if (\n componentState &&\n Object.keys(componentState).length &&\n personalization &&\n componentState.activePersonalization\n ) {\n rsStore.componentState = componentState;\n const activeComponentState = pickProperties(componentState, personalizationProps);\n let hydratedState: State = {\n personalization: {\n ...personalization,\n active: componentState.activePersonalization\n },\n ...activeComponentState\n };\n\n // Resolve visible columns then apply OOTB column visibility.\n hydratedState = hydrateVisibleColumnsStateSlice(getView().meta, hydratedState);\n dispatch(actionHydrateState(hydratedState));\n }\n};\n\n// Todo: onLoad sorting, filterBy, GroupBy, Freeze, HiddenColumn,\n// the structure in meta and hydration of state from it\nconst hydrate = ([{ getRsStore, getRsProps, getView, dispatch, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const state = getState();\n const rsStore = getRsStore();\n const rsProps = getRsProps();\n const activePersonalization =\n state.personalization?.allPersonalizations?.[state.personalization?.active];\n\n let hydratedState: State = {};\n\n if (rsProps.persistedInfo && rsStore.presets[0].id === state.personalization?.active) {\n // Hydrate from persisted info.\n hydratedState = rsProps.persistedInfo;\n } else if (rsStore.componentState) {\n // Component state already applied by hydrateComponentState ,clear and skip.\n rsStore.componentState = null;\n return null;\n } else if (\n activePersonalization?.isPreset &&\n !isEmpty(activePersonalization.personalizationState ?? {})\n ) {\n // Preset has its own saved personalization,use it directly.\n hydratedState = activePersonalization.personalizationState ?? {};\n } else if (activePersonalization?.isPreset) {\n // If Preset has no saved personalization, derive initial state from meta.\n hydratedState = {\n template: getView().meta.template,\n presetId: getView().meta.id,\n ...convertMetaIntoState(getView().meta)\n };\n } else {\n return null;\n }\n\n hydratedState = getCurrentVersionedState(\n hydrateVisibleColumnsStateSlice(getView().meta, hydratedState)\n );\n return dispatch(actionHydrateState(hydratedState));\n};\n\n/**\n * Hydrates the repeating structure state on bootstrap, following this priority order:\n * 1. {@link RsProps.persistedInfo}\n * 2. Component state from {@link ApiContext.getComponentState}\n * 3. Personalized state from the preset\n * 4. {@link Meta} (including {@link Meta.presetState})\n */\nexport default () => {\n const memoizedHydrateComponentState = withMemoization(hydrateComponentState);\n const memoizedHydrate = withMemoization(hydrate);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n memoizedHydrateComponentState([featureProps], []);\n memoizedHydrate([featureProps], [featureProps.getView().meta]);\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAsCA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,OAAO,YAAY,MAAM,6BAA6B,CAAC;;;4EAJrD,kEAAsC;6BApBnC,kEAAsC;6BAyEkxG,kEAAsC;uBAbt1G,kEAGT;;0BAzDgD,kEAChB;;uBAaM,kEACd;6BAoD4mC,kEAAsC;;4BA3D1nC,kEACpC;8BA0D0pO,kEAAsC;kCA7BlsO,kEAEZ;6BArC+B,kEAChB;2BAGgB,kEAC5B;2EA2DgsE,kEAAsC;yCAjD3tE,kEAAsC;+BAiDuwL,kEAAsC;4BArDj0L,kEACd;kCAoDgwU,kEAAsC;;;6EAA1xM,kEAAsC;gCA/DpiI,kEACpB;kCAR2C,kEAC1C;4BAqES,kEAAsC;kCApEvC,kEAAsC;sCAQ/B,kEAC7B;+BAE2B,kEACZ;0EAwDmxP,kEAAsC;wEAA78I,kEAAsC;4BAA13F,kEAAsC;6BA9EhhB,kEAC5B;sEA2BZ,kEAAsC;2BAkDlB,kEAAsC;4BA/DzD,kEACpB;;uCA8Do2B,kEAAsC;;;0BAAqtD,sDAA0B;iCAAq9C,sDAA0B;yCA7DlkI,sDAC5B;;;AAab,wBA8CE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAsCA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,OAAO,YAAY,MAAM,6BAA6B,CAAC;;;4EAJrD,kEAAsC;6BApBnC,kEAAsC;6BAyEkxG,kEAAsC;uBAbt1G,kEAGT;;0BAzDgD,kEAChB;;uBAaM,kEACd;6BAoD4mC,kEAAsC;;4BA3D1nC,kEACpC;8BA0D0pO,kEAAsC;kCA7BlsO,kEAEZ;6BArC+B,kEAChB;2BAGgB,kEAC5B;2EA2DgsE,kEAAsC;yCAjD3tE,kEAAsC;+BAiDw2M,kEAAsC;4BArDl6M,kEACd;kCAoDgwU,kEAAsC;;;6EAA1xM,kEAAsC;gCA/DpiI,kEACpB;kCAR2C,kEAC1C;4BAqES,kEAAsC;kCApEvC,kEAAsC;sCAQ/B,kEAC7B;+BAE2B,kEACZ;0EAwDmxP,kEAAsC;wEAA78I,kEAAsC;4BAA13F,kEAAsC;6BA9EhhB,kEAC5B;sEA2BZ,kEAAsC;2BAkDlB,kEAAsC;4BA/DzD,kEACpB;;uCA8Do2B,kEAAsC;;;0BAAqtD,sDAA0B;iCAAq9C,sDAA0B;yCA7DlkI,sDAC5B;;;AAab,wBA8CE"}
@@ -1 +1 @@
1
- {"version":3,"file":"personalizationReducer.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EACV,MAAM,EAYP,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAK5C,eAAO,MAAM,oBAAoB,yYAyBN,CAAC;AAS5B,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,EAAE,UAAU,GACtB,KAAK,CAwQP"}
1
+ {"version":3,"file":"personalizationReducer.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EACV,MAAM,EAYP,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAK5C,eAAO,MAAM,oBAAoB,yYAyBN,CAAC;AAS5B,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,EAAE,UAAU,GACtB,KAAK,CA6QP"}
@@ -80,9 +80,13 @@ export default function personalizationReducer(state, action, { getView }) {
80
80
  // If no default is marked then show Non personalized view and also make it active
81
81
  state.personalization.defaultPersonalization = defaultPresetId;
82
82
  }
83
+ // The first active view is the one the meta asks for, but the default personalization stays as it is.
84
+ const { initialPresetId } = getView().meta;
83
85
  payload = {
84
86
  ...state,
85
- personalizationKey: state.personalization.defaultPersonalization
87
+ personalizationKey: initialPresetId && state.personalization.allPersonalizations[initialPresetId]
88
+ ? initialPresetId
89
+ : state.personalization.defaultPersonalization
86
90
  };
87
91
  }
88
92
  // eslint-disable-next-line no-fallthrough
@@ -1 +1 @@
1
- {"version":3,"file":"personalizationReducer.js","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationReducer.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAerD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG,OAAO,EAAE,0CAA0C,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;IACf,QAAQ;IACR,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,sBAAsB;IACtB,eAAe;IACf,i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CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type {\n Action,\n GetPersonalizationsAction,\n PersonalizationActions,\n PersonalizationCreateAction,\n PersonalizationDeleteAction,\n PersonalizationEditAction,\n PersonalizationSetActiveAction,\n PersonalizationSetAppDefaultAction,\n PersonalizationSetDefaultAction,\n PersonalizationUpdateAction,\n PersonalizationUpdateIdAction,\n PersonalizationUpdatePresetIdAction\n} from '../actions/actions.types';\nimport { hydrateVisibleColumnsStateSlice } from '../features/uIFeatures/beforeRender/stateHydration';\nimport type RsInternal from '../RsInternal';\nimport { getDefaultPresetIdFromStatePersonalisation, pickProperties } from '../utils/util';\n\nimport { getCurrentVersionedState } from './versioning';\n\nexport const personalizationProps = [\n 'version',\n 'showHeaderIcons',\n 'columnAlias',\n 'renderFormatter',\n 'colOrder',\n 'columnWidths',\n 'customFields',\n 'sortingOrder',\n 'freezeColumns',\n 'groups',\n 'hierarchicalGroup',\n // 'groupingInfo',\n // 'groupFilters',\n 'filterExpression',\n 'hiddenColumns',\n 'selectedHeightOption',\n 'galleryLayout',\n 'aggregationInfo',\n 'allGroupsExpanded',\n 'template',\n 'presetId',\n 'externalState',\n 'visibleColumns',\n '_groupsSnapshot'\n] satisfies (keyof State)[];\n\nconst getStateToCarryAcrossPersonalization = (state: State) => ({\n paginationOptions: state.paginationOptions,\n rowSelectionChangeSet: state.rowSelectionChangeSet,\n selectedRows: state.selectedRows,\n responsive: state.responsive\n});\n\nexport default function personalizationReducer(\n state: State,\n action: Action,\n { getView }: RsInternal\n): State {\n const { type } = action;\n let { payload } = action as PersonalizationActions;\n switch (type) {\n case ActionTypes.PERSONALIZATION_SET_DEFAULT: {\n const { personalizationKey } = payload as PersonalizationSetDefaultAction['payload'];\n if (personalizationKey === state.personalization!.defaultPersonalization) {\n return state;\n }\n // Here update the previousDefaultPersonalization only if newDefault is different from previous one\n const previousDefaultPersonalization = state.personalization!.defaultPersonalization;\n const newPersonalization = {\n ...state.personalization!,\n previousDefaultPersonalization,\n defaultPersonalization: personalizationKey\n };\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_DELETE: {\n const { personalizationKey } = payload as PersonalizationDeleteAction['payload'];\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n\n const personalizationBeingDeleted =\n state.personalization!.allPersonalizations[personalizationKey];\n delete state.personalization!.allPersonalizations[personalizationKey];\n\n if (state.personalization!.defaultPersonalization === personalizationKey) {\n // The personalization being deleted is default so select the non-personalized view as next Default\n state.personalization!.defaultPersonalization = defaultPresetId!;\n }\n\n return {\n ...getStateToCarryAcrossPersonalization(state),\n personalization: {\n ...state.personalization!,\n lastDeletedPersonalization: personalizationBeingDeleted,\n active: defaultPresetId!\n }\n };\n }\n case ActionTypes.PERSONALIZATION_GET: {\n state.personalization = payload as GetPersonalizationsAction['payload'];\n if (!state.personalization.defaultPersonalization) {\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization.allPersonalizations\n );\n\n // If no default is marked then show Non personalized view and also make it active\n state.personalization.defaultPersonalization = defaultPresetId!;\n }\n payload = {\n ...state,\n personalizationKey: state.personalization.defaultPersonalization\n };\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_SET_ACTIVE: {\n const { personalizationKey, isPreset } = payload as PersonalizationSetActiveAction['payload'];\n\n if (personalizationKey === state.personalization!.active) {\n return state;\n }\n\n if (isPreset) {\n // we are making state empty\n return {\n ...getStateToCarryAcrossPersonalization(state),\n personalization: {\n ...state.personalization!,\n active: personalizationKey\n }\n };\n }\n\n let newState = getCurrentVersionedState(\n state.personalization!.allPersonalizations?.[personalizationKey]?.personalizationState\n );\n\n // Older saved states may have hiddenColumns but no visibleColumns, derive visibleColumns before applying.\n if (newState.hiddenColumns && !newState.visibleColumns) {\n newState = hydrateVisibleColumnsStateSlice(getView().meta, newState);\n }\n\n return {\n ...getStateToCarryAcrossPersonalization(state),\n ...newState,\n personalization: {\n ...state.personalization!,\n active: personalizationKey\n }\n };\n }\n\n case ActionTypes.PERSONALIZATION_CREATE: {\n if (\n !(payload as PersonalizationCreateAction['payload']).personalizationKey ||\n !(payload as PersonalizationCreateAction['payload']).personalizationName\n )\n return state;\n if ((payload as PersonalizationCreateAction['payload']).markAsDefault) {\n state.personalization!.defaultPersonalization = (\n payload as PersonalizationCreateAction['payload']\n ).personalizationKey;\n }\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_SET_APP_DEFAULT: {\n if (\n !(payload as PersonalizationSetAppDefaultAction['payload']).personalizationKey ||\n !(payload as PersonalizationSetAppDefaultAction['payload']).personalizationName\n )\n return state;\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_UPDATE: {\n if (!(payload as PersonalizationUpdateAction['payload']).personalizationKey) return state;\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n\n // Temp until update is also made separate\n state.personalization!.active = (\n payload as PersonalizationUpdateAction['payload']\n ).personalizationKey;\n if (state.personalization!.active === defaultPresetId) {\n // When we are on default never have any save\n return state;\n }\n\n const activePersonalization = state.personalization!.active;\n\n // should changing personalizationName be separate from saveChanges to View? UX Q to Sree!!!\n const activePersonalizationName =\n // @ts-expect-error personalizationName does not exist on PersonalizationUpdateAction payload.\n (payload as PersonalizationUpdateAction['payload']).personalizationName ||\n state.personalization!.allPersonalizations[activePersonalization].name;\n\n const pickedState = pickProperties(state, personalizationProps);\n let newPersonalization = {\n ...state.personalization!,\n allPersonalizations: {\n ...state.personalization!.allPersonalizations,\n [activePersonalization]: {\n name: activePersonalizationName,\n personalizationState: pickedState!\n }\n }\n };\n\n if ((payload as PersonalizationUpdateAction['payload']).markAsDefault) {\n const previousDefaultPersonalization = state.personalization!.defaultPersonalization;\n newPersonalization = {\n ...newPersonalization,\n previousDefaultPersonalization,\n defaultPersonalization: (payload as PersonalizationUpdateAction['payload'])\n .personalizationKey\n };\n }\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_UPDATE_ID: {\n const { oldPersonalizationId, newPersonalizationId } =\n payload as PersonalizationUpdateIdAction['payload'];\n\n const updatedPersonalization = {\n ...state.personalization!,\n allPersonalizations: { ...state.personalization!.allPersonalizations }\n };\n\n if (state.personalization!.defaultPersonalization === oldPersonalizationId) {\n updatedPersonalization.defaultPersonalization = newPersonalizationId;\n }\n\n if (state.personalization!.active === oldPersonalizationId) {\n updatedPersonalization.active = newPersonalizationId;\n }\n\n if (state.personalization!.previousDefaultPersonalization === oldPersonalizationId) {\n updatedPersonalization.previousDefaultPersonalization = newPersonalizationId;\n }\n\n const oldPersonalization = state.personalization?.allPersonalizations?.[oldPersonalizationId];\n\n delete updatedPersonalization.allPersonalizations[oldPersonalizationId];\n\n updatedPersonalization.allPersonalizations[newPersonalizationId] = oldPersonalization!;\n\n return {\n ...state,\n personalization: updatedPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID: {\n const { oldPresetId, newPresetId, personalizationKey } =\n payload as PersonalizationUpdatePresetIdAction['payload'];\n const allPersonalizationsCopy = { ...state.personalization!.allPersonalizations };\n\n const currentPresetId =\n allPersonalizationsCopy[personalizationKey].personalizationState.presetId;\n\n if (currentPresetId === oldPresetId) {\n allPersonalizationsCopy[personalizationKey].personalizationState.presetId = newPresetId;\n }\n\n return {\n ...state,\n personalization: {\n ...state.personalization!,\n allPersonalizations: allPersonalizationsCopy\n }\n };\n }\n\n case ActionTypes.PERSONALIZATION_EDIT: {\n const { personalizationKey, personalizationName, markAsDefault } =\n payload as PersonalizationEditAction['payload'];\n if (!personalizationKey || !personalizationName) return state;\n if (markAsDefault) {\n state.personalization!.defaultPersonalization = personalizationKey;\n } else if (markAsDefault === false) {\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n state.personalization!.defaultPersonalization = defaultPresetId!;\n }\n\n const currentPersonalization =\n state.personalization!.allPersonalizations?.[personalizationKey];\n const newPersonalization = {\n ...state.personalization!,\n allPersonalizations: {\n ...state.personalization!.allPersonalizations,\n [personalizationKey]: {\n ...currentPersonalization,\n name: personalizationName\n }\n }\n };\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n default: {\n // Todo: check instance.personalizationExplicitSave in the future\n // and also update the state always here for every action dispatched\n return state;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"personalizationReducer.js","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationReducer.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAerD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAErG,OAAO,EAAE,0CAA0C,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;IACf,QAAQ;IACR,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,sBAAsB;IACtB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,iBAAiB;CACQ,CAAC;AAE5B,MAAM,oCAAoC,GAAG,CAAC,KAAY,EAAE,EAAE,CAAC,CAAC;IAC9D,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;IAC1C,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;IAClD,YAAY,EAAE,KAAK,CAAC,YAAY;IAChC,UAAU,EAAE,KAAK,CAAC,UAAU;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO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AAC,eAAgB;oBACzB,mBAAmB,EAAE,uBAAuB;iBAC7C;aACF,CAAC;QACJ,CAAC;QAED,KAAK,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC;YACtC,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAC9D,OAA+C,CAAC;YAClD,IAAI,CAAC,kBAAkB,IAAI,CAAC,mBAAmB;gBAAE,OAAO,KAAK,CAAC;YAC9D,IAAI,aAAa,EAAE,CAAC;gBAClB,KAAK,CAAC,eAAgB,CAAC,sBAAsB,GAAG,kBAAkB,CAAC;YACrE,CAAC;iBAAM,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;gBACnC,MAAM,eAAe,GAAG,0CAA0C,CAChE,KAAK,CAAC,eAAgB,CAAC,mBAAmB,CAC3C,CAAC;gBACF,KAAK,CAAC,eAAgB,CAAC,sBAAsB,GAAG,eAAgB,CAAC;YACnE,CAAC;YAED,MAAM,sBAAsB,GAC1B,KAAK,CAAC,eAAgB,CAAC,mBAAmB,EAAE,CAAC,kBAAkB,CAAC,CAAC;YACnE,MAAM,kBAAkB,GAAG;gBACzB,GAAG,KAAK,CAAC,eAAgB;gBACzB,mBAAmB,EAAE;oBACnB,GAAG,KAAK,CAAC,eAAgB,CAAC,mBAAmB;oBAC7C,CAAC,kBAAkB,CAAC,EAAE;wBACpB,GAAG,sBAAsB;wBACzB,IAAI,EAAE,mBAAmB;qBAC1B;iBACF;aACF,CAAC;YAEF,OAAO;gBACL,GAAG,KAAK;gBACR,eAAe,EAAE,kBAAkB;aACpC,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,iEAAiE;YACjE,oEAAoE;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type {\n Action,\n GetPersonalizationsAction,\n PersonalizationActions,\n PersonalizationCreateAction,\n PersonalizationDeleteAction,\n PersonalizationEditAction,\n PersonalizationSetActiveAction,\n PersonalizationSetAppDefaultAction,\n PersonalizationSetDefaultAction,\n PersonalizationUpdateAction,\n PersonalizationUpdateIdAction,\n PersonalizationUpdatePresetIdAction\n} from '../actions/actions.types';\nimport { hydrateVisibleColumnsStateSlice } from '../features/uIFeatures/beforeRender/stateHydration';\nimport type RsInternal from '../RsInternal';\nimport { getDefaultPresetIdFromStatePersonalisation, pickProperties } from '../utils/util';\n\nimport { getCurrentVersionedState } from './versioning';\n\nexport const personalizationProps = [\n 'version',\n 'showHeaderIcons',\n 'columnAlias',\n 'renderFormatter',\n 'colOrder',\n 'columnWidths',\n 'customFields',\n 'sortingOrder',\n 'freezeColumns',\n 'groups',\n 'hierarchicalGroup',\n // 'groupingInfo',\n // 'groupFilters',\n 'filterExpression',\n 'hiddenColumns',\n 'selectedHeightOption',\n 'galleryLayout',\n 'aggregationInfo',\n 'allGroupsExpanded',\n 'template',\n 'presetId',\n 'externalState',\n 'visibleColumns',\n '_groupsSnapshot'\n] satisfies (keyof State)[];\n\nconst getStateToCarryAcrossPersonalization = (state: State) => ({\n paginationOptions: state.paginationOptions,\n rowSelectionChangeSet: state.rowSelectionChangeSet,\n selectedRows: state.selectedRows,\n responsive: state.responsive\n});\n\nexport default function personalizationReducer(\n state: State,\n action: Action,\n { getView }: RsInternal\n): State {\n const { type } = action;\n let { payload } = action as PersonalizationActions;\n switch (type) {\n case ActionTypes.PERSONALIZATION_SET_DEFAULT: {\n const { personalizationKey } = payload as PersonalizationSetDefaultAction['payload'];\n if (personalizationKey === state.personalization!.defaultPersonalization) {\n return state;\n }\n // Here update the previousDefaultPersonalization only if newDefault is different from previous one\n const previousDefaultPersonalization = state.personalization!.defaultPersonalization;\n const newPersonalization = {\n ...state.personalization!,\n previousDefaultPersonalization,\n defaultPersonalization: personalizationKey\n };\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_DELETE: {\n const { personalizationKey } = payload as PersonalizationDeleteAction['payload'];\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n\n const personalizationBeingDeleted =\n state.personalization!.allPersonalizations[personalizationKey];\n delete state.personalization!.allPersonalizations[personalizationKey];\n\n if (state.personalization!.defaultPersonalization === personalizationKey) {\n // The personalization being deleted is default so select the non-personalized view as next Default\n state.personalization!.defaultPersonalization = defaultPresetId!;\n }\n\n return {\n ...getStateToCarryAcrossPersonalization(state),\n personalization: {\n ...state.personalization!,\n lastDeletedPersonalization: personalizationBeingDeleted,\n active: defaultPresetId!\n }\n };\n }\n case ActionTypes.PERSONALIZATION_GET: {\n state.personalization = payload as GetPersonalizationsAction['payload'];\n if (!state.personalization.defaultPersonalization) {\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization.allPersonalizations\n );\n\n // If no default is marked then show Non personalized view and also make it active\n state.personalization.defaultPersonalization = defaultPresetId!;\n }\n // The first active view is the one the meta asks for, but the default personalization stays as it is.\n const { initialPresetId } = getView().meta;\n payload = {\n ...state,\n personalizationKey:\n initialPresetId && state.personalization.allPersonalizations[initialPresetId]\n ? initialPresetId\n : state.personalization.defaultPersonalization\n };\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_SET_ACTIVE: {\n const { personalizationKey, isPreset } = payload as PersonalizationSetActiveAction['payload'];\n\n if (personalizationKey === state.personalization!.active) {\n return state;\n }\n\n if (isPreset) {\n // we are making state empty\n return {\n ...getStateToCarryAcrossPersonalization(state),\n personalization: {\n ...state.personalization!,\n active: personalizationKey\n }\n };\n }\n\n let newState = getCurrentVersionedState(\n state.personalization!.allPersonalizations?.[personalizationKey]?.personalizationState\n );\n\n // Older saved states may have hiddenColumns but no visibleColumns, derive visibleColumns before applying.\n if (newState.hiddenColumns && !newState.visibleColumns) {\n newState = hydrateVisibleColumnsStateSlice(getView().meta, newState);\n }\n\n return {\n ...getStateToCarryAcrossPersonalization(state),\n ...newState,\n personalization: {\n ...state.personalization!,\n active: personalizationKey\n }\n };\n }\n\n case ActionTypes.PERSONALIZATION_CREATE: {\n if (\n !(payload as PersonalizationCreateAction['payload']).personalizationKey ||\n !(payload as PersonalizationCreateAction['payload']).personalizationName\n )\n return state;\n if ((payload as PersonalizationCreateAction['payload']).markAsDefault) {\n state.personalization!.defaultPersonalization = (\n payload as PersonalizationCreateAction['payload']\n ).personalizationKey;\n }\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_SET_APP_DEFAULT: {\n if (\n !(payload as PersonalizationSetAppDefaultAction['payload']).personalizationKey ||\n !(payload as PersonalizationSetAppDefaultAction['payload']).personalizationName\n )\n return state;\n }\n // eslint-disable-next-line no-fallthrough\n case ActionTypes.PERSONALIZATION_UPDATE: {\n if (!(payload as PersonalizationUpdateAction['payload']).personalizationKey) return state;\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n\n // Temp until update is also made separate\n state.personalization!.active = (\n payload as PersonalizationUpdateAction['payload']\n ).personalizationKey;\n if (state.personalization!.active === defaultPresetId) {\n // When we are on default never have any save\n return state;\n }\n\n const activePersonalization = state.personalization!.active;\n\n // should changing personalizationName be separate from saveChanges to View? UX Q to Sree!!!\n const activePersonalizationName =\n // @ts-expect-error personalizationName does not exist on PersonalizationUpdateAction payload.\n (payload as PersonalizationUpdateAction['payload']).personalizationName ||\n state.personalization!.allPersonalizations[activePersonalization].name;\n\n const pickedState = pickProperties(state, personalizationProps);\n let newPersonalization = {\n ...state.personalization!,\n allPersonalizations: {\n ...state.personalization!.allPersonalizations,\n [activePersonalization]: {\n name: activePersonalizationName,\n personalizationState: pickedState!\n }\n }\n };\n\n if ((payload as PersonalizationUpdateAction['payload']).markAsDefault) {\n const previousDefaultPersonalization = state.personalization!.defaultPersonalization;\n newPersonalization = {\n ...newPersonalization,\n previousDefaultPersonalization,\n defaultPersonalization: (payload as PersonalizationUpdateAction['payload'])\n .personalizationKey\n };\n }\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_UPDATE_ID: {\n const { oldPersonalizationId, newPersonalizationId } =\n payload as PersonalizationUpdateIdAction['payload'];\n\n const updatedPersonalization = {\n ...state.personalization!,\n allPersonalizations: { ...state.personalization!.allPersonalizations }\n };\n\n if (state.personalization!.defaultPersonalization === oldPersonalizationId) {\n updatedPersonalization.defaultPersonalization = newPersonalizationId;\n }\n\n if (state.personalization!.active === oldPersonalizationId) {\n updatedPersonalization.active = newPersonalizationId;\n }\n\n if (state.personalization!.previousDefaultPersonalization === oldPersonalizationId) {\n updatedPersonalization.previousDefaultPersonalization = newPersonalizationId;\n }\n\n const oldPersonalization = state.personalization?.allPersonalizations?.[oldPersonalizationId];\n\n delete updatedPersonalization.allPersonalizations[oldPersonalizationId];\n\n updatedPersonalization.allPersonalizations[newPersonalizationId] = oldPersonalization!;\n\n return {\n ...state,\n personalization: updatedPersonalization\n };\n }\n\n case ActionTypes.PERSONALIZATION_UPDATE_PRESET_ID: {\n const { oldPresetId, newPresetId, personalizationKey } =\n payload as PersonalizationUpdatePresetIdAction['payload'];\n const allPersonalizationsCopy = { ...state.personalization!.allPersonalizations };\n\n const currentPresetId =\n allPersonalizationsCopy[personalizationKey].personalizationState.presetId;\n\n if (currentPresetId === oldPresetId) {\n allPersonalizationsCopy[personalizationKey].personalizationState.presetId = newPresetId;\n }\n\n return {\n ...state,\n personalization: {\n ...state.personalization!,\n allPersonalizations: allPersonalizationsCopy\n }\n };\n }\n\n case ActionTypes.PERSONALIZATION_EDIT: {\n const { personalizationKey, personalizationName, markAsDefault } =\n payload as PersonalizationEditAction['payload'];\n if (!personalizationKey || !personalizationName) return state;\n if (markAsDefault) {\n state.personalization!.defaultPersonalization = personalizationKey;\n } else if (markAsDefault === false) {\n const defaultPresetId = getDefaultPresetIdFromStatePersonalisation(\n state.personalization!.allPersonalizations\n );\n state.personalization!.defaultPersonalization = defaultPresetId!;\n }\n\n const currentPersonalization =\n state.personalization!.allPersonalizations?.[personalizationKey];\n const newPersonalization = {\n ...state.personalization!,\n allPersonalizations: {\n ...state.personalization!.allPersonalizations,\n [personalizationKey]: {\n ...currentPersonalization,\n name: personalizationName\n }\n }\n };\n\n return {\n ...state,\n personalization: newPersonalization\n };\n }\n\n default: {\n // Todo: check instance.personalizationExplicitSave in the future\n // and also update the state always here for every action dispatched\n return state;\n }\n }\n}\n"]}
@@ -5,7 +5,7 @@ import type { HeadingTag, IconName, ImageSize, OmitStrict, StatusProps } from '@
5
5
  import type { FilterConfig } from '../src/core/config/filterConfig';
6
6
  import type Row from '../src/core/generators/RowGenerator';
7
7
  import type { RowData } from '../src/core/generators/RowGenerator.types';
8
- import type { AggregationType, GroupAdditionalField, IntervalGrouping, RangeGrouping, SortDirection, TextGrouping } from './State.types';
8
+ import type { AggregationType, GroupAdditionalField, IntervalGrouping, RangeGrouping, SortDirection, State, TextGrouping } from './State.types';
9
9
  import type { RenderFormatterType } from './RsCoreBootArgs.types';
10
10
  type CSSVariable = `--${string}`;
11
11
  export declare const ActionColumnPlacement: {
@@ -551,6 +551,14 @@ export interface GalleryConfig extends CardConfig {
551
551
  */
552
552
  showLayoutToggle?: boolean;
553
553
  }
554
+ /**
555
+ * State keys a preset can carry in {@link Meta.presetState}: the state that cannot be reconstructed from
556
+ * `fieldDefs` and the other Meta properties. This list is the single contract between RS Core (which
557
+ * accepts only these keys at runtime) and consumers (which build `presetState` from them).
558
+ */
559
+ export declare const PRESET_STATE_KEYS: readonly ["allGroupsExpanded", "aggregationInfo", "colOrder", "columnAlias", "columnWidths", "customFields", "externalState", "freezeColumns", "groups", "renderFormatter", "version", "visibleColumns"];
560
+ /** Initial state of a preset, see {@link Meta.presetState}. */
561
+ export type PresetState = Partial<Pick<State, (typeof PRESET_STATE_KEYS)[number]>>;
554
562
  /** Meta input to RS */
555
563
  export interface Meta {
556
564
  /** Metadata for fields */
@@ -561,6 +569,24 @@ export interface Meta {
561
569
  id: string;
562
570
  /** Preset name of the current preset/personalization. This will be displayed to end user */
563
571
  name: string;
572
+ /**
573
+ * Id of the preset that is active on first render, instead of the personalization default (which does
574
+ * not change). Read from the base meta only; ignored when it matches no preset.
575
+ */
576
+ initialPresetId?: string;
577
+ /**
578
+ * Initial state for an unpersonalized preset that cannot be reconstructed from `fieldDefs` and the
579
+ * other Meta properties (e.g. column aliases, frozen columns, custom columns, custom grouping,
580
+ * column widths and order, exact aggregation choices, external filter values). Everything Meta can
581
+ * express (field visibility, sorting, filter, conditional styles, header icons, row height, gallery
582
+ * layout) is hydrated from Meta itself and is intentionally not accepted here. `visibleColumns` is
583
+ * accepted only because custom columns have no field definition to carry their visibility.
584
+ * Only the keys in {@link PRESET_STATE_KEYS} are accepted. They override values reconstructed from
585
+ * fieldDefs. `externalState` (keyed like {@link externalFilters}) makes external filters known
586
+ * before the first data fetch. Preset identity, template and personalization remain controlled by
587
+ * Meta and the current component state rather than this property.
588
+ */
589
+ presetState?: PresetState;
564
590
  /** Array of fields(extra) that should be included in the query prepared for different api's in {@link ApiContext}.
565
591
  * `lists-client-api` package implicitly appends this in `select` field while preparing the query.
566
592
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Meta.types.d.ts","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iFAAiF,CAAC;AACpH,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,GAAG,MAAM,qCAAqC,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2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,IAAI,GAAG,OAAO,CAAC,CAAC;IACzE;;;;uEAImE;IACnE,aAAa,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC9C;;;;;;OAMG;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;IAC7B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC"}
@@ -45,4 +45,23 @@ const SELECTION_MODE = {
45
45
  MULTI: 'multi',
46
46
  MULTI_ON_HOVER: 'multi_on_hover'
47
47
  };
48
+ /**
49
+ * State keys a preset can carry in {@link Meta.presetState}: the state that cannot be reconstructed from
50
+ * `fieldDefs` and the other Meta properties. This list is the single contract between RS Core (which
51
+ * accepts only these keys at runtime) and consumers (which build `presetState` from them).
52
+ */
53
+ export const PRESET_STATE_KEYS = [
54
+ 'allGroupsExpanded',
55
+ 'aggregationInfo',
56
+ 'colOrder',
57
+ 'columnAlias',
58
+ 'columnWidths',
59
+ 'customFields',
60
+ 'externalState',
61
+ 'freezeColumns',
62
+ 'groups',
63
+ 'renderFormatter',
64
+ 'version',
65
+ 'visibleColumns'
66
+ ];
48
67
  //# sourceMappingURL=Meta.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Meta.types.js","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiEX,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,kEAAkE;AAClE,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;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAyDX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,kBAAkB;CAC9B,CAAC;AAuQX,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;IACV,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACxB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\n\nimport 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 {\n HeadingTag,\n IconName,\n ImageSize,\n OmitStrict,\n StatusProps\n} 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 {\n AggregationType,\n GroupAdditionalField,\n IntervalGrouping,\n RangeGrouping,\n SortDirection,\n State,\n TextGrouping\n} 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 const ActionColumnPlacement = {\n COLUMN: 'column',\n MENU: 'menu'\n} as const;\n\n/**\n * Additive row-position metadata handed to row-action onClick callbacks. Optional so existing\n * two-argument onClick implementations remain valid without change.\n */\nexport interface RowActionMeta {\n /**\n * The row header column's resolved value, read at the time the action was invoked (not a live\n * column/getValue reference) - the underlying Column instance's execution context is a\n * transient, render-cycle-scoped value that gets rebound to other rows as they render, so\n * reading it lazily later would be unsafe.\n */\n rowHeader?: RowData[keyof RowData];\n /** The row's 0-based position among the underlying data (-1 when unresolved); not a stable identifier. */\n rowIndex: number;\n}\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 * @param rowMeta - Optional row-position metadata; see {@link RowActionMeta}.\n * @return {void} - void\n */\n onClick: (rowContext: RowData, refreshRow: () => void, rowMeta?: RowActionMeta) => 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 onClick?: (target: HTMLElement) => void;\n}\n\nexport interface ActionConfig {\n /** Controls whether action column should be visible in table. */\n show: boolean;\n /** Controls whether action cell should be visible for a specific row. */\n isVisible: (rowContext: RowData) => boolean;\n /** Where action should be rendered. */\n placement: (typeof ActionColumnPlacement)[keyof typeof ActionColumnPlacement];\n /** Action to be invoked on click. */\n onClick: (rowContext: RowData, refreshRow?: () => void, rowMeta?: RowActionMeta) => 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\n// TODO: Look into expanding the types to accept more field types.\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 OBJECT: 'object'\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 data type of the field. */\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 (except when the field type is \"object\", where it defaults to false)\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 (except when the field type is \"object\", where it defaults to false)\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 (except when the field type is \"object\", where it defaults to false)\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 /**\n * Custom grouping applied when {@link grouped} is enabled. For custom grouping, the order is set to 'custom'.\n * - `TEXT_GROUPING` applies to {@link FieldType.TEXT text} fields.\n * - `RANGE_GROUPING` and `INTERVAL_GROUPING` apply to {@link FieldType.NUMBER number} and {@link FieldType.CURRENCY currency} fields.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table} supports all compatible custom grouping types.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} supports only {@link TextGrouping}.\n *\n * Incompatible combinations are removed during meta normalization.\n */\n customGrouping?: TextGrouping | RangeGrouping | IntervalGrouping;\n /**\n * Choose a date function {@link DateFunction} to group by when `grouped` is enabled for a date/time field.\n * Falls back to grouping by equality when undefined.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} does not support date-function grouping.\n */\n groupedDateFunction?: DateFunction;\n /**\n * Additional field configuration for the group.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} does not support group additional fields.\n */\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 /** Force the field label and value to appear in a specific layout. If layoutMode is omitted, layout is auto.\n * Currently, only supported when {@link Meta.template template} is set to {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} or {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban}.\n */\n layoutMode?: 'stacked' | 'inline';\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 false (except when the field type is \"number\"/ \"currency\", where it defaults to 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', 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 *\n * **Template support:** {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table} only.\n *\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 /** Indicates if the field is searchable via global search.\n * @default false (except when the field type is \"text\", where it defaults to true)\n */\n searchable?: boolean;\n /**\n * Optional field whose property is used when matching this field against a global search query.\n */\n searchProperty?: FieldReference;\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 KANBAN: 'Kanban'\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/** Represents a constant string value. */\nexport type ConstantValue = { value: string };\n\n/** Represents a reference to a field from {@link Meta.fieldDefs fieldDefs} by its {@link FieldDef.id id}. */\nexport type FieldReference = { field: FieldDef['id'] };\n\n/** Placement options for hero image */\nexport type HeroImagePlacement = 'left' | 'right' | 'top';\n\n/**\n * Configuration for a hero image displayed on gallery cards.\n *\n * @example\n * ```json\n * {\n * \"source\": { \"field\": \"ImageURL\" },\n * \"altText\": { \"field\": \"ImageDescription\" },\n * \"placement\": \"left\",\n * \"size\": \"flexible\"\n * }\n */\nexport type HeroImage = {\n /** Image source URL. Accepts `{field: 'fieldId'}` to reference a {@link FieldDef field} to get URL. */\n source: FieldReference;\n /** Alternative text for the image. Accepts either `{field: 'fieldId'}` to reference a {@link FieldDef field} or `{value: 'text'}` for a constant value. */\n altText?: ConstantValue | FieldReference;\n /**\n * Position of the hero image relative to card content.\n * @default 'left'\n */\n placement?: HeroImagePlacement;\n /**\n * Size of the hero image.\n * @default 'flexible'\n */\n size?: ImageSize;\n};\n\n/** Possible layout modes for the Gallery template. Extensible for future layouts (e.g. 'board'). */\nexport type GalleryLayout = 'cardgrid' | 'cardlist';\n\nexport interface CardTile {\n /** Field id whose value is the foreground colour (hex string). */\n foregroundColor: FieldReference;\n /** Field id whose value is the background CSS value (e.g. a linear-gradient string). */\n backgroundColor: FieldReference;\n /** Field id whose value is the registered icon name for the tile. */\n iconName?: FieldReference;\n /** Field id whose value is the text content for the tile. */\n text?: FieldReference;\n /**\n * Position of the tile relative to card content.\n * @default 'left'\n */\n placement?: HeroImagePlacement;\n /**\n * Size of the tile.\n * @default 'flexible'\n */\n size?: ImageSize;\n}\n\nexport interface CardConfig {\n /** Header of the card. Accepts `{field: 'fieldId'}` to reference a {@link FieldDef field}. */\n header?: FieldReference;\n /** Subheadings of the card. Accepts an array of `{field: 'fieldId'}` references to {@link FieldDef fields}. */\n subHeadings?: FieldReference[];\n /** Configuration for the hero image displayed on cards. */\n heroImage?: HeroImage;\n /** Configuration for a coloured tile shown in place of a hero image. */\n tile?: CardTile;\n /** Show field labels on cards.\n * @default true\n */\n showFieldLabels?: boolean;\n /** Optional render callback invoked for each card to produce footer content. */\n renderCardFooter?: (rowData: RowData) => ReactNode;\n}\n\n/** Template-neutral Master Detail metadata. */\nexport interface MasterDetailConfig {\n viewName: string;\n /** Icon displayed for each Master Detail selection in the configured table. */\n icon?: IconName;\n}\n\nexport interface GalleryConfig extends CardConfig {\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n header?: FieldReference;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n subHeadings?: FieldReference[];\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n heroImage?: HeroImage;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n tile?: CardTile;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n showFieldLabels?: boolean;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n renderCardFooter?: (rowData: RowData) => ReactNode;\n /** Optional click handler called when a gallery card is clicked. Receives the raw row data. */\n onCardClick?: (rowData: RowData) => void;\n /** Layout mode for the gallery.\n * - `'cardgrid'` - multi-column grid layout (default)\n * - `'cardlist'` - single-column list layout\n * @default 'cardgrid'\n */\n layout?: GalleryLayout;\n /** Shows the toolbar toggle for switching between card grid and card list layouts.\n * @default true\n */\n showLayoutToggle?: 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 for the view. If set, the `fitHeightToElement` property will be ignored.\n * - `number` — explicit pixel height.\n * - CSS variable (e.g. `'--my-height'`) — height driven by a CSS custom property.\n * This takes precedence over `basicMode` height behavior.\n */\n height?: number | CSSVariable;\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 /**\n * Determines the view of a Repeating Structure.\n *\n * @remarks\n * **Template-specific constraints:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} and {@link REPEATING_STRUCTURE_TEMPLATES.MAP Map} do not support grouping.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.TIMELINE Timeline} supports only one grouping level.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} renders only the level-0 group as board lanes.\n * Configure the lane field through {@link Meta.fieldDefs fieldDefs} by setting\n * {@link FieldDef.grouping grouping} and {@link FieldDef.grouped grouped} to `true`,\n * with {@link FieldDef.groupOrder groupOrder} set to `0`.\n *\n * @default 'Table'\n */\n template?: (typeof REPEATING_STRUCTURE_TEMPLATES)[keyof typeof REPEATING_STRUCTURE_TEMPLATES];\n /** Configuration for card-based templates. Only applicable when {@link Meta.template template} is set to {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} or {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban}. */\n cardConfig?: CardConfig;\n /** Allow editing on fields and if enabled then row actions are also enabled.\n *\n * Backward-compatible values:\n * - `boolean`: data- use case.\n * - {@link ActionConfig}: explicit edit behavior.\n *\n * @default false\n */\n editing?: boolean | ActionConfig;\n /** Allow deleting of rows.\n *\n * Backward-compatible values:\n * - `boolean`: data- use case.\n * - {@link ActionConfig}: explicit delete behavior.\n */\n deleting?: boolean | ActionConfig;\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 * Works only if the template is not set to timeline.\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 /**\n * Override the heading tag used for the {@link Meta.title title} title in the toolbar.\n * @default 'h2'\n */\n headingTag?: HeadingTag;\n /**\n * Show the repeating structure title.\n * @default true\n */\n showTitle?: boolean;\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 /** Allow switching between Table and Gallery templates at runtime via the toolbar.\n * Set to `false` for embedded tables where template switching is not supported.\n * @default true\n */\n allowSwitchTemplate?: 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 /**\n * Gallery-specific configuration. Card-content properties remain supported for backward\n * compatibility; use {@link Meta.cardConfig cardConfig} for new integrations.\n */\n galleryConfig?: GalleryConfig;\n // TODO: Narrow this type to a union of the known dx keys: `'PromotedFilters' | 'SEARCH_AND_SELECT_AS_EXTERNAL_FILTERS' | 'ADVANCED_SEARCH_AND_SELECT_AS_EXTERNAL_FILTERS'`.\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 /** Shows the row wrap toggle action in the toolbar.\n * Applicable only when {@link Meta.template template} is set to 'Table'.\n * @default true\n */\n showWrapAction?: 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 * @deprecated Provide the exact fieldDef configuration in the {@link FieldDef}.\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 * @deprecated Use {@link Meta.editing editing} property\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 * Configures a detail region for a selected Table item. Its absence disables Master Detail.\n * This is currently supported only when {@link Meta.template template} is set to\n * {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table}; it is removed during metadata\n * normalization for other templates.\n *\n */\n masterDetail?: MasterDetailConfig;\n}\n"]}
1
+ {"version":3,"file":"Meta.types.js","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAiCA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiEX,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,kEAAkE;AAClE,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;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAyDX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,kBAAkB;CAC9B,CAAC;AAuQX,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;IACV,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAuIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,mBAAmB;IACnB,iBAAiB;IACjB,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,QAAQ;IACR,iBAAiB;IACjB,SAAS;IACT,gBAAgB;CAC2B,CAAC","sourcesContent":["import type { ReactNode } from 'react';\n\nimport 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 {\n HeadingTag,\n IconName,\n ImageSize,\n OmitStrict,\n StatusProps\n} 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 {\n AggregationType,\n GroupAdditionalField,\n IntervalGrouping,\n RangeGrouping,\n SortDirection,\n State,\n TextGrouping\n} 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 const ActionColumnPlacement = {\n COLUMN: 'column',\n MENU: 'menu'\n} as const;\n\n/**\n * Additive row-position metadata handed to row-action onClick callbacks. Optional so existing\n * two-argument onClick implementations remain valid without change.\n */\nexport interface RowActionMeta {\n /**\n * The row header column's resolved value, read at the time the action was invoked (not a live\n * column/getValue reference) - the underlying Column instance's execution context is a\n * transient, render-cycle-scoped value that gets rebound to other rows as they render, so\n * reading it lazily later would be unsafe.\n */\n rowHeader?: RowData[keyof RowData];\n /** The row's 0-based position among the underlying data (-1 when unresolved); not a stable identifier. */\n rowIndex: number;\n}\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 * @param rowMeta - Optional row-position metadata; see {@link RowActionMeta}.\n * @return {void} - void\n */\n onClick: (rowContext: RowData, refreshRow: () => void, rowMeta?: RowActionMeta) => 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 onClick?: (target: HTMLElement) => void;\n}\n\nexport interface ActionConfig {\n /** Controls whether action column should be visible in table. */\n show: boolean;\n /** Controls whether action cell should be visible for a specific row. */\n isVisible: (rowContext: RowData) => boolean;\n /** Where action should be rendered. */\n placement: (typeof ActionColumnPlacement)[keyof typeof ActionColumnPlacement];\n /** Action to be invoked on click. */\n onClick: (rowContext: RowData, refreshRow?: () => void, rowMeta?: RowActionMeta) => 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\n// TODO: Look into expanding the types to accept more field types.\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 OBJECT: 'object'\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 data type of the field. */\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 (except when the field type is \"object\", where it defaults to false)\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 (except when the field type is \"object\", where it defaults to false)\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 (except when the field type is \"object\", where it defaults to false)\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 /**\n * Custom grouping applied when {@link grouped} is enabled. For custom grouping, the order is set to 'custom'.\n * - `TEXT_GROUPING` applies to {@link FieldType.TEXT text} fields.\n * - `RANGE_GROUPING` and `INTERVAL_GROUPING` apply to {@link FieldType.NUMBER number} and {@link FieldType.CURRENCY currency} fields.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table} supports all compatible custom grouping types.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} supports only {@link TextGrouping}.\n *\n * Incompatible combinations are removed during meta normalization.\n */\n customGrouping?: TextGrouping | RangeGrouping | IntervalGrouping;\n /**\n * Choose a date function {@link DateFunction} to group by when `grouped` is enabled for a date/time field.\n * Falls back to grouping by equality when undefined.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} does not support date-function grouping.\n */\n groupedDateFunction?: DateFunction;\n /**\n * Additional field configuration for the group.\n *\n * **Template support:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} does not support group additional fields.\n */\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 /** Force the field label and value to appear in a specific layout. If layoutMode is omitted, layout is auto.\n * Currently, only supported when {@link Meta.template template} is set to {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} or {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban}.\n */\n layoutMode?: 'stacked' | 'inline';\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 false (except when the field type is \"number\"/ \"currency\", where it defaults to 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', 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 *\n * **Template support:** {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table} only.\n *\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 /** Indicates if the field is searchable via global search.\n * @default false (except when the field type is \"text\", where it defaults to true)\n */\n searchable?: boolean;\n /**\n * Optional field whose property is used when matching this field against a global search query.\n */\n searchProperty?: FieldReference;\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 KANBAN: 'Kanban'\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/** Represents a constant string value. */\nexport type ConstantValue = { value: string };\n\n/** Represents a reference to a field from {@link Meta.fieldDefs fieldDefs} by its {@link FieldDef.id id}. */\nexport type FieldReference = { field: FieldDef['id'] };\n\n/** Placement options for hero image */\nexport type HeroImagePlacement = 'left' | 'right' | 'top';\n\n/**\n * Configuration for a hero image displayed on gallery cards.\n *\n * @example\n * ```json\n * {\n * \"source\": { \"field\": \"ImageURL\" },\n * \"altText\": { \"field\": \"ImageDescription\" },\n * \"placement\": \"left\",\n * \"size\": \"flexible\"\n * }\n */\nexport type HeroImage = {\n /** Image source URL. Accepts `{field: 'fieldId'}` to reference a {@link FieldDef field} to get URL. */\n source: FieldReference;\n /** Alternative text for the image. Accepts either `{field: 'fieldId'}` to reference a {@link FieldDef field} or `{value: 'text'}` for a constant value. */\n altText?: ConstantValue | FieldReference;\n /**\n * Position of the hero image relative to card content.\n * @default 'left'\n */\n placement?: HeroImagePlacement;\n /**\n * Size of the hero image.\n * @default 'flexible'\n */\n size?: ImageSize;\n};\n\n/** Possible layout modes for the Gallery template. Extensible for future layouts (e.g. 'board'). */\nexport type GalleryLayout = 'cardgrid' | 'cardlist';\n\nexport interface CardTile {\n /** Field id whose value is the foreground colour (hex string). */\n foregroundColor: FieldReference;\n /** Field id whose value is the background CSS value (e.g. a linear-gradient string). */\n backgroundColor: FieldReference;\n /** Field id whose value is the registered icon name for the tile. */\n iconName?: FieldReference;\n /** Field id whose value is the text content for the tile. */\n text?: FieldReference;\n /**\n * Position of the tile relative to card content.\n * @default 'left'\n */\n placement?: HeroImagePlacement;\n /**\n * Size of the tile.\n * @default 'flexible'\n */\n size?: ImageSize;\n}\n\nexport interface CardConfig {\n /** Header of the card. Accepts `{field: 'fieldId'}` to reference a {@link FieldDef field}. */\n header?: FieldReference;\n /** Subheadings of the card. Accepts an array of `{field: 'fieldId'}` references to {@link FieldDef fields}. */\n subHeadings?: FieldReference[];\n /** Configuration for the hero image displayed on cards. */\n heroImage?: HeroImage;\n /** Configuration for a coloured tile shown in place of a hero image. */\n tile?: CardTile;\n /** Show field labels on cards.\n * @default true\n */\n showFieldLabels?: boolean;\n /** Optional render callback invoked for each card to produce footer content. */\n renderCardFooter?: (rowData: RowData) => ReactNode;\n}\n\n/** Template-neutral Master Detail metadata. */\nexport interface MasterDetailConfig {\n viewName: string;\n /** Icon displayed for each Master Detail selection in the configured table. */\n icon?: IconName;\n}\n\nexport interface GalleryConfig extends CardConfig {\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n header?: FieldReference;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n subHeadings?: FieldReference[];\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n heroImage?: HeroImage;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n tile?: CardTile;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n showFieldLabels?: boolean;\n /**\n * @deprecated Use {@link Meta.cardConfig cardConfig}.\n */\n renderCardFooter?: (rowData: RowData) => ReactNode;\n /** Optional click handler called when a gallery card is clicked. Receives the raw row data. */\n onCardClick?: (rowData: RowData) => void;\n /** Layout mode for the gallery.\n * - `'cardgrid'` - multi-column grid layout (default)\n * - `'cardlist'` - single-column list layout\n * @default 'cardgrid'\n */\n layout?: GalleryLayout;\n /** Shows the toolbar toggle for switching between card grid and card list layouts.\n * @default true\n */\n showLayoutToggle?: boolean;\n}\n\n/**\n * State keys a preset can carry in {@link Meta.presetState}: the state that cannot be reconstructed from\n * `fieldDefs` and the other Meta properties. This list is the single contract between RS Core (which\n * accepts only these keys at runtime) and consumers (which build `presetState` from them).\n */\nexport const PRESET_STATE_KEYS = [\n 'allGroupsExpanded',\n 'aggregationInfo',\n 'colOrder',\n 'columnAlias',\n 'columnWidths',\n 'customFields',\n 'externalState',\n 'freezeColumns',\n 'groups',\n 'renderFormatter',\n 'version',\n 'visibleColumns'\n] as const satisfies readonly (keyof State)[];\n\n/** Initial state of a preset, see {@link Meta.presetState}. */\nexport type PresetState = Partial<Pick<State, (typeof PRESET_STATE_KEYS)[number]>>;\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 /**\n * Id of the preset that is active on first render, instead of the personalization default (which does\n * not change). Read from the base meta only; ignored when it matches no preset.\n */\n initialPresetId?: string;\n /**\n * Initial state for an unpersonalized preset that cannot be reconstructed from `fieldDefs` and the\n * other Meta properties (e.g. column aliases, frozen columns, custom columns, custom grouping,\n * column widths and order, exact aggregation choices, external filter values). Everything Meta can\n * express (field visibility, sorting, filter, conditional styles, header icons, row height, gallery\n * layout) is hydrated from Meta itself and is intentionally not accepted here. `visibleColumns` is\n * accepted only because custom columns have no field definition to carry their visibility.\n * Only the keys in {@link PRESET_STATE_KEYS} are accepted. They override values reconstructed from\n * fieldDefs. `externalState` (keyed like {@link externalFilters}) makes external filters known\n * before the first data fetch. Preset identity, template and personalization remain controlled by\n * Meta and the current component state rather than this property.\n */\n presetState?: PresetState;\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 for the view. If set, the `fitHeightToElement` property will be ignored.\n * - `number` — explicit pixel height.\n * - CSS variable (e.g. `'--my-height'`) — height driven by a CSS custom property.\n * This takes precedence over `basicMode` height behavior.\n */\n height?: number | CSSVariable;\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 /**\n * Determines the view of a Repeating Structure.\n *\n * @remarks\n * **Template-specific constraints:**\n * - {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} and {@link REPEATING_STRUCTURE_TEMPLATES.MAP Map} do not support grouping.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.TIMELINE Timeline} supports only one grouping level.\n * - {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban} renders only the level-0 group as board lanes.\n * Configure the lane field through {@link Meta.fieldDefs fieldDefs} by setting\n * {@link FieldDef.grouping grouping} and {@link FieldDef.grouped grouped} to `true`,\n * with {@link FieldDef.groupOrder groupOrder} set to `0`.\n *\n * @default 'Table'\n */\n template?: (typeof REPEATING_STRUCTURE_TEMPLATES)[keyof typeof REPEATING_STRUCTURE_TEMPLATES];\n /** Configuration for card-based templates. Only applicable when {@link Meta.template template} is set to {@link REPEATING_STRUCTURE_TEMPLATES.GALLERY Gallery} or {@link REPEATING_STRUCTURE_TEMPLATES.KANBAN Kanban}. */\n cardConfig?: CardConfig;\n /** Allow editing on fields and if enabled then row actions are also enabled.\n *\n * Backward-compatible values:\n * - `boolean`: data- use case.\n * - {@link ActionConfig}: explicit edit behavior.\n *\n * @default false\n */\n editing?: boolean | ActionConfig;\n /** Allow deleting of rows.\n *\n * Backward-compatible values:\n * - `boolean`: data- use case.\n * - {@link ActionConfig}: explicit delete behavior.\n */\n deleting?: boolean | ActionConfig;\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 * Works only if the template is not set to timeline.\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 /**\n * Override the heading tag used for the {@link Meta.title title} title in the toolbar.\n * @default 'h2'\n */\n headingTag?: HeadingTag;\n /**\n * Show the repeating structure title.\n * @default true\n */\n showTitle?: boolean;\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 /** Allow switching between Table and Gallery templates at runtime via the toolbar.\n * Set to `false` for embedded tables where template switching is not supported.\n * @default true\n */\n allowSwitchTemplate?: 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 /**\n * Gallery-specific configuration. Card-content properties remain supported for backward\n * compatibility; use {@link Meta.cardConfig cardConfig} for new integrations.\n */\n galleryConfig?: GalleryConfig;\n // TODO: Narrow this type to a union of the known dx keys: `'PromotedFilters' | 'SEARCH_AND_SELECT_AS_EXTERNAL_FILTERS' | 'ADVANCED_SEARCH_AND_SELECT_AS_EXTERNAL_FILTERS'`.\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 /** Shows the row wrap toggle action in the toolbar.\n * Applicable only when {@link Meta.template template} is set to 'Table'.\n * @default true\n */\n showWrapAction?: 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 * @deprecated Provide the exact fieldDef configuration in the {@link FieldDef}.\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 * @deprecated Use {@link Meta.editing editing} property\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 * Configures a detail region for a selected Table item. Its absence disables Master Detail.\n * This is currently supported only when {@link Meta.template template} is set to\n * {@link REPEATING_STRUCTURE_TEMPLATES.TABLE Table}; it is removed during metadata\n * normalization for other templates.\n *\n */\n masterDetail?: MasterDetailConfig;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-core",
3
- "version": "10.0.0-build.10.2",
3
+ "version": "10.0.0-build.10.3",
4
4
  "description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pegasystems",
@@ -14,8 +14,8 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "10.0.0-build.10.2",
18
- "@pega/cosmos-react-core": "10.0.0-build.10.2",
17
+ "@pega/cosmos-react-condition-builder": "10.0.0-build.10.3",
18
+ "@pega/cosmos-react-core": "10.0.0-build.10.3",
19
19
  "@types/lodash-es": "^4.17.12",
20
20
  "dayjs": "^1.11.13",
21
21
  "fast-deep-equal": "^3.1.3",