@canvas-components/list-table 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5874,6 +5874,9 @@ function drawBodyTextContent(params) {
5874
5874
  searchMatch,
5875
5875
  fragmentKey = `content:${contentIndex}`
5876
5876
  } = params;
5877
+ if (params.content.visible === false || params.content.style?.display === "none") {
5878
+ return void 0;
5879
+ }
5877
5880
  ctx.save();
5878
5881
  ctx.globalAlpha *= resolveContentOpacity(content);
5879
5882
  applyTextContentStyle(
@@ -5985,6 +5988,9 @@ function drawBodyTextContent(params) {
5985
5988
  return width;
5986
5989
  }
5987
5990
  function measureTextContentWidth(ctx, content, theme) {
5991
+ if (content.visible === false || content.style?.display === "none") {
5992
+ return 0;
5993
+ }
5988
5994
  applyTextContentStyle(ctx, content, theme.textColor, theme);
5989
5995
  const intrinsicWidth = Math.max(
5990
5996
  ctx.measureText(content.text).width + resolveContentTextIndent(content),
@@ -6175,6 +6181,11 @@ var CONTENT_HORIZONTAL_PADDING = 12;
6175
6181
  var CONTENT_GAP = 8;
6176
6182
  var CONTENT_VERTICAL_PADDING = 6;
6177
6183
  function resolveBodyCellContents(params) {
6184
+ return resolveRawBodyCellContents(params).filter(
6185
+ (content) => content.visible !== false && content.style?.display !== "none"
6186
+ );
6187
+ }
6188
+ function resolveRawBodyCellContents(params) {
6178
6189
  const { record, rowIndex, column } = params;
6179
6190
  const value = utils.getValueByDataIndex(record, column.dataIndex);
6180
6191
  const rendered = column.render?.(value, record, rowIndex, column);
@@ -6319,7 +6330,9 @@ function normalizeCellContents(contents) {
6319
6330
  return [normalizeCellContentItem(contents)];
6320
6331
  }
6321
6332
  function normalizeDrawableCellContents(contents) {
6322
- return contents.map(normalizeCellContentItem);
6333
+ return contents.filter(
6334
+ (content) => content.visible !== false && content.style?.display !== "none"
6335
+ ).map(normalizeCellContentItem);
6323
6336
  }
6324
6337
  function normalizeCellContentItem(content) {
6325
6338
  if (content.type !== "money") {
@@ -6329,6 +6342,7 @@ function normalizeCellContentItem(content) {
6329
6342
  type: "text",
6330
6343
  text: formatMoneyValue(content.value, content),
6331
6344
  key: content.key,
6345
+ visible: content.visible,
6332
6346
  style: content.style,
6333
6347
  cursor: content.cursor,
6334
6348
  onClick: content.onClick,