@ceed/cds 1.26.0 → 1.27.0

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
@@ -2321,6 +2321,7 @@ var StyledTd = (0, import_joy25.styled)("td")(({ theme }) => ({
2321
2321
  }));
2322
2322
  var MotionSortIcon = (0, import_framer_motion17.motion)(import_ArrowUpwardRounded.default);
2323
2323
  var DefaultLoadingOverlay = () => /* @__PURE__ */ import_react19.default.createElement(import_joy25.LinearProgress, { value: 8, variant: "plain" });
2324
+ var DefaultNoRowsOverlay = () => /* @__PURE__ */ import_react19.default.createElement(import_joy25.Typography, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
2324
2325
  var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ import_react19.default.createElement(
2325
2326
  Box_default,
2326
2327
  {
@@ -4035,9 +4036,15 @@ function Component(props, apiRef) {
4035
4036
  checkbox: RenderCheckbox = Checkbox_default,
4036
4037
  toolbar: Toolbar,
4037
4038
  footer: Footer,
4038
- loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
4039
+ loadingOverlay: LoadingOverlay = DefaultLoadingOverlay,
4040
+ noRowsOverlay: NoRowsOverlay = DefaultNoRowsOverlay
4041
+ } = {},
4042
+ slotProps: {
4043
+ checkbox: checkboxProps = {},
4044
+ toolbar: toolbarProps,
4045
+ background: backgroundProps = {},
4046
+ noRowsOverlay: noRowsOverlayProps = {}
4039
4047
  } = {},
4040
- slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
4041
4048
  stripe,
4042
4049
  isTotalSelected: ___________,
4043
4050
  ...innerProps
@@ -4081,6 +4088,8 @@ function Component(props, apiRef) {
4081
4088
  const paginationModel = (0, import_react28.useMemo)(() => ({ page, pageSize }), [page, pageSize]);
4082
4089
  const totalSize = virtualizer.getTotalSize();
4083
4090
  const virtualizedItems = virtualizer.getVirtualItems();
4091
+ const showNoRowsOverlay = !loading && rowCount === 0;
4092
+ const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0));
4084
4093
  const getRowClickHandler = (0, import_react28.useCallback)(
4085
4094
  (row, rowId) => (e) => {
4086
4095
  onRowClick?.({ row, rowId }, e);
@@ -4372,6 +4381,18 @@ function Component(props, apiRef) {
4372
4381
  /* @__PURE__ */ import_react28.default.createElement(LoadingOverlay, null)
4373
4382
  )
4374
4383
  )),
4384
+ showNoRowsOverlay && /* @__PURE__ */ import_react28.default.createElement("tr", null, /* @__PURE__ */ import_react28.default.createElement("td", { colSpan: totalColCount, style: { border: "none" } }, /* @__PURE__ */ import_react28.default.createElement(
4385
+ Box_default,
4386
+ {
4387
+ sx: {
4388
+ display: "flex",
4389
+ alignItems: "center",
4390
+ justifyContent: "center",
4391
+ minHeight: "150px"
4392
+ }
4393
+ },
4394
+ /* @__PURE__ */ import_react28.default.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
4395
+ ))),
4375
4396
  virtualizedItems.map((virtualizedRow, index) => {
4376
4397
  const rowIndex = virtualizedRow.index;
4377
4398
  const row = dataInPage[rowIndex];
package/dist/index.js CHANGED
@@ -2089,7 +2089,7 @@ var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().form
2089
2089
 
2090
2090
  // src/components/DataTable/styled.tsx
2091
2091
  import React17 from "react";
2092
- import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses } from "@mui/joy";
2092
+ import { styled as styled8, LinearProgress, buttonClasses, iconButtonClasses, Typography as Typography3 } from "@mui/joy";
2093
2093
  import { motion as motion17 } from "framer-motion";
2094
2094
  import SortIcon from "@mui/icons-material/ArrowUpwardRounded";
2095
2095
  var EllipsisDiv = styled8("div", {
@@ -2195,6 +2195,7 @@ var StyledTd = styled8("td")(({ theme }) => ({
2195
2195
  }));
2196
2196
  var MotionSortIcon = motion17(SortIcon);
2197
2197
  var DefaultLoadingOverlay = () => /* @__PURE__ */ React17.createElement(LinearProgress, { value: 8, variant: "plain" });
2198
+ var DefaultNoRowsOverlay = () => /* @__PURE__ */ React17.createElement(Typography3, { level: "body-sm", textColor: "text.tertiary" }, "No rows");
2198
2199
  var Resizer = (ref, targetRef = ref) => /* @__PURE__ */ React17.createElement(
2199
2200
  Box_default,
2200
2201
  {
@@ -2666,7 +2667,7 @@ var Textarea_default = Textarea;
2666
2667
 
2667
2668
  // src/components/Select/Select.tsx
2668
2669
  import React20, { useMemo as useMemo7 } from "react";
2669
- import { Select as JoySelect, Option as JoyOption, ListItemContent as ListItemContent2, Typography as Typography3 } from "@mui/joy";
2670
+ import { Select as JoySelect, Option as JoyOption, ListItemContent as ListItemContent2, Typography as Typography4 } from "@mui/joy";
2670
2671
  import { motion as motion20 } from "framer-motion";
2671
2672
  var MotionOption = motion20(JoyOption);
2672
2673
  var Option = MotionOption;
@@ -2740,7 +2741,7 @@ function Select(props) {
2740
2741
  return optionMap.get(selected.value)?.label;
2741
2742
  }
2742
2743
  },
2743
- options.map((option) => /* @__PURE__ */ React20.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ React20.createElement(ListItemContent2, { sx: { gap: 0.5 } }, /* @__PURE__ */ React20.createElement(Typography3, { level: "inherit" }, option.label), /* @__PURE__ */ React20.createElement(Typography3, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
2744
+ options.map((option) => /* @__PURE__ */ React20.createElement(Option, { key: option.value, value: option.value, disabled: option.disabled }, option.secondaryText ? /* @__PURE__ */ React20.createElement(ListItemContent2, { sx: { gap: 0.5 } }, /* @__PURE__ */ React20.createElement(Typography4, { level: "inherit" }, option.label), /* @__PURE__ */ React20.createElement(Typography4, { level: secondaryTextLevelMap2[size ?? "md"], textColor: "text.tertiary" }, option.secondaryText)) : option.label))
2744
2745
  );
2745
2746
  return /* @__PURE__ */ React20.createElement(
2746
2747
  FormControl_default,
@@ -3918,9 +3919,15 @@ function Component(props, apiRef) {
3918
3919
  checkbox: RenderCheckbox = Checkbox_default,
3919
3920
  toolbar: Toolbar,
3920
3921
  footer: Footer,
3921
- loadingOverlay: LoadingOverlay = DefaultLoadingOverlay
3922
+ loadingOverlay: LoadingOverlay = DefaultLoadingOverlay,
3923
+ noRowsOverlay: NoRowsOverlay = DefaultNoRowsOverlay
3924
+ } = {},
3925
+ slotProps: {
3926
+ checkbox: checkboxProps = {},
3927
+ toolbar: toolbarProps,
3928
+ background: backgroundProps = {},
3929
+ noRowsOverlay: noRowsOverlayProps = {}
3922
3930
  } = {},
3923
- slotProps: { checkbox: checkboxProps = {}, toolbar: toolbarProps, background: backgroundProps = {} } = {},
3924
3931
  stripe,
3925
3932
  isTotalSelected: ___________,
3926
3933
  ...innerProps
@@ -3964,6 +3971,8 @@ function Component(props, apiRef) {
3964
3971
  const paginationModel = useMemo10(() => ({ page, pageSize }), [page, pageSize]);
3965
3972
  const totalSize = virtualizer.getTotalSize();
3966
3973
  const virtualizedItems = virtualizer.getVirtualItems();
3974
+ const showNoRowsOverlay = !loading && rowCount === 0;
3975
+ const totalColCount = Math.max(1, columns.length + (checkboxSelection ? 1 : 0));
3967
3976
  const getRowClickHandler = useCallback12(
3968
3977
  (row, rowId) => (e) => {
3969
3978
  onRowClick?.({ row, rowId }, e);
@@ -4255,6 +4264,18 @@ function Component(props, apiRef) {
4255
4264
  /* @__PURE__ */ React25.createElement(LoadingOverlay, null)
4256
4265
  )
4257
4266
  )),
4267
+ showNoRowsOverlay && /* @__PURE__ */ React25.createElement("tr", null, /* @__PURE__ */ React25.createElement("td", { colSpan: totalColCount, style: { border: "none" } }, /* @__PURE__ */ React25.createElement(
4268
+ Box_default,
4269
+ {
4270
+ sx: {
4271
+ display: "flex",
4272
+ alignItems: "center",
4273
+ justifyContent: "center",
4274
+ minHeight: "150px"
4275
+ }
4276
+ },
4277
+ /* @__PURE__ */ React25.createElement(NoRowsOverlay, { ...noRowsOverlayProps })
4278
+ ))),
4258
4279
  virtualizedItems.map((virtualizedRow, index) => {
4259
4280
  const rowIndex = virtualizedRow.index;
4260
4281
  const row = dataInPage[rowIndex];