@loja-integrada/admin-components 1.0.21 → 1.0.22
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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { b } from './chunk-HZACKBIW.js';
|
|
2
|
+
import { a } from './chunk-OWG2V7MG.js';
|
|
3
|
+
import { a as a$1 } from './chunk-HQ53LHR2.js';
|
|
4
|
+
import { a as a$2 } from './chunk-REQIQLRI.js';
|
|
5
|
+
import E, { useMemo, useEffect, useRef, useState, useCallback } from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function C(n){return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}var k=({currentItemsLength:n,totalItemsLength:i=0,itemsLengthOptions:o,onItemsLengthChange:a,defaultItemsLengthOption:e})=>{let r=E.createRef(),s=u=>{let t=parseInt(u.currentTarget.value);a&&a(t);},l=useMemo(()=>o?.[0]?.value,[o]);if(useEffect(()=>{e&&r.current&&(r.current.value=e.toString(),a?.(e));},[e]),!n&&n!==0)return null;let m=Math.max(n,i);return jsx("div",{className:"pagination-info hidden sm:flex",children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[o&&o?.length>0&&n>=l?jsx(b,{ref:r,id:"selectItemsPerPage",options:o,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:s,className:"h-6",defaultValue:e}):jsxs("span",{children:["Mostrando"," ",jsx("span",{className:"pagination-info-current",children:n})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:C(m)}),"\xA0no total"]})})},g=E.memo(k);g.displayName="PaginationInfo";var L=({currentPage:n=1,totalPages:i=1,onPageChange:o})=>{let a$2=useRef(null),e=useMemo(()=>Math.max(n,i),[n,i]),r=useMemo(()=>n<i,[n,i]),s=useMemo(()=>n>1,[n]),l=t=>{t=t<1?1:t>e?e:t,o&&o(t);},m=t=>(t.preventDefault(),!1),u=t=>{if(t.key==="Enter"){let c=a$2?.current?.value;if(c){let v=parseInt(c);l(v);}t.preventDefault();return}};return useEffect(()=>{a$2?.current&&(a$2.current.value=n.toString());},[n]),jsxs("div",{className:"pagination-nav flex w-full items-center justify-between sm:w-auto",children:[jsxs("div",{className:"text-f6 text-inverted-2",children:[jsx(a,{ref:a$2,maxLength:3,formatValue:"onlyNumber",className:"pagination-nav-current mr-1 h-8 w-9 border-card-stroke/50 p-0 text-center font-semibold text-primary",formGroupClassName:"inline-flex",onKeyDown:u,onCopy:m,onCut:m,onPaste:m,defaultValue:n}),"/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{n!==e&&l(e);},children:e})]}),jsxs("div",{className:"ml-5 flex items-center text-inverted-2",children:[jsx("button",{type:"button",id:"btnPaginationPrev",className:`pagination-nav-previous mr-3 outline-none duration-200 ${s?"hover:text-inverted-1":""}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{s&&l(n-1);},children:jsx(a$1,{icon:"arrowLeft",size:4})}),jsx("button",{type:"button",id:"btnPaginationNext",className:`pagination-nav-next outline-none duration-200 ${r?"hover:text-inverted-1":""}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{r&&l(n+1);},children:jsx(a$1,{icon:"arrowRight",size:4})})]})]})},N=E.memo(L);N.displayName="PaginationNav";var w=[{label:"Mostrando 25",value:25},{label:"Mostrando 50",value:50},{label:"Mostrando 75",value:75},{label:"Mostrando 100",value:100}],B=({className:n="",currentPage:i=1,totalPages:o,defaultItemsLengthOption:a=w[0].value,onPageChange:e,currentItemsLength:r,totalItemsLength:s,itemsLengthOptions:l=w,onItemsLengthChange:m})=>{let[u,t]=useState(a),c=s&&Math.ceil(s/u),v=o||c;useEffect(()=>{t(a);},[a]);let R=useCallback(x=>{t(x),m&&m(x);},[]);return jsxs("div",{className:a$2("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",n),children:[jsx(g,{currentItemsLength:r,totalItemsLength:s,itemsLengthOptions:l,onItemsLengthChange:R,defaultItemsLengthOption:u}),jsx(N,{currentPage:i,totalPages:v,onPageChange:e})]})},F=E.memo(B);F.displayName="Pagination";
|
|
9
|
+
|
|
10
|
+
export { F as a };
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './
|
|
|
5
5
|
export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
|
|
6
6
|
export { a as Breadcrumb } from './chunk-FZISHDWC.js';
|
|
7
7
|
export { a as HelpLink } from './chunk-SXBDHD2Z.js';
|
|
8
|
-
export { a as Pagination } from './chunk-
|
|
8
|
+
export { a as Pagination } from './chunk-7PDX5FMD.js';
|
|
9
9
|
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
10
10
|
import './chunk-DIFKNF3L.js';
|
|
11
11
|
export { a as IconCircular } from './chunk-BV27BOLB.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function numberWithDots(number: string | number): string;
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../chunk-4PUGMMDC.js';
|
|
2
2
|
export { a as Breadcrumb } from '../chunk-FZISHDWC.js';
|
|
3
3
|
export { a as HelpLink } from '../chunk-SXBDHD2Z.js';
|
|
4
|
-
export { a as Pagination } from '../chunk-
|
|
4
|
+
export { a as Pagination } from '../chunk-7PDX5FMD.js';
|
|
5
5
|
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
6
6
|
import '../chunk-BQWNCDFV.js';
|
|
7
7
|
import '../chunk-HZACKBIW.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loja-integrada/admin-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"author": "Loja Integrada",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"./style.css": "./dist/index.css",
|
|
66
66
|
"./utils": "./dist/lib/utils.js",
|
|
67
|
+
"./formatters": "./dist/lib/formatters.js",
|
|
67
68
|
"./package.json": "./package.json",
|
|
68
69
|
"./Button": {
|
|
69
70
|
"types": "./dist/components/Button/Button.d.ts",
|
package/dist/chunk-THDR2EMM.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { b } from './chunk-HZACKBIW.js';
|
|
2
|
-
import { a } from './chunk-OWG2V7MG.js';
|
|
3
|
-
import { a as a$1 } from './chunk-HQ53LHR2.js';
|
|
4
|
-
import { a as a$2 } from './chunk-REQIQLRI.js';
|
|
5
|
-
import M, { useMemo, useEffect, useRef, useState, useCallback } from 'react';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var D=({currentItemsLength:n,totalItemsLength:i=0,itemsLengthOptions:o,onItemsLengthChange:e,defaultItemsLengthOption:t})=>{let r=M.createRef(),s=p=>{let a=parseInt(p.currentTarget.value);e&&e(a);},l=useMemo(()=>o?.[0]?.value,[o]);if(useEffect(()=>{t&&r.current&&(r.current.value=t.toString(),e?.(t));},[t]),!n&&n!==0)return null;let m=Math.max(n,i);return jsx("div",{className:"pagination-info hidden sm:flex",children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[o&&o?.length>0&&n>=l?jsx(b,{ref:r,id:"selectItemsPerPage",options:o,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:s,className:"h-6",defaultValue:t}):jsxs("span",{children:["Mostrando"," ",jsx("span",{className:"pagination-info-current",children:n})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:m}),"\xA0no total"]})})},g=M.memo(D);g.displayName="PaginationInfo";var K=({currentPage:n=1,totalPages:i=1,onPageChange:o})=>{let e=useRef(null),t=useMemo(()=>Math.max(n,i),[n,i]),r=useMemo(()=>n<i,[n,i]),s=useMemo(()=>n>1,[n]),l=a=>{a=a<1?1:a>t?t:a,o&&o(a);},m=a=>(a.preventDefault(),!1),p=a=>{if(a.key==="Enter"){let c=e?.current?.value;if(c){let v=parseInt(c);l(v);}a.preventDefault();return}};return useEffect(()=>{e?.current&&(e.current.value=n.toString());},[n]),jsxs("div",{className:"pagination-nav flex w-full items-center justify-between sm:w-auto",children:[jsxs("div",{className:"text-f6 text-inverted-2",children:[jsx(a,{ref:e,maxLength:3,formatValue:"onlyNumber",className:"pagination-nav-current mr-1 h-8 w-9 border-card-stroke/50 p-0 text-center font-semibold text-primary",formGroupClassName:"inline-flex",onKeyDown:p,onCopy:m,onCut:m,onPaste:m,defaultValue:n}),"/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{n!==t&&l(t);},children:t})]}),jsxs("div",{className:"ml-5 flex items-center text-inverted-2",children:[jsx("button",{type:"button",id:"btnPaginationPrev",className:`pagination-nav-previous mr-3 outline-none duration-200 ${s?"hover:text-inverted-1":""}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{s&&l(n-1);},children:jsx(a$1,{icon:"arrowLeft",size:4})}),jsx("button",{type:"button",id:"btnPaginationNext",className:`pagination-nav-next outline-none duration-200 ${r?"hover:text-inverted-1":""}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{r&&l(n+1);},children:jsx(a$1,{icon:"arrowRight",size:4})})]})]})},N=M.memo(K);N.displayName="PaginationNav";var E=[{label:"Mostrando 25",value:25},{label:"Mostrando 50",value:50},{label:"Mostrando 75",value:75},{label:"Mostrando 100",value:100}],F=({className:n="",currentPage:i=1,totalPages:o,defaultItemsLengthOption:e=E[0].value,onPageChange:t,currentItemsLength:r,totalItemsLength:s,itemsLengthOptions:l=E,onItemsLengthChange:m})=>{let[p,a]=useState(e),c=s&&Math.ceil(s/p),v=o||c;useEffect(()=>{a(e);},[e]);let R=useCallback(x=>{a(x),m&&m(x);},[]);return jsxs("div",{className:a$2("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",n),children:[jsx(g,{currentItemsLength:r,totalItemsLength:s,itemsLengthOptions:l,onItemsLengthChange:R,defaultItemsLengthOption:p}),jsx(N,{currentPage:i,totalPages:v,onPageChange:t})]})},G=M.memo(F);G.displayName="Pagination";
|
|
9
|
-
|
|
10
|
-
export { G as a };
|