@deix/rossini-core 5.0.0 → 5.2.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.
@@ -14,7 +14,8 @@ export interface ListItemProps {
14
14
  rowIcon?: React.ReactNode;
15
15
  canClick?: boolean;
16
16
  listId: number;
17
+ buttons?: React.ReactNode[];
17
18
  }
18
- declare const ListItem: ({ id, title, subtitle, onClick, actions, density, rowIcon, canClick, listId, }: ListItemProps) => React.JSX.Element;
19
+ declare const ListItem: ({ id, title, subtitle, onClick, actions, density, rowIcon, canClick, listId, buttons, }: ListItemProps) => React.JSX.Element;
19
20
  export default ListItem;
20
21
  //# sourceMappingURL=ListItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/display/PaginatedList/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpD,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;QAClC,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,EAAE,CAAC;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD,QAAA,MAAM,QAAQ,GAAI,gFAUf,aAAa,sBA8Hf,CAAC;AACF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/components/display/PaginatedList/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpD,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;QAClC,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,EAAE,CAAC;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAC7B;AAQD,QAAA,MAAM,QAAQ,GAAI,yFAWf,aAAa,sBAgJf,CAAC;AACF,eAAe,QAAQ,CAAC"}
@@ -9,7 +9,7 @@ import { useLocale } from '../../../utils/hooks/useLocale';
9
9
  standard: 0,
10
10
  comfortable: 1,
11
11
  };*/
12
- const ListItem = ({ id, title, subtitle, onClick, actions = [], density = 'standard', rowIcon, canClick = false, listId, }) => {
12
+ const ListItem = ({ id, title, subtitle, onClick, actions = [], density = 'standard', rowIcon, canClick = false, listId, buttons = [], }) => {
13
13
  const locale = useLocale();
14
14
  const theme = useTheme();
15
15
  // Item Options
@@ -50,7 +50,15 @@ const ListItem = ({ id, title, subtitle, onClick, actions = [], density = 'stand
50
50
  ? isStringTranslation(subtitle)
51
51
  ? subtitle[locale]
52
52
  : subtitle
53
- : undefined }))),
53
+ : undefined }),
54
+ buttons.length > 0 && (React.createElement(Box, { sx: {
55
+ display: 'flex',
56
+ gap: 1,
57
+ ml: 'auto',
58
+ flexWrap: 'wrap',
59
+ justifyContent: { xs: 'flex-start', sm: 'flex-end' },
60
+ mt: { xs: 1, sm: 0 }, // spacing from text if stacked
61
+ } }, buttons)))),
54
62
  React.createElement(Menu, { anchorEl: itemMenuAnchorEl, id: 'options-menu', open: isItemMenuOpen, onClose: () => setItemMenuAnchorEl(null), onClick: () => setItemMenuAnchorEl(null), slotProps: {
55
63
  paper: {
56
64
  elevation: 0,
@@ -78,6 +86,8 @@ const ListItem = ({ id, title, subtitle, onClick, actions = [], density = 'stand
78
86
  },
79
87
  },
80
88
  },
81
- }, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, actions.map((action) => (React.createElement(MenuItem, { onClick: action.onClick }, isStringTranslation(action.label) ? action.label[locale] : action.label))))));
89
+ }, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, actions.map((action) => (React.createElement(MenuItem, { onClick: action.onClick }, isStringTranslation(action.label)
90
+ ? action.label[locale]
91
+ : action.label))))));
82
92
  };
83
93
  export default ListItem;
@@ -15,7 +15,8 @@ export interface PaginatedListProps {
15
15
  densityMenuEnabled?: boolean;
16
16
  maxHeight?: string | number;
17
17
  emptyDataLabel?: string;
18
+ disablePaginationLabels?: boolean;
18
19
  }
19
- declare const PaginatedList: ({ title, subtitle, items, totalItems, page, onPageChange, pageSize, rowsPerPageOptions, onPageSizeChange, menu, densityMenuEnabled, maxHeight, emptyDataLabel, }: PaginatedListProps) => React.JSX.Element;
20
+ declare const PaginatedList: ({ title, subtitle, items, totalItems, page, onPageChange, pageSize, rowsPerPageOptions, onPageSizeChange, menu, densityMenuEnabled, maxHeight, emptyDataLabel, disablePaginationLabels, }: PaginatedListProps) => React.JSX.Element;
20
21
  export default PaginatedList;
21
22
  //# sourceMappingURL=PaginatedList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedList.d.ts","sourceRoot":"","sources":["../../../../src/components/display/PaginatedList/PaginatedList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAqB5C,OAAiB,EAAW,aAAa,EAAE,MAAM,YAAY,CAAC;AAI9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA2BD,QAAA,MAAM,aAAa,GAAI,kKAcpB,kBAAkB,sBA4KpB,CAAC;AACF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"PaginatedList.d.ts","sourceRoot":"","sources":["../../../../src/components/display/PaginatedList/PaginatedList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAqB5C,OAAiB,EAAW,aAAa,EAAE,MAAM,YAAY,CAAC;AAI9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AA2BD,QAAA,MAAM,aAAa,GAAI,2LAepB,kBAAkB,sBA8KpB,CAAC;AACF,eAAe,aAAa,CAAC"}
@@ -31,7 +31,7 @@ const paginatedListTranslations = {
31
31
  en: 'No data available',
32
32
  },
33
33
  };
34
- const PaginatedList = ({ title, subtitle, items, totalItems, page = 0, onPageChange, pageSize = 10, rowsPerPageOptions = [10, 25, 50], onPageSizeChange, menu = [], densityMenuEnabled = false, maxHeight = '90vh', emptyDataLabel, }) => {
34
+ const PaginatedList = ({ title, subtitle, items, totalItems, page = 0, onPageChange, pageSize = 10, rowsPerPageOptions = [10, 25, 50], onPageSizeChange, menu = [], densityMenuEnabled = false, maxHeight = '90vh', emptyDataLabel, disablePaginationLabels = false, }) => {
35
35
  const locale = useLocale();
36
36
  // Appearance
37
37
  const [listDensity, setListDensity] = usePersistedState(`listDensity`, 'standard');
@@ -61,10 +61,10 @@ const PaginatedList = ({ title, subtitle, items, totalItems, page = 0, onPageCha
61
61
  } }, items.map((item) => (React.createElement(ListItem, { ...item, key: item.id, density: listDensity })))),
62
62
  React.createElement(Grid, { container: true, justifyContent: 'space-between' },
63
63
  React.createElement(Grid, { size: { xs: 12, md: 3 }, sx: { textAlign: 'start' } },
64
- React.createElement(Typography, { variant: 'caption', sx: { mr: 2 } },
64
+ !disablePaginationLabels && (React.createElement(Typography, { variant: 'caption', sx: { mr: 2 } },
65
65
  paginatedListTranslations.rowsPerPage[locale] ||
66
66
  'Rows per page',
67
- ":"),
67
+ ":")),
68
68
  React.createElement(Select, { labelId: 'page-size-select-label', id: 'page-size-select', value: Number(pageSize), label: 'Rows per Page', onChange: (event) => {
69
69
  onPageSizeChange(Number(event.target.value));
70
70
  }, variant: 'standard' }, rowsPerPageOptions.map((opt) => (React.createElement(MenuItem, { key: opt, value: Number(opt) },