@pega/lists-core 9.0.0-build.16.4 → 9.0.0-build.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ declare const _default: {
6
6
  readonly created_view: "Created view \"{0}\"";
7
7
  readonly created_view_with_default: "Created view \"{0}\" and marked as default view";
8
8
  readonly deleted_view: "Deleted view \"{0}\"";
9
- readonly view_navigation_instructions: "{0}, Refer to keyboard instructions for navigation.";
9
+ readonly view_navigation_instructions: "{0}, press {1} for keyboard navigation help.";
10
10
  readonly Actions: "Actions";
11
11
  readonly Select: "Select";
12
12
  readonly Reorder: "Reorder";
@@ -6,7 +6,7 @@ export default {
6
6
  created_view: 'Created view "{0}"',
7
7
  created_view_with_default: 'Created view "{0}" and marked as default view',
8
8
  deleted_view: 'Deleted view "{0}"',
9
- view_navigation_instructions: '{0}, Refer to keyboard instructions for navigation.',
9
+ view_navigation_instructions: '{0}, press {1} for keyboard navigation help.',
10
10
  Actions: 'Actions',
11
11
  Select: 'Select',
12
12
  Reorder: 'Reorder',
@@ -1 +1 @@
1
- {"version":3,"file":"defaultTranslations.js","sourceRoot":"","sources":["../../../src/core/defaultTranslations.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,EAAE,0BAA0B;IACzC,0BAA0B,EAAE,qDAAqD;IACjF,mBAAmB,EAAE,iCAAiC;IACtD,uBAAuB,EAAE,qCAAqC;IAC9D,YAAY,EAAE,oBAAoB;IAClC,yBAAyB,EAAE,+CAA+C;IAC1E,YAAY,EAAE,oBAAoB;IAClC,4BAA4B,EAAE,qDAAqD;IACnF,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC","sourcesContent":["export default {\n saved_changes: '\"{0}\" saved with changes',\n saved_changes_with_default: '\"{0}\" saved with changes and marked as default view',\n view_marked_default: '\"{0}\" view is marked as Default',\n view_marked_app_default: '\"{0}\" view is marked as App Default',\n created_view: 'Created view \"{0}\"',\n created_view_with_default: 'Created view \"{0}\" and marked as default view',\n deleted_view: 'Deleted view \"{0}\"',\n view_navigation_instructions: '{0}, Refer to keyboard instructions for navigation.',\n Actions: 'Actions',\n Select: 'Select',\n Reorder: 'Reorder',\n Error: 'Error'\n} as const;\n"]}
1
+ {"version":3,"file":"defaultTranslations.js","sourceRoot":"","sources":["../../../src/core/defaultTranslations.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,aAAa,EAAE,0BAA0B;IACzC,0BAA0B,EAAE,qDAAqD;IACjF,mBAAmB,EAAE,iCAAiC;IACtD,uBAAuB,EAAE,qCAAqC;IAC9D,YAAY,EAAE,oBAAoB;IAClC,yBAAyB,EAAE,+CAA+C;IAC1E,YAAY,EAAE,oBAAoB;IAClC,4BAA4B,EAAE,8CAA8C;IAC5E,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC","sourcesContent":["export default {\n saved_changes: '\"{0}\" saved with changes',\n saved_changes_with_default: '\"{0}\" saved with changes and marked as default view',\n view_marked_default: '\"{0}\" view is marked as Default',\n view_marked_app_default: '\"{0}\" view is marked as App Default',\n created_view: 'Created view \"{0}\"',\n created_view_with_default: 'Created view \"{0}\" and marked as default view',\n deleted_view: 'Deleted view \"{0}\"',\n view_navigation_instructions: '{0}, press {1} for keyboard navigation help.',\n Actions: 'Actions',\n Select: 'Select',\n Reorder: 'Reorder',\n Error: 'Error'\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/afterRender/animation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6HzD;;;;;;;;;;;;;;;;;;;GAmBG;+BAKuB,cAAc,YAAY;AAJpD,wBA8BE"}
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/afterRender/animation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAmIzD;;;;;;;;;;;;;;;;;;;GAmBG;+BAKuB,cAAc,YAAY;AAJpD,wBA8BE"}
@@ -96,11 +96,17 @@ const columnAnimation = ([{ getState, getView, getRsStore }]) => {
96
96
  }
97
97
  });
98
98
  }
99
+ const visibleColumns = getView().getVisibleColumns();
99
100
  rsStore.oldColumnBoundingBox.forEach((value, key) => {
100
101
  if (newColBoundingBox.has(key)) {
101
102
  const deltaX = value.left - newColBoundingBox.get(key).left;
102
103
  const domNodes = pNode?.querySelectorAll(`[data-col-id='${key}']`);
103
104
  if (deltaX) {
105
+ // FIXME: skipping animation on the last column because in case a record is added like in embedded tables, a vertical scrollbar appears momentarily which shifts the last column to left and this triggers unnecessary animation on last column.
106
+ const currentColumn = visibleColumns.find(col => col.field.id === key);
107
+ if (currentColumn?.isLastColumn) {
108
+ return;
109
+ }
104
110
  domNodes?.forEach(domNode => {
105
111
  animate(domNode, deltaX, 0);
106
112
  });
@@ -1 +1 @@
1
- {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/afterRender/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,OAAoB,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QACrB,qBAAqB,CAAC,GAAG,EAAE;YACzB,qCAAqC;YACrC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,cAAc,CAAC;YAC1C,8CAA8C;YAC9C,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,MAAM,OAAO,M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CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,oBAAoB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3D,MAAM,uBAAuB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IAEjE,OAAO,SAAS,OAAO,CAAC,YAA0B;QAChD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QACtC,oBAAoB,CAClB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,gBAAgB;YACtB,iGAAiG;YACjG,KAAK,CAAC,UAAU;YAChB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,oBAAoB;SAC3B,CACF,CAAC;QACF,uBAAuB,CACrB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,QAAQ;YACd,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,YAAY,CAAC,UAAU,EAAE,CAAC,4BAA4B;SACvD,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { State } from '../../../../../types/State.types';\nimport { withMemoization } from '../../../utils/util';\nimport type { FeatureProps } from '../../featureFactory';\n// Used in JsDoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type RsStore from '../../../RsStore';\n\n/**\n * Triggers animation on a {@link domNode} in X and Y direction by {@link deltaX} and {@link deltaY} respectively.\n * @param domNode - Dom node on which animation should be triggered.\n * @param deltaX - Range of movement on X axis.\n * @param deltaY - Range of movement on Y axis\n * @returns void\n */\nfunction animate(domNode: HTMLElement, deltaX = 150, deltaY = 150) {\n if (!domNode) return;\n if (deltaY || deltaX) {\n requestAnimationFrame(() => {\n // Ensure that it inverts immediately\n domNode.style.transition = 'transform 0s';\n // Before the DOM paints, Invert it to its old\n domNode.style.transform = `translate3d(${deltaX}px, ${deltaY}px, 0)`;\n\n requestAnimationFrame(() => {\n domNode.style.removeProperty('transform');\n domNode.style.removeProperty('transition');\n });\n });\n }\n}\n\n/**\n * Triggers column animation.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nconst rowAnimation = ([{ getState, getView, getRsStore }]: [featureProps: FeatureProps]) => {\n const { featuresToAvoid } = getState();\n const rsStore = getRsStore();\n let avoidRowAnimation = false;\n if (featuresToAvoid?.includes('rowAnimation')) {\n avoidRowAnimation = true;\n }\n // Row animation\n if (!avoidRowAnimation && rsStore.oldBoundingBox?.size) {\n const pNode = getView().getDomContainer();\n const rowContainer = pNode?.querySelector('.row-container'); // row container should wrap all the rows.\n\n // Calculate the bounding box\n const newBoundingBox = new Map();\n rowContainer?.childNodes.forEach(n => {\n if (n.nodeType === Node.ELEMENT_NODE && n instanceof Element && n.hasAttribute?.('data-key'))\n newBoundingBox.set(n.getAttribute('data-key'), n.getBoundingClientRect());\n });\n\n for (const [key, value] of newBoundingBox) {\n const rowNode = rowContainer?.querySelector<HTMLElement>(`[data-key='${CSS.escape(key)}']`);\n if (rsStore.oldBoundingBox.has(key)) {\n // Those elements that were in the dom earlier as well\n const deltaY = rsStore.oldBoundingBox.get(key)!.top - value.top;\n const deltaX = rsStore.oldBoundingBox.get(key)!.left - value.left;\n animate(rowNode!, deltaX, deltaY);\n } else {\n // Those elements that came in now\n animate(rowNode!, 0);\n }\n }\n rsStore.oldBoundingBox = null;\n }\n};\n\n/**\n * Evaluates if column animation needs to be skipped based on {@link State.featuresToAvoid}\n * @param featuresToAvoid\n * @returns boolean - true if columnAnimation should be skipped otherwise false.\n */\nfunction avoidColumnAnimation(featuresToAvoid: State['featuresToAvoid']) {\n return featuresToAvoid?.includes('columnAnimation');\n}\n/**\n * Triggers column animation.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nconst columnAnimation = ([{ getState, getView, getRsStore }]: [featureProps: FeatureProps]) => {\n const { featuresToAvoid } = getState();\n const rsStore = getRsStore();\n\n if (rsStore.skipColumnAnimationOnNextRun) {\n rsStore.skipColumnAnimationOnNextRun = false;\n return;\n }\n\n // Column animation\n if (!avoidColumnAnimation(featuresToAvoid) && rsStore.oldColumnBoundingBox?.size) {\n const pNode = getView().getDomContainer();\n\n // Calculate the bounding box\n const newColBoundingBox = new Map<string, DOMRect>();\n if (getView().getItemElement()) {\n getView()\n .getItemElement()!\n .childNodes.forEach(cell => {\n if (\n cell.nodeType === Node.ELEMENT_NODE &&\n cell instanceof Element &&\n cell.hasAttribute?.('data-col-id')\n ) {\n newColBoundingBox.set(cell.getAttribute('data-col-id')!, cell.getBoundingClientRect());\n }\n });\n }\n rsStore.oldColumnBoundingBox.forEach((value, key) => {\n if (newColBoundingBox.has(key)) {\n const deltaX = value.left - newColBoundingBox.get(key)!.left;\n const domNodes = pNode?.querySelectorAll<HTMLElement>(`[data-col-id='${key}']`);\n if (deltaX) {\n domNodes?.forEach(domNode => {\n animate(domNode, deltaX, 0);\n });\n }\n }\n });\n rsStore.oldColumnBoundingBox = null;\n }\n};\n\n/**\n * Handles animations for rows and columns\n * The animations are triggered based on changes to specific state properties:\n *\n * ### Row Animation Triggers\n * - {@link State.filterExpression}\n * - search text\n * - {@link State.sortingOrder}\n * - {@link State.groups}\n * - {@link State.refresh}\n * - {@link State.selectedHeightOption}\n *\n * ### Column Animation Triggers\n * - {@link State.freezeColumns}\n * - {@link State.colOrder}\n * - {@link State.hiddenColumns}\n * - {@link State.columnWidths}\n * - {@link State.refresh}\n * - {@link RsStore.skipColumnAnimationOnNextRun}\n */\nexport default () => {\n const memoizedRowAnimation = withMemoization(rowAnimation);\n const memoizedColumnAnimation = withMemoization(columnAnimation);\n\n return function execute(featureProps: FeatureProps) {\n const state = featureProps.getState();\n memoizedRowAnimation(\n [featureProps],\n [\n state.filterExpression,\n // @ts-expect-error Property 'searchText' does not exist on type 'State' but exists on view.state\n state.searchText,\n state.sortingOrder,\n state.groups,\n state.refresh,\n state.selectedHeightOption\n ]\n );\n memoizedColumnAnimation(\n [featureProps],\n [\n state.freezeColumns,\n state.colOrder,\n state.hiddenColumns,\n state.columnWidths,\n state.refresh,\n featureProps.getRsStore().skipColumnAnimationOnNextRun\n ]\n );\n };\n};\n"]}
1
+ {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/afterRender/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,OAAoB,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QACrB,qBAAqB,CAAC,GAAG,EAAE;YACzB,qCAAqC;YACrC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,cAAc,CAAC;YAC1C,8CAA8C;YAC9C,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,MAAM,OAAO,MAAM,QAAQ,CAAC;YAErE,qBAAqB,CAAC,GAAG,EAAE;gBACzB,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,CAA+B,EAAE,EAAE;IACzF,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;Q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AAC;QACtC,oBAAoB,CAClB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,gBAAgB;YACtB,iGAAiG;YACjG,KAAK,CAAC,UAAU;YAChB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,oBAAoB;SAC3B,CACF,CAAC;QACF,uBAAuB,CACrB,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,QAAQ;YACd,KAAK,CAAC,aAAa;YACnB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,YAAY,CAAC,UAAU,EAAE,CAAC,4BAA4B;SACvD,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { State } from '../../../../../types/State.types';\nimport { withMemoization } from '../../../utils/util';\nimport type { FeatureProps } from '../../featureFactory';\n// Used in JsDoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type RsStore from '../../../RsStore';\n\n/**\n * Triggers animation on a {@link domNode} in X and Y direction by {@link deltaX} and {@link deltaY} respectively.\n * @param domNode - Dom node on which animation should be triggered.\n * @param deltaX - Range of movement on X axis.\n * @param deltaY - Range of movement on Y axis\n * @returns void\n */\nfunction animate(domNode: HTMLElement, deltaX = 150, deltaY = 150) {\n if (!domNode) return;\n if (deltaY || deltaX) {\n requestAnimationFrame(() => {\n // Ensure that it inverts immediately\n domNode.style.transition = 'transform 0s';\n // Before the DOM paints, Invert it to its old\n domNode.style.transform = `translate3d(${deltaX}px, ${deltaY}px, 0)`;\n\n requestAnimationFrame(() => {\n domNode.style.removeProperty('transform');\n domNode.style.removeProperty('transition');\n });\n });\n }\n}\n\n/**\n * Triggers column animation.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nconst rowAnimation = ([{ getState, getView, getRsStore }]: [featureProps: FeatureProps]) => {\n const { featuresToAvoid } = getState();\n const rsStore = getRsStore();\n let avoidRowAnimation = false;\n if (featuresToAvoid?.includes('rowAnimation')) {\n avoidRowAnimation = true;\n }\n // Row animation\n if (!avoidRowAnimation && rsStore.oldBoundingBox?.size) {\n const pNode = getView().getDomContainer();\n const rowContainer = pNode?.querySelector('.row-container'); // row container should wrap all the rows.\n\n // Calculate the bounding box\n const newBoundingBox = new Map();\n rowContainer?.childNodes.forEach(n => {\n if (n.nodeType === Node.ELEMENT_NODE && n instanceof Element && n.hasAttribute?.('data-key'))\n newBoundingBox.set(n.getAttribute('data-key'), n.getBoundingClientRect());\n });\n\n for (const [key, value] of newBoundingBox) {\n const rowNode = rowContainer?.querySelector<HTMLElement>(`[data-key='${CSS.escape(key)}']`);\n if (rsStore.oldBoundingBox.has(key)) {\n // Those elements that were in the dom earlier as well\n const deltaY = rsStore.oldBoundingBox.get(key)!.top - value.top;\n const deltaX = rsStore.oldBoundingBox.get(key)!.left - value.left;\n animate(rowNode!, deltaX, deltaY);\n } else {\n // Those elements that came in now\n animate(rowNode!, 0);\n }\n }\n rsStore.oldBoundingBox = null;\n }\n};\n\n/**\n * Evaluates if column animation needs to be skipped based on {@link State.featuresToAvoid}\n * @param featuresToAvoid\n * @returns boolean - true if columnAnimation should be skipped otherwise false.\n */\nfunction avoidColumnAnimation(featuresToAvoid: State['featuresToAvoid']) {\n return featuresToAvoid?.includes('columnAnimation');\n}\n/**\n * Triggers column animation.\n * @param featureProps - A tuple containing an object of feature props.\n * @returns void\n */\nconst columnAnimation = ([{ getState, getView, getRsStore }]: [featureProps: FeatureProps]) => {\n const { featuresToAvoid } = getState();\n const rsStore = getRsStore();\n\n if (rsStore.skipColumnAnimationOnNextRun) {\n rsStore.skipColumnAnimationOnNextRun = false;\n return;\n }\n\n // Column animation\n if (!avoidColumnAnimation(featuresToAvoid) && rsStore.oldColumnBoundingBox?.size) {\n const pNode = getView().getDomContainer();\n\n // Calculate the bounding box\n const newColBoundingBox = new Map<string, DOMRect>();\n if (getView().getItemElement()) {\n getView()\n .getItemElement()!\n .childNodes.forEach(cell => {\n if (\n cell.nodeType === Node.ELEMENT_NODE &&\n cell instanceof Element &&\n cell.hasAttribute?.('data-col-id')\n ) {\n newColBoundingBox.set(cell.getAttribute('data-col-id')!, cell.getBoundingClientRect());\n }\n });\n }\n const visibleColumns = getView().getVisibleColumns();\n rsStore.oldColumnBoundingBox.forEach((value, key) => {\n if (newColBoundingBox.has(key)) {\n const deltaX = value.left - newColBoundingBox.get(key)!.left;\n const domNodes = pNode?.querySelectorAll<HTMLElement>(`[data-col-id='${key}']`);\n if (deltaX) {\n // FIXME: skipping animation on the last column because in case a record is added like in embedded tables, a vertical scrollbar appears momentarily which shifts the last column to left and this triggers unnecessary animation on last column.\n const currentColumn = visibleColumns.find(col => col.field.id === key);\n if (currentColumn?.isLastColumn) {\n return;\n }\n domNodes?.forEach(domNode => {\n animate(domNode, deltaX, 0);\n });\n }\n }\n });\n rsStore.oldColumnBoundingBox = null;\n }\n};\n\n/**\n * Handles animations for rows and columns\n * The animations are triggered based on changes to specific state properties:\n *\n * ### Row Animation Triggers\n * - {@link State.filterExpression}\n * - search text\n * - {@link State.sortingOrder}\n * - {@link State.groups}\n * - {@link State.refresh}\n * - {@link State.selectedHeightOption}\n *\n * ### Column Animation Triggers\n * - {@link State.freezeColumns}\n * - {@link State.colOrder}\n * - {@link State.hiddenColumns}\n * - {@link State.columnWidths}\n * - {@link State.refresh}\n * - {@link RsStore.skipColumnAnimationOnNextRun}\n */\nexport default () => {\n const memoizedRowAnimation = withMemoization(rowAnimation);\n const memoizedColumnAnimation = withMemoization(columnAnimation);\n\n return function execute(featureProps: FeatureProps) {\n const state = featureProps.getState();\n memoizedRowAnimation(\n [featureProps],\n [\n state.filterExpression,\n // @ts-expect-error Property 'searchText' does not exist on type 'State' but exists on view.state\n state.searchText,\n state.sortingOrder,\n state.groups,\n state.refresh,\n state.selectedHeightOption\n ]\n );\n memoizedColumnAnimation(\n [featureProps],\n [\n state.freezeColumns,\n state.colOrder,\n state.hiddenColumns,\n state.columnWidths,\n state.refresh,\n featureProps.getRsStore().skipColumnAnimationOnNextRun\n ]\n );\n };\n};\n"]}
@@ -9,12 +9,6 @@ import type View from '../../../../generators/ViewGenerator';
9
9
  * @returns column width in pixels.
10
10
  */
11
11
  export declare function autoSizeOfColumn(column: Column, domContainer: NonNullable<View['domContainer']>, forceAutoSize?: boolean): number;
12
- /**
13
- * Calculates the maximum width available in the dom container
14
- * @param domContainer The HTML element that acts as the container for RS.
15
- * @returns Maximum available width.
16
- */
17
- export declare function getMaxAvailableWidth(domContainer: NonNullable<View['domContainer']>): number;
18
12
  /**
19
13
  * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..
20
14
  *
@@ -1 +1 @@
1
- {"version":3,"file":"autoSize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAK7D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,UA0DtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,UAmBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,KAAK,CAAC,EAAE,OAAO;;EA8BhB"}
1
+ {"version":3,"file":"autoSize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAI7D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,UA0DtB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,KAAK,CAAC,EAAE,OAAO;;EAahB"}
@@ -1,5 +1,4 @@
1
1
  import { expandCollapseAllMeta, rowSelectColumnMeta } from '../../../../constants';
2
- import { getScrollbarWidth } from '../../../../utils/util';
3
2
  /**
4
3
  * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.
5
4
  *
@@ -56,31 +55,6 @@ export function autoSizeOfColumn(column, domContainer, forceAutoSize = false) {
56
55
  ? column.field.maxWidth
57
56
  : autoSize;
58
57
  }
59
- /**
60
- * Calculates the maximum width available in the dom container
61
- * @param domContainer The HTML element that acts as the container for RS.
62
- * @returns Maximum available width.
63
- */
64
- export function getMaxAvailableWidth(domContainer) {
65
- let width = domContainer.clientWidth - getScrollbarWidth();
66
- const firstCell = domContainer.querySelector('.cell');
67
- if (!firstCell) {
68
- return width;
69
- }
70
- let element = firstCell.parentElement;
71
- let style = null;
72
- let margin = 0;
73
- let padding = 0;
74
- while (element !== domContainer.parentElement) {
75
- // @ts-expect-error Property 'currentStyle' does not exist on type 'HTMLElement' This was used for IE browser initially. Check if it can be removed.
76
- style = element.currentStyle || window.getComputedStyle(element);
77
- margin = parseFloat(style.marginLeft) + parseFloat(style.marginRight);
78
- padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
79
- width -= padding + margin + element.offsetWidth - element.clientWidth;
80
- element = element.parentElement;
81
- }
82
- return width;
83
- }
84
58
  /**
85
59
  * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..
86
60
  *
@@ -90,32 +64,15 @@ export function getMaxAvailableWidth(domContainer) {
90
64
  * @returns An object containing width for each column.
91
65
  */
92
66
  export function autoSizeOfColumns(columns, domContainer, reset) {
93
- let totalCalculatedWidth = 0;
94
67
  const columnAutoSizes = {};
95
- const remainingAvailableWidth = getMaxAvailableWidth(domContainer);
96
68
  columns.forEach(column => {
97
- if (!column.hidden) {
98
- if (!(column.currentWidth && reset === undefined)) {
99
- // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.
100
- const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;
101
- const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);
102
- columnAutoSizes[column.field.id] = autoSize;
103
- totalCalculatedWidth += autoSize;
104
- }
105
- else {
106
- totalCalculatedWidth += column.currentWidth;
107
- }
69
+ if (!column.hidden && !(column.currentWidth && reset === undefined)) {
70
+ // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.
71
+ const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;
72
+ const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);
73
+ columnAutoSizes[column.field.id] = autoSize;
108
74
  }
109
75
  });
110
- const extraSpace = remainingAvailableWidth - totalCalculatedWidth;
111
- if (extraSpace <= 0 || Number.isNaN(extraSpace))
112
- return columnAutoSizes;
113
- const columnToFillRemainingSpace = columns.find(c => c.field.fillAvailableSpace);
114
- if (columnToFillRemainingSpace && !columnToFillRemainingSpace.hidden) {
115
- columnAutoSizes[columnToFillRemainingSpace.field.id] =
116
- (columnAutoSizes[columnToFillRemainingSpace.field.id] ??
117
- columnToFillRemainingSpace.currentWidth) + extraSpace;
118
- }
119
76
  return columnAutoSizes;
120
77
  }
121
78
  //# sourceMappingURL=autoSize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,YAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,+CAA+C;QAC/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACxD,IAAI,iBAAiB;YAAE,OAAO,iBAAiB,CAAC;QAChD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IACpD,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,MAAM,EACJ,6BAA6B,EAC7B,KAAK,EAAE,EAAE,qBAAqB,EAAE,EACjC,GAAG,IAAI,CAAC;IACT,oEAAoE;IACpE,iCAAiC;IACjC,MAAM,KAAK,GAAG,YAAY,CAAC,gBAAgB,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;IAClF,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,wBAAwB;IACzD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzB,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,GAAG,GAAG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CAAC;IAC5D,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ColumnResizePayload } from '../../../../actions/actions.types';\nimport { expandCollapseAllMeta, rowSelectColumnMeta } from '../../../../constants';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\nimport { getScrollbarWidth } from '../../../../utils/util';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../../../../types/Meta.types';\n\n/**\n * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.\n *\n * @param column - A column object representing column in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param forceAutoSize - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns column width in pixels.\n */\nexport function autoSizeOfColumn(\n column: Column,\n domContainer: NonNullable<View['domContainer']>,\n forceAutoSize = false\n) {\n if (!forceAutoSize) {\n // This will be executed in case of reset width\n const personalizedWidth = column.getPersonalizedWidth();\n if (personalizedWidth) return personalizedWidth;\n if (column.field.width) return column.field.width;\n }\n\n const view = column.parent;\n const {\n showGroupingExpandCollapseAll,\n state: { showSelectAllCheckbox }\n } = view;\n // Condition for double click event triggered to autosize the column\n /* Autosize calculations begin */\n const cells = domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`);\n const holder = document.createElement('div');\n holder.style.width = '100000px'; // some very high number\n const span = document.createElement('span');\n holder.appendChild(span);\n domContainer.appendChild(holder);\n cells.forEach(cell => {\n const row = document.createElement('div');\n row.style.display = 'table-row';\n cell.childNodes.forEach(child => row.appendChild(child.cloneNode(true)));\n span.appendChild(row);\n });\n let autoSize = Math.ceil(span.getBoundingClientRect().width);\n const iconsPlaceholder = domContainer.querySelector<HTMLElement>(\n `.header .cell[data-col-id=\"${column.field.id}\"] .icons-ph`\n );\n // If grouping and select all functionality are enabled and selection is the first column, reserve extra space in Row select header column to accommodate expand all button.\n const reserveSpaceForGroupToggleButton =\n showGroupingExpandCollapseAll &&\n showSelectAllCheckbox &&\n column.field.id === rowSelectColumnMeta.field.id &&\n // TODO: Selectors should not be hardcoded in rsCore OR it should come via proper contract.\n domContainer.querySelector<HTMLElement>(\n `.row .cell[data-col-id=\"${rowSelectColumnMeta.field.id}\"]:first-child`\n );\n\n if (iconsPlaceholder) {\n autoSize += iconsPlaceholder.offsetWidth;\n }\n if (reserveSpaceForGroupToggleButton) {\n const expandCollapseAllElement = domContainer.querySelector<HTMLElement>(\n expandCollapseAllMeta.selector\n );\n autoSize += expandCollapseAllElement ? expandCollapseAllElement.offsetWidth : 0;\n }\n domContainer.removeChild(holder);\n // Increased spacing style width by 1px to account for offsetWidth rounding off, this was causing truncation.\n autoSize += 17; // 17px for Spacing styles applied (Fetching applied styles is costly, so keeping some visible space)\n // Allow columns to autosize till a restricted max width\n return column.field.maxWidth && autoSize > column.field.maxWidth\n ? column.field.maxWidth\n : autoSize;\n}\n\n/**\n * Calculates the maximum width available in the dom container\n * @param domContainer The HTML element that acts as the container for RS.\n * @returns Maximum available width.\n */\nexport function getMaxAvailableWidth(domContainer: NonNullable<View['domContainer']>) {\n let width = domContainer.clientWidth - getScrollbarWidth();\n const firstCell = domContainer.querySelector('.cell');\n if (!firstCell) {\n return width;\n }\n let element = firstCell.parentElement!;\n let style = null;\n let margin = 0;\n let padding = 0;\n while (element !== domContainer.parentElement) {\n // @ts-expect-error Property 'currentStyle' does not exist on type 'HTMLElement' This was used for IE browser initially. Check if it can be removed.\n style = element.currentStyle || window.getComputedStyle(element);\n margin = parseFloat(style.marginLeft) + parseFloat(style.marginRight);\n padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n width -= padding + margin + element.offsetWidth - element.clientWidth;\n element = element.parentElement!;\n }\n return width;\n}\n\n/**\n * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..\n *\n * @param columns - An array of `Column` objects representing the columns in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param reset - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns An object containing width for each column.\n */\nexport function autoSizeOfColumns(\n columns: Column[],\n domContainer: NonNullable<View['domContainer']>,\n reset?: boolean\n) {\n let totalCalculatedWidth = 0;\n const columnAutoSizes: ColumnResizePayload['data'] = {};\n\n const remainingAvailableWidth = getMaxAvailableWidth(domContainer);\n\n columns.forEach(column => {\n if (!column.hidden) {\n if (!(column.currentWidth && reset === undefined)) {\n // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.\n const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;\n const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);\n columnAutoSizes[column.field.id] = autoSize;\n totalCalculatedWidth += autoSize;\n } else {\n totalCalculatedWidth += column.currentWidth;\n }\n }\n });\n const extraSpace = remainingAvailableWidth - totalCalculatedWidth;\n if (extraSpace <= 0 || Number.isNaN(extraSpace)) return columnAutoSizes;\n const columnToFillRemainingSpace = columns.find(c => c.field.fillAvailableSpace);\n\n if (columnToFillRemainingSpace && !columnToFillRemainingSpace.hidden) {\n columnAutoSizes[columnToFillRemainingSpace.field.id] =\n (columnAutoSizes[columnToFillRemainingSpace.field.id] ??\n columnToFillRemainingSpace.currentWidth) + extraSpace;\n }\n return columnAutoSizes;\n}\n"]}
1
+ {"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAMnF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,YAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,+CAA+C;QAC/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACxD,I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AAC;YACpE,+IAA+I;YAC/I,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,mBAAmB,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;YACjF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;YACvE,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import type { ColumnResizePayload } from '../../../../actions/actions.types';\nimport { expandCollapseAllMeta, rowSelectColumnMeta } from '../../../../constants';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef } from '../../../../../../types/Meta.types';\n\n/**\n * Calculates the width of column based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width.\n *\n * @param column - A column object representing column in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param forceAutoSize - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns column width in pixels.\n */\nexport function autoSizeOfColumn(\n column: Column,\n domContainer: NonNullable<View['domContainer']>,\n forceAutoSize = false\n) {\n if (!forceAutoSize) {\n // This will be executed in case of reset width\n const personalizedWidth = column.getPersonalizedWidth();\n if (personalizedWidth) return personalizedWidth;\n if (column.field.width) return column.field.width;\n }\n\n const view = column.parent;\n const {\n showGroupingExpandCollapseAll,\n state: { showSelectAllCheckbox }\n } = view;\n // Condition for double click event triggered to autosize the column\n /* Autosize calculations begin */\n const cells = domContainer.querySelectorAll(`[data-col-id=\"${column.field.id}\"]`);\n const holder = document.createElement('div');\n holder.style.width = '100000px'; // some very high number\n const span = document.createElement('span');\n holder.appendChild(span);\n domContainer.appendChild(holder);\n cells.forEach(cell => {\n const row = document.createElement('div');\n row.style.display = 'table-row';\n cell.childNodes.forEach(child => row.appendChild(child.cloneNode(true)));\n span.appendChild(row);\n });\n let autoSize = Math.ceil(span.getBoundingClientRect().width);\n const iconsPlaceholder = domContainer.querySelector<HTMLElement>(\n `.header .cell[data-col-id=\"${column.field.id}\"] .icons-ph`\n );\n // If grouping and select all functionality are enabled and selection is the first column, reserve extra space in Row select header column to accommodate expand all button.\n const reserveSpaceForGroupToggleButton =\n showGroupingExpandCollapseAll &&\n showSelectAllCheckbox &&\n column.field.id === rowSelectColumnMeta.field.id &&\n // TODO: Selectors should not be hardcoded in rsCore OR it should come via proper contract.\n domContainer.querySelector<HTMLElement>(\n `.row .cell[data-col-id=\"${rowSelectColumnMeta.field.id}\"]:first-child`\n );\n\n if (iconsPlaceholder) {\n autoSize += iconsPlaceholder.offsetWidth;\n }\n if (reserveSpaceForGroupToggleButton) {\n const expandCollapseAllElement = domContainer.querySelector<HTMLElement>(\n expandCollapseAllMeta.selector\n );\n autoSize += expandCollapseAllElement ? expandCollapseAllElement.offsetWidth : 0;\n }\n domContainer.removeChild(holder);\n // Increased spacing style width by 1px to account for offsetWidth rounding off, this was causing truncation.\n autoSize += 17; // 17px for Spacing styles applied (Fetching applied styles is costly, so keeping some visible space)\n // Allow columns to autosize till a restricted max width\n return column.field.maxWidth && autoSize > column.field.maxWidth\n ? column.field.maxWidth\n : autoSize;\n}\n\n/**\n * Calculates the width of columns based on their content size. If a column already has a width specified in {@link FieldDef.width} or through {@link column.getPersonalizedWidth personalization}, then that width will be honored over content size width..\n *\n * @param columns - An array of `Column` objects representing the columns in the view.\n * @param domContainer - The HTML element that acts as the container for RS.\n * @param reset - A boolean flag that indicates whether to force a recalculation of column widths.\n * @returns An object containing width for each column.\n */\nexport function autoSizeOfColumns(\n columns: Column[],\n domContainer: NonNullable<View['domContainer']>,\n reset?: boolean\n) {\n const columnAutoSizes: ColumnResizePayload['data'] = {};\n\n columns.forEach(column => {\n if (!column.hidden && !(column.currentWidth && reset === undefined)) {\n // always calculate the content based width for row selection column because it's width will change depending on if grouping is applied or not.\n const forceAutosize = column.field.id === rowSelectColumnMeta.field.id || !reset;\n const autoSize = autoSizeOfColumn(column, domContainer, forceAutosize);\n columnAutoSizes[column.field.id] = autoSize;\n }\n });\n return columnAutoSizes;\n}\n"]}
@@ -1,13 +1,11 @@
1
1
  import type { State } from '../../../../../../types/State.types';
2
- import type Column from '../../../../generators/ColumnGenerator';
3
2
  import type View from '../../../../generators/ViewGenerator';
4
3
  import type { BeforeRenderFeatureProps } from '../../../featureFactory';
5
4
  export declare const COLUMN_RESIZING_CLASS = "column-resizing";
6
5
  export declare function setColumnStyle(domContainer: View['domContainer'], style: string, columnId: number, value: number): void;
7
- export declare const resizedColumnWidth: (column: Column, distanceDragged: number) => number;
8
6
  export declare const getNextFrozenColumns: (columnId: string, freezeColumns?: State["freezeColumns"]) => string[];
9
- export declare const columnResizerProps: ([{ getState, getView, dispatch }]: [featureProps: BeforeRenderFeatureProps]) => {
10
- onMouseDown: (e: MouseEvent) => boolean;
7
+ export declare const columnResizerProps: ([{ getState, getView, dispatch }]: [BeforeRenderFeatureProps]) => {
8
+ onMouseDown: (e: MouseEvent) => void;
11
9
  };
12
10
  declare const _default: () => (featureProps: BeforeRenderFeatureProps) => void;
13
11
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/beforeRender/columnSizing/resize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAE7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,QAKd;AAED,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,iBAAiB,MAAM,WAOzE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,gBAAe,KAAK,CAAC,eAAe,CAAM,aAU3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,mCAAmC,CACpE,YAAY,EAAE,wBAAwB,CACvC;qBAiEyB,UAAU;CA+BnC,CAAC;+BAKwB,cAAc,wBAAwB;AAHhE,wBAWE"}
1
+ {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/beforeRender/columnSizing/resize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAGjE,OAAO,KAAK,IAAI,MAAM,sCAAsC,CAAC;AAE7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,EAClC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,QAGd;AAmBD,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,gBAAe,KAAK,CAAC,eAAe,CAAM,aAU3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,mCAAmC,CACpE,wBAAwB,CACzB;qBAmFyB,UAAU;CAmCnC,CAAC;+BAKwB,cAAc,wBAAwB;AAHhE,wBAWE"}
@@ -1,17 +1,19 @@
1
+ import { isInstance } from '@pega/cosmos-react-core';
1
2
  import { actionColumnResize, actionColumnAutoSize } from '../../../../actions/actions';
2
3
  import { withMemoization } from '../../../../utils/util';
3
4
  import { calculateFieldLeft } from '../freeze';
4
5
  export const COLUMN_RESIZING_CLASS = 'column-resizing';
5
6
  export function setColumnStyle(domContainer, style, columnId, value) {
6
- if (domContainer && domContainer.style) {
7
- domContainer.style.setProperty(`--col-${style}-${columnId}`, `${value}px`);
8
- }
7
+ domContainer?.style?.setProperty(`--col-${style}-${columnId}`, `${value}px`);
9
8
  }
10
- export const resizedColumnWidth = (column, distanceDragged) => {
11
- const existingWidth = column.currentWidth || column.field.width || column.field.minWidth;
12
- let width = existingWidth + distanceDragged;
13
- if (width < column.field.minWidth) {
14
- width = column.field.minWidth;
9
+ const getResizedColumnWidth = (column, distanceDragged, currentCell) => {
10
+ const currentWidth = column.field.fillAvailableSpace
11
+ ? currentCell?.offsetWidth ?? 0
12
+ : column.currentWidth ?? column.field.width ?? column.field.minWidth ?? 0;
13
+ let width = currentWidth + distanceDragged;
14
+ // TODO: confirm with designers if we want to limit the column sizing within the maxWidth(if defined on fieldDef). Currently only minWidth is getting honored.
15
+ if (width < (column.field.minWidth ?? 0)) {
16
+ width = column.field.minWidth ?? 0;
15
17
  }
16
18
  return width;
17
19
  };
@@ -27,15 +29,18 @@ export const getNextFrozenColumns = (columnId, freezeColumns = []) => {
27
29
  };
28
30
  export const columnResizerProps = ([{ getState, getView, dispatch }]) => {
29
31
  const { freezeColumns, hiddenColumns, columnWidths = {} } = getState();
30
- let column = {};
32
+ let column;
31
33
  let startPosition = 0;
32
34
  let resized = false;
33
35
  let updatedWidth = 0;
34
36
  let currentCell = null;
35
- let nextFrozenColumns = []; // Contains next frozen columns with left positions to apply left on resize
37
+ let currentCellOccupiedWidthBeforeResize = 0;
38
+ let nextFrozenColumns = [];
36
39
  const updateWidth = (distance) => {
37
- updatedWidth = resizedColumnWidth({ ...column, currentWidth: column.currentWidth }, distance);
38
- column = column.setProp('currentWidth', updatedWidth); // Updating current width
40
+ if (!column)
41
+ return;
42
+ updatedWidth = getResizedColumnWidth({ ...column, currentWidth: column.currentWidth }, distance, currentCell);
43
+ column = column.setProp('currentWidth', updatedWidth);
39
44
  setColumnStyle(getView().getDomContainer(), 'width', column.field.idHash, updatedWidth);
40
45
  };
41
46
  /**
@@ -43,29 +48,40 @@ export const columnResizerProps = ([{ getState, getView, dispatch }]) => {
43
48
  */
44
49
  const updateLefts = () => {
45
50
  nextFrozenColumns.forEach(colId => {
46
- const left = calculateFieldLeft(colId, getView().columns, freezeColumns, hiddenColumns, { ...columnWidths, [column.field.id]: updatedWidth } // injecting the resized width to current column
51
+ const left = calculateFieldLeft(colId, getView().columns, freezeColumns, hiddenColumns, column ? { ...columnWidths, [column.field.id]: updatedWidth } : columnWidths // injecting the resized width to current column
47
52
  );
48
53
  const nextFrozenColumn = getView().columns?.find(c => `${c.field.id}` === colId);
49
54
  setColumnStyle(getView().getDomContainer(), 'left', nextFrozenColumn.field.idHash, left);
50
55
  });
51
56
  };
52
57
  const resizeHandler = (e) => {
58
+ if (!currentCell || !column)
59
+ return;
53
60
  e.preventDefault();
54
61
  const distance = e.clientX - startPosition;
62
+ const parentContainer = getView().getVirtualizeElement('rootVirtualiser')?.getParentContainer();
63
+ const clientWidth = parentContainer?.clientWidth ?? 0;
64
+ const scrollWidth = parentContainer?.scrollWidth ?? 0;
65
+ // Prevent reducing size for fillAvailableSpace column if the size reduction will introduce empty space in the table.
66
+ const preventSizeReductionForFillAvailableSpaceColumn = column.field.fillAvailableSpace &&
67
+ distance <= 0 &&
68
+ currentCellOccupiedWidthBeforeResize <= (currentCell.offsetWidth ?? 0) &&
69
+ clientWidth === scrollWidth;
70
+ if (preventSizeReductionForFillAvailableSpaceColumn) {
71
+ return;
72
+ }
55
73
  if (distance !== 0) {
56
- column =
57
- getView().columns?.find(c => `${c.field.id}` === currentCell?.dataset.colId) ??
58
- {};
59
74
  updateWidth(distance);
60
75
  updateLefts();
61
76
  resized = true;
62
77
  }
63
78
  startPosition = e.clientX;
64
- return false;
65
79
  };
66
80
  const resizeEndHandler = (e) => {
67
81
  e.preventDefault();
68
82
  const domContainer = getView().getDomContainer();
83
+ if (!domContainer || !currentCell || !column)
84
+ return;
69
85
  domContainer.removeEventListener('mousemove', resizeHandler);
70
86
  domContainer.removeEventListener('mouseup', resizeEndHandler);
71
87
  domContainer.removeEventListener('mouseleave', resizeEndHandler);
@@ -76,35 +92,37 @@ export const columnResizerProps = ([{ getState, getView, dispatch }]) => {
76
92
  currentCell.style.pointerEvents = 'auto';
77
93
  currentCell.classList.toggle(COLUMN_RESIZING_CLASS);
78
94
  domContainer.classList.toggle(COLUMN_RESIZING_CLASS);
79
- return false;
80
95
  };
81
96
  const onMouseDown = (e) => {
97
+ if (!isInstance(e.target, HTMLElement))
98
+ return;
82
99
  e.preventDefault();
83
100
  e.stopPropagation();
84
- startPosition = e.clientX;
85
101
  const domContainer = getView().getDomContainer();
102
+ if (!domContainer)
103
+ return;
86
104
  domContainer.addEventListener('mousemove', resizeHandler);
87
105
  domContainer.addEventListener('mouseup', resizeEndHandler);
88
106
  domContainer.addEventListener('mouseleave', resizeEndHandler);
89
107
  currentCell = e.target.closest('.cell');
108
+ if (!currentCell)
109
+ return;
90
110
  currentCell.style.pointerEvents = 'none';
91
- if (e.detail >= 2) {
92
- // It is a double click so ask for a resize on column
93
- const col = getView().columns?.find(c => `${c.field.id}` === currentCell.dataset.colId);
94
- if (col?.field?.resize) {
95
- dispatch(actionColumnAutoSize(col, getView().getDomContainer(), true));
96
- }
111
+ column = getView().columns?.find(c => `${c.field.id}` === currentCell?.dataset.colId);
112
+ if (!column)
113
+ return;
114
+ startPosition = e.clientX;
115
+ currentCellOccupiedWidthBeforeResize = currentCell.offsetWidth ?? 0;
116
+ if (e.detail >= 2 && column.field.resize) {
117
+ dispatch(actionColumnAutoSize(column, domContainer, true));
97
118
  }
98
119
  currentCell.classList.toggle(COLUMN_RESIZING_CLASS);
99
120
  domContainer.classList.toggle(COLUMN_RESIZING_CLASS);
100
121
  // TODO: getState().freezeColumns should
101
122
  // give latest state after the action triggered from current feature only on above lines. Check this.
102
123
  nextFrozenColumns = getNextFrozenColumns(currentCell.dataset.colId, getState().freezeColumns);
103
- return false;
104
- };
105
- return {
106
- onMouseDown
107
124
  };
125
+ return { onMouseDown };
108
126
  };
109
127
  export default () => {
110
128
  const memoizedColumnResize = withMemoization(columnResizerProps);
@@ -1 +1 @@
1
- {"version":3,"file":"resize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/beforeRender/columnSizing/resize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,MAAM,UAAU,cAAc,CAC5B,YAAkC,EAClC,KAAa,EACb,QAAgB,EAChB,KAAa;IAEb,IAAI,YAAY,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACvC,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,KAAK,IAAI,QAAQ,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,eAAuB,EAAE,EAAE;IAC5E,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;IACzF,IAAI,KAAK,GAAG,aAAc,GAAG,eAAe,CAAC;IAC7C,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAS,EAAE,CAAC;QACnC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;IACjC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,QAAgB,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,CAAC,CACnF,CAAC;IACN,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { State } from '../../../../../../types/State.types';\nimport { actionColumnResize, actionColumnAutoSize } from '../../../../actions/actions';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\nimport { withMemoization } from '../../../../utils/util';\nimport type { BeforeRenderFeatureProps } from '../../../featureFactory';\nimport { calculateFieldLeft } from '../freeze';\n\nexport const COLUMN_RESIZING_CLASS = 'column-resizing';\n\nexport function setColumnStyle(\n domContainer: View['domContainer'],\n style: string,\n columnId: number,\n value: number\n) {\n if (domContainer && domContainer.style) {\n domContainer.style.setProperty(`--col-${style}-${columnId}`, `${value}px`);\n }\n}\n\nexport const resizedColumnWidth = (column: Column, distanceDragged: number) => {\n const existingWidth = column.currentWidth || column.field.width || column.field.minWidth;\n let width = existingWidth! + distanceDragged;\n if (width < column.field.minWidth!) {\n width = column.field.minWidth!;\n }\n return width;\n};\n\nexport const getNextFrozenColumns = (\n columnId: string,\n freezeColumns: State['freezeColumns'] = []\n) => {\n const nextFrozenColumns = [];\n const freezeColIndex = freezeColumns.indexOf(columnId); // If current column freezed\n if (freezeColIndex > -1) {\n for (let i = freezeColIndex + 1; i < freezeColumns.length; i += 1) {\n nextFrozenColumns.push(freezeColumns[i]);\n }\n }\n return nextFrozenColumns;\n};\n\nexport const columnResizerProps = ([{ getState, getView, dispatch }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { freezeColumns, hiddenColumns, columnWidths = {} } = getState();\n let column: Column = {} as Column;\n let startPosition = 0;\n let resized = false;\n let updatedWidth = 0;\n let currentCell: HTMLElement | null = null;\n let nextFrozenColumns: string[] = []; // Contains next frozen columns with left positions to apply left on resize\n const updateWidth = (distance: number) => {\n updatedWidth = resizedColumnWidth(\n { ...column, currentWidth: column.currentWidth } as Column,\n distance\n );\n column = column.setProp('currentWidth', updatedWidth); // Updating current width\n setColumnStyle(getView().getDomContainer(), 'width', column.field.idHash!, updatedWidth);\n };\n\n /**\n * Update left positions to frozen columns or right of this column.\n */\n const updateLefts = () => {\n nextFrozenColumns.forEach(colId => {\n const left = calculateFieldLeft(\n colId,\n getView().columns,\n freezeColumns,\n hiddenColumns,\n { ...columnWidths, [column.field.id]: updatedWidth } // injecting the resized width to current column\n );\n const nextFrozenColumn = getView().columns?.find(c => `${c.field.id}` === colId);\n setColumnStyle(getView().getDomContainer(), 'left', nextFrozenColumn!.field.idHash!, left);\n });\n };\n\n const resizeHandler = (e: MouseEvent) => {\n e.preventDefault();\n const distance = e.clientX - startPosition;\n if (distance !== 0) {\n column =\n getView().columns?.find(c => `${c.field.id}` === currentCell?.dataset.colId) ??\n ({} as Column);\n updateWidth(distance);\n updateLefts();\n resized = true;\n }\n startPosition = e.clientX;\n return false;\n };\n\n const resizeEndHandler = (e: MouseEvent) => {\n e.preventDefault();\n const domContainer = getView().getDomContainer()!;\n domContainer.removeEventListener('mousemove', resizeHandler);\n domContainer.removeEventListener('mouseup', resizeEndHandler);\n domContainer.removeEventListener('mouseleave', resizeEndHandler);\n if (resized) {\n dispatch(actionColumnResize({ [column.field.id]: updatedWidth }));\n resized = false;\n }\n currentCell!.style.pointerEvents = 'auto';\n currentCell!.classList.toggle(COLUMN_RESIZING_CLASS);\n domContainer.classList.toggle(COLUMN_RESIZING_CLASS);\n return false;\n };\n\n const onMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n startPosition = e.clientX;\n const domContainer = getView().getDomContainer()!;\n domContainer.addEventListener('mousemove', resizeHandler);\n domContainer.addEventListener('mouseup', resizeEndHandler);\n domContainer.addEventListener('mouseleave', resizeEndHandler);\n currentCell = (e.target as HTMLElement).closest('.cell')!;\n currentCell.style.pointerEvents = 'none';\n\n if (e.detail >= 2) {\n // It is a double click so ask for a resize on column\n const col = getView().columns?.find(c => `${c.field.id}` === currentCell!.dataset.colId);\n if (col?.field?.resize) {\n dispatch(actionColumnAutoSize(col, getView().getDomContainer()!, true));\n }\n }\n\n currentCell.classList.toggle(COLUMN_RESIZING_CLASS);\n domContainer.classList.toggle(COLUMN_RESIZING_CLASS);\n // TODO: getState().freezeColumns should\n // give latest state after the action triggered from current feature only on above lines. Check this.\n nextFrozenColumns = getNextFrozenColumns(currentCell.dataset.colId!, getState().freezeColumns);\n\n return false;\n };\n\n return {\n onMouseDown\n };\n};\n\nexport default () => {\n const memoizedColumnResize = withMemoization(columnResizerProps);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n const { freezeColumns, hiddenColumns, columnWidths } = featureProps.getState();\n featureProps\n .getRsStore()\n .setColumnResizerProps(\n memoizedColumnResize([featureProps], [freezeColumns, hiddenColumns, columnWidths])\n );\n };\n};\n"]}
1
+ {"version":3,"file":"resize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/beforeRender/columnSizing/resize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,MAAM,UAAU,cAAc,CAC5B,YAAkC,EAClC,KAAa,EACb,QAAgB,EAChB,KAAa;IAEb,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,SAAS,KAAK,IAAI,QAAQ,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,qBAAqB,GAAG,CAC5B,MAAc,EACd,eAAuB,EACvB,WAA+B,EACvB,EAAE;IACV,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,kBAAkB;QAClD,CAAC,CAAC,WAAW,EAAE,WAAW,IAAI,CAAC;QAC/B,CAAC,CAAC,MAAM,CAAC,YA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,CAAC,KAAK,CAAC,CAAC;QACtF,IAAI,CAAC,MAAM;YAAE,OAAO;QAEpB,aAAa,GAAG,CAAC,CAAC,OAAO,CAAC;QAC1B,oCAAoC,GAAG,WAAW,CAAC,WAAW,IAAI,CAAC,CAAC;QAEpE,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACzC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACpD,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACrD,wCAAwC;QACxC,qGAAqG;QACrG,iBAAiB,GAAG,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,KAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAC;IACjG,CAAC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF,eAAe,GAAG,EAAE;IAClB,MAAM,oBAAoB,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAEjE,OAAO,SAAS,OAAO,CAAC,YAAsC;QAC5D,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC/E,YAAY;aACT,UAAU,EAAE;aACZ,qBAAqB,CACpB,oBAAoB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CACnF,CAAC;IACN,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { isInstance } from '@pega/cosmos-react-core';\n\nimport type { State } from '../../../../../../types/State.types';\nimport { actionColumnResize, actionColumnAutoSize } from '../../../../actions/actions';\nimport type Column from '../../../../generators/ColumnGenerator';\nimport type View from '../../../../generators/ViewGenerator';\nimport { withMemoization } from '../../../../utils/util';\nimport type { BeforeRenderFeatureProps } from '../../../featureFactory';\nimport { calculateFieldLeft } from '../freeze';\n\nexport const COLUMN_RESIZING_CLASS = 'column-resizing';\n\nexport function setColumnStyle(\n domContainer: View['domContainer'],\n style: string,\n columnId: number,\n value: number\n) {\n domContainer?.style?.setProperty(`--col-${style}-${columnId}`, `${value}px`);\n}\n\nconst getResizedColumnWidth = (\n column: Column,\n distanceDragged: number,\n currentCell: HTMLElement | null\n): number => {\n const currentWidth = column.field.fillAvailableSpace\n ? currentCell?.offsetWidth ?? 0\n : column.currentWidth ?? column.field.width ?? column.field.minWidth ?? 0;\n\n let width = currentWidth + distanceDragged;\n // TODO: confirm with designers if we want to limit the column sizing within the maxWidth(if defined on fieldDef). Currently only minWidth is getting honored.\n if (width < (column.field.minWidth ?? 0)) {\n width = column.field.minWidth ?? 0;\n }\n return width;\n};\n\nexport const getNextFrozenColumns = (\n columnId: string,\n freezeColumns: State['freezeColumns'] = []\n) => {\n const nextFrozenColumns = [];\n const freezeColIndex = freezeColumns.indexOf(columnId); // If current column freezed\n if (freezeColIndex > -1) {\n for (let i = freezeColIndex + 1; i < freezeColumns.length; i += 1) {\n nextFrozenColumns.push(freezeColumns[i]);\n }\n }\n return nextFrozenColumns;\n};\n\nexport const columnResizerProps = ([{ getState, getView, dispatch }]: [\n BeforeRenderFeatureProps\n]) => {\n const { freezeColumns, hiddenColumns, columnWidths = {} } = getState();\n let column: Column | undefined;\n let startPosition = 0;\n let resized = false;\n let updatedWidth = 0;\n let currentCell: HTMLElement | null = null;\n let currentCellOccupiedWidthBeforeResize = 0;\n let nextFrozenColumns: string[] = [];\n\n const updateWidth = (distance: number) => {\n if (!column) return;\n updatedWidth = getResizedColumnWidth(\n { ...column, currentWidth: column.currentWidth } as Column,\n distance,\n currentCell\n );\n column = column.setProp('currentWidth', updatedWidth);\n setColumnStyle(getView().getDomContainer(), 'width', column.field.idHash!, updatedWidth);\n };\n\n /**\n * Update left positions to frozen columns or right of this column.\n */\n const updateLefts = () => {\n nextFrozenColumns.forEach(colId => {\n const left = calculateFieldLeft(\n colId,\n getView().columns,\n freezeColumns,\n hiddenColumns,\n column ? { ...columnWidths, [column.field.id]: updatedWidth } : columnWidths // injecting the resized width to current column\n );\n const nextFrozenColumn = getView().columns?.find(c => `${c.field.id}` === colId);\n setColumnStyle(getView().getDomContainer(), 'left', nextFrozenColumn!.field.idHash!, left);\n });\n };\n\n const resizeHandler = (e: MouseEvent) => {\n if (!currentCell || !column) return;\n e.preventDefault();\n\n const distance = e.clientX - startPosition;\n const parentContainer = getView().getVirtualizeElement('rootVirtualiser')?.getParentContainer();\n const clientWidth = parentContainer?.clientWidth ?? 0;\n const scrollWidth = parentContainer?.scrollWidth ?? 0;\n\n // Prevent reducing size for fillAvailableSpace column if the size reduction will introduce empty space in the table.\n const preventSizeReductionForFillAvailableSpaceColumn =\n column.field.fillAvailableSpace &&\n distance <= 0 &&\n currentCellOccupiedWidthBeforeResize <= (currentCell.offsetWidth ?? 0) &&\n clientWidth === scrollWidth;\n\n if (preventSizeReductionForFillAvailableSpaceColumn) {\n return;\n }\n\n if (distance !== 0) {\n updateWidth(distance);\n updateLefts();\n resized = true;\n }\n startPosition = e.clientX;\n };\n\n const resizeEndHandler = (e: MouseEvent) => {\n e.preventDefault();\n const domContainer = getView().getDomContainer();\n if (!domContainer || !currentCell || !column) return;\n\n domContainer.removeEventListener('mousemove', resizeHandler);\n domContainer.removeEventListener('mouseup', resizeEndHandler);\n domContainer.removeEventListener('mouseleave', resizeEndHandler);\n if (resized) {\n dispatch(actionColumnResize({ [column.field.id]: updatedWidth }));\n resized = false;\n }\n currentCell.style.pointerEvents = 'auto';\n currentCell.classList.toggle(COLUMN_RESIZING_CLASS);\n domContainer.classList.toggle(COLUMN_RESIZING_CLASS);\n };\n\n const onMouseDown = (e: MouseEvent) => {\n if (!isInstance(e.target, HTMLElement)) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const domContainer = getView().getDomContainer();\n if (!domContainer) return;\n\n domContainer.addEventListener('mousemove', resizeHandler);\n domContainer.addEventListener('mouseup', resizeEndHandler);\n domContainer.addEventListener('mouseleave', resizeEndHandler);\n\n currentCell = e.target.closest('.cell');\n if (!currentCell) return;\n currentCell.style.pointerEvents = 'none';\n\n column = getView().columns?.find(c => `${c.field.id}` === currentCell?.dataset.colId);\n if (!column) return;\n\n startPosition = e.clientX;\n currentCellOccupiedWidthBeforeResize = currentCell.offsetWidth ?? 0;\n\n if (e.detail >= 2 && column.field.resize) {\n dispatch(actionColumnAutoSize(column, domContainer, true));\n }\n\n currentCell.classList.toggle(COLUMN_RESIZING_CLASS);\n domContainer.classList.toggle(COLUMN_RESIZING_CLASS);\n // TODO: getState().freezeColumns should\n // give latest state after the action triggered from current feature only on above lines. Check this.\n nextFrozenColumns = getNextFrozenColumns(currentCell.dataset.colId!, getState().freezeColumns);\n };\n\n return { onMouseDown };\n};\n\nexport default () => {\n const memoizedColumnResize = withMemoization(columnResizerProps);\n\n return function execute(featureProps: BeforeRenderFeatureProps) {\n const { freezeColumns, hiddenColumns, columnWidths } = featureProps.getState();\n featureProps\n .getRsStore()\n .setColumnResizerProps(\n memoizedColumnResize([featureProps], [freezeColumns, hiddenColumns, columnWidths])\n );\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;;;4EAJ/B,kEAClB;6BAnBC,kEAAsC;6BAuE8hE,kEAAsC;uBAV1mE,kEAEI;;0BAzD2C,kEAChB;;uBAQd,kEACZ;6BAuD4Y,kEAAsC;;4BA7Dlb,kEAAsC;8BA6Du8L,kEAAsC;kCA1BzhM,kEACiB;6BArCY,kEAChB;2BAGgB,kEAC5B;2EAyDuhD,kEAAsC;yCAvDlkD,kEAAqC;+BAuD2gH,kEAAsC;4BAnDvkH,kEACd;kCAkD0pP,kEAAsC;;;gCAhE3qP,kEAChB;kCALmD,kEAC1C;4BAoDS,kEAER;kCArDO,kEAAsC;sCAQlC,kEAAsC;0EA0Di/O,kEAAsC;wEAA7qI,kEAAsC;wCAxCl8G,kEAEN;4BA8BgB,kEAGX;6BAvEgD,kEAC5B;sEAwBR,kEACd;2BAkD6E,kEAAsC;4BA/DjF,kEACtB;;uCA8Ds3B,kEAAsC;;;0BAA6qC,sDAA0B;iCAAywD,sDAA0B;yCA3Dt3H,sDAC5B;;;AAYZ,wBA6CE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAsCA,OAAO,WAAW,MAAM,4BAA4B,CAAC;;;4EAJ/B,kEAClB;6BAnBC,kEAAsC;6BAuE4+F,kEAAsC;uBAVxjG,kEAEI;;0BAzD2C,kEAChB;;uBAQd,kEACZ;6BAuD4Y,kEAAsC;;4BA7Dlb,kEAAsC;8BA6Du8L,kEAAsC;kCA1BzhM,kEACiB;6BArCY,kEAChB;2BAGgB,kEAC5B;2EAyDuhD,kEAAsC;yCAvDlkD,kEAAqC;+BAuD2gH,kEAAsC;4BAnDvkH,kEACd;kCAkD0pP,kEAAsC;;;gCAhE3qP,kEAChB;kCALmD,kEAC1C;4BAoDS,kEAER;kCArDO,kEAAsC;sCAQlC,kEAAsC;0EA0Di/O,kEAAsC;wEAA7qI,kEAAsC;wCAxCl8G,kEAEN;4BA8BgB,kEAGX;6BAvEgD,kEAC5B;sEAwBR,kEACd;2BAkD6E,kEAAsC;4BA/DjF,kEACtB;;uCA8Ds3B,kEAAsC;;;0BAAioD,sDAA0B;iCAAqzC,sDAA0B;yCA3Dt3H,sDAC5B;;;AAYZ,wBA6CE"}
@@ -1,4 +1,4 @@
1
- import type { OmitStrict } from '@pega/cosmos-react-core';
1
+ import { type OmitStrict } from '@pega/cosmos-react-core';
2
2
  import type { Meta } from '../../../types/Meta.types';
3
3
  import type RsInternal from '../RsInternal';
4
4
  import type RsProps from '../RsProps';
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGenerator.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAgBtD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAKtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EACV,yBAAyB,EACzB,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,gGAAgG;AAChG,MAAM,CAAC,OAAO,OAAO,IAAI;;IAavB,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,0CAA0C;IAC1C,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;IAChC,4GAA4G;I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AIvB;;;;SAIK;IACL,UAAU,IAAI,WAAW;IAazB;;;;OAIG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAIvE;;;;;;OAMG;IACH,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAIrC;;;;;;OAMG;IACH,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAIpC;;;;OAIG;IACH,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAInC;;;;OAIG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,iBAAiB,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAKzE;;;OAGG;IACH,eAAe;IAIf;;;OAGG;IACH,aAAa;IAIb;;;OAGG;IACH,cAAc;IAId;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO;IAKvF;;;OAGG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,GACX,iBAAiB,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS;IAIjE;;;OAGG;IACH,oBAAoB,CAAC,KAAK,UAAO;IAIjC,sEAAsE;IACtE,wBAAwB;IAIxB,uEAAuE;IACvE,wBAAwB,CAAC,GAAG,EAAE,MAAM;IAIpC;;;;;OAKG;IACH,iBAAiB,CAAC,oBAAoB,UAAQ;CAa/C"}
@@ -1,4 +1,5 @@
1
1
  import { v4 as uuidV4 } from 'uuid';
2
+ import { navigatorIsAvailable } from '@pega/cosmos-react-core';
2
3
  import { defaultPresetIdIndex, rowDensityClasses, rowSelectColumnMeta, rowActionColumnMeta, rowDragDropColumnMeta, SELECTION_MODES, TEMPLATES } from '../constants';
3
4
  import * as actions from '../actions/actions';
4
5
  import { getExternalStateKeys, isRowReorderFieldEnabled, normalizeFieldDef } from '../utils/util';
@@ -326,11 +327,16 @@ export default class View {
326
327
  const ariaLabel = personalizations && Object.keys(personalizations).length > 1
327
328
  ? `${this.meta.title}: ${personalizations[activeView]?.name}`
328
329
  : this.meta.title;
330
+ const isMacOs = navigatorIsAvailable && navigator.userAgent.match(/(Windows|Macintosh)/)?.[0] === 'Macintosh';
331
+ const navigationHelpKey = `${isMacOs ? 'Command' : 'Control'} /`;
329
332
  return {
330
333
  role: 'grid',
331
334
  'aria-rowcount': (this.totalItemCount ?? 0) + 1, // include header row as well in total row count announcement
332
335
  'aria-colcount': this.getVisibleColumns(true).length, // include action columns as well for total column count announcement
333
- 'aria-label': this.#rsStore.translate('view_navigation_instructions', [ariaLabel])
336
+ 'aria-label': this.#rsStore.translate('view_navigation_instructions', [
337
+ ariaLabel,
338
+ navigationHelpKey
339
+ ])
334
340
  };
335
341
  }
336
342
  /** Returns the default(preset at 0th index in {@link RsStore.presets presets} array) preset id. */
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAOpC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAS7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAmBvC,gGAAgG;AAChG,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,4DAA4D;IAC5D,SAAS,CAA4B;IACrC,sBAAsB;IACtB,QAAQ,CAAU;IAClB,qCAAqC;IACrC,OAAO,CAAS;IAChB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,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;IAED,uEAAuE;IACvE,wBAAwB,CAAC,GAAW;QAClC,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,iBAAiB,CAAC,oBAAoB,GAAG,KAAK;QAC5C,MAAM,aAAa,GAAG;YACpB,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;YAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;SAC7B,CAAC;QACF,OAAO,CACL,IAAI,CAAC,OAAO,EAAE,MAAM,CAClB,MAAM,CAAC,EAAE,CACP,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,oBAAoB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CACvF,IAAI,EAAE,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { v4 as uuidV4 } from 'uuid';\n\nimport type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { Meta } from '../../../types/Meta.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../types/State.types';\nimport {\n defaultPresetIdIndex,\n rowDensityClasses,\n rowSelectColumnMeta,\n rowActionColumnMeta,\n rowDragDropColumnMeta,\n SELECTION_MODES,\n TEMPLATES\n} from '../constants';\nimport * as actions from '../actions/actions';\nimport { getExternalStateKeys, isRowReorderFieldEnabled, normalizeFieldDef } from '../utils/util';\nimport defaultConfig from '../config/config';\nimport type RsStore from '../RsStore';\nimport type RsInternal from '../RsInternal';\nimport type RsProps from '../RsProps';\nimport type StateResolver from '../StateResolver';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type ActionTypes from '../actions/actionConstants';\n\nimport type { UtilityFunctions } from './viewUtilityMethods';\nimport Column from './ColumnGenerator';\nimport type Row from './RowGenerator';\nimport type {\n ConfirmationActionDetails,\n DebugInfo,\n FormatterFunction,\n FreezeLine,\n RefreshNotification,\n RequiredDefinition,\n UIProps,\n ViewConfig,\n ViewContext,\n ViewState,\n VirtualizeElement\n} from './ViewGenerator.types';\nimport type { RowData } from './RowGenerator.types';\nimport type { ColumnConfig } from './ColumnGenerator.types';\nimport type GroupGenerator from './GroupGenerator';\n\n/** A view model blueprint that represents the whole view of a repeating structure component. */\nexport default class View {\n /** A dispatcher function to dispatch actions to RsCore. */\n #dispatch: StateResolver['dispatch'];\n /** Rs store object */\n #rsStore: RsStore;\n /** Unique id for the current view */\n #viewID: string;\n /** Rs internal object reference. */\n #rsInternal: RsInternal;\n /** used to pass the latest view to rsInternal. */\n #updateView!: RsInternal['updateView'];\n /** Value of unique key to identify the single selected row. */\n #singleSelectionRowKey?: string;\n /** Render factory reference from {@link RsProps} */\n renderFactory: RsProps['renderFactory'];\n /** A unique id to identify the current repeating structure. */\n rsID: string;\n /** Current data for the view. */\n data?: RowData[];\n /** Current {@link Column columns} for the view. */\n columns?: Column[];\n /** Current {@link Row rows} for the view. */\n rows?: Row[];\n /** Current group headers for the view. */\n groupHeaders?: GroupGenerator[];\n /** Indicates the visible records count for the current view after applying any type of filter operation. */\n resultsCount?: number;\n /** Indicates whether to show the overall count on view or not. */\n showCount?: boolean;\n /** Indicates if the view has more records. */\n hasMoreResults?: boolean;\n /** Indicates the total record count of the view including group headers.\n */\n totalItemCount?: number;\n /** Indicates the total selected records count. */\n selectedRecordsCount?: number;\n /** Indicates the total height of the view. */\n viewHeight?: number;\n /** Indicates the current height of the container that contains data records like rows. */\n bodyHeight?: number | string;\n /** Indicates max height of the current parent container. */\n bodyMaxHeight?: number;\n /** Indicates the current height of each data row. It does not include group header row. */\n rowHeight?: number;\n /** Indicates the class name of the current selected row density. */\n rowHeightClass?: string;\n /** Indicates if the filter is applied for the current view. */\n isFilterApplied?: boolean;\n /** Indicates if the view is in loading state and not ready. It is used to show loaders in case of api calls. */\n isLoading?: boolean;\n /** Styles for the freeze line to be shown when freezing is applied. */\n freezeLine?: FreezeLine;\n /** Meta of the repeating structures. */\n meta: Meta;\n /**\n * This function is provided a click handler for a row via row generator.\n * @param {RowData} data - current row data\n * @returns {void} void\n */\n onRowClickAction?: RsProps['onRowClickAction'];\n /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */\n toolBarOptions?: RsProps['toolBarOptions'];\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsProps['formatters'];\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: RsProps['styleFormats'];\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure. */\n renderFormatterTypeMap?: RsProps['renderFormatterTypeMap'];\n /** Reference to the top level Html element of repeating structures. */\n domContainer?: HTMLElement;\n /** Reference to the scroller element of repeating structures */\n scrollerNode?: HTMLElement;\n /** Reference to the header element of repeating structures. */\n itemElement?: HTMLElement;\n /** Reference to the virtualizer instance of the repeating structures. */\n virtualizeElements: VirtualizeElement;\n /** Indicates if hierarchical grouping is enabled. */\n hierarchicalGroupEnabled?: boolean;\n /** The details of the confirmation action modal triggered from consumer of repeating structures. */\n confirmationActionDetails?: ConfirmationActionDetails;\n /** Indicates if a count update is required. E.g. after applying filter a reset of count is required. */\n isCountUpdateRequired?: boolean;\n /** Indicates if count is generated internally. Used for RS core internal purpose. */\n countGeneratedInternally?: boolean;\n /** The state shared with the view after completion of one render cycle. */\n state: ViewState;\n /** The details of the debug information shared by the consumer of repeating structures.\n * It is displayed as one of the toolbar actions to debug the {@link ApiContext api context methods} latency. */\n debugInfo?: DebugInfo[];\n /** The definition of a required view. It has a boolean flag to indicate if the current repeating structures view\n * is required and a validation message to be displayed in case of required validation failure.\n * This definition is passed by consumer of repeating structures. */\n requiredDef?: RequiredDefinition;\n /** A set of {@link State.externalState external state} valid keys derived from meta.\n * E.g. value of {@link Meta.externalFilters external filters in meta} is a valid external state key. */\n externalStateKeys?: string[];\n /** Stores all the view related utility functions */\n type!: UtilityFunctions;\n /** Indicates if the current view object is generated via instantRender. */\n isInstantRender?: boolean;\n /** Config to show refreshNotification. This will be set upon receiving {@link ActionTypes.NOTIFY_DATA_REFRESH NOTIFY_DATA_REFRESH} action. */\n refreshNotification?: RefreshNotification;\n\n /**\n Overrides the default count announcement behavior for screen readers.\n * true: Always announce the row count, including on first render.\n * false: Never announce the row count.\n * undefined: Use default behavior (skip first count announcement, announce on subsequent count updates).\n */\n announceCount?: boolean;\n /** Indicates if global search is enabled.\n * If a view does not contain any visible columns which are searchable, then this will be false.\n * @default true\n */\n enableGlobalSearch: boolean;\n /**\n * Creates a view instance that represents the whole view of repeating structures.\n * It has properties like rows, columns, data to build a repeating structures view.\n * @param options An options object to create a view instance. If passed the view is created with this set of options.\n * @param rsInternal The {@link RsInternal} object.\n */\n constructor(config: ViewConfig, rsInternal: RsInternal) {\n const {\n data,\n columns,\n rows = [],\n groupHeaders,\n resultsCount,\n hasMoreResults,\n totalItemCount,\n showCount,\n viewHeight,\n selectedRecordsCount,\n bodyHeight,\n bodyMaxHeight,\n rowHeight,\n rowHeightClass,\n isFilterApplied,\n isLoading,\n freezeLine,\n state,\n domContainer,\n scrollerNode,\n meta,\n itemElement,\n virtualizeElements,\n debugInfo = [] as DebugInfo[],\n requiredDef,\n hierarchicalGroupEnabled,\n singleSelectionRowKey,\n confirmationActionDetails,\n externalStateKeys,\n isCountUpdateRequired,\n countGeneratedInternally,\n isInstantRender,\n refreshNotification,\n announceCount,\n enableGlobalSearch\n } = config;\n const { getRsStore, getRsProps, getRsStateResolver } = rsInternal;\n this.#rsInternal = rsInternal;\n this.#rsStore = getRsStore();\n const rsProps = getRsProps();\n const rsStateResolver = getRsStateResolver();\n\n this.#dispatch = rsStateResolver.dispatch;\n this.#viewID = uuidV4();\n\n // TODO: temporary solution until renderFactory is moved out of core library\n this.renderFactory = rsProps.renderFactory;\n this.rsID = rsInternal.getRsID();\n\n this.data = data;\n this.columns = columns!;\n this.rows = rows;\n this.groupHeaders = groupHeaders;\n this.resultsCount = resultsCount;\n this.hasMoreResults = hasMoreResults;\n this.showCount = meta.showCount ? showCount : false;\n this.totalItemCount = totalItemCount;\n this.selectedRecordsCount = selectedRecordsCount;\n this.viewHeight = viewHeight;\n this.bodyHeight = bodyHeight;\n this.bodyMaxHeight = bodyMaxHeight;\n this.rowHeight = rowHeight;\n this.rowHeightClass = rowHeightClass;\n this.isFilterApplied = isFilterApplied;\n this.isLoading = isLoading;\n this.freezeLine = freezeLine;\n this.meta = meta;\n this.onRowClickAction = rsProps.onRowClickAction;\n this.toolBarOptions = rsProps.toolBarOptions;\n this.formatters = rsProps.formatters;\n this.styleFormats = rsProps.styleFormats;\n this.renderFormatterTypeMap = rsProps.renderFormatterTypeMap;\n this.#singleSelectionRowKey = singleSelectionRowKey;\n\n this.domContainer = domContainer;\n this.scrollerNode = scrollerNode;\n this.itemElement = itemElement;\n this.virtualizeElements = virtualizeElements || {};\n this.hierarchicalGroupEnabled = hierarchicalGroupEnabled;\n this.confirmationActionDetails = {\n ...confirmationActionDetails!,\n showConfirmationAction: state?.showConfirmationAction!\n };\n this.isCountUpdateRequired = isCountUpdateRequired;\n this.countGeneratedInternally = countGeneratedInternally;\n this.debugInfo = debugInfo;\n this.requiredDef = requiredDef;\n this.externalStateKeys = externalStateKeys || getExternalStateKeys(this.meta);\n this.isInstantRender = isInstantRender;\n this.refreshNotification = refreshNotification;\n this.announceCount = announceCount;\n this.enableGlobalSearch = enableGlobalSearch ?? true;\n // FIXME: keep the state on view in sync with the emitted stated from StateResolver\n this.state = {\n searchText: state?.search?.query || '',\n personalization: state?.personalization,\n filterExpression: state?.filterExpression,\n clearColFilter: state?.clearColFilter,\n sortingOrder: state?.sortingOrder,\n groups: state?.groups,\n allGroupsExpanded: state?.allGroupsExpanded,\n groupToggle: state?.groupToggle,\n showHeaderIcons: state?.showHeaderIcons,\n colOrder: state?.colOrder,\n hiddenColumns: state?.hiddenColumns,\n freezeColumns: state?.freezeColumns,\n columnWidths: state?.columnWidths,\n customFields: state?.customFields,\n selectedHeightOption: state?.selectedHeightOption,\n paginationOptions: state?.paginationOptions,\n notifications: state?.notifications,\n rowSelectionChangeSet: state?.rowSelectionChangeSet,\n selectedRows: state?.selectedRows,\n bootstrap: state?.bootstrap,\n refresh: state?.refresh,\n showSelectAllCheckbox: state?.showSelectAllCheckbox,\n externalState: state?.externalState,\n columnAlias: state?.columnAlias,\n aggregationInfo: state?.aggregationInfo,\n errors: state?.errors,\n responsive: state?.responsive, // stores the responsive behavior of DOM container w.r.t. various breakpoints.\n conditionalStyleFormats: state?.conditionalStyleFormats\n };\n\n /** IMP: For generator methods use traditional function syntax\n * rather than arrow function for memory efficiency\n * and bind 'this' to the methods which requires 'this' context. */\n this.getRenderingEnginePropsById = this.getRenderingEnginePropsById.bind(this);\n this.getFormatterByKey = this.getFormatterByKey.bind(this);\n this.getContext = this.getContext.bind(this);\n this.setProp = this.setProp.bind(this);\n this.addColumnAtIndex = this.addColumnAtIndex.bind(this);\n this.getRowDensity = this.getRowDensity.bind(this);\n this.setDomContainer = this.setDomContainer.bind(this);\n this.setItemElement = this.setItemElement.bind(this);\n this.shouldDisplayFeature = this.shouldDisplayFeature.bind(this);\n this.setScrollNode = this.setScrollNode.bind(this);\n this.putVirtualizeElement = this.putVirtualizeElement.bind(this);\n this.getDomContainer = this.getDomContainer.bind(this);\n this.getItemElement = this.getItemElement.bind(this);\n this.getScrollNode = this.getScrollNode.bind(this);\n this.getVirtualizeElement = this.getVirtualizeElement.bind(this);\n this.applyColumnsAutoSize = this.applyColumnsAutoSize.bind(this);\n this.addColumn = this.addColumn.bind(this);\n this.getUIProps = this.getUIProps.bind(this);\n }\n\n // Used by setProp for mutation\n /**\n * Retruns the View properties that is used by setProp while creating new view.\n * @returns\n */\n #get(): ViewConfig &\n Pick<RsProps, 'toolBarOptions' | 'formatters' | 'renderFormatterTypeMap' | 'onRowClickAction'> {\n return {\n data: this.data,\n singleSelectionRowKey: this.#singleSelectionRowKey,\n columns: this.columns,\n rows: this.rows,\n groupHeaders: this.groupHeaders,\n resultsCount: this.resultsCount,\n showCount: this.showCount,\n hasMoreResults: this.hasMoreResults,\n totalItemCount: this.totalItemCount,\n selectedRecordsCount: this.selectedRecordsCount,\n viewHeight: this.viewHeight,\n bodyHeight: this.bodyHeight,\n bodyMaxHeight: this.bodyMaxHeight,\n rowHeight: this.rowHeight,\n rowHeightClass: this.rowHeightClass,\n isFilterApplied: this.isFilterApplied,\n isLoading: this.isLoading,\n freezeLine: this.freezeLine,\n meta: this.meta,\n toolBarOptions: this.toolBarOptions,\n formatters: this.formatters,\n renderFormatterTypeMap: this.renderFormatterTypeMap,\n state: this.state,\n onRowClickAction: this.onRowClickAction,\n domContainer: this.domContainer,\n scrollerNode: this.scrollerNode,\n itemElement: this.itemElement,\n virtualizeElements: this.virtualizeElements,\n debugInfo: this.debugInfo,\n requiredDef: this.requiredDef,\n hierarchicalGroupEnabled: this.hierarchicalGroupEnabled,\n confirmationActionDetails: this.confirmationActionDetails,\n externalStateKeys: this.externalStateKeys,\n isCountUpdateRequired: this.isCountUpdateRequired,\n countGeneratedInternally: this.countGeneratedInternally,\n isInstantRender: this.isInstantRender,\n refreshNotification: this.refreshNotification,\n announceCount: this.announceCount,\n enableGlobalSearch: this.enableGlobalSearch\n };\n }\n\n /**\n * Attach utility functions of view to {@link type} property.\n * @param functions\n * @returns void\n */\n addUtilityFunctions(functions: UtilityFunctions) {\n this.type = functions;\n }\n\n /**\n * Sets the {@link updateView} callback function.\n * @param updateViewCallback\n * @returns void\n */\n setViewUpdateCallback(updateViewCallback: RsInternal['updateView']) {\n this.#updateView = updateViewCallback;\n }\n\n /**\n * This is used to create immutable objects of {@link View} instance. Always call setProp if updating any properties of View to make it immutable.\n * @param prop Either partial of {@link ViewConfig} or individual properties of {@link ViewConfig}.\n * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link ViewConfig}\n * @returns void\n */\n setProp(prop: Partial<ViewConfig> | keyof ViewConfig, value?: ViewConfig[keyof ViewConfig]) {\n const { getView } = this.#rsInternal;\n if (getView().#viewID !== this.#viewID) {\n // eslint-disable-next-line no-console\n console.warn('Doing setProp on a stale view. This might cause bugs.');\n }\n const pObject = typeof prop === 'object' ? prop : { [prop]: value };\n\n const clonedView = new View({ ...this.#get(), ...(pObject as ViewConfig) }, this.#rsInternal);\n\n if (!Object.hasOwn(pObject, 'state')) {\n clonedView.state = this.state;\n }\n\n this.#updateView(clonedView);\n\n return clonedView;\n }\n\n // FIXME: add tranlsations back\n /**\n * Returns the ui props for the {@link View} used for accessibility.\n */\n getUIProps(): UIProps {\n const activeView = this.state.personalization?.active!;\n const personalizations = this.state.personalization?.allPersonalizations;\n const ariaLabel =\n personalizations && Object.keys(personalizations).length > 1\n ? `${this.meta.title}: ${personalizations[activeView]?.name}`\n : this.meta.title!;\n return {\n role: 'grid',\n 'aria-rowcount': (this.totalItemCount ?? 0) + 1, // include header row as well in total row count announcement\n 'aria-colcount': this.getVisibleColumns(true).length, // include action columns as well for total column count announcement\n 'aria-label': this.#rsStore.translate('view_navigation_instructions', [ariaLabel])\n };\n }\n\n /** Returns the default(preset at 0th index in {@link RsStore.presets presets} array) preset id. */\n get defaultPresetId(): string | undefined {\n return this.#rsStore.presets?.[defaultPresetIdIndex].id;\n }\n\n /** Indicates if the view is ready.(means the RS component is mounted). */\n get isReady() {\n return this.state.bootstrap;\n }\n\n /** Indicates if {@link Meta.selectionMode selection mode} is ON */\n get isInSelectionMode(): boolean {\n return !!(this.meta?.selectionMode && SELECTION_MODES[this.meta.selectionMode]);\n }\n\n /** Indicates if the Group Expand all functionality should be shown on UI. */\n get showGroupingExpandCollapseAll(): boolean {\n return !!this.#rsStore.groupingInfo?.length;\n }\n\n /** A set of props that can be used to configure Group Expand all Header cell. */\n get groupingHeaderCellProps() {\n if (!this.showGroupingExpandCollapseAll) return {};\n return {\n isExpanded: this.state.allGroupsExpanded,\n handleChange: (isExpanded: boolean): void =>\n this.#dispatch(actions.actionGroupingExpandCollapseAll(isExpanded)),\n enable: this.showGroupingExpandCollapseAll as boolean,\n // Do not show right border if OOTB columns are on.\n classList:\n this.state.showSelectAllCheckbox ||\n this.state.errors?.dataErrors ||\n isRowReorderFieldEnabled(this.meta)\n ? ['no-border-right']\n : []\n };\n }\n\n /** Indicates if there are no records in the view. */\n get hasNoRecords() {\n return !Number.isNaN(this.resultsCount) && this.resultsCount === 0;\n }\n\n /** Indicates if there are any frozen columns in the view. */\n get hasNoFrozenColumns() {\n return (this.columns?.filter(c => c.frozen && !c.hidden).length ?? 0) === 0;\n }\n\n /** Indicates to hide the freeze line if selection column is the only frozen column in the view. */\n get bHideFreezeLine() {\n const frozenColumns = this.columns?.filter(col => col.frozen && !col.hidden) ?? [];\n return frozenColumns.length === 1 && frozenColumns[0].field.id === rowSelectColumnMeta.field.id;\n }\n\n /** Return the predefined CSS classes for a view. */\n get className(): string {\n if (this.meta?.template !== TEMPLATES.TABLE) return '';\n // if every visible column has a width defined in field def, no need to hide the columns and wait for width calculation\n if (this.getVisibleColumns().every(col => !!col?.field?.width)) return '';\n if (!this.#rsStore.columnSizingTriggerdOnRowsAvailable) return 'hide-rows-till-ready';\n return '';\n }\n\n /**\n * Adds a column to the {@link columns Columns} of the view\n * @param field The {@link Column.field field} for the column.\n * @param option Extra options.\n * @returns the new column or existing column if it already exists.\n */\n addColumn(field: Column['field'], option: OmitStrict<ColumnConfig, 'field'>): Column {\n // Check if any column with new field exists, don't add it and show warnings.\n const existingColumn = this.columns?.find(c => c.field.id === field.id);\n\n if (!existingColumn) {\n const rowActionColumnIndex = this.columns?.findIndex(\n c => c.field.id === rowActionColumnMeta.field.id\n );\n /*\n The row action column should always be the last column in the view.\n The newly added column should take the position of the row action column\n and push it to the last in the array.\n */\n if (rowActionColumnIndex && rowActionColumnIndex !== -1) {\n return this.addColumnAtIndex(field, option, rowActionColumnIndex);\n }\n normalizeFieldDef(field, defaultConfig.defaultFieldDef);\n const column = new Column({ field, ...option }, this.#rsInternal);\n const cloned = [...this.columns!];\n cloned.push(column);\n this.columns = cloned;\n return column;\n }\n return existingColumn;\n }\n\n /**\n * Adds a column at a specified index in the {@link columns Columns} of the view.\n * @param field The {@link Column.field field} for the column.\n * @param option Extra options.\n * @param index The index at which the column needs to be inserted in the {@link columns Columns} array of view.\n * @returns void\n */\n addColumnAtIndex(\n field: Column['field'],\n option: OmitStrict<ColumnConfig, 'field'>,\n index: number\n ): Column {\n // Check if any column with new field exists, don't add it and show warnings.\n const existingColumn = this.columns?.find(c => c.field.id === field.id);\n if (!existingColumn) {\n // Full blow the meta\n normalizeFieldDef(field, defaultConfig.defaultFieldDef);\n const column = new Column({ field, ...option }, this.#rsInternal);\n const cloned = [...this.columns!];\n cloned.splice(index, 0, column);\n this.columns = cloned;\n return column;\n }\n return existingColumn;\n }\n\n /**\n * Remove a column from the {@link columns Columns} array of the view.\n * @param fieldId The {@link Column.field.id fieldId} of the column to be removed.\n * @returns boolean - Indicates if the column is successfully removed from the view.\n */\n removeColumn(fieldId: string) {\n // Check if column exists, delete it and show warnings if not exists.\n const existingColumn = this.columns?.find(c => c.field.id === fieldId);\n if (existingColumn) {\n this.columns = this.columns?.filter(c => c.field.id !== fieldId);\n return true;\n }\n // eslint-disable-next-line no-console\n console.warn(`Column with id ${fieldId} not found.`);\n\n return false;\n }\n\n /**\n * Return the rendering engine props of a given column\n * @param id The {@link Column.field.id id} of the column for which rendering engine props are required.\n * @returns\n */\n getRenderingEnginePropsById(id: string) {\n const column = this.columns?.find(c => c.field.id === id);\n return column?.getRenderingEngineProps();\n }\n\n /**\n * Returns the row density id for a given {@link rowHeightClass}.\n * @returns\n */\n getRowDensity(): string {\n return Object.values(rowDensityClasses).find(obj => obj.className === this.rowHeightClass)!.id;\n }\n\n /** Returns the current view context. While building a RS view,\n * pass getContext to the consumers of RS to access the view related information.\n *\n * @public\n * */\n getContext(): ViewContext {\n return {\n getMeta: () => this.meta,\n getState: () => this.state,\n getColumns: () => this.columns,\n getRenderingEnginePropsById: this.getRenderingEnginePropsById,\n selectedRecordsCount: this.selectedRecordsCount,\n resultsCount: this.resultsCount,\n getRequiredDef: () => this.requiredDef,\n getRowDensity: this.getRowDensity\n };\n }\n\n /**\n * It returns the formatter function available for a given formatterName from {@link RsProps.formatters formatters} passed to RS Core.\n * @param formatterName\n * @returns\n */\n getFormatterByKey(formatterName: string): FormatterFunction | undefined {\n return this.formatters?.[formatterName];\n }\n\n /**\n * This sets the parent dom container in RS core. RS Core utilizes this dom container for DOM related features.\n * Set this as part of initialization of Repeating structures.\n *\n * Refer `Initialization section` in [README.md](../../../README.md)\n * @param n - the parent container of the whole Repeating structures.\n */\n setDomContainer(n: HTMLElement): void {\n this.domContainer = n;\n }\n\n /**\n * This sets the the header element in RS core. RS Core utilizes this header element for DOM related features e.g. animation.\n * Pass Html header element of the repeating structures to this method as part of initialization of Repeating structures.\n *\n * Refer `Initialization section` in [README.md](../../../README.md)\n * @param n The header element\n */\n setItemElement(n: HTMLElement): void {\n this.itemElement = n;\n }\n\n /**\n * This sets the scroller element(the element used in virtualizer as a scrollable area, e.g. a buffer container) of repeating structures into RS core. RS Core utilizes this scroller element for scrolling related features.\n * Pass Html scrollable area element of the repeating structures to this method as part of initialization of Repeating structures.\n * @param n The scroller element\n */\n setScrollNode(n: HTMLElement): void {\n this.scrollerNode = n;\n }\n\n /**\n * This sets the virtualizer instance in the RS core.\n * @param name unique id of the virtualizer\n * @param element the instance of the virtualizer\n */\n putVirtualizeElement(\n name: string,\n virtualizerInstance: VirtualizeElement[keyof VirtualizeElement[number]]\n ) {\n this.virtualizeElements[name] = virtualizerInstance;\n }\n\n /**\n * Returns the parent dom container HTML element.\n * @returns\n */\n getDomContainer() {\n return this.domContainer;\n }\n\n /**\n * Returns the scroller element(the element used in virtualizer as a scrollable area.)\n * @returns\n */\n getScrollNode() {\n return this.scrollerNode;\n }\n\n /**\n * Returns the header row of the Repeating structures view.\n * @returns\n */\n getItemElement() {\n return this.itemElement;\n }\n\n /**\n * Indicates if the given {@link feature} should be displayed on the Repeating structures UI or not.\n * This flag can be derived for a given {@link column} too apart from the whole view.\n * This flag is just to hide the user interaction items from the UI for the respective features. It will not stop running the respective features.\n * @param feature The feature name\n * @param column an optional column parameter if you want to check if the feature is available for the given column.\n * @returns boolean\n */\n shouldDisplayFeature(feature: 'filter' | 'sort' | 'grouping', column?: Column): boolean {\n const viewDisplayFeatureFlag = this.meta?.displayFeatures![feature];\n return !!(column ? !!column.field[feature] && viewDisplayFeatureFlag : viewDisplayFeatureFlag);\n }\n\n /**\n * Returns virtualizer instance for a given virtualizer name.\n * @param name unique id of the virtualizer\n */\n getVirtualizeElement(\n name: string\n ): VirtualizeElement[keyof VirtualizeElement[number]] | undefined {\n return this.virtualizeElements[name];\n }\n\n /**\n * It triggers the autosize of columns.\n * @param reset An optional flag to reset the column widths to its default configured width.\n */\n applyColumnsAutoSize(reset = true) {\n this.#dispatch(actions.actionColumnsAutoSize(this.columns!, this.getDomContainer()!, reset));\n }\n\n /** Returns value of unique key to identify the single selected row */\n getSingleSelectionRowKey() {\n return this.#singleSelectionRowKey;\n }\n\n /** Sets the value of unique key to identify the single selected row */\n setSingleSelectionRowKey(key: string) {\n this.#singleSelectionRowKey = key;\n }\n\n /**\n * Returns the array of visible columns.\n * @function getVisibleColumns\n * @param includeActionColumns include action columns. Default value is false.\n * @returns array of visible columns with/without including action columns(rowSelect, rowDragDrop and rowActionColumn).\n */\n getVisibleColumns(includeActionColumns = false) {\n const actionColumns = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id\n ];\n return (\n this.columns?.filter(\n column =>\n !column.hidden && (includeActionColumns || !actionColumns.includes(column.field.id))\n ) ?? []\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ViewGenerator.js","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAmB,MAAM,yBAAy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AAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CACvF,IAAI,EAAE,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { v4 as uuidV4 } from 'uuid';\n\nimport { navigatorIsAvailable, type OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { Meta } from '../../../types/Meta.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { State } from '../../../types/State.types';\nimport {\n defaultPresetIdIndex,\n rowDensityClasses,\n rowSelectColumnMeta,\n rowActionColumnMeta,\n rowDragDropColumnMeta,\n SELECTION_MODES,\n TEMPLATES\n} from '../constants';\nimport * as actions from '../actions/actions';\nimport { getExternalStateKeys, isRowReorderFieldEnabled, normalizeFieldDef } from '../utils/util';\nimport defaultConfig from '../config/config';\nimport type RsStore from '../RsStore';\nimport type RsInternal from '../RsInternal';\nimport type RsProps from '../RsProps';\nimport type StateResolver from '../StateResolver';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type ActionTypes from '../actions/actionConstants';\n\nimport type { UtilityFunctions } from './viewUtilityMethods';\nimport Column from './ColumnGenerator';\nimport type Row from './RowGenerator';\nimport type {\n ConfirmationActionDetails,\n DebugInfo,\n FormatterFunction,\n FreezeLine,\n RefreshNotification,\n RequiredDefinition,\n UIProps,\n ViewConfig,\n ViewContext,\n ViewState,\n VirtualizeElement\n} from './ViewGenerator.types';\nimport type { RowData } from './RowGenerator.types';\nimport type { ColumnConfig } from './ColumnGenerator.types';\nimport type GroupGenerator from './GroupGenerator';\n\n/** A view model blueprint that represents the whole view of a repeating structure component. */\nexport default class View {\n /** A dispatcher function to dispatch actions to RsCore. */\n #dispatch: StateResolver['dispatch'];\n /** Rs store object */\n #rsStore: RsStore;\n /** Unique id for the current view */\n #viewID: string;\n /** Rs internal object reference. */\n #rsInternal: RsInternal;\n /** used to pass the latest view to rsInternal. */\n #updateView!: RsInternal['updateView'];\n /** Value of unique key to identify the single selected row. */\n #singleSelectionRowKey?: string;\n /** Render factory reference from {@link RsProps} */\n renderFactory: RsProps['renderFactory'];\n /** A unique id to identify the current repeating structure. */\n rsID: string;\n /** Current data for the view. */\n data?: RowData[];\n /** Current {@link Column columns} for the view. */\n columns?: Column[];\n /** Current {@link Row rows} for the view. */\n rows?: Row[];\n /** Current group headers for the view. */\n groupHeaders?: GroupGenerator[];\n /** Indicates the visible records count for the current view after applying any type of filter operation. */\n resultsCount?: number;\n /** Indicates whether to show the overall count on view or not. */\n showCount?: boolean;\n /** Indicates if the view has more records. */\n hasMoreResults?: boolean;\n /** Indicates the total record count of the view including group headers.\n */\n totalItemCount?: number;\n /** Indicates the total selected records count. */\n selectedRecordsCount?: number;\n /** Indicates the total height of the view. */\n viewHeight?: number;\n /** Indicates the current height of the container that contains data records like rows. */\n bodyHeight?: number | string;\n /** Indicates max height of the current parent container. */\n bodyMaxHeight?: number;\n /** Indicates the current height of each data row. It does not include group header row. */\n rowHeight?: number;\n /** Indicates the class name of the current selected row density. */\n rowHeightClass?: string;\n /** Indicates if the filter is applied for the current view. */\n isFilterApplied?: boolean;\n /** Indicates if the view is in loading state and not ready. It is used to show loaders in case of api calls. */\n isLoading?: boolean;\n /** Styles for the freeze line to be shown when freezing is applied. */\n freezeLine?: FreezeLine;\n /** Meta of the repeating structures. */\n meta: Meta;\n /**\n * This function is provided a click handler for a row via row generator.\n * @param {RowData} data - current row data\n * @returns {void} void\n */\n onRowClickAction?: RsProps['onRowClickAction'];\n /** A list of customised the toolbar actions to be displayed at the top of a repeating structure, apart from ootb toolbar actions. */\n toolBarOptions?: RsProps['toolBarOptions'];\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsProps['formatters'];\n /** A collection of style formats that can be applied for styling the data. */\n styleFormats?: RsProps['styleFormats'];\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure. */\n renderFormatterTypeMap?: RsProps['renderFormatterTypeMap'];\n /** Reference to the top level Html element of repeating structures. */\n domContainer?: HTMLElement;\n /** Reference to the scroller element of repeating structures */\n scrollerNode?: HTMLElement;\n /** Reference to the header element of repeating structures. */\n itemElement?: HTMLElement;\n /** Reference to the virtualizer instance of the repeating structures. */\n virtualizeElements: VirtualizeElement;\n /** Indicates if hierarchical grouping is enabled. */\n hierarchicalGroupEnabled?: boolean;\n /** The details of the confirmation action modal triggered from consumer of repeating structures. */\n confirmationActionDetails?: ConfirmationActionDetails;\n /** Indicates if a count update is required. E.g. after applying filter a reset of count is required. */\n isCountUpdateRequired?: boolean;\n /** Indicates if count is generated internally. Used for RS core internal purpose. */\n countGeneratedInternally?: boolean;\n /** The state shared with the view after completion of one render cycle. */\n state: ViewState;\n /** The details of the debug information shared by the consumer of repeating structures.\n * It is displayed as one of the toolbar actions to debug the {@link ApiContext api context methods} latency. */\n debugInfo?: DebugInfo[];\n /** The definition of a required view. It has a boolean flag to indicate if the current repeating structures view\n * is required and a validation message to be displayed in case of required validation failure.\n * This definition is passed by consumer of repeating structures. */\n requiredDef?: RequiredDefinition;\n /** A set of {@link State.externalState external state} valid keys derived from meta.\n * E.g. value of {@link Meta.externalFilters external filters in meta} is a valid external state key. */\n externalStateKeys?: string[];\n /** Stores all the view related utility functions */\n type!: UtilityFunctions;\n /** Indicates if the current view object is generated via instantRender. */\n isInstantRender?: boolean;\n /** Config to show refreshNotification. This will be set upon receiving {@link ActionTypes.NOTIFY_DATA_REFRESH NOTIFY_DATA_REFRESH} action. */\n refreshNotification?: RefreshNotification;\n\n /**\n Overrides the default count announcement behavior for screen readers.\n * true: Always announce the row count, including on first render.\n * false: Never announce the row count.\n * undefined: Use default behavior (skip first count announcement, announce on subsequent count updates).\n */\n announceCount?: boolean;\n /** Indicates if global search is enabled.\n * If a view does not contain any visible columns which are searchable, then this will be false.\n * @default true\n */\n enableGlobalSearch: boolean;\n /**\n * Creates a view instance that represents the whole view of repeating structures.\n * It has properties like rows, columns, data to build a repeating structures view.\n * @param options An options object to create a view instance. If passed the view is created with this set of options.\n * @param rsInternal The {@link RsInternal} object.\n */\n constructor(config: ViewConfig, rsInternal: RsInternal) {\n const {\n data,\n columns,\n rows = [],\n groupHeaders,\n resultsCount,\n hasMoreResults,\n totalItemCount,\n showCount,\n viewHeight,\n selectedRecordsCount,\n bodyHeight,\n bodyMaxHeight,\n rowHeight,\n rowHeightClass,\n isFilterApplied,\n isLoading,\n freezeLine,\n state,\n domContainer,\n scrollerNode,\n meta,\n itemElement,\n virtualizeElements,\n debugInfo = [] as DebugInfo[],\n requiredDef,\n hierarchicalGroupEnabled,\n singleSelectionRowKey,\n confirmationActionDetails,\n externalStateKeys,\n isCountUpdateRequired,\n countGeneratedInternally,\n isInstantRender,\n refreshNotification,\n announceCount,\n enableGlobalSearch\n } = config;\n const { getRsStore, getRsProps, getRsStateResolver } = rsInternal;\n this.#rsInternal = rsInternal;\n this.#rsStore = getRsStore();\n const rsProps = getRsProps();\n const rsStateResolver = getRsStateResolver();\n\n this.#dispatch = rsStateResolver.dispatch;\n this.#viewID = uuidV4();\n\n // TODO: temporary solution until renderFactory is moved out of core library\n this.renderFactory = rsProps.renderFactory;\n this.rsID = rsInternal.getRsID();\n\n this.data = data;\n this.columns = columns!;\n this.rows = rows;\n this.groupHeaders = groupHeaders;\n this.resultsCount = resultsCount;\n this.hasMoreResults = hasMoreResults;\n this.showCount = meta.showCount ? showCount : false;\n this.totalItemCount = totalItemCount;\n this.selectedRecordsCount = selectedRecordsCount;\n this.viewHeight = viewHeight;\n this.bodyHeight = bodyHeight;\n this.bodyMaxHeight = bodyMaxHeight;\n this.rowHeight = rowHeight;\n this.rowHeightClass = rowHeightClass;\n this.isFilterApplied = isFilterApplied;\n this.isLoading = isLoading;\n this.freezeLine = freezeLine;\n this.meta = meta;\n this.onRowClickAction = rsProps.onRowClickAction;\n this.toolBarOptions = rsProps.toolBarOptions;\n this.formatters = rsProps.formatters;\n this.styleFormats = rsProps.styleFormats;\n this.renderFormatterTypeMap = rsProps.renderFormatterTypeMap;\n this.#singleSelectionRowKey = singleSelectionRowKey;\n\n this.domContainer = domContainer;\n this.scrollerNode = scrollerNode;\n this.itemElement = itemElement;\n this.virtualizeElements = virtualizeElements || {};\n this.hierarchicalGroupEnabled = hierarchicalGroupEnabled;\n this.confirmationActionDetails = {\n ...confirmationActionDetails!,\n showConfirmationAction: state?.showConfirmationAction!\n };\n this.isCountUpdateRequired = isCountUpdateRequired;\n this.countGeneratedInternally = countGeneratedInternally;\n this.debugInfo = debugInfo;\n this.requiredDef = requiredDef;\n this.externalStateKeys = externalStateKeys || getExternalStateKeys(this.meta);\n this.isInstantRender = isInstantRender;\n this.refreshNotification = refreshNotification;\n this.announceCount = announceCount;\n this.enableGlobalSearch = enableGlobalSearch ?? true;\n // FIXME: keep the state on view in sync with the emitted stated from StateResolver\n this.state = {\n searchText: state?.search?.query || '',\n personalization: state?.personalization,\n filterExpression: state?.filterExpression,\n clearColFilter: state?.clearColFilter,\n sortingOrder: state?.sortingOrder,\n groups: state?.groups,\n allGroupsExpanded: state?.allGroupsExpanded,\n groupToggle: state?.groupToggle,\n showHeaderIcons: state?.showHeaderIcons,\n colOrder: state?.colOrder,\n hiddenColumns: state?.hiddenColumns,\n freezeColumns: state?.freezeColumns,\n columnWidths: state?.columnWidths,\n customFields: state?.customFields,\n selectedHeightOption: state?.selectedHeightOption,\n paginationOptions: state?.paginationOptions,\n notifications: state?.notifications,\n rowSelectionChangeSet: state?.rowSelectionChangeSet,\n selectedRows: state?.selectedRows,\n bootstrap: state?.bootstrap,\n refresh: state?.refresh,\n showSelectAllCheckbox: state?.showSelectAllCheckbox,\n externalState: state?.externalState,\n columnAlias: state?.columnAlias,\n aggregationInfo: state?.aggregationInfo,\n errors: state?.errors,\n responsive: state?.responsive, // stores the responsive behavior of DOM container w.r.t. various breakpoints.\n conditionalStyleFormats: state?.conditionalStyleFormats\n };\n\n /** IMP: For generator methods use traditional function syntax\n * rather than arrow function for memory efficiency\n * and bind 'this' to the methods which requires 'this' context. */\n this.getRenderingEnginePropsById = this.getRenderingEnginePropsById.bind(this);\n this.getFormatterByKey = this.getFormatterByKey.bind(this);\n this.getContext = this.getContext.bind(this);\n this.setProp = this.setProp.bind(this);\n this.addColumnAtIndex = this.addColumnAtIndex.bind(this);\n this.getRowDensity = this.getRowDensity.bind(this);\n this.setDomContainer = this.setDomContainer.bind(this);\n this.setItemElement = this.setItemElement.bind(this);\n this.shouldDisplayFeature = this.shouldDisplayFeature.bind(this);\n this.setScrollNode = this.setScrollNode.bind(this);\n this.putVirtualizeElement = this.putVirtualizeElement.bind(this);\n this.getDomContainer = this.getDomContainer.bind(this);\n this.getItemElement = this.getItemElement.bind(this);\n this.getScrollNode = this.getScrollNode.bind(this);\n this.getVirtualizeElement = this.getVirtualizeElement.bind(this);\n this.applyColumnsAutoSize = this.applyColumnsAutoSize.bind(this);\n this.addColumn = this.addColumn.bind(this);\n this.getUIProps = this.getUIProps.bind(this);\n }\n\n // Used by setProp for mutation\n /**\n * Retruns the View properties that is used by setProp while creating new view.\n * @returns\n */\n #get(): ViewConfig &\n Pick<RsProps, 'toolBarOptions' | 'formatters' | 'renderFormatterTypeMap' | 'onRowClickAction'> {\n return {\n data: this.data,\n singleSelectionRowKey: this.#singleSelectionRowKey,\n columns: this.columns,\n rows: this.rows,\n groupHeaders: this.groupHeaders,\n resultsCount: this.resultsCount,\n showCount: this.showCount,\n hasMoreResults: this.hasMoreResults,\n totalItemCount: this.totalItemCount,\n selectedRecordsCount: this.selectedRecordsCount,\n viewHeight: this.viewHeight,\n bodyHeight: this.bodyHeight,\n bodyMaxHeight: this.bodyMaxHeight,\n rowHeight: this.rowHeight,\n rowHeightClass: this.rowHeightClass,\n isFilterApplied: this.isFilterApplied,\n isLoading: this.isLoading,\n freezeLine: this.freezeLine,\n meta: this.meta,\n toolBarOptions: this.toolBarOptions,\n formatters: this.formatters,\n renderFormatterTypeMap: this.renderFormatterTypeMap,\n state: this.state,\n onRowClickAction: this.onRowClickAction,\n domContainer: this.domContainer,\n scrollerNode: this.scrollerNode,\n itemElement: this.itemElement,\n virtualizeElements: this.virtualizeElements,\n debugInfo: this.debugInfo,\n requiredDef: this.requiredDef,\n hierarchicalGroupEnabled: this.hierarchicalGroupEnabled,\n confirmationActionDetails: this.confirmationActionDetails,\n externalStateKeys: this.externalStateKeys,\n isCountUpdateRequired: this.isCountUpdateRequired,\n countGeneratedInternally: this.countGeneratedInternally,\n isInstantRender: this.isInstantRender,\n refreshNotification: this.refreshNotification,\n announceCount: this.announceCount,\n enableGlobalSearch: this.enableGlobalSearch\n };\n }\n\n /**\n * Attach utility functions of view to {@link type} property.\n * @param functions\n * @returns void\n */\n addUtilityFunctions(functions: UtilityFunctions) {\n this.type = functions;\n }\n\n /**\n * Sets the {@link updateView} callback function.\n * @param updateViewCallback\n * @returns void\n */\n setViewUpdateCallback(updateViewCallback: RsInternal['updateView']) {\n this.#updateView = updateViewCallback;\n }\n\n /**\n * This is used to create immutable objects of {@link View} instance. Always call setProp if updating any properties of View to make it immutable.\n * @param prop Either partial of {@link ViewConfig} or individual properties of {@link ViewConfig}.\n * @param [value] An optional parameter to provide value for {@link prop} in case prop is not of type {@link ViewConfig}\n * @returns void\n */\n setProp(prop: Partial<ViewConfig> | keyof ViewConfig, value?: ViewConfig[keyof ViewConfig]) {\n const { getView } = this.#rsInternal;\n if (getView().#viewID !== this.#viewID) {\n // eslint-disable-next-line no-console\n console.warn('Doing setProp on a stale view. This might cause bugs.');\n }\n const pObject = typeof prop === 'object' ? prop : { [prop]: value };\n\n const clonedView = new View({ ...this.#get(), ...(pObject as ViewConfig) }, this.#rsInternal);\n\n if (!Object.hasOwn(pObject, 'state')) {\n clonedView.state = this.state;\n }\n\n this.#updateView(clonedView);\n\n return clonedView;\n }\n\n // FIXME: add tranlsations back\n /**\n * Returns the ui props for the {@link View} used for accessibility.\n */\n getUIProps(): UIProps {\n const activeView = this.state.personalization?.active!;\n const personalizations = this.state.personalization?.allPersonalizations;\n const ariaLabel =\n personalizations && Object.keys(personalizations).length > 1\n ? `${this.meta.title}: ${personalizations[activeView]?.name}`\n : this.meta.title!;\n\n const isMacOs =\n navigatorIsAvailable && navigator.userAgent.match(/(Windows|Macintosh)/)?.[0] === 'Macintosh';\n\n const navigationHelpKey = `${isMacOs ? 'Command' : 'Control'} /`;\n return {\n role: 'grid',\n 'aria-rowcount': (this.totalItemCount ?? 0) + 1, // include header row as well in total row count announcement\n 'aria-colcount': this.getVisibleColumns(true).length, // include action columns as well for total column count announcement\n 'aria-label': this.#rsStore.translate('view_navigation_instructions', [\n ariaLabel,\n navigationHelpKey\n ])\n };\n }\n\n /** Returns the default(preset at 0th index in {@link RsStore.presets presets} array) preset id. */\n get defaultPresetId(): string | undefined {\n return this.#rsStore.presets?.[defaultPresetIdIndex].id;\n }\n\n /** Indicates if the view is ready.(means the RS component is mounted). */\n get isReady() {\n return this.state.bootstrap;\n }\n\n /** Indicates if {@link Meta.selectionMode selection mode} is ON */\n get isInSelectionMode(): boolean {\n return !!(this.meta?.selectionMode && SELECTION_MODES[this.meta.selectionMode]);\n }\n\n /** Indicates if the Group Expand all functionality should be shown on UI. */\n get showGroupingExpandCollapseAll(): boolean {\n return !!this.#rsStore.groupingInfo?.length;\n }\n\n /** A set of props that can be used to configure Group Expand all Header cell. */\n get groupingHeaderCellProps() {\n if (!this.showGroupingExpandCollapseAll) return {};\n return {\n isExpanded: this.state.allGroupsExpanded,\n handleChange: (isExpanded: boolean): void =>\n this.#dispatch(actions.actionGroupingExpandCollapseAll(isExpanded)),\n enable: this.showGroupingExpandCollapseAll as boolean,\n // Do not show right border if OOTB columns are on.\n classList:\n this.state.showSelectAllCheckbox ||\n this.state.errors?.dataErrors ||\n isRowReorderFieldEnabled(this.meta)\n ? ['no-border-right']\n : []\n };\n }\n\n /** Indicates if there are no records in the view. */\n get hasNoRecords() {\n return !Number.isNaN(this.resultsCount) && this.resultsCount === 0;\n }\n\n /** Indicates if there are any frozen columns in the view. */\n get hasNoFrozenColumns() {\n return (this.columns?.filter(c => c.frozen && !c.hidden).length ?? 0) === 0;\n }\n\n /** Indicates to hide the freeze line if selection column is the only frozen column in the view. */\n get bHideFreezeLine() {\n const frozenColumns = this.columns?.filter(col => col.frozen && !col.hidden) ?? [];\n return frozenColumns.length === 1 && frozenColumns[0].field.id === rowSelectColumnMeta.field.id;\n }\n\n /** Return the predefined CSS classes for a view. */\n get className(): string {\n if (this.meta?.template !== TEMPLATES.TABLE) return '';\n // if every visible column has a width defined in field def, no need to hide the columns and wait for width calculation\n if (this.getVisibleColumns().every(col => !!col?.field?.width)) return '';\n if (!this.#rsStore.columnSizingTriggerdOnRowsAvailable) return 'hide-rows-till-ready';\n return '';\n }\n\n /**\n * Adds a column to the {@link columns Columns} of the view\n * @param field The {@link Column.field field} for the column.\n * @param option Extra options.\n * @returns the new column or existing column if it already exists.\n */\n addColumn(field: Column['field'], option: OmitStrict<ColumnConfig, 'field'>): Column {\n // Check if any column with new field exists, don't add it and show warnings.\n const existingColumn = this.columns?.find(c => c.field.id === field.id);\n\n if (!existingColumn) {\n const rowActionColumnIndex = this.columns?.findIndex(\n c => c.field.id === rowActionColumnMeta.field.id\n );\n /*\n The row action column should always be the last column in the view.\n The newly added column should take the position of the row action column\n and push it to the last in the array.\n */\n if (rowActionColumnIndex && rowActionColumnIndex !== -1) {\n return this.addColumnAtIndex(field, option, rowActionColumnIndex);\n }\n normalizeFieldDef(field, defaultConfig.defaultFieldDef);\n const column = new Column({ field, ...option }, this.#rsInternal);\n const cloned = [...this.columns!];\n cloned.push(column);\n this.columns = cloned;\n return column;\n }\n return existingColumn;\n }\n\n /**\n * Adds a column at a specified index in the {@link columns Columns} of the view.\n * @param field The {@link Column.field field} for the column.\n * @param option Extra options.\n * @param index The index at which the column needs to be inserted in the {@link columns Columns} array of view.\n * @returns void\n */\n addColumnAtIndex(\n field: Column['field'],\n option: OmitStrict<ColumnConfig, 'field'>,\n index: number\n ): Column {\n // Check if any column with new field exists, don't add it and show warnings.\n const existingColumn = this.columns?.find(c => c.field.id === field.id);\n if (!existingColumn) {\n // Full blow the meta\n normalizeFieldDef(field, defaultConfig.defaultFieldDef);\n const column = new Column({ field, ...option }, this.#rsInternal);\n const cloned = [...this.columns!];\n cloned.splice(index, 0, column);\n this.columns = cloned;\n return column;\n }\n return existingColumn;\n }\n\n /**\n * Remove a column from the {@link columns Columns} array of the view.\n * @param fieldId The {@link Column.field.id fieldId} of the column to be removed.\n * @returns boolean - Indicates if the column is successfully removed from the view.\n */\n removeColumn(fieldId: string) {\n // Check if column exists, delete it and show warnings if not exists.\n const existingColumn = this.columns?.find(c => c.field.id === fieldId);\n if (existingColumn) {\n this.columns = this.columns?.filter(c => c.field.id !== fieldId);\n return true;\n }\n // eslint-disable-next-line no-console\n console.warn(`Column with id ${fieldId} not found.`);\n\n return false;\n }\n\n /**\n * Return the rendering engine props of a given column\n * @param id The {@link Column.field.id id} of the column for which rendering engine props are required.\n * @returns\n */\n getRenderingEnginePropsById(id: string) {\n const column = this.columns?.find(c => c.field.id === id);\n return column?.getRenderingEngineProps();\n }\n\n /**\n * Returns the row density id for a given {@link rowHeightClass}.\n * @returns\n */\n getRowDensity(): string {\n return Object.values(rowDensityClasses).find(obj => obj.className === this.rowHeightClass)!.id;\n }\n\n /** Returns the current view context. While building a RS view,\n * pass getContext to the consumers of RS to access the view related information.\n *\n * @public\n * */\n getContext(): ViewContext {\n return {\n getMeta: () => this.meta,\n getState: () => this.state,\n getColumns: () => this.columns,\n getRenderingEnginePropsById: this.getRenderingEnginePropsById,\n selectedRecordsCount: this.selectedRecordsCount,\n resultsCount: this.resultsCount,\n getRequiredDef: () => this.requiredDef,\n getRowDensity: this.getRowDensity\n };\n }\n\n /**\n * It returns the formatter function available for a given formatterName from {@link RsProps.formatters formatters} passed to RS Core.\n * @param formatterName\n * @returns\n */\n getFormatterByKey(formatterName: string): FormatterFunction | undefined {\n return this.formatters?.[formatterName];\n }\n\n /**\n * This sets the parent dom container in RS core. RS Core utilizes this dom container for DOM related features.\n * Set this as part of initialization of Repeating structures.\n *\n * Refer `Initialization section` in [README.md](../../../README.md)\n * @param n - the parent container of the whole Repeating structures.\n */\n setDomContainer(n: HTMLElement): void {\n this.domContainer = n;\n }\n\n /**\n * This sets the the header element in RS core. RS Core utilizes this header element for DOM related features e.g. animation.\n * Pass Html header element of the repeating structures to this method as part of initialization of Repeating structures.\n *\n * Refer `Initialization section` in [README.md](../../../README.md)\n * @param n The header element\n */\n setItemElement(n: HTMLElement): void {\n this.itemElement = n;\n }\n\n /**\n * This sets the scroller element(the element used in virtualizer as a scrollable area, e.g. a buffer container) of repeating structures into RS core. RS Core utilizes this scroller element for scrolling related features.\n * Pass Html scrollable area element of the repeating structures to this method as part of initialization of Repeating structures.\n * @param n The scroller element\n */\n setScrollNode(n: HTMLElement): void {\n this.scrollerNode = n;\n }\n\n /**\n * This sets the virtualizer instance in the RS core.\n * @param name unique id of the virtualizer\n * @param element the instance of the virtualizer\n */\n putVirtualizeElement(\n name: string,\n virtualizerInstance: VirtualizeElement[keyof VirtualizeElement[number]]\n ) {\n this.virtualizeElements[name] = virtualizerInstance;\n }\n\n /**\n * Returns the parent dom container HTML element.\n * @returns\n */\n getDomContainer() {\n return this.domContainer;\n }\n\n /**\n * Returns the scroller element(the element used in virtualizer as a scrollable area.)\n * @returns\n */\n getScrollNode() {\n return this.scrollerNode;\n }\n\n /**\n * Returns the header row of the Repeating structures view.\n * @returns\n */\n getItemElement() {\n return this.itemElement;\n }\n\n /**\n * Indicates if the given {@link feature} should be displayed on the Repeating structures UI or not.\n * This flag can be derived for a given {@link column} too apart from the whole view.\n * This flag is just to hide the user interaction items from the UI for the respective features. It will not stop running the respective features.\n * @param feature The feature name\n * @param column an optional column parameter if you want to check if the feature is available for the given column.\n * @returns boolean\n */\n shouldDisplayFeature(feature: 'filter' | 'sort' | 'grouping', column?: Column): boolean {\n const viewDisplayFeatureFlag = this.meta?.displayFeatures![feature];\n return !!(column ? !!column.field[feature] && viewDisplayFeatureFlag : viewDisplayFeatureFlag);\n }\n\n /**\n * Returns virtualizer instance for a given virtualizer name.\n * @param name unique id of the virtualizer\n */\n getVirtualizeElement(\n name: string\n ): VirtualizeElement[keyof VirtualizeElement[number]] | undefined {\n return this.virtualizeElements[name];\n }\n\n /**\n * It triggers the autosize of columns.\n * @param reset An optional flag to reset the column widths to its default configured width.\n */\n applyColumnsAutoSize(reset = true) {\n this.#dispatch(actions.actionColumnsAutoSize(this.columns!, this.getDomContainer()!, reset));\n }\n\n /** Returns value of unique key to identify the single selected row */\n getSingleSelectionRowKey() {\n return this.#singleSelectionRowKey;\n }\n\n /** Sets the value of unique key to identify the single selected row */\n setSingleSelectionRowKey(key: string) {\n this.#singleSelectionRowKey = key;\n }\n\n /**\n * Returns the array of visible columns.\n * @function getVisibleColumns\n * @param includeActionColumns include action columns. Default value is false.\n * @returns array of visible columns with/without including action columns(rowSelect, rowDragDrop and rowActionColumn).\n */\n getVisibleColumns(includeActionColumns = false) {\n const actionColumns = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id\n ];\n return (\n this.columns?.filter(\n column =>\n !column.hidden && (includeActionColumns || !actionColumns.includes(column.field.id))\n ) ?? []\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-core",
3
- "version": "9.0.0-build.16.4",
3
+ "version": "9.0.0-build.17.1",
4
4
  "description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pegasystems",
@@ -14,8 +14,8 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "9.0.0-build.16.4",
18
- "@pega/cosmos-react-core": "9.0.0-build.16.4",
17
+ "@pega/cosmos-react-condition-builder": "9.0.0-build.17.1",
18
+ "@pega/cosmos-react-core": "9.0.0-build.17.1",
19
19
  "@types/lodash-es": "^4.17.12",
20
20
  "@types/uuid": "^9.0.0",
21
21
  "dayjs": "^1.11.13",