@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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("../pagination-inner-context.js"),m=require("../store/use-jumper-store.js"),h=require("../../input/input.js"),C=require("../../utils/is.js");function P(u){const{showCurrent:n,className:s,style:a}=u,{current:t,disabled:c,allPages:r,onPageNumberChange:l}=p.usePaginationInnerContext(),{inputText:i,inputRef:d,handleChange:g,handleJump:o}=m.useJumperStore({allPages:r,current:t,onPageNumberChange:l,showCurrent:n},n?t:void 0);return e.jsx(e.Fragment,{children:e.jsx(h.InputComponent,{ref:d,value:C.isUndefined(i)?void 0:i.toString(),disabled:c||!r,onChange:g,onPressEnter:o,onBlur:o,className:s,style:a})})}exports.PaginationJumper=P;
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"),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:b,...f}=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",...f,children:b})})};exports.PaginationRoot=I;
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 i, Fragment as f } from "react/jsx-runtime";
3
- import { usePaginationInnerContext as g } from "../pagination-inner-context.mjs";
4
- import { useJumperStore as c } from "../store/use-jumper-store.mjs";
5
- import { InputComponent as h } from "../../input/input.mjs";
6
- import { isUndefined as C } from "../../utils/is.mjs";
7
- function I(a) {
8
- const { showCurrent: e, className: m, style: s } = a, { current: n, disabled: u, allPages: o, onPageNumberChange: p } = g(), { inputText: r, inputRef: l, handleChange: d, handleJump: t } = c(
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: p,
12
+ onPageNumberChange: u,
13
13
  showCurrent: e
14
14
  },
15
15
  e ? n : void 0
16
16
  );
17
- return /* @__PURE__ */ i(f, { children: /* @__PURE__ */ i(
18
- h,
17
+ return /* @__PURE__ */ d(
18
+ c,
19
19
  {
20
- ref: l,
21
- value: C(r) ? void 0 : r.toString(),
22
- disabled: u || !o,
23
- onChange: d,
24
- onPressEnter: t,
25
- onBlur: t,
26
- className: m,
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
- I as PaginationJumper
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
- const T = (i) => {
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 const PaginationRoot: (props: PaginationRootProps) => React.JSX.Element;
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: (props: import('./interface').PaginationRootProps) => import("react").JSX.Element;
6
+ Root: typeof PaginationRoot;
7
7
  EndItem: typeof PaginationEndItem;
8
8
  StartItem: typeof PaginationStartItem;
9
9
  Items: typeof PaginationItems;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t-headless-ui/react",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "T-UI React.",
5
5
  "keywords": [
6
6
  "ui",
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- import { PaginationJumperProps } from '../interface';
3
- export declare function PaginationJumper(props: PaginationJumperProps): React.JSX.Element;