@majapisoftwares/ui 4.3.15 → 4.3.17
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/components/PictureCropInput/PictureCropInput.jsx +9 -9
- package/components/Table/TableFooterWithPagination.jsx +2 -2
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/getInitials.d.ts +1 -1
- package/utils/getInitials.js +18 -4
- package/utils/formatTime.d.ts +0 -16
- package/utils/formatTime.js +0 -66
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { CheckIcon, TrashIcon } from "@heroicons/react/20/solid";
|
|
2
|
+
import { PhotoIcon } from "@heroicons/react/24/outline";
|
|
3
|
+
import clsx from "clsx";
|
|
1
4
|
import { useCallback, useEffect, useId, useRef, useState, } from "react";
|
|
2
5
|
import ReactCrop, {} from "react-image-crop";
|
|
6
|
+
import { useLatest } from "react-use";
|
|
3
7
|
import useDebounceEffect from "../../hooks/useDebounceEffect";
|
|
4
|
-
import { canvasPreview } from "./canvasPreview";
|
|
5
|
-
import Skeleton from "../Skeleton";
|
|
6
8
|
import Button from "../Button";
|
|
7
|
-
import { PhotoIcon } from "@heroicons/react/24/outline";
|
|
8
|
-
import clsx from "clsx";
|
|
9
|
-
import { CheckIcon, TrashIcon } from "@heroicons/react/20/solid";
|
|
10
|
-
import Tooltip from "../Tooltip";
|
|
11
|
-
import { useLatest } from "react-use";
|
|
12
9
|
import { defaultLabelClassName } from "../Input";
|
|
13
|
-
|
|
10
|
+
import Skeleton from "../Skeleton";
|
|
11
|
+
import Tooltip from "../Tooltip";
|
|
12
|
+
import { canvasPreview } from "./canvasPreview";
|
|
13
|
+
export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames = "size-52", previewContainerClassName, cropButtonClassName, aspect, minWidth, minHeight, ref, label, }) {
|
|
14
14
|
const id = useId();
|
|
15
15
|
const [src, setSrc] = useState();
|
|
16
16
|
const [crop, setCrop] = useState();
|
|
@@ -118,7 +118,7 @@ export default function PictureCropInput({ value, onChange, loading, className,
|
|
|
118
118
|
{label && (<label htmlFor={id} className={defaultLabelClassName}>
|
|
119
119
|
{label}
|
|
120
120
|
</label>)}
|
|
121
|
-
<div className="flex gap-2">
|
|
121
|
+
<div className="flex items-start gap-2">
|
|
122
122
|
{loading && <Skeleton className={previewSizeClassNames}/>}
|
|
123
123
|
{src && (<>
|
|
124
124
|
<ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={minWidth} minHeight={minHeight} className="max-h-96 max-w-96" keepSelection>
|
|
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useState } from "react";
|
|
|
4
4
|
import Button from "../Button/Button";
|
|
5
5
|
export default function TableFooterWithPagination({ itemsPerPage, totalItems, currentPage, onChangePage, previousText = "Previous", nextText = "Next", showingText = "Showing", toText = "to", ofText = "of", resultsText = "results", }) {
|
|
6
6
|
const pageCount = totalItems !== undefined && itemsPerPage !== undefined
|
|
7
|
-
? Math.
|
|
7
|
+
? Math.ceil(totalItems / itemsPerPage)
|
|
8
8
|
: 0;
|
|
9
9
|
const [page, setPage] = useState(currentPage);
|
|
10
10
|
useEffect(() => {
|
|
@@ -33,7 +33,7 @@ export default function TableFooterWithPagination({ itemsPerPage, totalItems, cu
|
|
|
33
33
|
<Button disabled={page === 1} onClick={handlePageClick(page - 1)}>
|
|
34
34
|
{previousText}
|
|
35
35
|
</Button>
|
|
36
|
-
<Button disabled={page === pageCount
|
|
36
|
+
<Button disabled={page === pageCount} onClick={handlePageClick(page + 1)}>
|
|
37
37
|
{nextText}
|
|
38
38
|
</Button>
|
|
39
39
|
</div>
|
package/package.json
CHANGED