@loja-integrada/admin-components 1.0.13 → 1.0.14

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 { a as a$2 } from './chunk-IPIBO3ES.js';
2
+ import { f, c, a as a$1, b, d, g } from './chunk-MMWMFOBR.js';
3
+ import { a } from './chunk-DIENJUYM.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 A=o=>typeof o=="string"?jsx("div",{className:"text-f4 py-4 text-center font-semibold text-on-base-2 lg:py-10",children:o}):o,U=({columns:o,data:d$1=[],isLoading:w=!1,error:g$1=!1,selectable:l=!1,showSelectAll:y=!0,showCountSelected:S=!0,onChange:f$1,selectedIds:D,disabledIds:R=[],id:b$1="",emptyText:v="Nenhum registro encontrado",errorText:P="Ocorreu um erro ao carregar os itens."})=>{let[n,N]=useState({}),r=useMemo(()=>o.map(e=>({...e,accessorKey:e?.id||""})),[o]);useEffect(()=>{D&&N(D.reduce((e,a)=>({...e,[a]:!0}),{})||{});},[D]),useEffect(()=>{f$1&&f$1(Object.keys(n));},[n,f$1]);let u=useMemo(()=>b$1?`table${b$1.charAt(0).toUpperCase()}${b$1.slice(1)}`:"table",[b$1]),E=useMemo(()=>l?R.length===0?!0:e=>!R.includes(e.id.toString()):!1,[l,R]),s=useReactTable({data:d$1,columns:r,state:{rowSelection:n},getRowId:e=>e?.id,enableRowSelection:E,onRowSelectionChange:N,getCoreRowModel:getCoreRowModel(),manualPagination:!0,manualFiltering:!0}),C=s.getIsAllRowsSelected(),x=s.getIsSomeRowsSelected(),G=useMemo(()=>s.getHeaderGroups().map(e=>jsxs(f,{children:[l?jsx(c,{className:"w-8",children:y?jsx(a,{checked:C,indeterminate:!C&&x,onChange:s.getToggleAllRowsSelectedHandler(),id:`checkboxSelectAllRows${u}`}):null}):null,e.headers.map((a,B)=>jsx(c,{colSpan:a.colSpan,className:a.column.columnDef?.className?.header||"",children:S&&B===0&&Object.keys(n).length>0?jsxs("span",{className:"min-w-28 text-primary-dark",id:"tableCountSelected",children:[Object.keys(n).length," selecionado",Object.keys(n).length>1?"s":""]}):a.isPlaceholder?null:flexRender(a.column.columnDef.header,a.getContext())},a.id))]},e.id)),[s,l,u,C,x,y,n,S,o]),W=useMemo(()=>l?r.length+1:r.length,[r,l]);return jsxs(a$1,{id:u,children:[jsx(b,{children:G}),jsx(d,{className:"flex flex-col gap-2 lg:table-row-group",children:w||g$1||d$1.length===0?jsx(f,{className:g$1||d$1.length===0?"p-0 hover:bg-transparent max-lg:border-none":"flex-row flex-wrap items-center",children:w?jsxs(Fragment,{children:[l?jsx(g,{className:"mr-2",children:jsx(a,{disabled:!0,className:"animate-pulse"})}):null,r.map((e,a)=>jsx(g,{className:`${a===0?"w-10/12":"w-full"} lg:w-auto`,children:jsx(a$2,{className:"mb-1 lg:mb-0"})},`${e.id}-${a}`))]}):g$1||d$1.length===0?jsx(g,{colSpan:W||1,children:A(g$1?P:v)}):null}):s.getRowModel().rows.map(e=>jsxs(f,{"data-checked":e.getIsSelected(),className:l?"flex-row flex-wrap items-center":"",children:[l?jsx(g,{children:jsx(a,{onChange:e.getToggleSelectedHandler(),checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),id:`checkboxRow${e.id}${u}`,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))})]})},M=memo(U);M.displayName="DataTable";var _=M;
9
+
10
+ export { _ as a };
@@ -1,4 +1,4 @@
1
- "use client";export { a as DataTable } from '../../chunk-3O4Z3XLF.js';
1
+ "use client";export { a as DataTable } from '../../chunk-FVV4RPTS.js';
2
2
  import '../../chunk-IPIBO3ES.js';
3
3
  import '../../chunk-MMWMFOBR.js';
4
4
  import '../../chunk-DIENJUYM.js';
