@loja-integrada/admin-components 1.0.31 → 1.0.32
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/chunk-BDSJLA3R.js +11 -0
- package/dist/chunk-DVFKTOCS.js +3 -0
- package/dist/chunk-UY7G2JRL.js +10 -0
- package/dist/components/DataTable/index.js +2 -1
- package/dist/components/index.js +2 -1
- package/dist/forms/Calendar/index.js +2 -1
- package/dist/forms/index.js +2 -1
- package/dist/index.js +3 -2
- package/dist/navigation/Pagination/index.js +2 -1
- package/dist/navigation/index.js +2 -1
- package/package.json +3 -3
- package/dist/chunk-6WZYS65C.js +0 -10
- package/dist/chunk-YRMGTRPK.js +0 -9
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-DVFKTOCS.js';
|
|
2
|
+
import { a } from './chunk-DIENJUYM.js';
|
|
3
|
+
import { a as a$3 } from './chunk-IPIBO3ES.js';
|
|
4
|
+
import { f, c, a as a$2, b, d, g } from './chunk-MMWMFOBR.js';
|
|
5
|
+
import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
6
|
+
import { memo, useState, useMemo, useEffect } from 'react';
|
|
7
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var E=n=>typeof n=="string"?jsx("div",{className:"text-f4 py-4 text-center font-semibold text-on-base-2 lg:py-10",children:n}):n,X=({columns:n,data:o=[],isLoading:C=!1,error:b$1=!1,selectable:t=!1,showSelectAll:N=!0,showCountSelected:S=!0,showHeaderInMobile:y=!1,childrenHeaderMobile:k=null,onChange:v,defaultSelectedIds:H,disabledIds:w=[],id:u="",emptyText:B="Nenhum registro encontrado",errorText:F="Ocorreu um erro ao carregar os itens."})=>{let[T,I]=useState({}),i=useMemo(()=>n.map(e=>({...e,accessorKey:e?.id||""})),[n]);useEffect(()=>{H&&I(H.reduce((e,a)=>({...e,[a]:!0}),{})||{});},[o]),useEffect(()=>{v&&v(Object.keys(T));},[T]);let d$1=useMemo(()=>u?`table${u.charAt(0).toUpperCase()}${u.slice(1)}`:"table",[u]),z=useMemo(()=>t?w.length===0?!0:e=>!w.includes(e.id.toString()):!1,[t,w]),s=useReactTable({data:o,columns:i,state:{rowSelection:T},getRowId:e=>e?.id,enableRowSelection:z,onRowSelectionChange:I,getCoreRowModel:getCoreRowModel(),manualPagination:!0,manualFiltering:!0}),x=s.getIsAllPageRowsSelected(),P=s.getIsSomePageRowsSelected(),f$1=s.getSelectedRowModel().rows.length,g$1=useMemo(()=>y&&o.length>0,[y,o]),K=useMemo(()=>s.getHeaderGroups().map(e=>jsxs(f,{className:g$1?"shrink-0 max-lg:min-w-28 max-lg:flex-row max-lg:items-center max-lg:!border-0 max-lg:p-0 max-lg:hover:bg-transparent max-lg:[&>th:not(:nth-child(1),:nth-child(2))]:hidden":"",children:[t?jsx(c,{className:"w-6 lg:w-8",children:N?jsx(a,{checked:x,indeterminate:!x&&P,disabled:o.length===0,onChange:s.getToggleAllPageRowsSelectedHandler(),id:`checkboxSelectAllRows${d$1}`}):null}):null,e.headers.map((a,V)=>jsx(c,{colSpan:a.colSpan,className:a.column.columnDef?.className?.header||"",children:S&&V===0&&(f$1>0||g$1)?jsx("label",{htmlFor:`checkboxSelectAllRows${d$1}`,className:"cursor-pointer",children:g$1&&f$1==0?jsxs(Fragment,{children:[jsx("div",{className:"lg:hidden",children:"0 selecionados"}),jsx("div",{className:"hidden lg:inline",children:flexRender(a.column.columnDef.header,a.getContext())})]}):jsxs("div",{className:"inline min-w-28 text-primary-dark",id:"tableCountSelected",children:[a$1(f$1)," selecionado",f$1>1?"s":""]})}):a.isPlaceholder?null:flexRender(a.column.columnDef.header,a.getContext())},a.id))]},e.id)),[s,t,d$1,x,P,N,T,S,g$1,n]),U=useMemo(()=>t?i.length+1:i.length,[i,t]);return jsxs(a$2,{id:d$1,children:[jsxs(b,{className:g$1?"flex w-full justify-between max-lg:mb-3 max-lg:border-0 max-lg:bg-transparent max-lg:[&_tr]:border-0":"",children:[K,jsx("tr",{className:"w-[55%] lg:hidden",children:jsx("th",{className:"flex items-center justify-between font-normal",children:k||null})})]}),jsx(d,{className:"flex flex-col gap-2 lg:table-row-group",children:C||b$1||o.length===0?jsx(f,{className:b$1||o.length===0?"p-0 hover:bg-transparent max-lg:border-none":"flex-row flex-wrap items-center",children:C?jsxs(Fragment,{children:[t?jsx(g,{className:"mr-2",children:jsx(a,{disabled:!0,className:"animate-pulse"})}):null,i.map((e,a)=>jsx(g,{className:`${a===0?"w-10/12":"w-full"} lg:w-auto`,children:jsx(a$3,{className:"mb-1 lg:mb-0"})},`${e.id}-${a}`))]}):b$1||o.length===0?jsx(g,{colSpan:U||1,children:E(b$1?F:B)}):null}):s.getRowModel().rows.map(e=>jsxs(f,{"data-checked":e.getIsSelected(),className:t?"flex-row flex-wrap items-center":"",children:[t?jsx(g,{children:jsx(a,{onChange:e.getToggleSelectedHandler(),checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),id:`checkboxRow${e.id}${d$1}`,className:"mr-2 lg:mr-0"})}):null,e.getVisibleCells().map(a=>jsx(g,{className:a.column.columnDef?.className?.cell||"",children:flexRender(a.column.columnDef.cell,a.getContext())},a.id))]},e.id))})]})},L=memo(X);L.displayName="DataTable";var ne=L;
|
|
10
|
+
|
|
11
|
+
export { ne as a };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { b } from './chunk-HZACKBIW.js';
|
|
2
|
+
import { a as a$1 } from './chunk-DVFKTOCS.js';
|
|
3
|
+
import { a as a$2 } from './chunk-HQ53LHR2.js';
|
|
4
|
+
import { a } from './chunk-REQIQLRI.js';
|
|
5
|
+
import M, { useMemo, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var L=({className:g="",currentItemsLength:t,totalItemsLength:i=0,itemsLengthOptions:e=d,onItemsLengthChange:o,defaultItemsLengthOption:a$2=d[0].value})=>{let r=M.createRef(),s=m=>{let n=parseInt(m.currentTarget.value);o&&o(n);},l=useMemo(()=>e?.[0]?.value,[e]);if(useEffect(()=>{a$2&&r.current&&(r.current.value=a$2.toString(),o?.(a$2));},[a$2]),!t&&t!==0)return null;let c=Math.max(t,i);return jsx("div",{className:a("pagination-info hidden sm:flex",g),children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[e&&e?.length>0&&t>=l?jsx(b,{ref:r,id:"selectItemsPerPage",options:e,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:s,className:"h-6",defaultValue:a$2}):jsxs("span",{children:["Mostrando"," ",jsx("span",{className:"pagination-info-current",children:t})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:a$1(c)}),"\xA0no total"]})})},N=M.memo(L);N.displayName="PaginationInfo";var z=({className:g="",currentPage:t=1,totalPages:i=1,onPageChange:e})=>{let o=useRef(null),a$1=useMemo(()=>Math.max(t,i),[t,i]),r=useMemo(()=>t<i,[t,i]),s=useMemo(()=>t>1,[t]),l=n=>{n=n<1||isNaN(n)?1:n>a$1?a$1:n,e&&e(n);},c=n=>(n.preventDefault(),!1),m=n=>{if(!/^\d$/.test(n.key)&&n.key!=="Enter"&&n.key!=="Backspace"&&n.key!=="Delete"&&n.key!=="ArrowLeft"&&n.key!=="ArrowRight"&&n.key!=="Tab"){n.preventDefault();return}if(n.key==="Enter"){let v=o?.current?.innerText;if(v)try{let p=parseInt(v);l(p);}catch(p){console.error(p);}n.preventDefault();return}};return useEffect(()=>{o?.current&&(o.current.innerText=t.toString());},[t]),jsxs("div",{className:a("pagination-nav flex w-full items-center justify-between lg:w-auto",g),children:[jsxs("div",{className:"pagination-nav-current-total text-f6 text-inverted-2",children:[jsx("span",{id:"btnPaginationActualPage",className:"pagination-nav-current -mx-1 inline-block rounded border-card-stroke/50 px-1 text-center font-semibold leading-8 text-primary lg:mx-0 lg:min-w-9 lg:border lg:bg-base-1",ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:m,onCopy:c,onCut:c,onPaste:c,children:t})," ","/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{t!==a$1&&l(a$1);},children:a$1})]}),jsxs("div",{className:"pagination-nav-previous-next 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":"opacity-75"}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{s&&l(t-1);},children:jsx(a$2,{icon:"arrowLeft",size:4})}),jsx("button",{type:"button",id:"btnPaginationNext",className:`pagination-nav-next outline-none duration-200 ${r?"hover:text-inverted-1":"opacity-75"}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{r&&l(t+1);},children:jsx(a$2,{icon:"arrowRight",size:4})})]})]})},h=M.memo(z);h.displayName="PaginationNav";var d=[{label:"Mostrando 25",value:25},{label:"Mostrando 50",value:50},{label:"Mostrando 75",value:75},{label:"Mostrando 100",value:100}],W=({showPaginationInfo:g=!0,showPaginationNav:t=!0,classNamePaginationInfo:i="",classNamePaginationNav:e="",className:o="",currentPage:a$1=1,totalPages:r,defaultItemsLengthOption:s=d[0].value,onPageChange:l,currentItemsLength:c,totalItemsLength:m,itemsLengthOptions:n=d,onItemsLengthChange:v})=>{let[p,I]=useState(s),D=m&&Math.ceil(m/p),R=r||D;useEffect(()=>{I(s);},[s]);let S=E=>{I(E),v&&v(E);};return jsxs("div",{className:a("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",o),children:[g?jsx(N,{className:i,currentItemsLength:c,totalItemsLength:m,itemsLengthOptions:n,onItemsLengthChange:S,defaultItemsLengthOption:p}):null,t?jsx(h,{className:e,currentPage:a$1,totalPages:R,onPageChange:l}):null]})},B=M.memo(W);B.displayName="Pagination";
|
|
9
|
+
|
|
10
|
+
export { N as a, h as b, d as c, B as d };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use client";export { a as DataTable } from '../../chunk-
|
|
1
|
+
"use client";export { a as DataTable } from '../../chunk-BDSJLA3R.js';
|
|
2
|
+
import '../../chunk-DVFKTOCS.js';
|
|
2
3
|
import '../../chunk-DIENJUYM.js';
|
|
3
4
|
import '../../chunk-G3GCVCTU.js';
|
|
4
5
|
import '../../chunk-IPIBO3ES.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '../chunk-DIFKNF3L.js';
|
|
2
2
|
export { a as IconCircular } from '../chunk-BV27BOLB.js';
|
|
3
3
|
export { a as Button } from '../chunk-HHPP5PSK.js';
|
|
4
|
-
export { a as DataTable } from '../chunk-
|
|
4
|
+
export { a as DataTable } from '../chunk-BDSJLA3R.js';
|
|
5
|
+
import '../chunk-DVFKTOCS.js';
|
|
5
6
|
import '../chunk-DIENJUYM.js';
|
|
6
7
|
import '../chunk-G3GCVCTU.js';
|
|
7
8
|
export { a as LoadingPlaceholder } from '../chunk-IPIBO3ES.js';
|
|
@@ -10,7 +10,8 @@ import '../../chunk-7Z3CCBLX.js';
|
|
|
10
10
|
import '../../chunk-7QFPSOGQ.js';
|
|
11
11
|
import '../../chunk-L6H2NDVS.js';
|
|
12
12
|
import '../../chunk-HHPP5PSK.js';
|
|
13
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-BDSJLA3R.js';
|
|
14
|
+
import '../../chunk-DVFKTOCS.js';
|
|
14
15
|
import '../../chunk-DIENJUYM.js';
|
|
15
16
|
import '../../chunk-G3GCVCTU.js';
|
|
16
17
|
import '../../chunk-IPIBO3ES.js';
|
package/dist/forms/index.js
CHANGED
|
@@ -13,7 +13,8 @@ export { a as InputLabel } from '../chunk-7Z3CCBLX.js';
|
|
|
13
13
|
import '../chunk-7QFPSOGQ.js';
|
|
14
14
|
import '../chunk-L6H2NDVS.js';
|
|
15
15
|
import '../chunk-HHPP5PSK.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-BDSJLA3R.js';
|
|
17
|
+
import '../chunk-DVFKTOCS.js';
|
|
17
18
|
export { a as Checkbox } from '../chunk-DIENJUYM.js';
|
|
18
19
|
export { a as InputHelpText } from '../chunk-G3GCVCTU.js';
|
|
19
20
|
import '../chunk-IPIBO3ES.js';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import './chunk-7RP4L6ZM.js';
|
|
|
2
2
|
import './chunk-4PUGMMDC.js';
|
|
3
3
|
export { a as Breadcrumb } from './chunk-FZISHDWC.js';
|
|
4
4
|
export { a as HelpLink } from './chunk-SXBDHD2Z.js';
|
|
5
|
-
export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from './chunk-
|
|
5
|
+
export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from './chunk-UY7G2JRL.js';
|
|
6
6
|
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
7
7
|
import './chunk-BQWNCDFV.js';
|
|
8
8
|
export { a as Dropdown } from './chunk-I757C3JI.js';
|
|
@@ -24,7 +24,8 @@ export { a as InputLabel } from './chunk-7Z3CCBLX.js';
|
|
|
24
24
|
export { a as ActionBar } from './chunk-7QFPSOGQ.js';
|
|
25
25
|
import './chunk-L6H2NDVS.js';
|
|
26
26
|
export { a as Button } from './chunk-HHPP5PSK.js';
|
|
27
|
-
export { a as DataTable } from './chunk-
|
|
27
|
+
export { a as DataTable } from './chunk-BDSJLA3R.js';
|
|
28
|
+
import './chunk-DVFKTOCS.js';
|
|
28
29
|
export { a as Checkbox } from './chunk-DIENJUYM.js';
|
|
29
30
|
export { a as InputHelpText } from './chunk-G3GCVCTU.js';
|
|
30
31
|
export { a as LoadingPlaceholder } from './chunk-IPIBO3ES.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"use client";export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from '../../chunk-
|
|
1
|
+
"use client";export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from '../../chunk-UY7G2JRL.js';
|
|
2
2
|
import '../../chunk-HZACKBIW.js';
|
|
3
3
|
import '../../chunk-7Z3CCBLX.js';
|
|
4
|
+
import '../../chunk-DVFKTOCS.js';
|
|
4
5
|
import '../../chunk-G3GCVCTU.js';
|
|
5
6
|
import '../../chunk-LTWCICTK.js';
|
|
6
7
|
import '../../chunk-HQ53LHR2.js';
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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 { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from '../chunk-
|
|
4
|
+
export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from '../chunk-UY7G2JRL.js';
|
|
5
5
|
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
6
6
|
import '../chunk-HZACKBIW.js';
|
|
7
7
|
import '../chunk-7Z3CCBLX.js';
|
|
8
|
+
import '../chunk-DVFKTOCS.js';
|
|
8
9
|
import '../chunk-G3GCVCTU.js';
|
|
9
10
|
import '../chunk-LTWCICTK.js';
|
|
10
11
|
import '../chunk-HQ53LHR2.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.32",
|
|
4
4
|
"author": "Loja Integrada",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"tsup": "^8.1.0",
|
|
33
33
|
"typescript": "^5.3.3",
|
|
34
34
|
"vite": "^5.1.4",
|
|
35
|
-
"@loja-integrada/
|
|
35
|
+
"@loja-integrada/eslint-config": "0.0.3",
|
|
36
36
|
"@loja-integrada/tailwindcss-config": "2.0.3",
|
|
37
|
-
"@loja-integrada/
|
|
37
|
+
"@loja-integrada/typescript-config": "0.0.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@tanstack/react-table": "^8.17.3",
|
package/dist/chunk-6WZYS65C.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-DIENJUYM.js';
|
|
2
|
-
import { a as a$2 } from './chunk-IPIBO3ES.js';
|
|
3
|
-
import { f, c, a as a$1, b, d, g } from './chunk-MMWMFOBR.js';
|
|
4
|
-
import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
5
|
-
import { memo, useState, useMemo, useEffect } from 'react';
|
|
6
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var P=s=>typeof s=="string"?jsx("div",{className:"text-f4 py-4 text-center font-semibold text-on-base-2 lg:py-10",children:s}):s,Q=({columns:s,data:n=[],isLoading:C=!1,error:u=!1,selectable:t=!1,showSelectAll:D=!0,showCountSelected:N=!0,showHeaderInMobile:y=!1,childrenHeaderMobile:S=null,onChange:k,defaultSelectedIds:v,disabledIds:h=[],id:p="",emptyText:W="Nenhum registro encontrado",errorText:B="Ocorreu um erro ao carregar os itens."})=>{let[o,H]=useState({}),d$1=useMemo(()=>s.map(e=>({...e,accessorKey:e?.id||""})),[s]);useEffect(()=>{v&&H(v.reduce((e,l)=>({...e,[l]:!0}),{})||{});},[n]),useEffect(()=>{k&&k(Object.keys(o));},[o]);let g$1=useMemo(()=>p?`table${p.charAt(0).toUpperCase()}${p.slice(1)}`:"table",[p]),F=useMemo(()=>t?h.length===0?!0:e=>!h.includes(e.id.toString()):!1,[t,h]),r=useReactTable({data:n,columns:d$1,state:{rowSelection:o},getRowId:e=>e?.id,enableRowSelection:F,onRowSelectionChange:H,getCoreRowModel:getCoreRowModel(),manualPagination:!0,manualFiltering:!0}),x=r.getIsAllRowsSelected(),O=r.getIsSomeRowsSelected(),b$1=useMemo(()=>y&&n.length>0,[y,n]),L=useMemo(()=>r.getHeaderGroups().map(e=>jsxs(f,{className:b$1?"max-lg:min-w-28 max-lg:flex-row max-lg:items-center max-lg:!border-0 max-lg:p-0 max-lg:hover:bg-transparent max-lg:[&>th:not(:nth-child(1),:nth-child(2))]:hidden":"",children:[t?jsx(c,{className:"w-6 lg:w-8",children:D?jsx(a,{checked:x,indeterminate:!x&&O,disabled:n.length===0,onChange:r.getToggleAllRowsSelectedHandler(),id:`checkboxSelectAllRows${g$1}`}):null}):null,e.headers.map((l,K)=>jsx(c,{colSpan:l.colSpan,className:l.column.columnDef?.className?.header||"",children:N&&K===0&&(Object.keys(o).length>0||b$1)?jsx("label",{htmlFor:`checkboxSelectAllRows${g$1}`,className:"cursor-pointer",children:b$1&&Object.keys(o).length==0?jsxs(Fragment,{children:[jsx("div",{className:"lg:hidden",children:"0 selecionados"}),jsx("div",{className:"hidden lg:inline",children:flexRender(l.column.columnDef.header,l.getContext())})]}):jsxs("div",{className:"inline min-w-28 text-primary-dark",id:"tableCountSelected",children:[Object.keys(o).length," selecionado",Object.keys(o).length>1?"s":""]})}):l.isPlaceholder?null:flexRender(l.column.columnDef.header,l.getContext())},l.id))]},e.id)),[r,t,g$1,x,O,D,o,N,b$1,s]),z=useMemo(()=>t?d$1.length+1:d$1.length,[d$1,t]);return jsxs(a$1,{id:g$1,children:[jsxs(b,{className:b$1?"flex w-full justify-between max-lg:mb-3 max-lg:border-0 max-lg:bg-transparent":"",children:[L,jsx("span",{className:"col-span-2 flex w-[55%] items-center justify-between lg:hidden",children:S||null})]}),jsx(d,{className:"flex flex-col gap-2 lg:table-row-group",children:C||u||n.length===0?jsx(f,{className:u||n.length===0?"p-0 hover:bg-transparent max-lg:border-none":"flex-row flex-wrap items-center",children:C?jsxs(Fragment,{children:[t?jsx(g,{className:"mr-2",children:jsx(a,{disabled:!0,className:"animate-pulse"})}):null,d$1.map((e,l)=>jsx(g,{className:`${l===0?"w-10/12":"w-full"} lg:w-auto`,children:jsx(a$2,{className:"mb-1 lg:mb-0"})},`${e.id}-${l}`))]}):u||n.length===0?jsx(g,{colSpan:z||1,children:P(u?B:W)}):null}):r.getRowModel().rows.map(e=>jsxs(f,{"data-checked":e.getIsSelected(),className:t?"flex-row flex-wrap items-center":"",children:[t?jsx(g,{children:jsx(a,{onChange:e.getToggleSelectedHandler(),checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),id:`checkboxRow${e.id}${g$1}`,className:"mr-2 lg:mr-0"})}):null,e.getVisibleCells().map(l=>jsx(g,{className:l.column.columnDef?.className?.cell||"",children:flexRender(l.column.columnDef.cell,l.getContext())},l.id))]},e.id))})]})},G=memo(Q);G.displayName="DataTable";var ae=G;
|
|
9
|
-
|
|
10
|
-
export { ae as a };
|
package/dist/chunk-YRMGTRPK.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { b } from './chunk-HZACKBIW.js';
|
|
2
|
-
import { a as a$1 } from './chunk-HQ53LHR2.js';
|
|
3
|
-
import { a } from './chunk-REQIQLRI.js';
|
|
4
|
-
import M, { useMemo, useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function w(c){return c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}var L=({className:c="",currentItemsLength:t,totalItemsLength:i=0,itemsLengthOptions:e=d,onItemsLengthChange:o,defaultItemsLengthOption:a$1=d[0].value})=>{let r=M.createRef(),s=p=>{let n=parseInt(p.currentTarget.value);o&&o(n);},l=useMemo(()=>e?.[0]?.value,[e]);if(useEffect(()=>{a$1&&r.current&&(r.current.value=a$1.toString(),o?.(a$1));},[a$1]),!t&&t!==0)return null;let m=Math.max(t,i);return jsx("div",{className:a("pagination-info hidden sm:flex",c),children:jsxs("div",{className:"text-f6 mr-5 flex items-center tracking-4 text-inverted-2",children:[e&&e?.length>0&&t>=l?jsx(b,{ref:r,id:"selectItemsPerPage",options:e,withoutStyle:!0,"aria-label":"Itens por p\xE1gina",onChange:s,className:"h-6",defaultValue:a$1}):jsxs("span",{children:["Mostrando"," ",jsx("span",{className:"pagination-info-current",children:t})]}),"\xA0de\xA0",jsx("span",{className:"pagination-info-total",children:w(m)}),"\xA0no total"]})})},N=M.memo(L);N.displayName="PaginationInfo";var $=({className:c="",currentPage:t=1,totalPages:i=1,onPageChange:e})=>{let o=useRef(null),a$2=useMemo(()=>Math.max(t,i),[t,i]),r=useMemo(()=>t<i,[t,i]),s=useMemo(()=>t>1,[t]),l=n=>{n=n<1||isNaN(n)?1:n>a$2?a$2:n,e&&e(n);},m=n=>(n.preventDefault(),!1),p=n=>{if(!/^\d$/.test(n.key)&&n.key!=="Enter"&&n.key!=="Backspace"&&n.key!=="Delete"&&n.key!=="ArrowLeft"&&n.key!=="ArrowRight"&&n.key!=="Tab"){n.preventDefault();return}if(n.key==="Enter"){let v=o?.current?.innerText;if(v)try{let u=parseInt(v);l(u);}catch(u){console.error(u);}n.preventDefault();return}};return useEffect(()=>{o?.current&&(o.current.innerText=t.toString());},[t]),jsxs("div",{className:a("pagination-nav flex w-full items-center justify-between lg:w-auto",c),children:[jsxs("div",{className:"pagination-nav-current-total text-f6 text-inverted-2",children:[jsx("span",{id:"btnPaginationActualPage",className:"pagination-nav-current -mx-1 inline-block rounded border-card-stroke/50 px-1 text-center font-semibold leading-8 text-primary lg:mx-0 lg:min-w-9 lg:border lg:bg-base-1",ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:p,onCopy:m,onCut:m,onPaste:m,children:t})," ","/"," ",jsx("button",{type:"button",id:"btnPaginationLastPage",className:"pagination-nav-total focus:outline-none",onClick:()=>{t!==a$2&&l(a$2);},children:a$2})]}),jsxs("div",{className:"pagination-nav-previous-next 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":"opacity-75"}`,"aria-label":"Ir para p\xE1gina anterior",onClick:()=>{s&&l(t-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":"opacity-75"}`,"aria-label":"Ir para pr\xF3xima p\xE1gina",onClick:()=>{r&&l(t+1);},children:jsx(a$1,{icon:"arrowRight",size:4})})]})]})},h=M.memo($);h.displayName="PaginationNav";var d=[{label:"Mostrando 25",value:25},{label:"Mostrando 50",value:50},{label:"Mostrando 75",value:75},{label:"Mostrando 100",value:100}],O=({showPaginationInfo:c=!0,showPaginationNav:t=!0,classNamePaginationInfo:i="",classNamePaginationNav:e="",className:o="",currentPage:a$1=1,totalPages:r,defaultItemsLengthOption:s=d[0].value,onPageChange:l,currentItemsLength:m,totalItemsLength:p,itemsLengthOptions:n=d,onItemsLengthChange:v})=>{let[u,I]=useState(s),D=p&&Math.ceil(p/u),S=r||D;useEffect(()=>{I(s);},[s]);let R=E=>{I(E),v&&v(E);};return jsxs("div",{className:a("pagination flex flex-wrap items-center justify-end leading-4 sm:justify-between",o),children:[c?jsx(N,{className:i,currentItemsLength:m,totalItemsLength:p,itemsLengthOptions:n,onItemsLengthChange:R,defaultItemsLengthOption:u}):null,t?jsx(h,{className:e,currentPage:a$1,totalPages:S,onPageChange:l}):null]})},U=M.memo(O);U.displayName="Pagination";
|
|
8
|
-
|
|
9
|
-
export { N as a, h as b, d as c, U as d };
|