jett.admin.npmpackage 2.0.23 → 2.0.25
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.js +110 -24
- package/dist/index.mjs +111 -22
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
AppSideBar: () => AppSideBar,
|
|
33
|
+
Calendar: () => Calendar,
|
|
33
34
|
Chip: () => Chip,
|
|
34
35
|
CustomAutocomplete: () => CustomAutocomplete,
|
|
35
36
|
CustomButton: () => CustomButton,
|
|
@@ -1571,7 +1572,8 @@ var RightSheet = ({
|
|
|
1571
1572
|
callBack,
|
|
1572
1573
|
actionLabel = "Save",
|
|
1573
1574
|
onAction = () => {
|
|
1574
|
-
}
|
|
1575
|
+
},
|
|
1576
|
+
showFooter = true
|
|
1575
1577
|
}) => {
|
|
1576
1578
|
const [visible, setVisible] = (0, import_react15.useState)(open);
|
|
1577
1579
|
(0, import_react15.useEffect)(() => {
|
|
@@ -1611,7 +1613,7 @@ var RightSheet = ({
|
|
|
1611
1613
|
id: `${id}-div-2`
|
|
1612
1614
|
},
|
|
1613
1615
|
/* @__PURE__ */ import_react15.default.createElement("div", { className: " min-h-full ", id: `${id}-div-3` }, children),
|
|
1614
|
-
/* @__PURE__ */ import_react15.default.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ import_react15.default.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ import_react15.default.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1616
|
+
showFooter && /* @__PURE__ */ import_react15.default.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ import_react15.default.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ import_react15.default.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1615
1617
|
)
|
|
1616
1618
|
);
|
|
1617
1619
|
};
|
|
@@ -1803,8 +1805,91 @@ var Dropdown = import_react17.default.forwardRef(
|
|
|
1803
1805
|
);
|
|
1804
1806
|
Dropdown.displayName = "Dropdown";
|
|
1805
1807
|
|
|
1806
|
-
// src/
|
|
1808
|
+
// src/Calendar/Calendar.tsx
|
|
1807
1809
|
var import_react18 = __toESM(require("react"));
|
|
1810
|
+
var import_dates = require("@mantine/dates");
|
|
1811
|
+
var Calendar = (props) => {
|
|
1812
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1813
|
+
const {
|
|
1814
|
+
minDate,
|
|
1815
|
+
maxDate,
|
|
1816
|
+
excludeDate,
|
|
1817
|
+
firstDayOfWeek = 1,
|
|
1818
|
+
locale,
|
|
1819
|
+
size,
|
|
1820
|
+
className,
|
|
1821
|
+
error
|
|
1822
|
+
} = props;
|
|
1823
|
+
const isRange = props.mode === "range";
|
|
1824
|
+
const isDateTime = props.mode === "datetime";
|
|
1825
|
+
const datesProviderSettings = {
|
|
1826
|
+
firstDayOfWeek,
|
|
1827
|
+
consistentWeeks: true
|
|
1828
|
+
};
|
|
1829
|
+
if (locale) {
|
|
1830
|
+
datesProviderSettings.locale = locale;
|
|
1831
|
+
}
|
|
1832
|
+
const anchorDate = isRange ? ((_a = props.value) == null ? void 0 : _a[0]) ?? ((_b = props.value) == null ? void 0 : _b[1]) ?? ((_c = props.defaultValue) == null ? void 0 : _c[0]) ?? ((_d = props.defaultValue) == null ? void 0 : _d[1]) ?? void 0 : !isDateTime ? props.value ?? props.defaultValue ?? void 0 : void 0;
|
|
1833
|
+
const [displayDate, setDisplayDate] = (0, import_react18.useState)(anchorDate ?? void 0);
|
|
1834
|
+
const anchorTime = isRange ? ((_f = (_e = props.value) == null ? void 0 : _e[0]) == null ? void 0 : _f.getTime()) ?? ((_h = (_g = props.value) == null ? void 0 : _g[1]) == null ? void 0 : _h.getTime()) : !isDateTime ? (_i = props.value) == null ? void 0 : _i.getTime() : void 0;
|
|
1835
|
+
(0, import_react18.useEffect)(() => {
|
|
1836
|
+
if (anchorTime !== void 0) {
|
|
1837
|
+
setDisplayDate(new Date(anchorTime));
|
|
1838
|
+
}
|
|
1839
|
+
}, [anchorTime]);
|
|
1840
|
+
const weekendColorStyle = {
|
|
1841
|
+
"--mantine-color-red-6": "var(--mantine-color-text)"
|
|
1842
|
+
};
|
|
1843
|
+
if (isRange) {
|
|
1844
|
+
const datePickerProps2 = {
|
|
1845
|
+
type: "range",
|
|
1846
|
+
value: props.value,
|
|
1847
|
+
defaultValue: props.defaultValue,
|
|
1848
|
+
onChange: props.onChange,
|
|
1849
|
+
minDate,
|
|
1850
|
+
maxDate,
|
|
1851
|
+
excludeDate,
|
|
1852
|
+
size,
|
|
1853
|
+
className,
|
|
1854
|
+
date: displayDate,
|
|
1855
|
+
onDateChange: setDisplayDate,
|
|
1856
|
+
style: weekendColorStyle
|
|
1857
|
+
};
|
|
1858
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_dates.DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ import_react18.default.createElement(import_dates.DatePicker, { ...datePickerProps2 }));
|
|
1859
|
+
}
|
|
1860
|
+
if (isDateTime) {
|
|
1861
|
+
const dateTimePickerProps = {
|
|
1862
|
+
value: props.value,
|
|
1863
|
+
defaultValue: props.defaultValue,
|
|
1864
|
+
onChange: props.onChange,
|
|
1865
|
+
minDate,
|
|
1866
|
+
maxDate,
|
|
1867
|
+
excludeDate,
|
|
1868
|
+
size,
|
|
1869
|
+
className,
|
|
1870
|
+
error,
|
|
1871
|
+
style: weekendColorStyle
|
|
1872
|
+
};
|
|
1873
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_dates.DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ import_react18.default.createElement(import_dates.DateTimePicker, { ...dateTimePickerProps }));
|
|
1874
|
+
}
|
|
1875
|
+
const datePickerProps = {
|
|
1876
|
+
value: props.value,
|
|
1877
|
+
defaultValue: props.defaultValue,
|
|
1878
|
+
onChange: props.onChange,
|
|
1879
|
+
minDate,
|
|
1880
|
+
maxDate,
|
|
1881
|
+
excludeDate,
|
|
1882
|
+
size,
|
|
1883
|
+
className,
|
|
1884
|
+
date: displayDate,
|
|
1885
|
+
onDateChange: setDisplayDate,
|
|
1886
|
+
style: weekendColorStyle
|
|
1887
|
+
};
|
|
1888
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_dates.DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ import_react18.default.createElement(import_dates.DatePicker, { ...datePickerProps }));
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
// src/Pagination/Pagination.jsx
|
|
1892
|
+
var import_react19 = __toESM(require("react"));
|
|
1808
1893
|
var import_lucide_react9 = require("lucide-react");
|
|
1809
1894
|
var Pagination = ({
|
|
1810
1895
|
id = "pagination",
|
|
@@ -1829,26 +1914,26 @@ var Pagination = ({
|
|
|
1829
1914
|
componentProps = {},
|
|
1830
1915
|
...restProps
|
|
1831
1916
|
}) => {
|
|
1832
|
-
const [internalCurrentPage, setInternalCurrentPage] = (0,
|
|
1833
|
-
const [internalItemsPerPage, setInternalItemsPerPage] = (0,
|
|
1917
|
+
const [internalCurrentPage, setInternalCurrentPage] = (0, import_react19.useState)(1);
|
|
1918
|
+
const [internalItemsPerPage, setInternalItemsPerPage] = (0, import_react19.useState)(itemsPerPage);
|
|
1834
1919
|
const isControlled = controlledCurrentPage !== void 0;
|
|
1835
1920
|
const isItemsPerPageControlled = controlledOnItemsPerPageChange !== void 0;
|
|
1836
1921
|
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
1837
1922
|
const activeItemsPerPage = isItemsPerPageControlled ? itemsPerPage : internalItemsPerPage;
|
|
1838
1923
|
const totalItems = legacyTotalItems !== void 0 ? legacyTotalItems : data.length;
|
|
1839
|
-
const calculatedTotalPages = (0,
|
|
1924
|
+
const calculatedTotalPages = (0, import_react19.useMemo)(() => {
|
|
1840
1925
|
if (totalItems > 0 && activeItemsPerPage > 0) {
|
|
1841
1926
|
return Math.ceil(totalItems / activeItemsPerPage);
|
|
1842
1927
|
}
|
|
1843
1928
|
return 1;
|
|
1844
1929
|
}, [totalItems, activeItemsPerPage]);
|
|
1845
|
-
const paginatedData = (0,
|
|
1930
|
+
const paginatedData = (0, import_react19.useMemo)(() => {
|
|
1846
1931
|
if (!data || data.length === 0) return [];
|
|
1847
1932
|
const startIndex = (currentPage - 1) * activeItemsPerPage;
|
|
1848
1933
|
const endIndex = startIndex + activeItemsPerPage;
|
|
1849
1934
|
return data.slice(startIndex, endIndex);
|
|
1850
1935
|
}, [data, currentPage, activeItemsPerPage]);
|
|
1851
|
-
(0,
|
|
1936
|
+
(0, import_react19.useEffect)(() => {
|
|
1852
1937
|
if (!isControlled && currentPage > calculatedTotalPages && calculatedTotalPages > 0) {
|
|
1853
1938
|
setInternalCurrentPage(1);
|
|
1854
1939
|
}
|
|
@@ -1881,11 +1966,11 @@ var Pagination = ({
|
|
|
1881
1966
|
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
1882
1967
|
const renderContent = () => {
|
|
1883
1968
|
if (Component) {
|
|
1884
|
-
if (
|
|
1969
|
+
if (import_react19.default.isValidElement(Component)) {
|
|
1885
1970
|
const ComponentType = Component.type;
|
|
1886
1971
|
const elementProps = Component.props;
|
|
1887
1972
|
if (isTable) {
|
|
1888
|
-
return /* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1889
1974
|
CustomTable,
|
|
1890
1975
|
{
|
|
1891
1976
|
tableHeader,
|
|
@@ -1893,7 +1978,7 @@ var Pagination = ({
|
|
|
1893
1978
|
id: `${id}-custom-table-1`
|
|
1894
1979
|
},
|
|
1895
1980
|
data.map((item, index) => {
|
|
1896
|
-
return /* @__PURE__ */
|
|
1981
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1897
1982
|
ComponentType,
|
|
1898
1983
|
{
|
|
1899
1984
|
key: item.id || item._id || index,
|
|
@@ -1908,7 +1993,7 @@ var Pagination = ({
|
|
|
1908
1993
|
);
|
|
1909
1994
|
} else {
|
|
1910
1995
|
if (isTable) {
|
|
1911
|
-
return /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1912
1997
|
CustomTable,
|
|
1913
1998
|
{
|
|
1914
1999
|
tableHeader,
|
|
@@ -1916,7 +2001,7 @@ var Pagination = ({
|
|
|
1916
2001
|
id: `${id}-custom-table-2`
|
|
1917
2002
|
},
|
|
1918
2003
|
paginatedData.map((item, index) => {
|
|
1919
|
-
return /* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1920
2005
|
ComponentType,
|
|
1921
2006
|
{
|
|
1922
2007
|
key: item.id || item._id || index,
|
|
@@ -1932,7 +2017,7 @@ var Pagination = ({
|
|
|
1932
2017
|
}
|
|
1933
2018
|
}
|
|
1934
2019
|
} else {
|
|
1935
|
-
return /* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1936
2021
|
CustomTable,
|
|
1937
2022
|
{
|
|
1938
2023
|
tableHeader,
|
|
@@ -1940,7 +2025,7 @@ var Pagination = ({
|
|
|
1940
2025
|
id: `${id}-custom-table-3`
|
|
1941
2026
|
},
|
|
1942
2027
|
paginatedData.map((item, index) => {
|
|
1943
|
-
return /* @__PURE__ */
|
|
2028
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1944
2029
|
Component,
|
|
1945
2030
|
{
|
|
1946
2031
|
key: item.id || item._id || index,
|
|
@@ -1956,7 +2041,7 @@ var Pagination = ({
|
|
|
1956
2041
|
}
|
|
1957
2042
|
return null;
|
|
1958
2043
|
};
|
|
1959
|
-
return /* @__PURE__ */
|
|
2044
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, renderContent()), /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ import_react19.default.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ import_react19.default.createElement(
|
|
1960
2045
|
"button",
|
|
1961
2046
|
{
|
|
1962
2047
|
onClick: () => handlePageChange(1),
|
|
@@ -1965,8 +2050,8 @@ var Pagination = ({
|
|
|
1965
2050
|
title: "First page",
|
|
1966
2051
|
id: `${id}-button-1`
|
|
1967
2052
|
},
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
), /* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ import_react19.default.createElement(import_lucide_react9.ChevronsLeft, { size: 16 })
|
|
2054
|
+
), /* @__PURE__ */ import_react19.default.createElement(
|
|
1970
2055
|
"button",
|
|
1971
2056
|
{
|
|
1972
2057
|
onClick: () => handlePageChange(currentPage - 1),
|
|
@@ -1975,8 +2060,8 @@ var Pagination = ({
|
|
|
1975
2060
|
title: "Previous page",
|
|
1976
2061
|
id: `${id}-button-2`
|
|
1977
2062
|
},
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
), getPageNumbers().map((pageNum) => /* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ import_react19.default.createElement(import_lucide_react9.ChevronLeft, { size: 16 })
|
|
2064
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ import_react19.default.createElement(
|
|
1980
2065
|
"button",
|
|
1981
2066
|
{
|
|
1982
2067
|
key: pageNum,
|
|
@@ -1985,7 +2070,7 @@ var Pagination = ({
|
|
|
1985
2070
|
id: `${id}-button-3`
|
|
1986
2071
|
},
|
|
1987
2072
|
pageNum
|
|
1988
|
-
)), /* @__PURE__ */
|
|
2073
|
+
)), /* @__PURE__ */ import_react19.default.createElement(
|
|
1989
2074
|
"button",
|
|
1990
2075
|
{
|
|
1991
2076
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -1994,8 +2079,8 @@ var Pagination = ({
|
|
|
1994
2079
|
title: "Next page",
|
|
1995
2080
|
id: `${id}-button-4`
|
|
1996
2081
|
},
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
), /* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ import_react19.default.createElement(import_lucide_react9.ChevronRight, { size: 16 })
|
|
2083
|
+
), /* @__PURE__ */ import_react19.default.createElement(
|
|
1999
2084
|
"button",
|
|
2000
2085
|
{
|
|
2001
2086
|
onClick: () => handlePageChange(calculatedTotalPages),
|
|
@@ -2004,12 +2089,13 @@ var Pagination = ({
|
|
|
2004
2089
|
title: "Last page",
|
|
2005
2090
|
id: `${id}-button-5`
|
|
2006
2091
|
},
|
|
2007
|
-
/* @__PURE__ */
|
|
2092
|
+
/* @__PURE__ */ import_react19.default.createElement(import_lucide_react9.ChevronsRight, { size: 16 })
|
|
2008
2093
|
))));
|
|
2009
2094
|
};
|
|
2010
2095
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2011
2096
|
0 && (module.exports = {
|
|
2012
2097
|
AppSideBar,
|
|
2098
|
+
Calendar,
|
|
2013
2099
|
Chip,
|
|
2014
2100
|
CustomAutocomplete,
|
|
2015
2101
|
CustomButton,
|
package/dist/index.mjs
CHANGED
|
@@ -1538,7 +1538,8 @@ var RightSheet = ({
|
|
|
1538
1538
|
callBack,
|
|
1539
1539
|
actionLabel = "Save",
|
|
1540
1540
|
onAction = () => {
|
|
1541
|
-
}
|
|
1541
|
+
},
|
|
1542
|
+
showFooter = true
|
|
1542
1543
|
}) => {
|
|
1543
1544
|
const [visible, setVisible] = useState5(open);
|
|
1544
1545
|
useEffect3(() => {
|
|
@@ -1578,7 +1579,7 @@ var RightSheet = ({
|
|
|
1578
1579
|
id: `${id}-div-2`
|
|
1579
1580
|
},
|
|
1580
1581
|
/* @__PURE__ */ React15.createElement("div", { className: " min-h-full ", id: `${id}-div-3` }, children),
|
|
1581
|
-
/* @__PURE__ */ React15.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1582
|
+
showFooter && /* @__PURE__ */ React15.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1582
1583
|
)
|
|
1583
1584
|
);
|
|
1584
1585
|
};
|
|
@@ -1770,8 +1771,95 @@ var Dropdown = React17.forwardRef(
|
|
|
1770
1771
|
);
|
|
1771
1772
|
Dropdown.displayName = "Dropdown";
|
|
1772
1773
|
|
|
1774
|
+
// src/Calendar/Calendar.tsx
|
|
1775
|
+
import React18, { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1776
|
+
import {
|
|
1777
|
+
DatePicker,
|
|
1778
|
+
DateTimePicker,
|
|
1779
|
+
DatesProvider
|
|
1780
|
+
} from "@mantine/dates";
|
|
1781
|
+
var Calendar = (props) => {
|
|
1782
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1783
|
+
const {
|
|
1784
|
+
minDate,
|
|
1785
|
+
maxDate,
|
|
1786
|
+
excludeDate,
|
|
1787
|
+
firstDayOfWeek = 1,
|
|
1788
|
+
locale,
|
|
1789
|
+
size,
|
|
1790
|
+
className,
|
|
1791
|
+
error
|
|
1792
|
+
} = props;
|
|
1793
|
+
const isRange = props.mode === "range";
|
|
1794
|
+
const isDateTime = props.mode === "datetime";
|
|
1795
|
+
const datesProviderSettings = {
|
|
1796
|
+
firstDayOfWeek,
|
|
1797
|
+
consistentWeeks: true
|
|
1798
|
+
};
|
|
1799
|
+
if (locale) {
|
|
1800
|
+
datesProviderSettings.locale = locale;
|
|
1801
|
+
}
|
|
1802
|
+
const anchorDate = isRange ? ((_a = props.value) == null ? void 0 : _a[0]) ?? ((_b = props.value) == null ? void 0 : _b[1]) ?? ((_c = props.defaultValue) == null ? void 0 : _c[0]) ?? ((_d = props.defaultValue) == null ? void 0 : _d[1]) ?? void 0 : !isDateTime ? props.value ?? props.defaultValue ?? void 0 : void 0;
|
|
1803
|
+
const [displayDate, setDisplayDate] = useState6(anchorDate ?? void 0);
|
|
1804
|
+
const anchorTime = isRange ? ((_f = (_e = props.value) == null ? void 0 : _e[0]) == null ? void 0 : _f.getTime()) ?? ((_h = (_g = props.value) == null ? void 0 : _g[1]) == null ? void 0 : _h.getTime()) : !isDateTime ? (_i = props.value) == null ? void 0 : _i.getTime() : void 0;
|
|
1805
|
+
useEffect4(() => {
|
|
1806
|
+
if (anchorTime !== void 0) {
|
|
1807
|
+
setDisplayDate(new Date(anchorTime));
|
|
1808
|
+
}
|
|
1809
|
+
}, [anchorTime]);
|
|
1810
|
+
const weekendColorStyle = {
|
|
1811
|
+
"--mantine-color-red-6": "var(--mantine-color-text)"
|
|
1812
|
+
};
|
|
1813
|
+
if (isRange) {
|
|
1814
|
+
const datePickerProps2 = {
|
|
1815
|
+
type: "range",
|
|
1816
|
+
value: props.value,
|
|
1817
|
+
defaultValue: props.defaultValue,
|
|
1818
|
+
onChange: props.onChange,
|
|
1819
|
+
minDate,
|
|
1820
|
+
maxDate,
|
|
1821
|
+
excludeDate,
|
|
1822
|
+
size,
|
|
1823
|
+
className,
|
|
1824
|
+
date: displayDate,
|
|
1825
|
+
onDateChange: setDisplayDate,
|
|
1826
|
+
style: weekendColorStyle
|
|
1827
|
+
};
|
|
1828
|
+
return /* @__PURE__ */ React18.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React18.createElement(DatePicker, { ...datePickerProps2 }));
|
|
1829
|
+
}
|
|
1830
|
+
if (isDateTime) {
|
|
1831
|
+
const dateTimePickerProps = {
|
|
1832
|
+
value: props.value,
|
|
1833
|
+
defaultValue: props.defaultValue,
|
|
1834
|
+
onChange: props.onChange,
|
|
1835
|
+
minDate,
|
|
1836
|
+
maxDate,
|
|
1837
|
+
excludeDate,
|
|
1838
|
+
size,
|
|
1839
|
+
className,
|
|
1840
|
+
error,
|
|
1841
|
+
style: weekendColorStyle
|
|
1842
|
+
};
|
|
1843
|
+
return /* @__PURE__ */ React18.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React18.createElement(DateTimePicker, { ...dateTimePickerProps }));
|
|
1844
|
+
}
|
|
1845
|
+
const datePickerProps = {
|
|
1846
|
+
value: props.value,
|
|
1847
|
+
defaultValue: props.defaultValue,
|
|
1848
|
+
onChange: props.onChange,
|
|
1849
|
+
minDate,
|
|
1850
|
+
maxDate,
|
|
1851
|
+
excludeDate,
|
|
1852
|
+
size,
|
|
1853
|
+
className,
|
|
1854
|
+
date: displayDate,
|
|
1855
|
+
onDateChange: setDisplayDate,
|
|
1856
|
+
style: weekendColorStyle
|
|
1857
|
+
};
|
|
1858
|
+
return /* @__PURE__ */ React18.createElement(DatesProvider, { settings: datesProviderSettings }, /* @__PURE__ */ React18.createElement(DatePicker, { ...datePickerProps }));
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1773
1861
|
// src/Pagination/Pagination.jsx
|
|
1774
|
-
import
|
|
1862
|
+
import React19, { useMemo as useMemo2, useState as useState7, useEffect as useEffect5 } from "react";
|
|
1775
1863
|
import { ChevronLeft, ChevronRight as ChevronRight2, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
1776
1864
|
var Pagination = ({
|
|
1777
1865
|
id = "pagination",
|
|
@@ -1796,8 +1884,8 @@ var Pagination = ({
|
|
|
1796
1884
|
componentProps = {},
|
|
1797
1885
|
...restProps
|
|
1798
1886
|
}) => {
|
|
1799
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
1800
|
-
const [internalItemsPerPage, setInternalItemsPerPage] =
|
|
1887
|
+
const [internalCurrentPage, setInternalCurrentPage] = useState7(1);
|
|
1888
|
+
const [internalItemsPerPage, setInternalItemsPerPage] = useState7(itemsPerPage);
|
|
1801
1889
|
const isControlled = controlledCurrentPage !== void 0;
|
|
1802
1890
|
const isItemsPerPageControlled = controlledOnItemsPerPageChange !== void 0;
|
|
1803
1891
|
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
@@ -1815,7 +1903,7 @@ var Pagination = ({
|
|
|
1815
1903
|
const endIndex = startIndex + activeItemsPerPage;
|
|
1816
1904
|
return data.slice(startIndex, endIndex);
|
|
1817
1905
|
}, [data, currentPage, activeItemsPerPage]);
|
|
1818
|
-
|
|
1906
|
+
useEffect5(() => {
|
|
1819
1907
|
if (!isControlled && currentPage > calculatedTotalPages && calculatedTotalPages > 0) {
|
|
1820
1908
|
setInternalCurrentPage(1);
|
|
1821
1909
|
}
|
|
@@ -1848,11 +1936,11 @@ var Pagination = ({
|
|
|
1848
1936
|
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
1849
1937
|
const renderContent = () => {
|
|
1850
1938
|
if (Component) {
|
|
1851
|
-
if (
|
|
1939
|
+
if (React19.isValidElement(Component)) {
|
|
1852
1940
|
const ComponentType = Component.type;
|
|
1853
1941
|
const elementProps = Component.props;
|
|
1854
1942
|
if (isTable) {
|
|
1855
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1856
1944
|
CustomTable,
|
|
1857
1945
|
{
|
|
1858
1946
|
tableHeader,
|
|
@@ -1860,7 +1948,7 @@ var Pagination = ({
|
|
|
1860
1948
|
id: `${id}-custom-table-1`
|
|
1861
1949
|
},
|
|
1862
1950
|
data.map((item, index) => {
|
|
1863
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1864
1952
|
ComponentType,
|
|
1865
1953
|
{
|
|
1866
1954
|
key: item.id || item._id || index,
|
|
@@ -1875,7 +1963,7 @@ var Pagination = ({
|
|
|
1875
1963
|
);
|
|
1876
1964
|
} else {
|
|
1877
1965
|
if (isTable) {
|
|
1878
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1879
1967
|
CustomTable,
|
|
1880
1968
|
{
|
|
1881
1969
|
tableHeader,
|
|
@@ -1883,7 +1971,7 @@ var Pagination = ({
|
|
|
1883
1971
|
id: `${id}-custom-table-2`
|
|
1884
1972
|
},
|
|
1885
1973
|
paginatedData.map((item, index) => {
|
|
1886
|
-
return /* @__PURE__ */
|
|
1974
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1887
1975
|
ComponentType,
|
|
1888
1976
|
{
|
|
1889
1977
|
key: item.id || item._id || index,
|
|
@@ -1899,7 +1987,7 @@ var Pagination = ({
|
|
|
1899
1987
|
}
|
|
1900
1988
|
}
|
|
1901
1989
|
} else {
|
|
1902
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1903
1991
|
CustomTable,
|
|
1904
1992
|
{
|
|
1905
1993
|
tableHeader,
|
|
@@ -1907,7 +1995,7 @@ var Pagination = ({
|
|
|
1907
1995
|
id: `${id}-custom-table-3`
|
|
1908
1996
|
},
|
|
1909
1997
|
paginatedData.map((item, index) => {
|
|
1910
|
-
return /* @__PURE__ */
|
|
1998
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1911
1999
|
Component,
|
|
1912
2000
|
{
|
|
1913
2001
|
key: item.id || item._id || index,
|
|
@@ -1923,7 +2011,7 @@ var Pagination = ({
|
|
|
1923
2011
|
}
|
|
1924
2012
|
return null;
|
|
1925
2013
|
};
|
|
1926
|
-
return /* @__PURE__ */
|
|
2014
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(React19.Fragment, null, renderContent()), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ React19.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ React19.createElement(
|
|
1927
2015
|
"button",
|
|
1928
2016
|
{
|
|
1929
2017
|
onClick: () => handlePageChange(1),
|
|
@@ -1932,8 +2020,8 @@ var Pagination = ({
|
|
|
1932
2020
|
title: "First page",
|
|
1933
2021
|
id: `${id}-button-1`
|
|
1934
2022
|
},
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
), /* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ React19.createElement(ChevronsLeft, { size: 16 })
|
|
2024
|
+
), /* @__PURE__ */ React19.createElement(
|
|
1937
2025
|
"button",
|
|
1938
2026
|
{
|
|
1939
2027
|
onClick: () => handlePageChange(currentPage - 1),
|
|
@@ -1942,8 +2030,8 @@ var Pagination = ({
|
|
|
1942
2030
|
title: "Previous page",
|
|
1943
2031
|
id: `${id}-button-2`
|
|
1944
2032
|
},
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
), getPageNumbers().map((pageNum) => /* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ React19.createElement(ChevronLeft, { size: 16 })
|
|
2034
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ React19.createElement(
|
|
1947
2035
|
"button",
|
|
1948
2036
|
{
|
|
1949
2037
|
key: pageNum,
|
|
@@ -1952,7 +2040,7 @@ var Pagination = ({
|
|
|
1952
2040
|
id: `${id}-button-3`
|
|
1953
2041
|
},
|
|
1954
2042
|
pageNum
|
|
1955
|
-
)), /* @__PURE__ */
|
|
2043
|
+
)), /* @__PURE__ */ React19.createElement(
|
|
1956
2044
|
"button",
|
|
1957
2045
|
{
|
|
1958
2046
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -1961,8 +2049,8 @@ var Pagination = ({
|
|
|
1961
2049
|
title: "Next page",
|
|
1962
2050
|
id: `${id}-button-4`
|
|
1963
2051
|
},
|
|
1964
|
-
/* @__PURE__ */
|
|
1965
|
-
), /* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ React19.createElement(ChevronRight2, { size: 16 })
|
|
2053
|
+
), /* @__PURE__ */ React19.createElement(
|
|
1966
2054
|
"button",
|
|
1967
2055
|
{
|
|
1968
2056
|
onClick: () => handlePageChange(calculatedTotalPages),
|
|
@@ -1971,11 +2059,12 @@ var Pagination = ({
|
|
|
1971
2059
|
title: "Last page",
|
|
1972
2060
|
id: `${id}-button-5`
|
|
1973
2061
|
},
|
|
1974
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ React19.createElement(ChevronsRight, { size: 16 })
|
|
1975
2063
|
))));
|
|
1976
2064
|
};
|
|
1977
2065
|
export {
|
|
1978
2066
|
AppSideBar,
|
|
2067
|
+
Calendar,
|
|
1979
2068
|
Chip,
|
|
1980
2069
|
CustomAutocomplete,
|
|
1981
2070
|
CustomButton,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jett.admin.npmpackage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.25",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -22,8 +22,12 @@
|
|
|
22
22
|
"react-dom": ">=18"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@mantine/core": "^7.17.8",
|
|
26
|
+
"@mantine/dates": "^7.17.8",
|
|
27
|
+
"@mantine/hooks": "^7.17.8",
|
|
25
28
|
"@tailwindcss/postcss": "^4.1.13",
|
|
26
29
|
"clsx": "^2.1.1",
|
|
30
|
+
"dayjs": "^1.11.23",
|
|
27
31
|
"js-cookie": "^3.0.5",
|
|
28
32
|
"lucide-react": "^0.544.0",
|
|
29
33
|
"node-forge": "^1.4.0",
|