@vnejs/uis.react.page-selector 0.1.5 → 0.1.7
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/PageSelector.d.ts +2 -11
- package/dist/PageSelector.d.ts.map +1 -1
- package/dist/PageSelector.js +2 -2
- package/dist/PageSelector.js.map +1 -1
- package/dist/PageSelector.types.d.ts +12 -0
- package/dist/PageSelector.types.d.ts.map +1 -0
- package/dist/PageSelector.types.js +2 -0
- package/dist/PageSelector.types.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/PageSelector.tsx +17 -4
- package/src/PageSelector.types.tsx +11 -0
- package/src/index.ts +2 -1
- package/tsconfig.json +1 -2
package/dist/PageSelector.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
pagesCount: any;
|
|
4
|
-
pagesMinCount: any;
|
|
5
|
-
gap?: number;
|
|
6
|
-
size?: number;
|
|
7
|
-
transition?: number;
|
|
8
|
-
itemWidth?: number;
|
|
9
|
-
onNextPage: any;
|
|
10
|
-
onPrevPage: any;
|
|
11
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { type PageSelectorProps } from "./PageSelector.types.js";
|
|
2
|
+
export declare const PageSelector: ({ page, pagesCount, pagesMinCount, gap, size, transition, itemWidth, onNextPage, onPrevPage, }: PageSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
3
|
//# sourceMappingURL=PageSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSelector.d.ts","sourceRoot":"","sources":["../src/PageSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageSelector.d.ts","sourceRoot":"","sources":["../src/PageSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA0BjE,eAAO,MAAM,YAAY,GAAI,gGAU1B,iBAAiB,4CAqCnB,CAAC"}
|
package/dist/PageSelector.js
CHANGED
|
@@ -5,8 +5,8 @@ import { Text, Flex } from "@vnejs/uis.react";
|
|
|
5
5
|
const LINE_ARGS = { x1: "3", y1: "24", x2: "60", y2: "60" };
|
|
6
6
|
const LINE_ARGS_1 = { ...LINE_ARGS, y1: "24" };
|
|
7
7
|
const LINE_ARGS_2 = { ...LINE_ARGS, y1: "96" };
|
|
8
|
-
const renderArrow = (style, angle, shift, onClick) => (_jsx("svg", { width: "60", height: "60", viewBox: "0 0 60 120", xmlns: "http://www.w3.org/2000/
|
|
9
|
-
export const PageSelector = ({ page, pagesCount, pagesMinCount, gap = 120, size = 60, transition = 300, itemWidth = 720, onNextPage, onPrevPage }) => {
|
|
8
|
+
const renderArrow = (style, angle, shift, onClick) => (_jsx("svg", { width: "60", height: "60", viewBox: "0 0 60 120", xmlns: "http://www.w3.org/2000/svg", fill: "none", stroke: "white", strokeWidth: "6", strokeLinecap: "round", style: style, onClick: onClick, children: _jsxs("g", { transform: `rotate(${angle} ${shift} 60)`, children: [_jsx("line", { ...LINE_ARGS_1 }), _jsx("line", { ...LINE_ARGS_2 })] }) }));
|
|
9
|
+
export const PageSelector = ({ page, pagesCount, pagesMinCount, gap = 120, size = 60, transition = 300, itemWidth = 720, onNextPage, onPrevPage, }) => {
|
|
10
10
|
const styleArrow = useMemo(() => {
|
|
11
11
|
const result = {};
|
|
12
12
|
if (size)
|
package/dist/PageSelector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSelector.js","sourceRoot":"","sources":["../src/PageSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageSelector.js","sourceRoot":"","sources":["../src/PageSelector.tsx"],"names":[],"mappings":";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C,OAAO,CAAC,MAAM,EAC5B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAC7B,GAAG,EAAE,GAAG,aAEP,WAAW,CAAC,cAAc,EAAE,GAAG,EAAE,EAAE,EAAE,iBAAiB,CAAC,EACxD,KAAC,IAAI,IACH,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,GAAG,IAAI,MAAM,UAAU,EAAE,EAC/B,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GACzB,EACD,WAAW,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,IAClD,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PageSelectorProps = {
|
|
2
|
+
page: number;
|
|
3
|
+
pagesCount: number;
|
|
4
|
+
pagesMinCount: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
size?: number;
|
|
7
|
+
transition?: number;
|
|
8
|
+
itemWidth?: number;
|
|
9
|
+
onNextPage?: () => void;
|
|
10
|
+
onPrevPage?: () => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=PageSelector.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageSelector.types.d.ts","sourceRoot":"","sources":["../src/PageSelector.types.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageSelector.types.js","sourceRoot":"","sources":["../src/PageSelector.types.tsx"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
|
package/package.json
CHANGED
package/src/PageSelector.tsx
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
2
3
|
|
|
3
4
|
import { getVneLength } from "@vnejs/uis.utils";
|
|
4
5
|
|
|
5
6
|
import { Text, Flex } from "@vnejs/uis.react";
|
|
6
7
|
|
|
8
|
+
import { type PageSelectorProps } from "./PageSelector.types.js";
|
|
9
|
+
|
|
7
10
|
const LINE_ARGS = { x1: "3", y1: "24", x2: "60", y2: "60" };
|
|
8
11
|
const LINE_ARGS_1 = { ...LINE_ARGS, y1: "24" };
|
|
9
12
|
const LINE_ARGS_2 = { ...LINE_ARGS, y1: "96" };
|
|
10
13
|
|
|
11
|
-
const renderArrow = (style, angle, shift, onClick) => (
|
|
14
|
+
const renderArrow = (style: CSSProperties, angle: number, shift: number, onClick?: () => void) => (
|
|
12
15
|
<svg
|
|
13
16
|
width="60"
|
|
14
17
|
height="60"
|
|
15
18
|
viewBox="0 0 60 120"
|
|
16
|
-
xmlns="http://www.w3.org/2000/
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
20
|
fill="none"
|
|
18
21
|
stroke="white"
|
|
19
22
|
strokeWidth="6"
|
|
@@ -28,9 +31,19 @@ const renderArrow = (style, angle, shift, onClick) => (
|
|
|
28
31
|
</svg>
|
|
29
32
|
);
|
|
30
33
|
|
|
31
|
-
export const PageSelector = ({
|
|
34
|
+
export const PageSelector = ({
|
|
35
|
+
page,
|
|
36
|
+
pagesCount,
|
|
37
|
+
pagesMinCount,
|
|
38
|
+
gap = 120,
|
|
39
|
+
size = 60,
|
|
40
|
+
transition = 300,
|
|
41
|
+
itemWidth = 720,
|
|
42
|
+
onNextPage,
|
|
43
|
+
onPrevPage,
|
|
44
|
+
}: PageSelectorProps) => {
|
|
32
45
|
const styleArrow = useMemo(() => {
|
|
33
|
-
const result: Record<string,
|
|
46
|
+
const result: Record<string, string> = {};
|
|
34
47
|
|
|
35
48
|
if (size) result.height = getVneLength(size);
|
|
36
49
|
if (itemWidth) result.width = getVneLength(itemWidth);
|
package/src/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./PageSelector";
|
|
1
|
+
export * from "./PageSelector.types.js";
|
|
2
|
+
export * from "./PageSelector.js";
|
package/tsconfig.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "
|
|
2
|
+
"extends": "../../tsconfig.react.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "dist",
|
|
5
5
|
"rootDir": "src"
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"src/**/*.ts",
|
|
9
9
|
"src/**/*.tsx",
|
|
10
10
|
"../../../globals.d.ts",
|
|
11
|
-
"../../../peer-modules.d.ts"
|
|
12
11
|
],
|
|
13
12
|
"exclude": [
|
|
14
13
|
"dist",
|