@t-headless-ui/react 1.1.3 → 1.1.4
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/cjs/pagination/components/pagination-jumper.js +1 -1
- package/dist/cjs/pagination/components/pagination-root.js +1 -1
- package/dist/es/pagination/components/pagination-jumper.mjs +19 -19
- package/dist/es/pagination/components/pagination-root.mjs +2 -2
- package/dist/types/pagination/components/pagination-root.d.ts +1 -1
- package/dist/types/pagination/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/pagination/components/pagination-jumper copy.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),p=require("../pagination-inner-context.js"),m=require("../store/use-jumper-store.js"),C=require("../../input/input.js"),P=require("../../utils/is.js");function h(i){const{showCurrent:e,className:u,style:s}=i,{current:n,disabled:a,allPages:t,onPageNumberChange:c}=p.usePaginationInnerContext(),{inputText:r,inputRef:l,handleChange:d,handleJump:o}=m.useJumperStore({allPages:t,current:n,onPageNumberChange:c,showCurrent:e},e?n:void 0);return g.jsx(C.InputComponent,{ref:l,value:P.isUndefined(r)?void 0:r.toString(),disabled:a||!t,onChange:d,onPressEnter:o,onBlur:o,className:u,style:s})}exports.PaginationJumper=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),m=require("../pagination-inner-context.js"),y=require("../store/use-pagination-store.js"),E=require("../hooks/use-pagination.js")
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),m=require("../pagination-inner-context.js"),y=require("../store/use-pagination-store.js"),E=require("../hooks/use-pagination.js");function I(i){const{current:g,pageSize:l,total:n=0,defaultCurrent:p,defaultPageSize:S,disabled:d,hideOnSinglePage:P,sizeOptions:a=[10,20,50],bufferSize:h=2,onChange:z,onPageSizeChange:c,pageSizeChangeResetCurrent:t=!0,children:f,...b}=i,{allPages:e,current:o,bufferSize:r,disabled:s,onPageNumberChange:C,pageSize:O,onPageSizeChange:v}=y.usePaginationStore({total:n,pageSize:l,current:g,sizeOptions:a,defaultCurrent:p,defaultPageSize:S,disabled:d,bufferSize:h,onChange:z,pageSizeChangeResetCurrent:t,onPageSizeChange:c},i),{pages:x,shouldShowFirst:j,shouldShowPrevEllipsis:q,shouldShowNextEllipsis:w,shouldShowLast:R}=E.usePagination({allPages:e,current:o,bufferSize:r});return P&&e<=1?null:u.jsx(m.PaginationInnerContext.Provider,{value:{allPages:e,current:o,bufferSize:r,disabled:s,onPageNumberChange:C,pageSize:O,onPageSizeChange:v,pageSizeChangeResetCurrent:t,total:n,pages:x,shouldShowFirst:j,shouldShowPrevEllipsis:q,shouldShowNextEllipsis:w,shouldShowLast:R,sizeOptions:a},children:u.jsx("div",{"aria-label":"pagination","aria-disabled":s,role:"navigation",...b,children:f})})}exports.PaginationRoot=I;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { usePaginationInnerContext as
|
|
4
|
-
import { useJumperStore as
|
|
5
|
-
import { InputComponent as
|
|
6
|
-
import { isUndefined as
|
|
7
|
-
function
|
|
8
|
-
const { showCurrent: e, className:
|
|
2
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { usePaginationInnerContext as f } from "../pagination-inner-context.mjs";
|
|
4
|
+
import { useJumperStore as g } from "../store/use-jumper-store.mjs";
|
|
5
|
+
import { InputComponent as c } from "../../input/input.mjs";
|
|
6
|
+
import { isUndefined as h } from "../../utils/is.mjs";
|
|
7
|
+
function J(i) {
|
|
8
|
+
const { showCurrent: e, className: a, style: s } = i, { current: n, disabled: m, allPages: o, onPageNumberChange: u } = f(), { inputText: t, inputRef: p, handleChange: l, handleJump: r } = g(
|
|
9
9
|
{
|
|
10
10
|
allPages: o,
|
|
11
11
|
current: n,
|
|
12
|
-
onPageNumberChange:
|
|
12
|
+
onPageNumberChange: u,
|
|
13
13
|
showCurrent: e
|
|
14
14
|
},
|
|
15
15
|
e ? n : void 0
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
return /* @__PURE__ */ d(
|
|
18
|
+
c,
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
21
|
-
value:
|
|
22
|
-
disabled:
|
|
23
|
-
onChange:
|
|
24
|
-
onPressEnter:
|
|
25
|
-
onBlur:
|
|
26
|
-
className:
|
|
20
|
+
ref: p,
|
|
21
|
+
value: h(t) ? void 0 : t.toString(),
|
|
22
|
+
disabled: m || !o,
|
|
23
|
+
onChange: l,
|
|
24
|
+
onPressEnter: r,
|
|
25
|
+
onBlur: r,
|
|
26
|
+
className: a,
|
|
27
27
|
style: s
|
|
28
28
|
}
|
|
29
|
-
)
|
|
29
|
+
);
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
J as PaginationJumper
|
|
33
33
|
};
|
|
@@ -3,7 +3,7 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
3
3
|
import { PaginationInnerContext as R } from "../pagination-inner-context.mjs";
|
|
4
4
|
import { usePaginationStore as j } from "../store/use-pagination-store.mjs";
|
|
5
5
|
import { usePagination as B } from "../hooks/use-pagination.mjs";
|
|
6
|
-
|
|
6
|
+
function T(i) {
|
|
7
7
|
const {
|
|
8
8
|
current: p,
|
|
9
9
|
pageSize: g,
|
|
@@ -62,7 +62,7 @@ const T = (i) => {
|
|
|
62
62
|
children: /* @__PURE__ */ l("div", { "aria-label": "pagination", "aria-disabled": s, role: "navigation", ...b, children: C })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
}
|
|
65
|
+
}
|
|
66
66
|
export {
|
|
67
67
|
T as PaginationRoot
|
|
68
68
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PaginationRootProps } from '../interface';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function PaginationRoot(props: PaginationRootProps): React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PaginationJumper, PaginationTotal, PaginationEndItem, PaginationStartItem, PaginationItems, PaginationEndEllipsis, PaginationStartEllipsis, PaginationNext, PaginationPrevious, PaginationOption } from './components';
|
|
1
|
+
import { PaginationJumper, PaginationTotal, PaginationRoot, PaginationEndItem, PaginationStartItem, PaginationItems, PaginationEndEllipsis, PaginationStartEllipsis, PaginationNext, PaginationPrevious, PaginationOption } from './components';
|
|
2
2
|
export * from './interface';
|
|
3
3
|
export declare const Pagination: {
|
|
4
4
|
Jumper: typeof PaginationJumper;
|
|
5
5
|
Total: typeof PaginationTotal;
|
|
6
|
-
Root:
|
|
6
|
+
Root: typeof PaginationRoot;
|
|
7
7
|
EndItem: typeof PaginationEndItem;
|
|
8
8
|
StartItem: typeof PaginationStartItem;
|
|
9
9
|
Items: typeof PaginationItems;
|
package/package.json
CHANGED