@movalib/movalib-commons 1.68.22 → 1.68.23

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/devIndex.tsx CHANGED
@@ -79,7 +79,7 @@ const App = () => {
79
79
  const getQRCodeData = ():string => {
80
80
  // On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
81
81
  //return `https://app.movalib.com/#/garage/2?redirect=garage`;
82
- return `https://forms.gle/TabzYcYiaLNfhTu7A`;
82
+ return `https://movalib.com/demo`;
83
83
  }
84
84
 
85
85
  const handleScheduleChange = (schedule: DaySchedule[]) => {
package/dist/devIndex.js CHANGED
@@ -104,7 +104,7 @@ var App = function () {
104
104
  var getQRCodeData = function () {
105
105
  // On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
106
106
  //return `https://app.movalib.com/#/garage/2?redirect=garage`;
107
- return "https://forms.gle/TabzYcYiaLNfhTu7A";
107
+ return "https://movalib.com/demo";
108
108
  };
109
109
  var handleScheduleChange = function (schedule) {
110
110
  if (schedule) {
@@ -21,6 +21,7 @@ type TMovaTable<T> = {
21
21
  onRowDoubleClick?: (data: T) => void;
22
22
  filterChildren?: React.ReactNode;
23
23
  asSearchSection?: boolean;
24
+ placeHolderNoData?: React.ReactNode;
24
25
  };
25
- export default function MovaTableBack<T>({ useDataHook, displayedColumns, pagination, compact, onRowClick, onRowRightClick, onRowDoubleClick, isClickable, filterChildren, asSearchSection }: TMovaTable<T>): import("react/jsx-runtime").JSX.Element;
26
+ export default function MovaTableBack<T>({ useDataHook, displayedColumns, pagination, compact, onRowClick, onRowRightClick, onRowDoubleClick, isClickable, filterChildren, asSearchSection, placeHolderNoData, }: TMovaTable<T>): import("react/jsx-runtime").JSX.Element;
26
27
  export {};
@@ -10,7 +10,7 @@ var Search_1 = __importDefault(require("@mui/icons-material/Search"));
10
10
  var material_1 = require("@mui/material");
11
11
  var react_1 = require("react");
12
12
  function MovaTableBack(_a) {
13
- var useDataHook = _a.useDataHook, displayedColumns = _a.displayedColumns, pagination = _a.pagination, compact = _a.compact, onRowClick = _a.onRowClick, onRowRightClick = _a.onRowRightClick, onRowDoubleClick = _a.onRowDoubleClick, isClickable = _a.isClickable, filterChildren = _a.filterChildren, _b = _a.asSearchSection, asSearchSection = _b === void 0 ? true : _b;
13
+ var useDataHook = _a.useDataHook, displayedColumns = _a.displayedColumns, pagination = _a.pagination, compact = _a.compact, onRowClick = _a.onRowClick, onRowRightClick = _a.onRowRightClick, onRowDoubleClick = _a.onRowDoubleClick, isClickable = _a.isClickable, filterChildren = _a.filterChildren, _b = _a.asSearchSection, asSearchSection = _b === void 0 ? true : _b, placeHolderNoData = _a.placeHolderNoData;
14
14
  var _c = (0, react_1.useState)(0), currentPageIndex = _c[0], setCurrentPageIndex = _c[1];
15
15
  var _d = (0, react_1.useState)(25), rowsPerPage = _d[0], setRowsPerPage = _d[1];
16
16
  var _e = (0, react_1.useState)(""), search = _e[0], setSearch = _e[1];
@@ -61,7 +61,7 @@ function MovaTableBack(_a) {
61
61
  gap: 2,
62
62
  }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { size: "small", type: "search", onChange: handleSearchChange, inputProps: {
63
63
  startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(Search_1.default, {}) })),
64
- }, sx: { width: "100%" }, placeholder: "Rechercher" }), refresh && ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", onClick: refresh, variant: "contained", children: (0, jsx_runtime_1.jsx)(icons_material_1.Refresh, {}) }))] }), filterChildren && filterChildren, (0, jsx_runtime_1.jsx)(material_1.TableContainer, { sx: { height: "100%" }, component: material_1.Paper, children: (0, jsx_runtime_1.jsxs)(material_1.Table, { size: compact ? "small" : "medium", sx: { height: "100%" }, stickyHeader: true, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: displayedColumns.map(function (column, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: column.displayName }, index)); }) }) }), (0, jsx_runtime_1.jsxs)(material_1.TableBody, { sx: { overflowY: "auto" }, children: [isLoading && ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: 5, sx: { padding: 0 }, children: (0, jsx_runtime_1.jsx)(material_1.LinearProgress, {}) }) })), (data === null || data === void 0 ? void 0 : data.length) !== 0 &&
64
+ }, sx: { width: "100%" }, placeholder: "Rechercher" }), refresh && ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", onClick: refresh, variant: "contained", children: (0, jsx_runtime_1.jsx)(icons_material_1.Refresh, {}) }))] }), filterChildren && filterChildren, (0, jsx_runtime_1.jsx)(material_1.TableContainer, { sx: { height: "100%" }, component: material_1.Paper, children: (0, jsx_runtime_1.jsxs)(material_1.Table, { size: compact ? "small" : "medium", sx: { height: "100%" }, stickyHeader: true, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: displayedColumns.map(function (column, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: column.displayName }, index)); }) }) }), (0, jsx_runtime_1.jsxs)(material_1.TableBody, { sx: { overflowY: "auto" }, children: [isLoading && ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: 5, sx: { padding: 0 }, children: (0, jsx_runtime_1.jsx)(material_1.LinearProgress, {}) }) })), !isLoading && (data === null || data === void 0 ? void 0 : data.length) === 0 && placeHolderNoData && ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: displayedColumns.length, sx: { textAlign: "center", color: "grey.400" }, children: placeHolderNoData }) })), (data === null || data === void 0 ? void 0 : data.length) !== 0 &&
65
65
  (data === null || data === void 0 ? void 0 : data.map(function (element, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableRow, { onDoubleClick: function () {
66
66
  handleDoubleClick(element);
67
67
  }, onClick: function () { return handleRowClick(element); }, onContextMenu: function (event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.68.22",
3
+ "version": "1.68.23",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -50,6 +50,7 @@ type TMovaTable<T> = {
50
50
  onRowDoubleClick?: (data: T) => void;
51
51
  filterChildren?: React.ReactNode;
52
52
  asSearchSection?: boolean;
53
+ placeHolderNoData?: React.ReactNode;
53
54
  };
54
55
 
55
56
  export default function MovaTableBack<T>({
@@ -62,7 +63,8 @@ export default function MovaTableBack<T>({
62
63
  onRowDoubleClick,
63
64
  isClickable,
64
65
  filterChildren,
65
- asSearchSection = true
66
+ asSearchSection = true,
67
+ placeHolderNoData,
66
68
  }: TMovaTable<T>) {
67
69
  const [currentPageIndex, setCurrentPageIndex] = useState<number>(0);
68
70
  const [rowsPerPage, setRowsPerPage] = useState<number>(25);
@@ -127,7 +129,6 @@ export default function MovaTableBack<T>({
127
129
  setCurrentPageIndex(0);
128
130
  }
129
131
  }, 700);
130
-
131
132
  return (
132
133
  <div style={{ height: "100%", display: "flex", flexDirection: "column" }}>
133
134
  {asSearchSection && <Box
@@ -182,6 +183,17 @@ export default function MovaTableBack<T>({
182
183
  </TableRow>
183
184
  )}
184
185
 
186
+ {!isLoading && data?.length === 0 && placeHolderNoData && (
187
+ <TableRow>
188
+ <TableCell
189
+ colSpan={displayedColumns.length}
190
+ sx={{ textAlign: "center", color: "grey.400" }}
191
+ >
192
+ {placeHolderNoData}
193
+ </TableCell>
194
+ </TableRow>
195
+ )}
196
+
185
197
  {data?.length !== 0 &&
186
198
  data?.map((element, index) => (
187
199
  <TableRow