@amateescu/portal-ui-components 0.0.9-beta0 → 0.0.10-beta0

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.
@@ -0,0 +1 @@
1
+ export declare function CustomFooter({ total, columnsDefinitions, isRtl }: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsxs as h, Fragment as l, jsx as r } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { CustomPagination as w } from "../CustomPagination/CustomPagination.js";
4
+ import { TotalDataGrid as p } from "../TotalDataGrid/TotalDataGrid.js";
5
+ import { useGridApiContext as m, useGridSelector as i, gridFilteredTopLevelRowCountSelector as v, useGridRootProps as u, gridPageSizeSelector as L, GridFooterContainer as k } from "@mui/x-data-grid";
6
+ const f = (e) => /* @__PURE__ */ t.createElement("svg", { width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("g", { id: "arrow/chevron/</default-first" }, /* @__PURE__ */ t.createElement("path", { id: "vector", d: "M17.5 5L10.5 12L17.5 19M7.5 5L7.5 19", stroke: "#045529", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }))), x = (e) => /* @__PURE__ */ t.createElement("svg", { width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("g", { id: "arrow/chevron/>/end" }, /* @__PURE__ */ t.createElement("path", { id: "vector", d: "M7.5 4.99998L14.5 12L7.5 19M17.5 4.99998L17.5 19", stroke: "#045529", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }))), E = (e) => /* @__PURE__ */ t.createElement("svg", { width: 10, height: 16, viewBox: "0 0 10 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("path", { d: "M1.5 1L8.5 8L1.5 15", stroke: "#045529", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), C = (e) => /* @__PURE__ */ t.createElement("svg", { width: 10, height: 16, viewBox: "0 0 10 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ t.createElement("path", { d: "M8.5 15L1.5 8L8.5 1", stroke: "#045529", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), S = (e, o) => o > 0 && e > 0 ? Math.ceil(e / o) : 0;
7
+ function G({ total: e, columnsDefinitions: o, isRtl: s }) {
8
+ const n = m(), c = i(n, v), d = u(), a = i(n, L), g = S(d.rowCount ?? c, a);
9
+ return /* @__PURE__ */ h(l, { children: [
10
+ /* @__PURE__ */ r("div", { style: { paddingTop: "10px", height: "7%" }, children: (e == null ? void 0 : e.length) > 0 && /* @__PURE__ */ r(
11
+ p,
12
+ {
13
+ rows: e,
14
+ isFetching: !1,
15
+ columnsDefinitions: o
16
+ }
17
+ ) }),
18
+ /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(
19
+ w,
20
+ {
21
+ isRtl: s,
22
+ pageCount: g,
23
+ arrowFirstIcon: f,
24
+ arrowLastIcon: x,
25
+ nextIcon: E,
26
+ previousIcon: C
27
+ }
28
+ ) })
29
+ ] });
30
+ }
31
+ export {
32
+ G as CustomFooter
33
+ };
@@ -1,15 +1,15 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { DataGrid as t, gridClasses as o } from "@mui/x-data-grid";
3
- const p = ({
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { DataGrid as l, gridClasses as o } from "@mui/x-data-grid";
3
+ const u = ({
4
4
  rows: e,
5
- isFetching: n
6
- // columnsDefinitions
7
- }) => /* @__PURE__ */ a(
8
- t,
5
+ isFetching: n,
6
+ columnsDefinitions: r
7
+ }) => /* @__PURE__ */ t(
8
+ l,
9
9
  {
10
10
  loading: (!e || !e.length) && n,
11
- rows: e.map((i, r) => (i.id = r, i)),
12
- columns: [],
11
+ rows: e.map((i, a) => (i.id = a, i)),
12
+ columns: r,
13
13
  getRowClassName: (i) => i.id === e.length - 1 ? "last-row" : "",
14
14
  sx: {
15
15
  "& .last-row": {
@@ -121,5 +121,5 @@ const p = ({
121
121
  }
122
122
  );
123
123
  export {
124
- p as TotalDataGrid
124
+ u as TotalDataGrid
125
125
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@amateescu/portal-ui-components",
3
3
  "main": "dist/main.js",
4
4
  "types": "dist/main.d.ts",
5
- "version": "0.0.9-beta0",
5
+ "version": "0.0.10-beta0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"