@@ -1,7 +1,7 @@
1
1
  import '../chunk-DIFKNF3L.js';
2
2
  export { a as IconCircular } from '../chunk-BV27BOLB.js';
3
3
  export { a as Button } from '../chunk-T7A7CWOV.js';
4
- export { a as DataTable } from '../chunk-3O4Z3XLF.js';
4
+ export { a as DataTable } from '../chunk-FVV4RPTS.js';
5
5
  export { a as LoadingPlaceholder } from '../chunk-IPIBO3ES.js';
6
6
  export { a as Modal } from '../chunk-2J6WGYVP.js';
7
7
  export { a as SidebarFixed } from '../chunk-2U5ZAW7M.js';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import './chunk-7RP4L6ZM.js';
2
2
  import './chunk-DBWOW4GL.js';
3
3
  import './chunk-4PUGMMDC.js';
4
- export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
4
+ export { a as Tooltip } from './chunk-TZI6YTCW.js';
5
5
  export { a as Breadcrumb } from './chunk-FZISHDWC.js';
6
6
  export { a as HelpLink } from './chunk-SXBDHD2Z.js';
7
7
  export { a as Pagination } from './chunk-TKA7LHSA.js';
@@ -14,16 +14,16 @@ export { b as Select, a as SelectComponent } from './chunk-HZACKBIW.js';
14
14
  export { a as InputMask } from './chunk-ABMMRP7O.js';
15
15
  export { a as Input } from './chunk-FNTWCBA6.js';
16
16
  export { a as InputLabel } from './chunk-7Z3CCBLX.js';
17
+ export { a as ActionBar } from './chunk-UQTLNERO.js';
18
+ export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-IGUCTFH2.js';
19
+ export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
20
+ import './chunk-L6H2NDVS.js';
17
21
  export { a as Alert } from './chunk-FM3XVRKO.js';
18
22
  export { a as Badge } from './chunk-72QPS6JN.js';
19
23
  export { a as Tag } from './chunk-2B6HWISX.js';
20
- export { b as ToastContainer, a as notify } from './chunk-EHRQIKSI.js';
21
- export { a as Tooltip } from './chunk-TZI6YTCW.js';
22
- export { a as ActionBar } from './chunk-UQTLNERO.js';
23
- import './chunk-L6H2NDVS.js';
24
24
  export { a as Button } from './chunk-T7A7CWOV.js';
25
- export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-IGUCTFH2.js';
26
- export { a as DataTable } from './chunk-3O4Z3XLF.js';
25
+ export { b as ToastContainer, a as notify } from './chunk-EHRQIKSI.js';
26
+ export { a as DataTable } from './chunk-FVV4RPTS.js';
27
27
  export { a as LoadingPlaceholder } from './chunk-IPIBO3ES.js';
28
28
  export { a as Modal } from './chunk-2J6WGYVP.js';
29
29
  export { a as SidebarFixed } from './chunk-2U5ZAW7M.js';
@@ -1,10 +1,10 @@
1
1
  import '../chunk-7RP4L6ZM.js';
2
+ export { a as Tooltip } from '../chunk-TZI6YTCW.js';
2
3
  export { a as Alert } from '../chunk-FM3XVRKO.js';
3
4
  export { a as Badge } from '../chunk-72QPS6JN.js';
4
5
  export { a as Tag } from '../chunk-2B6HWISX.js';
5
- export { b as ToastContainer, a as notify } from '../chunk-EHRQIKSI.js';
6
- export { a as Tooltip } from '../chunk-TZI6YTCW.js';
7
6
  import '../chunk-T7A7CWOV.js';
7
+ export { b as ToastContainer, a as notify } from '../chunk-EHRQIKSI.js';
8
8
  import '../chunk-LTWCICTK.js';
9
9
  import '../chunk-HQ53LHR2.js';
10
10
  import '../chunk-EVEOC5I2.js';
@@ -1,9 +1,9 @@
1
1
  import '../chunk-DBWOW4GL.js';
2
- export { a as Container, b as ContainerHeader } from '../chunk-3BKW5XAK.js';
3
2
  export { a as ActionBar } from '../chunk-UQTLNERO.js';
3
+ export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from '../chunk-IGUCTFH2.js';
4
+ export { a as Container, b as ContainerHeader } from '../chunk-3BKW5XAK.js';
4
5
  import '../chunk-L6H2NDVS.js';
5
6
  import '../chunk-T7A7CWOV.js';
