{isSlotUsed(this.el, "pagination-bar") ? (
diff --git a/packages/canary-web-components/src/components/ic-data-table/ic-data-table.types.tsx b/packages/canary-web-components/src/components/ic-data-table/ic-data-table.types.tsx
index 8e59149d50..73289103c4 100644
--- a/packages/canary-web-components/src/components/ic-data-table/ic-data-table.types.tsx
+++ b/packages/canary-web-components/src/components/ic-data-table/ic-data-table.types.tsx
@@ -41,6 +41,18 @@ export type IcDataTableColumnObject = {
};
};
+export type IcLoadingOptions = {
+ monochrome?: boolean;
+ description?: string;
+ label?: string;
+ labelDuration?: number;
+ max?: number;
+ min?: number;
+ progress?: number;
+ showBackground?: boolean;
+ overlay?: boolean;
+};
+
export type IcDataTableRowHeights = number | "auto";
export interface IcDensityUpdateEventDetail {
diff --git a/packages/canary-web-components/src/components/ic-data-table/readme.md b/packages/canary-web-components/src/components/ic-data-table/readme.md
index 2ee41f5e20..418b814d44 100644
--- a/packages/canary-web-components/src/components/ic-data-table/readme.md
+++ b/packages/canary-web-components/src/components/ic-data-table/readme.md
@@ -7,35 +7,35 @@
## Properties
-| Property | Attribute | Description | Type | Default |
-| ------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `caption` _(required)_ | `caption` | The title for the table only visible to screen readers. | `string` | `undefined` |
-| `columnHeaderTruncation` | `column-header-truncation` | Determines whether the column header should be truncated and display a tooltip. Default is `false`. | `boolean` | `false` |
-| `columns` _(required)_ | -- | The column headers for the table. | `IcDataTableColumnObject[]` | `undefined` |
-| `data` | -- | The row content for the table. | `IcDataTableDataType[]` | `undefined` |
-| `density` | `density` | Set the density of the table including font and padding. | `"default" \| "dense" \| "spacious"` | `"default"` |
-| `embedded` | `embedded` | Applies a border to the table container. | `boolean` | `false` |
-| `globalRowHeight` | `global-row-height` | Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method. | `"auto" \| number` | `"auto"` |
-| `height` | `height` | Sets the table height. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. | `string` | `undefined` |
-| `hideColumnHeaders` | `hide-column-headers` | If `true`, column headers will not be visible. | `boolean` | `false` |
-| `loading` | `loading` | When set to `true`, the full table will show a loading state, featuring a radial indicator. | `boolean` | `false` |
-| `loadingOptions` | -- | Sets the props for the circular loading indicator used in the loading state. | `{ description?: string; label?: string; labelDuration?: number; max?: number; min?: number; progress?: number; showBackground?: boolean; monochrome?: boolean; }` | `undefined` |
-| `maxWidth` | `max-width` | Sets the maximum width of the data table. Can be set in `px`, `rem`, or `%`. | `string` | `undefined` |
-| `minWidth` | `min-width` | Sets the minimum width of the data table. Can be set in `px`, `rem`, or `%`. | `string` | `undefined` |
-| `minimumLoadingDisplayDuration` | `minimum-loading-display-duration` | The minimum amount of time the `loading` state displays for before showing the data. Used to prevent flashing in the component. | `number` | `1000` |
-| `paginationBarOptions` | -- | Sets the props for the built-in pagination bar. If the `pagination-bar` slot is used then this prop is ignored. | `IcPaginationBarOptions` | `{ itemsPerPageOptions: [ { label: "10", value: "10" }, { label: "25", value: "25" }, { label: "50", value: "50" }, ], rangeLabelType: "page", type: "simple", showItemsPerPageControl: true, showGoToPageControl: true, alignment: "right", itemLabel: "Item", pageLabel: "Page", hideRangeLabel: false, hideAllFromItemsPerPage: false, monochrome: false, }` |
-| `showPagination` | `show-pagination` | If `true`, adds a pagination bar to the bottom of the table. | `boolean` | `false` |
-| `sortOptions` | -- | Sets the order columns will be sorted in and allows for 'default' sorts to be added. | `{ sortOrders: IcDataTableSortOrderOptions[]; defaultColumn?: string; }` | `{ sortOrders: ["unsorted", "ascending", "descending"], defaultColumn: "", }` |
-| `sortable` | `sortable` | If `true`, allows table columns to be sorted using applied sort buttons. | `boolean` | `false` |
-| `stickyColumnHeaders` | `sticky-column-headers` | If `true`, column headers will remain at the top of the table when scrolling vertically. | `boolean` | `false` |
-| `stickyRowHeaders` | `sticky-row-headers` | If `true`, row headers will remain to the left when scrolling horizontally. | `boolean` | `false` |
-| `tableLayout` | `table-layout` | Sets the layout of the table | `"auto" \| "fixed"` | `"fixed"` |
-| `theme` | `theme` | Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. | `"dark" \| "inherit" \| "light"` | `"inherit"` |
-| `truncationPattern` | `truncation-pattern` | Sets the method used to truncate long text in cells where textWrap is `false`. The `tooltip` truncation pattern allows the overflowing text to be seen in a tooltip. The `show-hide` truncation pattern allows the overflowing text to be shown and hidden using the ic-typography "See more"/"See less" buttons. | `"show-hide" \| "tooltip"` | `undefined` |
-| `updating` | `updating` | If `true`, the table displays a linear loading indicator below the header row to indicate an updating state. | `boolean` | `false` |
-| `updatingOptions` | -- | Sets the props for the linear loading indicator used in the updating state. | `{ description?: string; max?: number; min?: number; progress?: number; monochrome?: boolean; }` | `undefined` |
-| `variableRowHeight` | -- | Allows for custom setting of row heights on individual rows based on an individual value from the `data` prop and the row index. If the function returns `null`, that row's height will be set to the `globalRowHeight` property. | `(params: { [key: string]: any; index: number; }) => IcDataTableRowHeights` | `undefined` |
-| `width` | `width` | Sets the table width. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. | `string` | `undefined` |
+| Property | Attribute | Description | Type | Default |
+| ------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `caption` _(required)_ | `caption` | The title for the table only visible to screen readers. | `string` | `undefined` |
+| `columnHeaderTruncation` | `column-header-truncation` | Determines whether the column header should be truncated and display a tooltip. Default is `false`. | `boolean` | `false` |
+| `columns` _(required)_ | -- | The column headers for the table. | `IcDataTableColumnObject[]` | `undefined` |
+| `data` | -- | The row content for the table. | `IcDataTableDataType[]` | `undefined` |
+| `density` | `density` | Set the density of the table including font and padding. | `"default" \| "dense" \| "spacious"` | `"default"` |
+| `embedded` | `embedded` | Applies a border to the table container. | `boolean` | `false` |
+| `globalRowHeight` | `global-row-height` | Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method. | `"auto" \| number` | `"auto"` |
+| `height` | `height` | Sets the table height. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. | `string` | `undefined` |
+| `hideColumnHeaders` | `hide-column-headers` | If `true`, column headers will not be visible. | `boolean` | `false` |
+| `loading` | `loading` | When set to `true`, the full table will show a loading state, featuring a radial indicator. | `boolean` | `false` |
+| `loadingOptions` | -- | Sets the props for the circular loading indicator used in the loading state. | `{ description?: string; label?: string; labelDuration?: number; max?: number; min?: number; progress?: number; showBackground?: boolean; monochrome?: boolean; overlay?: boolean; }` | `undefined` |
+| `maxWidth` | `max-width` | Sets the maximum width of the data table. Can be set in `px`, `rem`, or `%`. | `string` | `undefined` |
+| `minWidth` | `min-width` | Sets the minimum width of the data table. Can be set in `px`, `rem`, or `%`. | `string` | `undefined` |
+| `minimumLoadingDisplayDuration` | `minimum-loading-display-duration` | The minimum amount of time the `loading` state displays for before showing the data. Used to prevent flashing in the component. | `number` | `1000` |
+| `paginationBarOptions` | -- | Sets the props for the built-in pagination bar. If the `pagination-bar` slot is used then this prop is ignored. | `IcPaginationBarOptions` | `{ itemsPerPageOptions: [ { label: "10", value: "10" }, { label: "25", value: "25" }, { label: "50", value: "50" }, ], rangeLabelType: "page", type: "simple", showItemsPerPageControl: true, showGoToPageControl: true, alignment: "right", itemLabel: "Item", pageLabel: "Page", hideRangeLabel: false, hideAllFromItemsPerPage: false, monochrome: false, }` |
+| `showPagination` | `show-pagination` | If `true`, adds a pagination bar to the bottom of the table. | `boolean` | `false` |
+| `sortOptions` | -- | Sets the order columns will be sorted in and allows for 'default' sorts to be added. | `{ sortOrders: IcDataTableSortOrderOptions[]; defaultColumn?: string; }` | `{ sortOrders: ["unsorted", "ascending", "descending"], defaultColumn: "", }` |
+| `sortable` | `sortable` | If `true`, allows table columns to be sorted using applied sort buttons. | `boolean` | `false` |
+| `stickyColumnHeaders` | `sticky-column-headers` | If `true`, column headers will remain at the top of the table when scrolling vertically. | `boolean` | `false` |
+| `stickyRowHeaders` | `sticky-row-headers` | If `true`, row headers will remain to the left when scrolling horizontally. | `boolean` | `false` |
+| `tableLayout` | `table-layout` | Sets the layout of the table | `"auto" \| "fixed"` | `"fixed"` |
+| `theme` | `theme` | Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. | `"dark" \| "inherit" \| "light"` | `"inherit"` |
+| `truncationPattern` | `truncation-pattern` | Sets the method used to truncate long text in cells where textWrap is `false`. The `tooltip` truncation pattern allows the overflowing text to be seen in a tooltip. The `show-hide` truncation pattern allows the overflowing text to be shown and hidden using the ic-typography "See more"/"See less" buttons. | `"show-hide" \| "tooltip"` | `undefined` |
+| `updating` | `updating` | If `true`, the table displays a linear loading indicator below the header row to indicate an updating state. | `boolean` | `false` |
+| `updatingOptions` | -- | Sets the props for the linear loading indicator used in the updating state. | `{ description?: string; max?: number; min?: number; progress?: number; monochrome?: boolean; }` | `undefined` |
+| `variableRowHeight` | -- | Allows for custom setting of row heights on individual rows based on an individual value from the `data` prop and the row index. If the function returns `null`, that row's height will be set to the `globalRowHeight` property. | `(params: { [key: string]: any; index: number; }) => IcDataTableRowHeights` | `undefined` |
+| `width` | `width` | Sets the table width. Can be set to `auto` or a specific value in `px`, `rem`, or `%`. | `string` | `undefined` |
## Events
diff --git a/packages/canary-web-components/src/components/ic-data-table/story-data.ts b/packages/canary-web-components/src/components/ic-data-table/story-data.ts
index 9df6884f21..df5aad9d6f 100644
--- a/packages/canary-web-components/src/components/ic-data-table/story-data.ts
+++ b/packages/canary-web-components/src/components/ic-data-table/story-data.ts
@@ -1278,6 +1278,7 @@ export const Loading = (): HTMLIcDataTableElement => {
dataTable.setAttribute("loading", "true");
return dataTable;
};
+
export const EmptyLoading = (): HTMLIcDataTableElement => {
const dataTable = createDataTableElement(
"Empty and Loading State",
diff --git a/packages/canary-web-components/src/components/ic-data-table/test/basic/__snapshots__/ic-data-table.spec.tsx.snap b/packages/canary-web-components/src/components/ic-data-table/test/basic/__snapshots__/ic-data-table.spec.tsx.snap
index 349853a83f..abc29d7f96 100644
--- a/packages/canary-web-components/src/components/ic-data-table/test/basic/__snapshots__/ic-data-table.spec.tsx.snap
+++ b/packages/canary-web-components/src/components/ic-data-table/test/basic/__snapshots__/ic-data-table.spec.tsx.snap
@@ -225,6 +225,7 @@ exports[`ic-data-table should apply a specified row height to all rows when glob
+
@@ -455,6 +456,7 @@ exports[`ic-data-table should apply a specified row height to specific rows when
+
@@ -685,6 +687,7 @@ exports[`ic-data-table should apply the correct density scaler to rowHeights whe
+
@@ -915,6 +918,7 @@ exports[`ic-data-table should apply the correct density scaler to rowHeights whe
+
@@ -964,6 +968,7 @@ exports[`ic-data-table should be able to slot a custom empty state into the data
+
@@ -1234,6 +1239,7 @@ exports[`ic-data-table should correctly render a custom icon in the header when
+
@@ -1464,6 +1470,7 @@ exports[`ic-data-table should not override the height of certain rows if \`varia
+
@@ -1694,6 +1701,7 @@ exports[`ic-data-table should not override the height of rows if \`globalRowHeig
+
@@ -1924,6 +1932,7 @@ exports[`ic-data-table should not render custom icon in header when hideOnHeader
+
@@ -2155,6 +2164,7 @@ exports[`ic-data-table should pass the caption down to any slotted ic-data-table
+
@@ -2277,6 +2287,9 @@ exports[`ic-data-table should pass through the updatingOptions to the linear loa
+
+ Updating
+
@@ -2507,6 +2520,7 @@ exports[`ic-data-table should render 1`] = `
+
@@ -2738,6 +2752,7 @@ exports[`ic-data-table should render a slotted icon instead of an icon defined i
+