@pega/lists-core 9.0.0-build.29.4 → 9.0.0-build.29.6
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.
|
@@ -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;AAmD7D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,GACpB,MAAM,
|
|
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;AAmD7D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC/C,aAAa,UAAQ,GACpB,MAAM,CAWR;AACD;;;;;;;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;;EAmChB"}
|
|
@@ -37,8 +37,10 @@ function calculateColumnWidth(column, domContainer, forceAutoSize = false) {
|
|
|
37
37
|
export function autoSizeOfColumn(col, domContainer, forceAutoSize = false) {
|
|
38
38
|
// Set to max-content to measure actual content width
|
|
39
39
|
domContainer.style.setProperty(`--col-width-${col.field.idHash}`, MAX_CONTENT);
|
|
40
|
+
domContainer.setAttribute('data-content-size-measuring', 'true');
|
|
40
41
|
const columnWidth = calculateColumnWidth(col, domContainer, forceAutoSize);
|
|
41
42
|
domContainer.style.setProperty(`--col-width-${col.field.idHash}`, `${col.currentWidth}px`);
|
|
43
|
+
domContainer.removeAttribute('data-content-size-measuring');
|
|
42
44
|
return columnWidth;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D;;;;;;;GAOG;AAEH,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,SAAS,oBAAoB,CAC3B,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,EAAE,CAAC;YACtB,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAC1B,YAAY,CAAC,gBAAgB,CAAc,iBAAiB,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CACjF,CAAC;IAEF,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;QACnC,IAAI,SAAS,GAAG,eAAe,EAAE,CAAC;YAChC,eAAe,GAAG,SAAS,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,oEAAoE;IACpE,MAAM,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;IAEzD,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAI,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACvB,CAAC,CAAC,cAAc,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,YAA+C,EAC/C,aAAa,GAAG,KAAK;IAErB,qDAAqD;IACrD,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"autoSize.js","sourceRoot":"","sources":["../../../../../../../src/core/features/uIFeatures/afterRender/columnSizing/autoSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D;;;;;;;GAOG;AAEH,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,SAAS,oBAAoB,CAC3B,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,EAAE,CAAC;YACtB,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAC1B,YAAY,CAAC,gBAAgB,CAAc,iBAAiB,MAAM,CAAC,KAAK,CAAC,EAAE,I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'../../../../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 */\n\nconst MAX_CONTENT = 'max-content';\nconst ROUNDING_BUFFER = 1;\nfunction calculateColumnWidth(\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) {\n return personalizedWidth;\n }\n if (column.field.width) {\n return column.field.width;\n }\n }\n\n const cellsList = Array.from(\n domContainer.querySelectorAll<HTMLElement>(`[data-col-id=\"${column.field.id}\"]`)\n );\n\n let maxContentWidth = 0;\n cellsList.forEach(cell => {\n const cellWidth = cell.offsetWidth;\n if (cellWidth > maxContentWidth) {\n maxContentWidth = cellWidth;\n }\n });\n\n /* buffer to prevent content clipping due to offsetWidth rounding */\n const maxColumnWidth = maxContentWidth + ROUNDING_BUFFER;\n\n return column.field.maxWidth && maxColumnWidth > column.field.maxWidth\n ? column.field.maxWidth\n : maxColumnWidth;\n}\n\nexport function autoSizeOfColumn(\n col: Column,\n domContainer: NonNullable<View['domContainer']>,\n forceAutoSize = false\n): number {\n // Set to max-content to measure actual content width\n domContainer.style.setProperty(`--col-width-${col.field.idHash}`, MAX_CONTENT);\n domContainer.setAttribute('data-content-size-measuring', 'true');\n\n const columnWidth = calculateColumnWidth(col, domContainer, forceAutoSize);\n\n domContainer.style.setProperty(`--col-width-${col.field.idHash}`, `${col.currentWidth}px`);\n domContainer.removeAttribute('data-content-size-measuring');\n\n return columnWidth;\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 const visibleColumns = columns.filter(col => !col.hidden);\n\n // Set CSS variables for all columns that need auto-sizing first (single batch write)\n visibleColumns.forEach(column => {\n domContainer.style.setProperty(`--col-width-${column.field.idHash}`, MAX_CONTENT);\n });\n domContainer.setAttribute('data-content-size-measuring', 'true');\n\n // Now calculate widths for all columns (each does its own DOM reading in batch context)\n visibleColumns.forEach(column => {\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 columnWidth = calculateColumnWidth(column, domContainer, forceAutosize);\n\n columnAutoSizes[column.field.id] = columnWidth;\n }\n });\n\n domContainer.removeAttribute('data-content-size-measuring');\n // Reset CSS variables back to original widths for columns that had max-content set\n visibleColumns.forEach(column => {\n if (column.currentWidth) {\n domContainer.style.setProperty(\n `--col-width-${column.field.idHash}`,\n `${column.currentWidth}px`\n );\n }\n });\n\n return columnAutoSizes;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-core",
|
|
3
|
-
"version": "9.0.0-build.29.
|
|
3
|
+
"version": "9.0.0-build.29.6",
|
|
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.29.
|
|
18
|
-
"@pega/cosmos-react-core": "9.0.0-build.29.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "9.0.0-build.29.6",
|
|
18
|
+
"@pega/cosmos-react-core": "9.0.0-build.29.6",
|
|
19
19
|
"@types/lodash-es": "^4.17.12",
|
|
20
20
|
"dayjs": "^1.11.13",
|
|
21
21
|
"fast-deep-equal": "^3.1.3",
|