6
- export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from '../chunk-IGUCTFH2.js';
7
7
  import '../chunk-LTWCICTK.js';
8
8
  import '../chunk-HQ53LHR2.js';
9
9
  import '../chunk-EVEOC5I2.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "author": "Loja Integrada",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,10 +0,0 @@
1
- import { a as a$2 } from './chunk-IPIBO3ES.js';
2
- import { f, c, a as a$1, b, d, g } from './chunk-MMWMFOBR.js';
3
- import { a } from './chunk-DIENJUYM.js';
4
- import { useReactTable, getCoreRowModel, getPaginationRowModel, getFilteredRowModel, getFacetedUniqueValues, 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 j=o=>typeof o=="string"?jsx("div",{className:"text-f4 py-4 text-center font-semibold text-on-base-2 lg:py-10",children:o}):o,J=({columns:o,data:d$1=[],isLoading:h=!1,error:g$1=!1,selectable:l=!1,showSelectAll:y=!0,showCountSelected:S=!0,onChange:f$1,selectedIds:R,disabledIds:w=[],id:b$1="",emptyText:P="Nenhum registro encontrado",errorText:v="Ocorreu um erro ao carregar os itens."})=>{let[n,N]=useState({}),r=useMemo(()=>o.map(e=>({...e,accessorKey:e?.id||""})),[o]);useEffect(()=>{R&&N(R.reduce((e,a)=>({...e,[a]:!0}),{})||{});},[R]),useEffect(()=>{f$1&&f$1(Object.keys(n));},[n,f$1]);let u=useMemo(()=>b$1?`table${b$1.charAt(0).toUpperCase()}${b$1.slice(1)}`:"table",[b$1]),F=useMemo(()=>l?w.length===0?!0:e=>!w.includes(e.id.toString()):!1,[l,w]),s=useReactTable({data:d$1,columns:r,state:{rowSelection:n},getRowId:e=>e?.id,enableRowSelection:F,onRowSelectionChange:N,getCoreRowModel:getCoreRowModel(),getPaginationRowModel:getPaginationRowModel(),getFilteredRowModel:getFilteredRowModel(),getFacetedUniqueValues:getFacetedUniqueValues()}),D=s.getIsAllRowsSelected(),x=s.getIsSomeRowsSelected(),E=useMemo(()=>s.getHeaderGroups().map(e=>jsxs(f,{children:[l?jsx(c,{className:"w-8",children:y?jsx(a,{checked:D,indeterminate:!D&&x,onChange:s.getToggleAllRowsSelectedHandler(),id:`checkboxSelectAllRows${u}`}):null}):null,e.headers.map((a,U)=>jsx(c,{colSpan:a.colSpan,className:a.column.columnDef?.className?.header||"",children:S&&U===0&&Object.keys(n).length>0?jsxs("span",{className:"min-w-28 text-primary-dark",id:"tableCountSelected",children:[Object.keys(n).length," selecionado",Object.keys(n).length>1?"s":""]}):a.isPlaceholder?null:flexRender(a.column.columnDef.header,a.getContext())},a.id))]},e.id)),[s,l,u,D,x,y,n,S,o]),G=useMemo(()=>l?r.length+1:r.length,[r,l]);return jsxs(a$1,{id:u,children:[jsx(b,{children:E}),jsx(d,{className:"flex flex-col gap-2 lg:table-row-group",children:h||g$1||d$1.length===0?jsx(f,{className:g$1||d$1.length===0?"p-0 hover:bg-transparent max-lg:border-none":"flex-row flex-wrap items-center",children:h?jsxs(Fragment,{children:[l?jsx(g,{className:"mr-2",children:jsx(a,{disabled:!0,className:"animate-pulse"})}):null,r.map((e,a)=>jsx(g,{className:`${a===0?"w-10/12":"w-full"} lg:w-auto`,children:jsx(a$2,{className:"mb-1 lg:mb-0"})},`${e.id}-${a}`))]}):g$1||d$1.length===0?jsx(g,{colSpan:G||1,children:j(g$1?v:P)}):null}):s.getRowModel().rows.map(e=>jsxs(f,{"data-checked":e.getIsSelected(),className:l?"flex-row flex-wrap items-center":"",children:[l?jsx(g,{children:jsx(a,{onChange:e.getToggleSelectedHandler(),checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),id:`checkboxRow${e.id}${u}`,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))})]})},A=memo(J);A.displayName="DataTable";var te=A;
9
-
10
- export { te as a };