@loja-integrada/admin-components 1.0.11 → 1.0.12
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-3O4Z3XLF.js +10 -0
- package/dist/{chunk-UYUM2DWH.js → chunk-C5IV2FYP.js} +1 -1
- package/dist/{chunk-T46I7KD2.js → chunk-HZACKBIW.js} +1 -1
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/forms/Select/index.js +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/index.js +9 -9
- package/dist/indicators/index.js +2 -2
- package/dist/layout/index.js +2 -2
- package/dist/navigation/Pagination/index.js +2 -2
- package/dist/navigation/index.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-7SZYD2J2.js +0 -10
|
@@ -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, 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 };
|
|
@@ -5,6 +5,6 @@ import { cva } from 'class-variance-authority';
|
|
|
5
5
|
import b from 'react';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var E=cva("w-full min-w-0 cursor-pointer appearance-none rounded border border-card-stroke bg-base-1 bg-no-repeat pl-4 pr-8 text-sm tracking-4 text-on-base shadow-none outline-none transition-colors duration-75 placeholder:text-on-base-2 focus:border-inverted-1",{variants:{variant:{default:"h-12",small:"h-10",large:"h-14",xlarge:"h-24"},withoutStyle:{true:"no-style border-transparent pl-
|
|
8
|
+
var E=cva("w-full min-w-0 cursor-pointer appearance-none rounded border border-card-stroke bg-base-1 bg-no-repeat pl-4 pr-8 text-sm tracking-4 text-on-base shadow-none outline-none transition-colors duration-75 placeholder:text-on-base-2 focus:border-inverted-1",{variants:{variant:{default:"h-12",small:"h-10",large:"h-14",xlarge:"h-24"},withoutStyle:{true:"no-style border-transparent pl-0 pr-4 hover:text-inverted-1"},hasErrorState:{true:"border-danger focus:border-danger"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2 opacity-100"}}}),R=({formGroupClassName:f="",className:g="",label:x,labelComplement:v,helpText:h,hasError:S=!1,errorMessage:n,required:r=!1,id:w,name:s,variant:H="default",disabled:p,placeholder:c,options:I=[],withoutStyle:i=!1,style:N,...P},T)=>{let a$3=w||s,o=S||!!n,y=jsx(a,{label:x,required:r,hasError:o,htmlFor:a$3,className:"mb-1",labelComplement:v}),L=jsx(a$1,{helpText:n||h,hasError:o,className:"mt-2"});return jsxs("div",{className:a$2("form-group flex flex-col",f),children:[y,jsx("div",{className:"flex w-full",children:jsxs("select",{ref:T,id:a$3,name:s,required:r,disabled:p,className:a$2(E({variant:H,withoutStyle:i,hasErrorState:o,disabled:p}),g),...P,style:{backgroundImage:`url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 5" fill="%23607081"><path d="M7.11 0H.889a.667.667 0 00-.47 1.138l3.11 3.11a.661.661 0 00.943 0l3.11-3.11A.666.666 0 007.112 0z" /></svg>')`,backgroundSize:"8px",backgroundPosition:`calc(100% - ${i?"5px":"15px"}) center`,...N},children:[c?jsx("option",{value:"",disabled:r,children:c}):null,I?.map(t=>jsx("option",{value:`${t.value}`,disabled:t.disabled,children:t.label},`${a$3}-${t.value}`))]})}),L]})},C=b.forwardRef(R),M=b.memo(C);M.displayName="Select";
|
|
9
9
|
|
|
10
10
|
export { R as a, M as b };
|
package/dist/components/index.js
CHANGED
|
@@ -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-
|
|
4
|
+
export { a as DataTable } from '../chunk-3O4Z3XLF.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/forms/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../chunk-WV2QQGA4.js';
|
|
2
2
|
export { a as Dropdown } from '../chunk-2VOBQTBC.js';
|
|
3
|
-
export { b as Select, a as SelectComponent } from '../chunk-
|
|
3
|
+
export { b as Select, a as SelectComponent } from '../chunk-HZACKBIW.js';
|
|
4
4
|
export { a as InputMask } from '../chunk-ABMMRP7O.js';
|
|
5
5
|
export { a as Input } from '../chunk-FNTWCBA6.js';
|
|
6
6
|
export { a as InputLabel } from '../chunk-7Z3CCBLX.js';
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import './chunk-7RP4L6ZM.js';
|
|
2
2
|
import './chunk-DBWOW4GL.js';
|
|
3
3
|
import './chunk-4PUGMMDC.js';
|
|
4
|
-
export { a as
|
|
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
|
-
export { a as Pagination } from './chunk-
|
|
7
|
+
export { a as Pagination } from './chunk-C5IV2FYP.js';
|
|
8
8
|
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
9
9
|
import './chunk-DIFKNF3L.js';
|
|
10
10
|
export { a as IconCircular } from './chunk-BV27BOLB.js';
|
|
11
11
|
import './chunk-WV2QQGA4.js';
|
|
12
12
|
export { a as Dropdown } from './chunk-2VOBQTBC.js';
|
|
13
|
-
export { b as Select, a as SelectComponent } from './chunk-
|
|
13
|
+
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
|
|
26
|
-
export { a as DataTable } from './chunk-
|
|
25
|
+
export { b as ToastContainer, a as notify } from './chunk-EHRQIKSI.js';
|
|
26
|
+
export { a as DataTable } from './chunk-3O4Z3XLF.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';
|
package/dist/indicators/index.js
CHANGED
|
@@ -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';
|
package/dist/layout/index.js
CHANGED
|
@@ -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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";export { a as Pagination } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
"use client";export { a as Pagination } from '../../chunk-C5IV2FYP.js';
|
|
2
|
+
import '../../chunk-HZACKBIW.js';
|
|
3
3
|
import '../../chunk-7Z3CCBLX.js';
|
|
4
4
|
import '../../chunk-LTWCICTK.js';
|
|
5
5
|
import '../../chunk-HQ53LHR2.js';
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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-C5IV2FYP.js';
|
|
5
5
|
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-HZACKBIW.js';
|
|
7
7
|
import '../chunk-7Z3CCBLX.js';
|
|
8
8
|
import '../chunk-LTWCICTK.js';
|
|
9
9
|
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.12",
|
|
4
4
|
"author": "Loja Integrada",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"tsup": "^8.1.0",
|
|
33
33
|
"typescript": "^5.3.3",
|
|
34
34
|
"vite": "^5.1.4",
|
|
35
|
+
"@loja-integrada/tailwindcss-config": "2.0.2",
|
|
35
36
|
"@loja-integrada/eslint-config": "0.0.2",
|
|
36
|
-
"@loja-integrada/tailwindcss-config": "2.0.1",
|
|
37
37
|
"@loja-integrada/typescript-config": "0.0.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
package/dist/chunk-7SZYD2J2.js
DELETED
|
@@ -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=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,J=({columns:n,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:A="Nenhum registro encontrado",errorText:v="Ocorreu um erro ao carregar os itens."})=>{let[o,N]=useState({}),r=useMemo(()=>n.map(e=>({...e,accessorKey:e?.id||""})),[n]);useEffect(()=>{R&&N(R.reduce((e,a)=>({...e,[a]:!0}),{})||{});},[R]),useEffect(()=>{f$1&&f$1(Object.keys(o));},[o,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:o},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(o).length>0?jsxs("span",{className:"min-w-28 text-primary-dark",id:"tableCountSelected",children:[Object.keys(o).length," selecionado",Object.keys(o).length>1?"s":""]}):a.isPlaceholder?null:flexRender(a.column.columnDef.header,a.getContext())},a.id))]},e.id)),[s,l,u,D,x,y,o,S]),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:A)}):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))})]})},P=memo(J);P.displayName="DataTable";var te=P;
|
|
9
|
-
|
|
10
|
-
export { te as a };
|