@uxf/ui 11.21.4 → 11.21.5
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/_file-input-base/file-input-base.d.ts +2 -1
- package/dropzone/dropzone-input.d.ts +2 -1
- package/dropzone/dropzone-input.js +1 -0
- package/dropzone/types.d.ts +1 -1
- package/package.json +4 -4
- package/pagination/pagination.d.ts +4 -2
- package/pagination/pagination.js +18 -11
- package/types/file-response.d.ts +0 -7
- package/utils/files/get-file-url.d.ts +1 -1
- package/utils/mocks/upload-file.mock.d.ts +2 -1
- package/utils/mocks/upload-file.mock.js +1 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FileResponse
|
|
1
|
+
import { FileResponse } from "@uxf/core/types";
|
|
2
|
+
import { FormControlProps } from "@uxf/ui/types";
|
|
2
3
|
import React from "react";
|
|
3
4
|
export interface FileInputBaseProps extends FormControlProps<FileResponse | null> {
|
|
4
5
|
"aria-describedby"?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FileResponse
|
|
1
|
+
import { FileResponse } from "@uxf/core/types";
|
|
2
|
+
import { FormControlProps, UploadOptions } from "@uxf/ui/types";
|
|
2
3
|
import React, { CSSProperties, ReactNode } from "react";
|
|
3
4
|
import { IconName } from "../icon/types";
|
|
4
5
|
import { Accept, DropzoneFile } from "./types";
|
package/dropzone/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "11.21.
|
|
3
|
+
"version": "11.21.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@floating-ui/react": "0.26.9",
|
|
19
19
|
"@headlessui/react": "1.7.14",
|
|
20
|
-
"@uxf/core": "11.21.
|
|
21
|
-
"@uxf/core-react": "11.21.
|
|
20
|
+
"@uxf/core": "11.21.5",
|
|
21
|
+
"@uxf/core-react": "11.21.5",
|
|
22
22
|
"@uxf/datepicker": "11.11.3",
|
|
23
|
-
"@uxf/styles": "11.21.
|
|
23
|
+
"@uxf/styles": "11.21.5",
|
|
24
24
|
"color2k": "2.0.3",
|
|
25
25
|
"dayjs": "1.11.10",
|
|
26
26
|
"jump.js": "1.0.2",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PaginationSizes } from "@uxf/ui/pagination/theme";
|
|
2
2
|
import { FC } from "react";
|
|
3
3
|
export interface PaginationProps {
|
|
4
|
+
className?: string;
|
|
4
5
|
count: number;
|
|
5
|
-
page: number;
|
|
6
6
|
onPageChange: (index: number) => void;
|
|
7
|
+
page: number;
|
|
8
|
+
showFirstButton?: boolean;
|
|
9
|
+
showLastButton?: boolean;
|
|
7
10
|
size?: keyof PaginationSizes;
|
|
8
|
-
className?: string;
|
|
9
11
|
}
|
|
10
12
|
export declare const Pagination: FC<PaginationProps>;
|
package/pagination/pagination.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Pagination = void 0;
|
|
7
|
+
const show_1 = require("@uxf/core-react/components/show");
|
|
7
8
|
const use_pagination_1 = require("@uxf/core-react/hooks/use-pagination");
|
|
8
9
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
@@ -16,8 +17,8 @@ const Pagination = (props) => {
|
|
|
16
17
|
const pagination = (0, use_pagination_1.usePagination)({
|
|
17
18
|
count: props.count,
|
|
18
19
|
page: props.page,
|
|
19
|
-
showFirstButton:
|
|
20
|
-
showLastButton:
|
|
20
|
+
showFirstButton: props.showFirstButton,
|
|
21
|
+
showLastButton: props.showFirstButton,
|
|
21
22
|
});
|
|
22
23
|
const onClick = (item) => {
|
|
23
24
|
if (typeof item === "number") {
|
|
@@ -39,15 +40,21 @@ const Pagination = (props) => {
|
|
|
39
40
|
((item === "last" || item === "next") && isCurrentPageLast);
|
|
40
41
|
return (
|
|
41
42
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
42
|
-
react_1.default.createElement("a", { className: (0, cx_1.cx)("uxf-pagination__button", isDisabled && "is-disabled", (item === "start-ellipsis" || item === "end-ellipsis") && "is-ellipsis", item === props.page && "is-selected", index === 0 && "is-first", index === pagination.length - 1 && "is-last"), key: item, onClick: isDisabled ? undefined : () => onClick(item) },
|
|
43
|
-
react_1.default.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
react_1.default.createElement(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
react_1.default.createElement(
|
|
50
|
-
react_1.default.createElement(
|
|
43
|
+
react_1.default.createElement("a", { className: (0, cx_1.cx)("uxf-pagination__button", isDisabled && "is-disabled", (item === "start-ellipsis" || item === "end-ellipsis") && "is-ellipsis", item === props.page && "is-selected", index === 0 && "is-go-to-first", index === pagination.length - 1 && "is-go-to-last", item === "next" && "is-next", item === "previous" && "is-previous", typeof item === "number" && "is-number"), key: item, onClick: isDisabled ? undefined : () => onClick(item) },
|
|
44
|
+
react_1.default.createElement(show_1.Show, { when: item === "first" },
|
|
45
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "First"),
|
|
46
|
+
react_1.default.createElement(icon_1.Icon, { name: "chevronsLeft", size: 12 })),
|
|
47
|
+
react_1.default.createElement(show_1.Show, { when: item === "previous" },
|
|
48
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Previous"),
|
|
49
|
+
react_1.default.createElement(icon_1.Icon, { name: "chevronLeft", size: 12 })),
|
|
50
|
+
react_1.default.createElement(show_1.Show, { when: item === "start-ellipsis" || item === "end-ellipsis" }, "\u2026"),
|
|
51
|
+
react_1.default.createElement(show_1.Show, { when: typeof item === "number" }, item),
|
|
52
|
+
react_1.default.createElement(show_1.Show, { when: item === "next" },
|
|
53
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Next"),
|
|
54
|
+
react_1.default.createElement(icon_1.Icon, { name: "chevronRight", size: 12 })),
|
|
55
|
+
react_1.default.createElement(show_1.Show, { when: item === "last" },
|
|
56
|
+
react_1.default.createElement("span", { className: "uxf-pagination__label" }, "Last"),
|
|
57
|
+
react_1.default.createElement(icon_1.Icon, { name: "chevronsRight", size: 12 }))));
|
|
51
58
|
})));
|
|
52
59
|
};
|
|
53
60
|
exports.Pagination = Pagination;
|
package/types/file-response.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export interface FileResponse {
|
|
2
|
-
extension: string;
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
namespace?: string | null;
|
|
6
|
-
uuid: string;
|
|
7
|
-
}
|
|
8
1
|
export interface UploadOptions {
|
|
9
2
|
abortController?: AbortController;
|
|
10
3
|
onUploadProgress?: (progressEvent: UploadProgressEvent) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FileResponse } from "@uxf/
|
|
1
|
+
import { FileResponse } from "@uxf/core/types";
|
|
2
2
|
export declare function getFileUrl(domain: string, file: FileResponse): string;
|