nexaas-ui-components 1.0.7 → 1.0.8
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/index.cjs +3770 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3710 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,3772 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var clsx7 = require('clsx');
|
|
5
|
+
var datetime2 = require('@blueprintjs/datetime2');
|
|
6
|
+
var React2 = require('react');
|
|
7
|
+
var reactHookForm = require('react-hook-form');
|
|
8
|
+
var zustand = require('zustand');
|
|
9
|
+
var dateFns = require('date-fns');
|
|
10
|
+
var react = require('@headlessui/react');
|
|
11
|
+
var react$1 = require('@headlessui-float/react');
|
|
12
|
+
var IntlCurrencyInputModule = require('react-intl-currency-input');
|
|
13
|
+
var _debounce = require('lodash/debounce');
|
|
14
|
+
var InputMask = require('react-input-mask');
|
|
15
|
+
var ReactModalNamespace = require('react-modal');
|
|
16
|
+
var reactTooltip = require('react-tooltip');
|
|
17
|
+
var reactSelect = require('react-select');
|
|
18
|
+
var AsyncSelect = require('react-select/async');
|
|
19
|
+
var reactTable = require('@tanstack/react-table');
|
|
20
|
+
var matchSorterUtils = require('@tanstack/match-sorter-utils');
|
|
21
|
+
|
|
22
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
|
|
24
|
+
function _interopNamespace(e) {
|
|
25
|
+
if (e && e.__esModule) return e;
|
|
26
|
+
var n = Object.create(null);
|
|
27
|
+
if (e) {
|
|
28
|
+
Object.keys(e).forEach(function (k) {
|
|
29
|
+
if (k !== 'default') {
|
|
30
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
31
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return e[k]; }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
n.default = e;
|
|
39
|
+
return Object.freeze(n);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var clsx7__default = /*#__PURE__*/_interopDefault(clsx7);
|
|
43
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
44
|
+
var IntlCurrencyInputModule__namespace = /*#__PURE__*/_interopNamespace(IntlCurrencyInputModule);
|
|
45
|
+
var _debounce__default = /*#__PURE__*/_interopDefault(_debounce);
|
|
46
|
+
var InputMask__default = /*#__PURE__*/_interopDefault(InputMask);
|
|
47
|
+
var ReactModalNamespace__namespace = /*#__PURE__*/_interopNamespace(ReactModalNamespace);
|
|
48
|
+
var AsyncSelect__default = /*#__PURE__*/_interopDefault(AsyncSelect);
|
|
49
|
+
|
|
50
|
+
// src/assets/spinner.tsx
|
|
51
|
+
var SpinnerIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52
|
+
"svg",
|
|
53
|
+
{
|
|
54
|
+
width: 16,
|
|
55
|
+
height: 16,
|
|
56
|
+
viewBox: "0 0 24 24",
|
|
57
|
+
fill: "none",
|
|
58
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
"circle",
|
|
63
|
+
{
|
|
64
|
+
className: "opacity-25",
|
|
65
|
+
cx: "12",
|
|
66
|
+
cy: "12",
|
|
67
|
+
r: "10",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
strokeWidth: "4"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
"path",
|
|
74
|
+
{
|
|
75
|
+
className: "opacity-75",
|
|
76
|
+
fill: "currentColor",
|
|
77
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
var sizes = {
|
|
84
|
+
xxs: {
|
|
85
|
+
text: "h-[18px]",
|
|
86
|
+
icon: "text-[16px]"
|
|
87
|
+
},
|
|
88
|
+
xs: {
|
|
89
|
+
text: "h-8 min-w-8 max-w-20",
|
|
90
|
+
icon: "text-[16px]"
|
|
91
|
+
},
|
|
92
|
+
sm: {
|
|
93
|
+
text: "h-[32px]",
|
|
94
|
+
icon: "text-[14px]"
|
|
95
|
+
},
|
|
96
|
+
md: {
|
|
97
|
+
text: "h-[38px]",
|
|
98
|
+
icon: "text-[20px]"
|
|
99
|
+
},
|
|
100
|
+
lg: {
|
|
101
|
+
text: "h-[46px]",
|
|
102
|
+
icon: "text-[20px]"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var variants = {
|
|
106
|
+
primary: {
|
|
107
|
+
text: "bg-gradient-to-b from-[#FF4D8B] to-[#DA3063] text-white shadow-[0_2px_6px_0_rgba(218,48,99,0.25)] hover:from-[#ff4d84] hover:to-[#df4573] active:from-[#ae264f] active:to-[#ae264f] disabled:opacity-50 disabled:shadow-none active:shadow-none disabled:hover:from-[#FF4D8B] disabled:hover:to-[#DA3063]"
|
|
108
|
+
},
|
|
109
|
+
secondary: {
|
|
110
|
+
text: "shadow-button bg-surface border-[0.5px] border-neutral-400 text-neutral-600 hover:bg-neutral-100 active:shadow-none disabled:text-neutral-400 disabled:opacity-50"
|
|
111
|
+
},
|
|
112
|
+
icon: {
|
|
113
|
+
text: "shadow-button bg-white border-[0.5px] border-neutral-300 hover:bg-[#f5f5f5] active:bg-neutral-100 disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
114
|
+
},
|
|
115
|
+
outline: {
|
|
116
|
+
text: "shadow-button bg-surface border-[0.5px] border-rose-500 text-rose-500 hover:bg-rose-50 active:bg-rose-100 disabled:bg-surface disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50 active:shadow-none"
|
|
117
|
+
},
|
|
118
|
+
dangerOutline: {
|
|
119
|
+
text: "shadow-button text-dangerous-500 bg-surface border-[0.5px] border-dangerous-500 hover:bg-dangerous-100 active:bg-dangerous-500 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-500 active:shadow-none"
|
|
120
|
+
},
|
|
121
|
+
danger: {
|
|
122
|
+
text: "shadow-button text-white bg-gradient-to-b from-danger-start to-danger-end hover:from-[#fe6464] hover:to-[#e24e4e] active:from-dangerous-600 active:to-dangerous-600 disabled:opacity-50 disabled:from-dangerous-500 disabled:to-dangerous-500 active:shadow-none"
|
|
123
|
+
},
|
|
124
|
+
success: {
|
|
125
|
+
text: "shadow-button text-white bg-gradient-to-b from-success-start to-success-end hover:from-[#40f09b] hover:to-[#28c67a] active:from-success-600 active:to-success-600 disabled:opacity-50 disabled:from-success-start disabled:to-success-end active:shadow-none"
|
|
126
|
+
},
|
|
127
|
+
warn: {
|
|
128
|
+
text: "shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#febd5b] hover:to-[#f4a52e] active:from-warning-600 active:to-warning-600 disabled:opacity-50 disabled:from-warning-start disabled:to-warning-end active:shadow-none"
|
|
129
|
+
},
|
|
130
|
+
blue: {
|
|
131
|
+
text: "shadow-button bg-blue-500 text-white text-bold"
|
|
132
|
+
},
|
|
133
|
+
link: {
|
|
134
|
+
text: "text-left text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 disabled:text-blue-500 disabled:no-underline shadow-none font-normal disabled:opacity-50"
|
|
135
|
+
},
|
|
136
|
+
iconSecondary: {
|
|
137
|
+
text: "border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
138
|
+
},
|
|
139
|
+
outlineIcon: {
|
|
140
|
+
text: "bg-white text-rose-500 hover:shadow-button active:bg-rose-500 active:text-white disabled:text-neutral-400 disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var paddingConfig = {
|
|
144
|
+
xxs: {
|
|
145
|
+
normal: "",
|
|
146
|
+
icon: ""
|
|
147
|
+
},
|
|
148
|
+
xs: {
|
|
149
|
+
normal: "p-2",
|
|
150
|
+
icon: "p-2"
|
|
151
|
+
},
|
|
152
|
+
sm: {
|
|
153
|
+
normal: "px-3 py-[6px]",
|
|
154
|
+
icon: "py-[6px] pl-2 pr-3"
|
|
155
|
+
},
|
|
156
|
+
md: {
|
|
157
|
+
normal: "py-2 px-4",
|
|
158
|
+
icon: "py-2 pl-3 pr-4"
|
|
159
|
+
},
|
|
160
|
+
lg: {
|
|
161
|
+
normal: "py-3 px-4",
|
|
162
|
+
icon: "p-3 pr-4"
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var Button = ({
|
|
166
|
+
variant = "primary",
|
|
167
|
+
size = "lg",
|
|
168
|
+
...props
|
|
169
|
+
}) => {
|
|
170
|
+
const applyGap = props.icon && props.children;
|
|
171
|
+
const appliedVariant = variants[variant].text;
|
|
172
|
+
const appliedSize = sizes[size];
|
|
173
|
+
const appliedPadding = props.icon ? paddingConfig[size].icon : paddingConfig[size].normal;
|
|
174
|
+
const gapText = applyGap ? "gap-[6px]" : "gap-0";
|
|
175
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
+
"button",
|
|
177
|
+
{
|
|
178
|
+
type: props.type,
|
|
179
|
+
id: "button-component",
|
|
180
|
+
...props,
|
|
181
|
+
disabled: props.disabled || props.loading,
|
|
182
|
+
className: `
|
|
183
|
+
${props.className}
|
|
184
|
+
${appliedVariant}
|
|
185
|
+
${appliedSize.text}
|
|
186
|
+
${appliedPadding}
|
|
187
|
+
${gapText}
|
|
7
188
|
whitespace-nowrap group rounded-lg font-bold disabled:shadow-none active:shadow-none flex items-center
|
|
8
|
-
`,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
${e?"left-[3rem]":"left-2.5"}`),style:{top:"13px"},children:[t,T&&t&&(0,ue.jsx)("strong",{className:"text-dangerous-700 ml-1",children:"*"})]}),s&&(l==null?void 0:l.value)&&(l==null?void 0:l.value)!==""&&!c&&(0,ue.jsx)("i",{className:(0,rt.default)({[A.clear]:!0},"uil uil-times clear-icon"),onClick:()=>{U&&(U==null||U.focus()),k&&k()}})]})}),V.map((l,X)=>(0,ue.jsx)("div",{className:"absolute text-dangerous-700 text-xs mt-[2px] ml-1",role:"alert","aria-label":l,children:l},X))]})});var Zt=K(require("clsx"),1),Qt=require("react/jsx-runtime"),_a={success:"bg-success-100 text-success-600",warning:"bg-warning-100 text-warning-600",blue:"bg-blue-100 text-blue-500",gray:"bg-neutral-100 text-neutral-400",dangerous:"bg-dangerous-100 text-dangerous-600",light:"bg-neutral-100 text-neutral-400",white:"bg-[#FFF] text-neutral-400 px-4 py-[6px] border border-light shadow-button text-paragraph",primary:"bg-rose-100 text-rose-800",dark:"bg-neutral-700 text-white",outline:"bg-white text-rose-700 border border-neutral-200","dark-gray":"bg-neutral-100 text-neutral-600"},Ya=({variant:e="blue",children:t,className:a,style:i})=>(0,Qt.jsx)("span",{className:(0,Zt.default)({[_a[e]]:(e==null?void 0:e.length)>0},"py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",a),style:i,children:t});var lt=require("@blueprintjs/datetime2"),ea=require("react-hook-form"),y=require("date-fns"),Le=require("react/jsx-runtime"),Za=({registration:e,error:t,control:a,name:i,rangeCalendar:m=!1,shortcutsChange:s,selectedShortcut:N,setSelectedShortcut:d,maxDate:T=new Date,singleMonth:D=!1})=>{let x=[t==null?void 0:t.message],E=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,y.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,y.set)((0,y.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,y.set)((0,y.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,y.startOfWeek)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,y.startOfWeek)((0,y.sub)(new Date,{days:7})),(0,y.endOfWeek)((0,y.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,y.startOfMonth)(new Date),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:1})),(0,y.endOfMonth)((0,y.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,y.startOfMonth)((0,y.sub)(new Date,{months:6})),(0,y.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}];return(0,Le.jsxs)("div",{children:[(0,Le.jsx)(ea.Controller,{control:a,name:i,render:({field:{onChange:h,value:c}})=>(0,Le.jsx)("div",{id:"group-input-calendar",className:"relative",children:m?(0,Le.jsx)(lt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:E,selectedShortcutIndex:N||E[0],onChange:f=>{let k=[];f[0]&&f[0]!==null&&k.push((0,y.set)(f[0],{hours:0,minutes:0,seconds:0})),f[1]&&f[1]!==null&&k.push((0,y.set)(f[1],{hours:23,minutes:59,seconds:59})),f[0]!==null&&f[1]==null&&(s&&s(null),d&&d(null)),s&&s(""),h(k)},singleMonthOnly:D,value:c,highlightCurrentDay:!0,minDate:(0,y.subYears)(new Date,50),maxDate:T,locale:"pt",onShortcutChange:f=>{let k=E.findIndex(u=>u.label===f.label);k!==-1&&d&&d(k),s&&s(f)}}):(0,Le.jsx)(lt.DatePicker3,{onChange:f=>{h(f)},value:c,highlightCurrentDay:!0,locale:"pt"})})}),x.map((h,c)=>(0,Le.jsx)("div",{className:"text-dangerous-500 text-xs mt-[2px]",role:"alert","aria-label":h,children:h},c))]})};var ta=K(require("clsx"),1),He=require("react/jsx-runtime"),Qa=({key:e="",label:t,registration:a,disabled:i})=>(0,He.jsx)("div",{children:(0,He.jsxs)("div",{className:"relative flex items-start",children:[(0,He.jsx)("div",{className:"flex h-5 items-center",children:(0,He.jsx)("input",{...a,id:a?a.name:e,disabled:i,type:"checkbox",className:(0,ta.default)("disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100")})}),(0,He.jsx)("div",{className:"ml-3 text-sm",children:(0,He.jsx)("label",{htmlFor:a==null?void 0:a.name,className:"cursor-pointer font-medium text-gray-700",children:t})})]})});var We=require("react"),aa=require("react-hook-form"),$e=require("@headlessui/react"),Xe=K(require("clsx"),1),it=require("@headlessui-float/react");var oa=require("date-fns"),w=require("date-fns"),dt=require("@blueprintjs/datetime2"),q=require("react/jsx-runtime"),eo=({icon:e,label:t,onApply:a,onClear:i,control:m,name:s,rangeCalendar:N=!0,defaultShortcut:d,shortcutsChange:T,singleMonth:D=!1,maxDate:x=void 0})=>{let E={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[h,c]=(0,We.useState)([]),[f,k]=(0,We.useState)(""),u=(window==null?void 0:window.innerWidth)<768,v=[{label:"Todo o per\xEDodo",dateRange:[]},{label:"Hoje",dateRange:[(0,w.set)(new Date,{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Ontem",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:0,minutes:0,seconds:0}),(0,w.set)((0,w.sub)(new Date,{days:1}),{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 7 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:7}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 14 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:14}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 30 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:30}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 60 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:60}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"\xDAltimos 90 dias",dateRange:[(0,w.set)((0,w.sub)(new Date,{days:90}),{hours:0,minutes:0,seconds:0}),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Esta semana",dateRange:[(0,w.startOfWeek)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"Semana passada",dateRange:[(0,w.startOfWeek)((0,w.sub)(new Date,{days:7})),(0,w.endOfWeek)((0,w.sub)(new Date,{days:7}))]},{label:"Este M\xEAs",dateRange:[(0,w.startOfMonth)(new Date),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59})]},{label:"M\xEAs passado",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:1})),(0,w.endOfMonth)((0,w.sub)(new Date,{months:1}))]},{label:"\xDAltimos 6 meses",dateRange:[(0,w.startOfMonth)((0,w.sub)(new Date,{months:6})),(0,w.set)(new Date,{hours:23,minutes:59,seconds:59}),,]}],[P,F]=(0,We.useState)(d||v[0]),b=(0,q.jsx)("div",{id:"group-input-calendar",className:"relative",children:N?(0,q.jsx)(dt.DateRangePicker3,{allowSingleDayRange:!0,shortcuts:v,selectedShortcutIndex:P,onChange:n=>{let R=[];n[0]&&n[0]!==null&&R.push((0,w.set)(n[0],{hours:0,minutes:0,seconds:0})),n[1]&&n[1]!==null&&R.push((0,w.set)(n[1],{hours:23,minutes:59,seconds:59})),n[0]!==null&&n[1]==null&&(k(""),F&&F(null)),k(""),c(R)},singleMonthOnly:D,value:h,highlightCurrentDay:!0,minDate:(0,w.subYears)(new Date,50),maxDate:x,locale:"pt",onShortcutChange:n=>{let R=v.findIndex(r=>r.label===n.label);R!==-1&&F&&F(R),k(n==null?void 0:n.label)}}):(0,q.jsx)(dt.DatePicker3,{onChange:n=>{c(n)},value:h,highlightCurrentDay:!0,locale:"pt"})});return(0,q.jsx)(aa.Controller,{name:s,control:m,render:({field:n})=>{var r;let R=((r=n==null?void 0:n.value)==null?void 0:r.length)>0;return(0,q.jsx)($e.Popover,{className:(0,Xe.default)({"w-full":u},"relative text-paragraph"),children:({open:o})=>{var g,L;return(0,q.jsxs)(it.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,q.jsx)(it.Float.Reference,{children:(0,q.jsx)($e.PopoverButton,{as:"button",children:(0,q.jsxs)("div",{className:(0,Xe.default)({[E.filter]:!R&&!o,[E.filterOpen]:o&&!R,[E.filterActive]:o&&R||!o&&R},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,q.jsx)("div",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value}),children:e}),(0,q.jsx)("label",{className:(0,Xe.default)({"text-paragraph group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"truncate cursor-pointer"),children:f||(((g=n==null?void 0:n.value)==null?void 0:g.length)>0?(L=n==null?void 0:n.value)==null?void 0:L.map(O=>O!==null?(0,oa.format)(O,"dd/MM/yyyy"):"").join(" - "):t)}),(0,q.jsx)("i",{className:(0,Xe.default)({"text-label group-active:text-blue-500":!n.value&&!o,"text-blue-500":o&&!n.value,"text-blue-500 group-hover:text-white group-active:text-white":o&&n.value},"uil uil-angle-down text-[18px]")})]})})}),o&&(0,q.jsx)(it.Float.Content,{children:(0,q.jsx)($e.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:O})=>{let V=()=>{c(n.value),O()};return(0,We.useEffect)(()=>{c(n.value)},[o]),(0,q.jsxs)("div",{className:"flex flex-col gap-2",children:[b,(0,q.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[i&&(0,q.jsx)("div",{className:"mr-1",children:(0,q.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{i&&(i(),c([]),n.onChange([])),O()},children:"Limpar"})}),(0,q.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{V()},children:"Cancelar"}),(0,q.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(h)===JSON.stringify(n==null?void 0:n.value),onClick:()=>{n.onChange(h),a&&a(),O()},children:"Aplicar"})]})]})}})})]})}})}})};var pe=require("react"),ra=require("react-hook-form"),le=require("@headlessui/react"),ce=K(require("clsx"),1),ut=require("@headlessui-float/react");var na=require("react"),Ue=K(require("clsx"),1),Se=require("react/jsx-runtime");function Et({type:e,registration:t,onClick:a,onBlur:i,onChange:m,inputProps:s,icon:N,clearField:d,disabled:T,placeholder:D,className:x,onKeyDown:E,value:h,searchOnClick:c,onClear:f,collapsed:k}){let u=(0,na.useRef)(null),v={input:"text-p-md text-paragraph w-full outline-none placeholder:text-label",icon:"text-label group-focus-within:text-neutral-600 m-[10px]",wrapper:`shadow-input border border-neutral-300 focus-within:border-blue-500 group rounded-lg h-9 w-full text-paragraph flex items-center justify-between disabled:bg-neutral-100 ${T?"bg-neutral-100":"bg-white"} ${x}`,clear:"pr-[5px] cursor-pointer text-label text-[16px]"},P=u==null?void 0:u.current;return(0,Se.jsxs)("div",{className:(0,Ue.default)(v.wrapper),children:[N&&!c&&(0,Se.jsx)("div",{className:(0,Ue.default)(v.icon),children:N}),(0,Se.jsx)("input",{...t,...s,type:"search-text",ref:u,className:(0,Ue.default)({"pl-1":k},v.input),placeholder:D,onBlur:i,onChange:F=>m(F.target.value),onClick:a,disabled:T,onKeyDown:E}),d&&h&&!T&&(0,Se.jsx)("i",{className:(0,Ue.default)(v.clear,"uil uil-times"),onClick:()=>{P.value="",P==null||P.focus(),m(""),f&&f()}}),c&&(0,Se.jsx)("div",{className:"py-1",children:(0,Se.jsx)("button",{type:"button",className:(0,Ue.default)({"border-l border-input pl-1":d&&h&&!T,"text-blue-500":!T,"text-neutral-300":T,"pl-[2px]":k}),onClick:c,children:(0,Se.jsx)("i",{className:"uil uil-search text-[16px] mr-2 pl-1"})})})]})}var C=require("react/jsx-runtime"),to=({icon:e,label:t,isMulti:a,options:i=[],onApply:m,onClear:s,onSelectAll:N,control:d,name:T,fetch:D,subFilters:x=[],emptyMessage:E,initialMessage:h,applyOnClick:c=!1,showFilter:f=!1})=>{let k={filter:"rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",filterOpen:"rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",filterActive:"rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"},[u,v]=(0,pe.useState)(a?[]:{}),[P,F]=(0,pe.useState)(()=>i),[b,n]=(0,pe.useState)(""),[R,r]=(0,pe.useState)((x==null?void 0:x.length)>0?x[0].id:null),[o,g]=(0,pe.useState)(!1),L=async()=>{if((b==null?void 0:b.length)>0||(i==null?void 0:i.length)>0)if(D)F(await D(b,R));else{let A=i.filter(U=>{var Z;return(Z=U==null?void 0:U.label)==null?void 0:Z.toLowerCase().includes(b.toLowerCase())}).sort((U,Z)=>{var l;return(l=U==null?void 0:U.label)==null?void 0:l.toLowerCase()});F(A)}else F([]);g(!1)};(0,pe.useEffect)(()=>{g(!0);let p=setTimeout(()=>{L()},400);return()=>clearTimeout(p)},[b]);let O=(p,A)=>(0,C.jsx)(le.ListboxOption,{disabled:p.disabled,value:p,as:pe.Fragment,children:(0,C.jsxs)("div",{className:(0,ce.default)("relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",{"hover:bg-neutral-200":!p.disabled&&!A,"text-gray-200":p.disabled,"bg-blue-500 hover:bg-blue-500":A}),children:[(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"text-wrap break-words font-normal block"),children:p==null?void 0:p.label}),(0,C.jsx)("span",{className:(0,ce.default)({"font-semibold text-white":A},"w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-label text-p-sm block"),children:p==null?void 0:p.description}),A?(0,C.jsx)("span",{className:(0,ce.default)("absolute inset-y-0 text-white right-0 flex items-center pr-4"),children:(0,C.jsx)("i",{className:"uil uil-check text-lg"})}):null]})},p.id),V=(window==null?void 0:window.innerWidth)<768;return(0,C.jsx)(ra.Controller,{name:T,control:d,render:({field:p})=>{var U,Z;let A=a?((U=p==null?void 0:p.value)==null?void 0:U.length)>0:!!((Z=p==null?void 0:p.value)!=null&&Z.id);return(0,C.jsx)(le.Popover,{className:(0,ce.default)({"w-full":V},"relative text-paragraph"),children:({open:l})=>{var X,ye;return(0,C.jsxs)(ut.Float,{composable:!0,shift:8,zIndex:99,offset:2,children:[(0,C.jsx)(ut.Float.Reference,{children:(0,C.jsx)(le.PopoverButton,{as:"button",children:(0,C.jsxs)("div",{className:(0,ce.default)({[k.filter]:!A&&!l,[k.filterOpen]:l&&!A,[k.filterActive]:l&&A||!l&&A},"group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2"),children:[e&&(0,C.jsx)("div",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value}),children:e}),(0,C.jsx)("label",{className:(0,ce.default)({"text-paragraph group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"truncate cursor-pointer"),children:a?t:(X=p==null?void 0:p.value)!=null&&X.id?(ye=p==null?void 0:p.value)==null?void 0:ye.label:t}),a&&p.value&&p.value.length>0&&(0,C.jsx)("div",{className:"bg-blue-500 text-white text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500",children:p.value.length}),(0,C.jsx)("i",{className:(0,ce.default)({"text-label group-active:text-blue-500":!p.value&&!l,"text-blue-500":l&&!p.value,"text-blue-500 group-hover:text-white group-active:text-white":l&&p.value},"uil uil-angle-down text-[18px]")})]})})}),l&&(0,C.jsx)(ut.Float.Content,{children:(0,C.jsx)(le.PopoverPanel,{className:"p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300",children:({close:we})=>{let xe=()=>{v(p.value),we()};return(0,pe.useEffect)(()=>{v(p.value)},[l]),(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(le.Listbox,{value:u||[],onChange:v,multiple:a,children:(0,C.jsxs)(le.ListboxOptions,{static:!0,className:"max-h-60 w-full overflow-x-hidden overflow-y-auto bg-white text-p-md focus:outline-none sm:text-sm relative",children:[(0,C.jsxs)("div",{className:"mr-1 sticky top-0 z-30",children:[f&&(0,C.jsx)(Et,{icon:(0,C.jsx)("i",{className:"uil uil-search"}),onChange:W=>n(W),value:b,placeholder:"Pesquisar",clearField:!0,onKeyDown:W=>{(W.key===" "||W.code==="Space")&&W.stopPropagation()}}),x&&D&&(0,C.jsx)("div",{className:"flex items-center gap-2 pt-2 bg-white",children:x.map((W,ne)=>{let fe=(W==null?void 0:W.id)===R;return(0,C.jsx)("button",{className:(0,ce.default)({"bg-blue-500 text-white":fe,"text-paragraph":!fe},"rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]"),onClick:()=>{R==W.id?r(null):r(W.id)},children:W.name},ne)})})]}),o&&(0,C.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full my-4",children:[(0,C.jsx)("img",{className:"animate-spin",src:"/spinner-gray.svg",alt:"circle",width:13,height:13}),"Carregando"]}),(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)>0&&!o&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:E})}),h&&(P==null?void 0:P.length)===0&&(b==null?void 0:b.length)===0&&!o&&(i==null?void 0:i.length)===0&&!(u!=null&&u.id)&&(0,C.jsx)("div",{className:"py-4",children:(0,C.jsx)("span",{className:"text-label text-p-md",children:h})}),h&&u&&(u==null?void 0:u.id)&&(b==null?void 0:b.length)===0&&(0,C.jsx)("div",{className:"py-2",children:a?(0,C.jsx)(C.Fragment,{children:u==null?void 0:u.map(W=>{let ne=a?u&&(u==null?void 0:u.length)>0&&(u==null?void 0:u.some(fe=>fe.id===W.id)):u&&(u==null?void 0:u.id)===W.id;return O(i,ne)})}):O(p.value,!0)}),!o&&(P==null?void 0:P.map(W=>{let ne=a?u&&u.length>0&&u.some(fe=>fe.id===W.id):u&&u.id===W.id;return O(W,ne)}))]})}),!c&&(0,C.jsxs)("div",{className:"flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3",children:[a&&N&&(0,C.jsx)("div",{className:"border-r pr-2 border-neutral-300",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{N(),p.onChange(i),v(i),we()},children:"Marcar todos"})}),s&&(0,C.jsx)("div",{className:"mr-1",children:(0,C.jsx)(G,{variant:"link",size:"xxs",onClick:()=>{s&&(s(),v([]),p.onChange([])),we()},children:"Limpar"})}),(0,C.jsx)(G,{size:"xs",variant:"secondary",onClick:()=>{xe()},children:"Cancelar"}),(0,C.jsx)(G,{size:"xs",variant:"primary",disabled:JSON.stringify(u)===JSON.stringify(p==null?void 0:p.value),onClick:()=>{p.onChange(u),m&&m(),we()},children:"Aplicar"})]})]})}})})]})}})}})};var sa=require("react"),la=require("react-hook-form"),pt=K(require("clsx"),1),ct=K(require("react-intl-currency-input"),1),me=require("react/jsx-runtime"),ao=(ct==null?void 0:ct.default)||ct,ia=(0,sa.forwardRef)(({label:e,type:t,onClick:a,error:i,onBlur:m,onChangeValue:s,inputProps:N,icon:d,clearField:T,name:D,required:x,disabled:E,value:h,placeholder:c,control:f,defaultValue:k,isWeightField:u,minFractionDigits:v=2},P)=>{let b={locale:"pt-BR",formats:{number:{BRL:u?{currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v,useGrouping:!1}:{style:"currency",currency:"BRL",minimumFractionDigits:v,maximumFractionDigits:v}}}},n=[i==null?void 0:i.message],R=n.some(o=>o!==void 0),r={input:`text-p-md pl-2 peer text-paragraph shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border ${e?"pt-[22px]":"pt-[10px]"} ${R?"border-dangerous-500 text-dangerous-500":"border-neutral-300 focus-visible:border-blue-500"}`,icon:`absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] w-[38px] rounded-l-lg ${R?"text-dangerous-500":"text-label"}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`,label:"absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",buttonsWrapper:"absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",button:"border-[0.5px] border-neutral-300 rounded shadow-input"},R=d?document==null?void 0:document.getElementById(d):null;return(0,ge.jsx)(ma.Controller,{control:E,name:d,defaultValue:h,render:({field:r})=>{let o=(g,L,O)=>{g.preventDefault(),r.onChange(L.toString()),f&&f(L.toString())};return typeof r.value=="string"&&(r.value=Number(r.value)),(0,ge.jsxs)("div",{children:[(0,ge.jsxs)("div",{className:"relative outline-none",children:[s&&(0,ge.jsx)("div",{className:(0,bt.default)(n.icon,"flex justify-center items-center"),children:s}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)(oo,{...m,...r,type:"text",ref:P,className:(0,bt.default)({[n.input]:!0,"pr-10":N,"pr-2":!N,"pl-[3rem]":s}),placeholder:!e&&x?x:" ",onClick:t,disabled:D,currency:"BRL",config:v,onChange:o,max:k}),(0,ge.jsxs)("label",{className:(0,bt.default)({[n.label]:!0,"left-[3rem]":s,"left-2.5":!s},"cursor-text"),onClick:()=>R==null?void 0:R.focus(),children:[e,T&&e&&(0,ge.jsx)("strong",{className:"text-dangerous-500",children:"\xA0*"})]})]})]}),F.map((g,L)=>(0,ge.jsx)("div",{className:"text-dangerous-500 text-xs mt-1 ml-[2px]",role:"alert","aria-label":g,children:g},L))]})}})}ga.displayName="InputPercentage";var ba=require("react"),xa=require("react-hook-form"),fa=K(require("react-input-mask"),1);var xt=require("react/jsx-runtime"),no=({type:e="text",name:t,label:a,placeholder:i,error:m,mask:s,control:N,required:d,onKeyUp:T,maskChar:D="",alwaysShowMask:x,defaultValue:E,disabled:h})=>{let c=(0,ba.useRef)(null);return(0,xt.jsx)(xa.Controller,{name:t,control:N,defaultValue:E,render:({field:f})=>{let k=u=>{let{nextState:v,previousState:P}=u;var{value:F}=v,b=v.selection,n=b?b.start:null,R=[".","-","/","(",")"," "],r=[...F];return R.includes(r[r.length-1])&&(n===F.length&&(n--,b={start:n,end:n}),F=F.slice(0,-1)),{value:F,selection:b}};return(0,xt.jsx)(fa.default,{...f,onKeyUp:T,disabled:h,mask:s,value:f.value||"",onChange:f.onChange,maskChar:D,alwaysShowMask:x,beforeMaskedStateChange:k,children:u=>(0,xt.jsx)(Ze,{onKeyUp:T,type:e,label:a,placeholder:i,required:d,inputProps:u,error:m,name:t,disabled:h,ref:c})})}})};var ft=K(require("clsx"),1),ha=require("react"),kt=K(require("react-modal"),1);var te=require("react/jsx-runtime"),ro=kt.default||kt,so={success:"text-success-500",error:"text-dangerous-500",warning:"text-warning-500",info:"text-blue-500",primary:"text-rose-700"},lo={xs:"w-[350px]",sm:"w-[662px]",md:"w-[960px]",lg:"w-[80%] min-w-[800px]",null:""},io=({open:e,onOpen:t=()=>{},onClose:a,onCancel:i,triggerButton:m,confirmButton:s,title:N,cancelButton:d,icon:T,alertType:D,size:x="sm",info:E,description:h,children:c})=>{let f={content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",border:"1px solid #E8E8E9",padding:"24px",borderRadius:"8px",overflow:"initial"},overlay:{backgroundColor:"rgb(107,114,128,0.50)",zIndex:9999}},k=m?(0,ha.cloneElement)(m,{onClick:()=>{t()}}):null;return(0,te.jsxs)("div",{children:[k,(0,te.jsx)(ro,{ariaHideApp:!1,isOpen:e,onRequestClose:a,style:f,contentLabel:"Example Modal",children:(0,te.jsxs)("div",{className:(0,ft.default)(lo[x]),children:[(0,te.jsxs)("div",{className:"pb-2 border-b border-b-neutral-200 flex items-center justify-between",children:[(0,te.jsxs)("h3",{className:"text-[24px] font-bold flex items-center gap-2",children:[D&&(0,te.jsx)("div",{className:(0,ft.default)([so[D]],"text-[30px]"),children:T}),N]}),(0,te.jsx)("button",{onClick:i,className:"text-neutral-500 text-[24px]",children:(0,te.jsx)("i",{className:"uil uil-times"})})]}),(0,te.jsx)("div",{children:c}),(0,te.jsxs)("div",{className:"pt-6 border-t border-t-neutral-200 flex w-full items-center justify-between",children:[(0,te.jsx)("div",{className:(0,ft.default)({"flex-1":E}),children:E}),(0,te.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-3 items-center md:justify-end w-full md:w-auto",children:[d||(0,te.jsx)(G,{onClick:()=>{i&&i()},variant:"secondary",size:"sm",children:"Cancelar"}),s]})]})]})})]})};var va=require("react-tooltip"),Qe=require("react/jsx-runtime"),uo=({id:e,displayArrow:t=!0,openOnClick:a=!1})=>(0,Qe.jsx)(Qe.Fragment,{children:(0,Qe.jsx)(va.Tooltip,{id:e,className:"absolute bg-neutral-700 text-sm text-neutral-100 py-2 px-4 max-w-[430px] break-words whitespace-normal",classNameArrow:t?"":{noArrow:"hidden"}.noArrow,openOnClick:a,delayHide:0,delayShow:0})});var wa=require("react"),Na=require("react-hook-form"),Pt=require("react-select"),Ca=K(require("react-select/async"),1);var ya={indicatorSeparator:(e,t)=>{var a;return{...e,backgroundColor:t.hasValue&&((a=e==null?void 0:e.selectProps)!=null&&a.isSearchable)?"var(--input)":"transparent"}},clearIndicator:e=>({...e,color:"var(--label)",":hover":{color:"var(--label)"}}),dropdownIndicator:(e,t)=>{var a;return{...e,color:"var(--paragraph)",transform:(a=t==null?void 0:t.selectProps)!=null&&a.menuIsOpen?"rotate(180deg)":"rotate(0)",":hover":{color:"var(--paragraph)"}}},input:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0px"}),menu:e=>({...e,marginTop:"4px",border:"1px solid var(--neutral-300)",boxShadow:"none",borderRadius:"8px",background:"white",zIndex:20}),menuList:e=>({...e,padding:"8px"}),singleValue:(e,t)=>({...e,paddingLeft:t.selectProps.hasIcon?"34px":"0px",paddingTop:t.selectProps.hasLabel?"10px":"0",color:t.data.value==="active"?"#0EAF86":t.selectProps.hasError?"var(--dangerous-500)":"black",display:"flex"}),control:(e,t)=>({...e,cursor:"pointer",border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--dark-blue-300)",boxShadow:"none",outline:"none",borderRadius:"0.5rem",placeholder:" ",height:t.selectProps.smallField?"30px":"46px",backgroundColor:t.isDisabled?"var(--light-100)":"white",":hover":{border:t.selectProps.hasError?"1px solid var(--dangerous-700)":t.menuIsOpen?"1px solid var(--blue-700)":"1px solid var(--neutral-300)"}}),multiValue:e=>({...e,borderRadius:"20px",backgroundColor:"var(--neutral-100)",padding:"0px 8px"}),multiValueLabel:e=>({...e,color:"var(--paragraph)"}),multiValueRemove:e=>({...e,color:"var(--neutral-400)",":hover":{color:"var(--dangerous-500)"}}),option:(e,t)=>{let a=t.isSelected?"white":t!=null&&t.isDisabled?"var(--label)":"var(--paragraph)";return{...e,cursor:t.isDisabled?"auto":"pointer",pointerEvents:t.isDisabled?"none":"",borderRadius:"8px",margin:"4px 0px",padding:"12px",backgroundColor:t.isSelected?"var(--blue-500)":"white",color:a,fontWeight:t.isSelected?700:400,"&:hover":{backgroundColor:t.isSelected?"var(--blue-500)":"var(--neutral-200)"},"&:active":{backgroundColor:"var(--blue-500)",color:"white",fontWeight:700},"&:active i":{color:"white",fontWeight:700}," i":{color:"white"}}},container:e=>({...e,border:"none",outline:"none",boxShadow:"none",padding:"none",margin:"none"})};var De=require("react");var ht=K(require("clsx"),1),z=require("react/jsx-runtime"),co=({name:e,error:t,label:a,defaultValue:i,control:m,placeholder:s,isSearchable:N=!1,isClearable:d=!1,onChange:T,required:D,debounce:x=0,filterOptions:E,optionsList:h,disabled:c,onChangeValue:f,resize:k=!0,optionStyle:u,valueStyle:v,icon:P,emptyMessage:F,small:b=!1})=>{var Oe;let{Option:n,DropdownIndicator:R,ClearIndicator:r,SingleValue:o}=Pt.components,g=(0,wa.useRef)(null),[L,O]=(0,De.useState)(""),[V,p]=(0,De.useState)(!1),[A,U]=(0,De.useState)(()=>h||[]),[Z,l]=(0,De.useState)(300),[X,ye]=(0,De.useState)(!1);(0,De.useEffect)(()=>{let _=()=>{var Ie,ze;if((Ie=g==null?void 0:g.current)!=null&&Ie.getBoundingClientRect){let qe=(ze=g==null?void 0:g.current)==null?void 0:ze.getBoundingClientRect(),Ve=window.innerHeight-qe.bottom-24;l(Ve<250?276:Ve)}};return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[g]);let we=_=>{if(p(!0),N&&E){if(x&&_.length>=x||!x){let Ie=E(_);return p(!1),Ie}}else U(h)},W=[(Oe=nt(_=>_.field)[e])==null?void 0:Oe.message,t==null?void 0:t.message],ne={hasError:W.some(_=>_!==void 0)},fe={smallField:b},tt={hasLabel:(a==null?void 0:a.length)>0},Ge=k?{menuHeight:Z}:null,Y={hasIcon:P};return(0,De.useEffect)(()=>{U(()=>h)},[h]),(0,z.jsx)(Na.Controller,{name:e,control:m,defaultValue:i,render:({field:_})=>{let Ie=M=>(0,z.jsx)(o,{...M,children:v?v(M==null?void 0:M.data):(0,z.jsxs)(z.Fragment,{children:[M.data.label," "]})}),ze=M=>(0,z.jsx)(n,{...M,children:u?u(M==null?void 0:M.data):(0,z.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:(0,z.jsx)("span",{className:(0,ht.default)("text-p-md focus:text-white"),children:M.data.label})})}),qe=M=>{if(!x||x&&L.length>=x)return(0,z.jsxs)("div",{...M.innerProps,className:"flex items-center gap-[6px] p-2",children:[(0,z.jsx)("img",{className:"animate-spin ",src:"/spinner.svg",alt:"circle",width:16,height:16}),"Buscando..."]});if(x&&L.length<x)return(0,z.jsxs)("div",{className:"p-2 text-neutral-300",children:["Digite ",x," ou mais caracteres para pesquisar"]})},at=M=>{var Ce;if(M.selectProps.inputValue.length==0&&x>0||x>0&&M.selectProps.inputValue.length<x)return(0,z.jsxs)("div",{className:"text-dangerous-500 text-sm",children:["Digite ",x," ou mais caracteres para pesquisar"]});if(M.selectProps.inputValue.length>0&&((Ce=M==null?void 0:M.options)==null?void 0:Ce.length)==0)return(0,z.jsx)("div",{className:"text-dangerous-500 text-sm",children:"Nenhum dado encontrado"})},Ve=M=>(0,z.jsx)(R,{...M,children:(0,z.jsx)("i",{className:`uil uil-angle-down text-[20px] ${b?"h-[20px] -mt-[7px]":"h-full"}`})}),Ne=M=>(0,z.jsx)(r,{...M,children:(0,z.jsx)("i",{className:"uil uil-times text-[16px]"})}),de=M=>{_.onChange(M),f&&f(M)},Je=async M=>{var Ce;if(M.key==="Enter"){M.preventDefault();let Te=await we((Ce=M==null?void 0:M.target)==null?void 0:Ce.value);(Te==null?void 0:Te.length)>0&&de(Te[0])}};return(0,z.jsxs)("div",{className:"relative w-full",id:"select",ref:g,children:[P&&(0,z.jsx)("div",{className:(0,ht.default)("z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",{"text-blue-500":X&&Y.hasIcon,"text-red-500":ne.hasError&&Y.hasIcon}),children:P}),(0,z.jsx)(Ca.default,{onKeyDown:Je,..._,...ne,...tt,...Ge,...Y,...fe,isDisabled:c,onFocus:()=>ye(!0),onBlur:()=>ye(!1),loadingMessage:()=>(0,z.jsx)("div",{children:"Carregando"}),isLoading:V,defaultOptions:x>0?!1:h?A:!0,loadOptions:we,name:_.name,isClearable:d,styles:ya,placeholder:s||" ",isSearchable:N,options:A,tabSelectsValue:!0,components:{SingleValue:Ie,ValueContainer:Ta,Option:ze,LoadingIndicator:()=>(0,z.jsx)(z.Fragment,{}),LoadingMessage:qe,NoOptionsMessage:at,DropdownIndicator:Ve,ClearIndicator:Ne},closeMenuOnSelect:!0,hideSelectedOptions:!1,onChange:de}),(0,z.jsxs)("span",{className:(0,ht.default)("text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",{"scale-75 -translate-y-3":_.value||L,"ml-[35px]":Y.hasIcon,"ml-[2px]":!Y.hasIcon,"top-2.5":!(_.value||L),"top-0":_.value||L}),children:[a,D&&a&&(0,z.jsx)("strong",{className:"text-dangerous-700",children:"\xA0*"})]}),W.map((M,Ce)=>(0,z.jsx)("div",{style:{color:"var(--dangerous-700)"},className:"text-xs ml-[2px]",role:"alert","aria-label":M,children:M},Ce))]})}})},Ta=({children:e,...t})=>(0,z.jsx)(Pt.components.ValueContainer,{...t,children:e});var Ra=require("react-hook-form"),Be=require("react/jsx-runtime"),po=({disabled:e,control:t,name:a,label:i,defaultChecked:m})=>(0,Be.jsx)(Ra.Controller,{name:a,control:t,render:({field:s})=>(0,Be.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,Be.jsxs)("label",{className:"custom-radio flex items-center",children:[(0,Be.jsx)("input",{name:a,id:a,type:"radio",className:"",onClick:N=>{s.onChange(N.target.value)},defaultChecked:m,disabled:e}),(0,Be.jsx)("span",{})]}),i&&(0,Be.jsx)("label",{htmlFor:a,className:"text-p-md cursor-pointer -pt-1",children:i})]})});var It=require("@headlessui/react"),Sa=require("react-hook-form"),ie=require("react/jsx-runtime"),{Group:mo,Label:go}=It.Switch;function vt(...e){return e.filter(Boolean).join(" ")}var bo=({name:e,label:t,subLabel:a,control:i,disabled:m})=>(0,ie.jsxs)(mo,{as:"div",className:"flex items-center",children:[(0,ie.jsx)(Sa.Controller,{control:i,name:e,render:({field:s})=>(0,ie.jsx)(It.Switch,{disabled:m,...s,className:"h-[18px] w-[33px] focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-full",checked:!!s.value,onChange:N=>{s.onChange(N)},children:({checked:N})=>(0,ie.jsx)("div",{className:vt(N?"bg-blue-500":"bg-neutral-200","relative inline-flex h-[18px] p-[2px] w-[33px] flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out "),children:(0,ie.jsxs)("span",{className:vt("pointer-events-none relative inline-block -top-[2px] right-[2px] h-[14px] w-[14px] transform rounded-full shadow ring-0 transition duration-200 ease-in-out",N?"translate-x-[15px]":"translate-x-0",m?"bg-neutral-300":"bg-white"),children:[(0,ie.jsx)("span",{className:vt(N?"opacity-0 ease-out duration-100":"opacity-100 ease-in duration-200","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"}),(0,ie.jsx)("span",{className:vt(N?"opacity-100 ease-in duration-200":"opacity-0 ease-out duration-100","absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"),"aria-hidden":"true"})]})})})}),t&&(0,ie.jsxs)(go,{as:"span",className:"flex flex-col gap-1 ml-2 cursor-pointer",children:[(0,ie.jsx)("span",{className:"text-sm text-paragraph",children:t}),a&&(0,ie.jsx)("span",{className:"text-sm",children:a})]})]});var ve=require("@headlessui/react"),be=require("react"),Ft=K(require("clsx"),1),$=require("react/jsx-runtime");function Mt({pageSizeOptions:e,table:t}){var v,P,F,b,n,R;let a=t==null?void 0:t.getPageCount(),i=a?[...Array(a)]:[],m=i==null?void 0:i.map((r,o)=>({id:o,name:o})),[s,N]=(0,be.useState)({id:((v=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:v.id)||20,name:((P=JSON.parse(sessionStorage.getItem("pageSize")))==null?void 0:P.name)||20}),[d,T]=(0,be.useState)({id:((b=(F=t==null?void 0:t.getState())==null?void 0:F.pagination)==null?void 0:b.pageIndex)||0,name:((R=(n=t==null?void 0:t.getState())==null?void 0:n.pagination)==null?void 0:R.pageIndex)||0}),[D,x]=(0,be.useState)(()=>m),[E,h]=(0,be.useState)(e==null?void 0:e.map(r=>({id:r,name:r}))),[c,f]=(0,be.useState)(""),k=()=>{let r=[...m];x(r.filter(o=>(o.name+1).toString().startsWith(c)))},u=(r,o)=>{sessionStorage.setItem(r,JSON.stringify(o))};return(0,be.useEffect)(()=>{k()},[c]),(0,be.useEffect)(()=>{u("pageSize",s),t.setPageSize(s==null?void 0:s.id),t.setPageIndex(0),T({id:0,name:0})},[s]),(0,be.useEffect)(()=>{x(a?[...Array(a)].map((r,o)=>({id:o,name:o})):[])},[t==null?void 0:t.getPageCount()]),(0,be.useEffect)(()=>{var r,o,g,L,O,V;((o=(r=t==null?void 0:t.getState())==null?void 0:r.pagination)==null?void 0:o.pageIndex)>=0&&T({id:(L=(g=t==null?void 0:t.getState())==null?void 0:g.pagination)==null?void 0:L.pageIndex,name:(V=(O=t==null?void 0:t.getState())==null?void 0:O.pagination)==null?void 0:V.pageIndex})},[t==null?void 0:t.getState().pagination]),(0,$.jsxs)("div",{className:"hidden md:flex items-center gap-2",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Exibir "}),(0,$.jsx)(ve.Combobox,{value:s,onChange:r=>{N(r)},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"flex items-center justify-between w-[70px] h-[42px] text-paragraph outline-none text-p-sm cursor-pointer peer relative shadow-input rounded-lg border p-2 disabled:bg-neutral-100 border-neutral-300",children:[s==null?void 0:s.name,r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base top-[13px] pl-3 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base top-[13px] pl-3 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:E==null?void 0:E.map(o=>{let g=(o==null?void 0:o.id)===(s==null?void 0:s.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Ft.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:o.name},(s==null?void 0:s.id)+"size")})})]})}),(0,$.jsx)("span",{children:" resultados"})]}),(0,$.jsx)("div",{className:"bg-neutral-300 h-[20px] w-[1px]"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 text-paragraph",children:[(0,$.jsx)("span",{children:"Ir para a p\xE1gina "}),(0,$.jsx)(ve.Combobox,{value:d,onChange:r=>{r&&(r!=null&&r.id)&&(T({id:r==null?void 0:r.id,name:r==null?void 0:r.id}),u("pageIndex",r==null?void 0:r.id),t.setPageIndex(r==null?void 0:r.id),f(""))},children:({open:r})=>(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsxs)(ve.Combobox.Button,{className:"relative",children:[(0,$.jsx)(ve.Combobox.Input,{as:"input",onKeyDown:o=>{var L;let g=Number((L=o.target)==null?void 0:L.value);o.key=="Enter"&&g&&g<=a&&(T({id:g-1,name:g-1}),u("pageIndex",g),t.setPageIndex(g-1),f(""))},displayValue:o=>d?(d==null?void 0:d.id)+1:(o==null?void 0:o.id)+1,onChange:o=>{o.target.value&&f(o.target.value)},className:"h-[42px] w-[70px] outline-none text-p-md text-paragraph cursor-pointer border-neutral-300 peer shadow-input rounded-lg border block disabled:bg-neutral-100 p-2"}),r?(0,$.jsx)("i",{className:"uil uil-angle-up text-base absolute top-[10px] right-2 cursor-pointer text-label"}):(0,$.jsx)("i",{className:"uil uil-angle-down text-base absolute top-[10px] right-2 cursor-pointer text-label"})]}),(0,$.jsx)(ve.Combobox.Options,{className:"w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white",children:D.map(o=>{let g=(o==null?void 0:o.id)===(d==null?void 0:d.id);return(0,$.jsx)(ve.Combobox.Option,{value:o,className:(0,Ft.default)("p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",{"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]":g},{"hover:bg-neutral-100 text-paragraph":!g}),children:(o==null?void 0:o.name)+1},(d==null?void 0:d.id)+"page")})})]})})]})]})}var ae=require("@tanstack/react-table"),j=K(require("react"),1);var Ee=require("clsx"),ke=K(require("react"),1),Pe=require("react/jsx-runtime"),yt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("table",{ref:a,className:(0,Ee.clsx)("table-scroll block text-left border-separate border-spacing-0 w-full",e),onScroll:t.onScroll,...t}));yt.displayName="Table";var wt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("thead",{ref:a,className:(0,Ee.clsx)("w-full sticky top-0 z-[90]",e),...t}));wt.displayName="TableHeader";var Nt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tbody",{ref:a,className:(0,Ee.clsx)(e),...t}));Nt.displayName="TableBody";var Ct=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("div",{ref:a,className:(0,Ee.clsx)(" flex flex-col md:flex-row gap-2 md:gap-0 justify-between items-center py-4 px-6 bg-white w-full h-full border border-neutral-200 rounded-t-lg",e),...t}));Ct.displayName="TableFooter";var et=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("tr",{ref:a,className:(0,Ee.clsx)(e),...t}));et.displayName="TableRow";var Tt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("th",{ref:a,className:(0,Ee.clsx)({"hover:bg-neutral-100":t.sortable},"text-p-md z-[50] bg-white font-normal text-neutral-700 p-4 text-left border-t border-b border-neutral-200 first:border-l last:border-r first:rounded-tl-lg first:rounded-bl-lg last:rounded-tr-lg last:rounded-br-lg",e),...t}));Tt.displayName="TableHead";var Rt=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("td",{ref:a,className:(0,Ee.clsx)("align-middle h-[80px] border-b border-neutral-200 whitespace-nowrap py-4 px-5",e),...t}));Rt.displayName="TableCell";var Da=ke.forwardRef(({className:e,...t},a)=>(0,Pe.jsx)("caption",{ref:a,className:(0,Ee.clsx)("text-default mt-4 text-sm",e),...t}));Da.displayName="TableCaption";var Ea=require("react");var H=require("react/jsx-runtime");function Lt({table:e,footer:t=(0,H.jsx)("div",{}),totalData:a,selectAllOption:i,onSelectAll:m,rowsSelected:s,onRemoveAll:N,tableRef:d,paginationScroll:T,pageSizeOptions:D=[]}){var v,P,F,b,n;let x=(v=e==null?void 0:e.getState())==null?void 0:v.pagination.pageIndex,E=a,h=e==null?void 0:e.getPageCount(),c=((P=e==null?void 0:e.getState())==null?void 0:P.pagination.pageIndex)+2,f=((F=e==null?void 0:e.getState())==null?void 0:F.pagination.pageIndex)-2,k=h?[...Array(h)]:[],u=((n=(b=e==null?void 0:e.getRowModel())==null?void 0:b.rows)==null?void 0:n.length)||0;return(0,H.jsxs)("div",{className:"w-full flex flex-col sticky z-[90] bottom-0",children:[(0,H.jsx)("div",{className:"bg-none overflow-x-hidden md:overflow-x-auto overflow-y-hidden table-scroll rounded-lg relative top-[8px] -space-y-1 z-[302] h-[12px]",onScroll:R=>{d==null||d.current.scrollTo({left:R.currentTarget.scrollLeft})},children:(0,H.jsx)("div",{style:{width:T?T-2:0},children:"\xA0"})}),(0,H.jsxs)(Ct,{children:[(D==null?void 0:D.length)>0&&(0,H.jsx)(Mt,{table:e,pageSizeOptions:D}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4",children:[t,i&&(0,H.jsx)("div",{children:s!==a?(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsxs)(G,{size:"xxs",onClick:m,variant:"link",children:["Selecionar todos os ",a]})}):(0,H.jsx)("div",{className:"md:border-l border-gray-300 pl-4",children:(0,H.jsx)(G,{size:"xxs",onClick:N,variant:"link",children:"Desmarcar todos"})})})]}),(0,H.jsxs)("div",{className:"flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1",children:[(0,H.jsxs)("span",{className:"text-p-md text-paragraph mr-1",children:["Mostrando ",u," de ",E," resultados"]}),(0,H.jsxs)("div",{className:"flex items-center gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-left text-base"}),size:"xs",className:"justify-center"}),f>=1&&(0,H.jsxs)("div",{className:"flex gap-2",children:[(0,H.jsx)(G,{onClick:()=>e.setPageIndex(0),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:1}),size:"xs",className:"justify-center"}),f!==1&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"})]}),k.map((R,r)=>{let o=r<=c&&r>=f,g=r===x;return(0,H.jsx)(Ea.Fragment,{children:o&&(0,H.jsx)(G,{onClick:()=>e.setPageIndex(r),className:"font-normal text-xs justify-center",variant:g?"blue":"icon",size:"xs",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:g?"#FFF":"#393C4D"},children:(r+1).toLocaleString("pt-BR")})})},r+"pagination")}),c+1<h&&(0,H.jsxs)("div",{className:"flex gap-2",children:[c!==k.length-2&&(0,H.jsx)(G,{disabled:!0,variant:"icon",icon:(0,H.jsx)(H.Fragment,{children:"..."}),size:"xs",className:"justify-center"}),(0,H.jsx)(G,{onClick:()=>e.setPageIndex(h),variant:"icon",icon:(0,H.jsx)("div",{style:{fontSize:"12px",color:"#393C4D"},children:h.toLocaleString("pt-BR")}),size:"xs",className:"font-normal justify-center"})]}),(0,H.jsx)(G,{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),variant:"icon",icon:(0,H.jsx)("i",{className:"uil uil-angle-right text-base"}),size:"xs",className:"justify-center"})]})]})]})]})}var Ke=K(require("clsx"),1),ka=require("@tanstack/match-sorter-utils");var B=require("react/jsx-runtime"),xo=(e,t,a,i)=>{let m=(0,ka.rankItem)(e.getValue(t),a);return i({itemRank:m}),m.passed};function Ht({columns:e,tableClass:t="",data:a=[],hidePagination:i,emptyButtonAction:m,hideBlankState:s,renderSubComponent:N=()=>{},footer:d,borderFull:T=!1,withShadow:D=!0,actionsSelection:x,backgroundColor:E,emptyState:h,totalData:c=0,showFilter:f,placeholder:k,fetchData:u,openedSubComponent:v=!1,getRowCanExpand:P,enableRowSelection:F,onScroll:b,tableContainerRef:n,setRows:R,selectAllOption:r,autoPagination:o,rowClassName:g,listUpdate:L,setRowSelection:O,rowSelection:V,perPage:p,pageSizeOptions:A,onFinishFetch:U}){var Ot,zt,Vt,Jt,jt,Xt;let Z=(0,j.useRef)(null),[l,X]=(0,j.useState)({}),[ye,we]=(0,j.useState)([]),[xe,W]=(0,j.useState)([]),[ne,fe]=(0,j.useState)([]),[tt,Ge]=(0,j.useState)(""),[Y,Oe]=(0,j.useState)([]),[_,Ie]=(0,j.useState)(!0),[ze,qe]=(0,j.useState)({}),[at,Ve]=(0,j.useState)(()=>c),[{pageIndex:Ne,pageSize:de},Je]=(0,j.useState)({pageIndex:0,pageSize:i?999999:p||20}),[M,Ce]=(0,j.useState)(),Te=(0,j.useMemo)(()=>({pageIndex:Ne,pageSize:de}),[Ne,de]),Pa=()=>{var I,J;u&&!o?u({pageSize:de,pageIndex:Ne,order:(I=xe[0])==null?void 0:I.id,orderDir:(J=xe[0])!=null&&J.desc?"DESC":"ASC"}).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}):Ia(Ne,de).then(S=>{Oe(S.rows),!(S!=null&&S.rows)&&c>0&&Je({pageIndex:Ne-1,pageSize:de})}),setTimeout(()=>{U&&U()},1e3)},Ia=async(I,J)=>({rows:(await new Promise((ee,St)=>{let _e=[],Fe,Wt;for(Fe=0,Wt=c;Fe<Wt;Fe+=J)_e.push(a==null?void 0:a.slice(Fe,Fe+J));ee(_e)}))[I],pageCount:Number(J)});(0,j.useEffect)(()=>{if(!(n!=null&&n.current))return;let I=new ResizeObserver(()=>{var J;Ce((J=n==null?void 0:n.current)==null?void 0:J.scrollWidth)});return I.observe(n==null?void 0:n.current),()=>I.disconnect()},[]),(0,j.useEffect)(()=>{(u||o)&&Pa()},[Ne,de,xe]),(0,j.useEffect)(()=>{c!==at&&(Je({pageIndex:0,pageSize:Te.pageSize}),Ve(c))},[c]),(0,j.useEffect)(()=>{a&&(Oe(()=>o?a.slice(0,de):a),Ie(!1))},[a]);let Fa=c<Te.pageSize?1:Math.ceil(c/Te.pageSize),oe=(0,ae.useReactTable)({data:(Y==null?void 0:Y.length)>0?Y:[],columns:e,state:{sorting:xe,columnVisibility:l,rowSelection:V,globalFilter:tt,columnFilters:ye,pagination:Te,expanded:ze},pageCount:Fa,manualPagination:!0,enableRowSelection:F,onRowSelectionChange:O,onSortingChange:W,onColumnFiltersChange:we,onColumnVisibilityChange:X,onGlobalFilterChange:Ge,globalFilterFn:xo,getCoreRowModel:(0,ae.getCoreRowModel)(),getFilteredRowModel:(0,ae.getFilteredRowModel)(),getFacetedRowModel:(0,ae.getFacetedRowModel)(),getFacetedUniqueValues:(0,ae.getFacetedUniqueValues)(),onPaginationChange:Je,getRowCanExpand:P,onExpandedChange:qe,getExpandedRowModel:(0,ae.getExpandedRowModel)(),enableExpanding:!0,getRowId:I=>I.id,meta:{getRowStyles:g}});(0,j.useEffect)(()=>{F&&V&&fe(Object.keys(V))},[V,F]);let Ma=()=>{oe.toggleAllRowsSelected(!0);let I=a==null?void 0:a.map(S=>S==null?void 0:S.id),J={};I==null||I.forEach(S=>{J={...J,[S]:!0}}),O(J)},La=()=>{oe.toggleAllRowsSelected(),O({})},Bt=Y&&(Y==null?void 0:Y.length)==0&&!_&&!s||!Y||((zt=(Ot=oe==null?void 0:oe.getRowModel())==null?void 0:Ot.rows)==null?void 0:zt.length)==0,Ha=!i&&c>0&&oe;function Ba(){var I;if(Bt&&c!==null)return h||(0,B.jsx)("div",{});if(Ha&&c!==null)return(0,B.jsx)(Lt,{table:oe,footer:d,totalData:c,tableRef:n,selectAllOption:r,onSelectAll:Ma,rowsSelected:(I=Object.keys(V||{}))==null?void 0:I.length,onRemoveAll:La,paginationScroll:M,pageSizeOptions:A});if(c==null)return(0,B.jsx)(B.Fragment,{})}(0,j.useEffect)(()=>{if(V&&Object.keys(V).length==0){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.add("with-shadow")})}else if(V&&Object.keys(V).length==1){let I=document.getElementsByClassName("th-shadow");Object.keys(I).forEach(J=>{var S,re;(re=(S=I[J])==null?void 0:S.classList)==null||re.remove("with-shadow")})}},[V]);let At=I=>{var S,re;let J=oe;return g?(re=(S=J==null?void 0:J.options)==null?void 0:S.meta)==null?void 0:re.getRowStyles(I):{}};return(0,B.jsxs)("div",{className:"w-full h-full flex flex-col",children:[f&&(0,B.jsxs)("div",{className:"w-full flex justify-between md:items-center flex-col md:flex-row gap-y-2 md:gap-y-0",children:[(0,B.jsx)("div",{className:"w-full md:max-w-[350px]",id:"filter-table",children:(0,B.jsx)(Ze,{onChange:I=>Ge(I.target.value),name:"filter",value:tt,icon:(0,B.jsx)("i",{className:"uil uil-search"}),placeholder:"Buscar pedido por ID, C\xF3digo ou Cliente",clearField:!0,onClear:()=>Ge("")})}),L]}),(0,B.jsxs)("div",{className:(0,Ke.default)("w-full flex mt-4 flex-col justify-between",{"flex-1":!Bt,[t]:t}),children:[(0,B.jsxs)(yt,{className:(0,Ke.default)("w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"),onScroll:b,ref:n,children:[V&&((Vt=Object.keys(V))==null?void 0:Vt.length)>0&&x&&(Y==null?void 0:Y.length)>0&&(0,B.jsxs)("div",{className:"h-[76px] flex items-center justify-between px-4 bg-gradient-to-b from-blue-start to-blue-end rounded-lg -mb-[1px]",children:[(0,B.jsxs)("div",{className:"flex gap-6",children:[(0,B.jsxs)("span",{className:"text-white text-p-lg",children:[Object.keys(V).length," selecionado(s)"]}),x]}),(0,B.jsx)("button",{title:"set-row",onClick:()=>O({}),children:(0,B.jsx)("i",{className:"uil uil-times text-white"})})]}),(0,B.jsxs)("div",{className:"table w-full mr-[2px]",ref:Z,children:[(0,B.jsx)(wt,{children:(Jt=oe==null?void 0:oe.getHeaderGroups())==null?void 0:Jt.map((I,J)=>(0,B.jsx)(et,{children:I.headers.map((S,re)=>{var St,_e,Fe;let ee=S.column.columnDef.meta;return(0,B.jsx)(Tt,{style:{width:S.getSize()},scope:"col",className:(0,Ke.default)({"hover:bg-neutral-100 th-shadow cursor-pointer":S.column.getCanSort(),"with-shadow":(ne==null?void 0:ne.length)==0&&D},ee==null?void 0:ee.header,ee==null?void 0:ee.className),children:(0,B.jsxs)("div",{onClick:S.column.getToggleSortingHandler(),children:[S.isPlaceholder?null:(0,ae.flexRender)(S.column.columnDef.header,S.getContext()),((St=xe[0])==null?void 0:St.id)==S.column.id?(0,B.jsx)("i",{className:(0,Ke.default)({"rotate-0":!((_e=xe[0])!=null&&_e.desc),"rotate-180":(Fe=xe[0])==null?void 0:Fe.desc},"uil uil-arrow-down text-blue-500 transform ml-1 text-[18px] duration-75")}):(0,B.jsx)(B.Fragment,{})]})},J+re+"th")})},I.id+J+"header"))}),(0,B.jsx)(Nt,{children:(Xt=(jt=oe==null?void 0:oe.getRowModel())==null?void 0:jt.rows)==null?void 0:Xt.map((I,J)=>(0,B.jsx)(j.default.Fragment,{children:!I.original._destroy&&(0,B.jsxs)(j.default.Fragment,{children:[(0,B.jsx)(et,{id:I.id,className:"text-p-md font-normal h-[80px] text-paragraph w-fit",style:At(I),children:I.getVisibleCells().map((S,re)=>{let ee=S.column.columnDef.meta;return(0,B.jsx)(Rt,{id:S.id,style:{width:S.column.getSize(),backgroundColor:E||"",...At(I)},className:(0,Ke.default)({hidden:S.row.original._destroy,"first:border-l last:border-r":T,"first:rounded-bl-lg last:rounded-br-lg":T&&I.index===(a==null?void 0:a.length)-1},ee==null?void 0:ee.cell,ee==null?void 0:ee.className),children:(0,ae.flexRender)(S.column.columnDef.cell,S.getContext())},S.id)})},I.id),(I.getIsExpanded()||v)&&(0,B.jsx)("tr",{children:(0,B.jsx)("td",{colSpan:I.getVisibleCells().length,children:N({row:I})})})]})},J+"row"))})]})]}),Ba()]})]})}0&&(module.exports={Badge,Button,Calendar,Checkbox,DataTable,DataTablePagination,DatePickerInput,FilterCalendar,FilterOptions,Input,InputMoney,InputNumber,InputPercentage,Logo,MaskedInput,ModalDialog,PaginationSelect,Popover,Radio,RocketIcon,SelectField,SpinnerIcon,Table,TableBody,TableCaption,TableCell,TableFooter,TableHead,TableHeader,TableRow,Toggle,ValueContainer});
|
|
189
|
+
`,
|
|
190
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
191
|
+
props.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
className: `flex items-center justify-center ${appliedSize.icon}`,
|
|
195
|
+
children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, { className: "animate-spin" })
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
props.children,
|
|
199
|
+
props.dropdown && /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[18px]" })
|
|
200
|
+
] })
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
};
|
|
204
|
+
var Input = ({
|
|
205
|
+
label,
|
|
206
|
+
type,
|
|
207
|
+
registration,
|
|
208
|
+
onClick,
|
|
209
|
+
error,
|
|
210
|
+
onBlur,
|
|
211
|
+
inputProps,
|
|
212
|
+
icon,
|
|
213
|
+
clearField,
|
|
214
|
+
name,
|
|
215
|
+
required,
|
|
216
|
+
disabled,
|
|
217
|
+
value,
|
|
218
|
+
placeholder,
|
|
219
|
+
defaultValue,
|
|
220
|
+
onKeyUp,
|
|
221
|
+
onKeyDown,
|
|
222
|
+
onClear,
|
|
223
|
+
hideInput,
|
|
224
|
+
onChange,
|
|
225
|
+
ref
|
|
226
|
+
}) => {
|
|
227
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
228
|
+
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
229
|
+
const styles = {
|
|
230
|
+
input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
|
|
231
|
+
${!hasError ? "border-neutral-300" : ""}`,
|
|
232
|
+
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${hasError ? "text-dangerous-500" : "text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,
|
|
233
|
+
rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
|
|
234
|
+
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",
|
|
235
|
+
clear: "absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]",
|
|
236
|
+
error: "border-dangerous-500 text-dangerous-500"
|
|
237
|
+
};
|
|
238
|
+
const inlineStyles = {
|
|
239
|
+
inputWithIcon: { paddingLeft: "48px" },
|
|
240
|
+
labelWithIcon: { left: "3rem" }
|
|
241
|
+
};
|
|
242
|
+
const input = name ? document == null ? void 0 : document.getElementById(name) : null;
|
|
243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative outline-none", children: [
|
|
245
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
+
"input",
|
|
247
|
+
{
|
|
248
|
+
id: name,
|
|
249
|
+
type,
|
|
250
|
+
name,
|
|
251
|
+
value,
|
|
252
|
+
defaultValue,
|
|
253
|
+
style: !label && placeholder && icon || icon ? inlineStyles.inputWithIcon : void 0,
|
|
254
|
+
className: clsx7__default.default({
|
|
255
|
+
[styles.error]: hasError,
|
|
256
|
+
[styles.input]: true,
|
|
257
|
+
["pr-10"]: clearField,
|
|
258
|
+
["pr-2"]: !clearField
|
|
259
|
+
}),
|
|
260
|
+
placeholder: !label && placeholder ? placeholder : " ",
|
|
261
|
+
onChange,
|
|
262
|
+
onBlur,
|
|
263
|
+
onClick,
|
|
264
|
+
disabled,
|
|
265
|
+
ref,
|
|
266
|
+
...inputProps,
|
|
267
|
+
...registration,
|
|
268
|
+
onKeyUp,
|
|
269
|
+
onKeyDown
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
className: clsx7__default.default(styles.icon, "flex justify-center items-center"),
|
|
276
|
+
children: icon
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
hideInput && /* @__PURE__ */ jsxRuntime.jsx(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
className: clsx7__default.default(
|
|
283
|
+
styles.rightIcon,
|
|
284
|
+
"flex justify-center items-center"
|
|
285
|
+
),
|
|
286
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-eye text-label cursor-pointer text-[20px]" })
|
|
287
|
+
}
|
|
288
|
+
),
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
290
|
+
"label",
|
|
291
|
+
{
|
|
292
|
+
style: icon ? inlineStyles.labelWithIcon : void 0,
|
|
293
|
+
className: clsx7__default.default(
|
|
294
|
+
{
|
|
295
|
+
[styles.label]: true,
|
|
296
|
+
["left-2.5"]: !icon
|
|
297
|
+
},
|
|
298
|
+
"cursor-text whitespace-nowrap text-ellipsis overflow-hidden pointer-events-none"
|
|
299
|
+
),
|
|
300
|
+
htmlFor: name,
|
|
301
|
+
children: [
|
|
302
|
+
label,
|
|
303
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
clearField && value && value !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
308
|
+
"i",
|
|
309
|
+
{
|
|
310
|
+
className: clsx7__default.default(
|
|
311
|
+
{
|
|
312
|
+
[styles.clear]: true
|
|
313
|
+
},
|
|
314
|
+
"uil uil-times clear-icon"
|
|
315
|
+
),
|
|
316
|
+
onClick: () => {
|
|
317
|
+
if (input) {
|
|
318
|
+
input == null ? void 0 : input.focus();
|
|
319
|
+
}
|
|
320
|
+
if (onClear) {
|
|
321
|
+
onClear();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
] }),
|
|
327
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
className: "text-dangerous-500 text-p-xs mt-1 ml-[2px]",
|
|
331
|
+
role: "alert",
|
|
332
|
+
"aria-label": message,
|
|
333
|
+
children: message
|
|
334
|
+
},
|
|
335
|
+
index
|
|
336
|
+
))
|
|
337
|
+
] });
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// src/assets/example-logo.svg
|
|
341
|
+
var example_logo_default = 'data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">%0A <rect width="100" height="100" fill="%23FF4D8B"/>%0A <text x="50" y="50" font-size="20" text-anchor="middle" dy=".3em" fill="white">LOGO</text>%0A</svg>%0A';
|
|
342
|
+
var Logo = ({ className }) => {
|
|
343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
344
|
+
"img",
|
|
345
|
+
{
|
|
346
|
+
src: example_logo_default,
|
|
347
|
+
alt: "Logo",
|
|
348
|
+
className,
|
|
349
|
+
width: 100,
|
|
350
|
+
height: 100
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
var RocketIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
355
|
+
"svg",
|
|
356
|
+
{
|
|
357
|
+
width: "800px",
|
|
358
|
+
height: "800px",
|
|
359
|
+
viewBox: "0 0 1024 1024",
|
|
360
|
+
className: "icon",
|
|
361
|
+
version: "1.1",
|
|
362
|
+
style: props.style,
|
|
363
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
366
|
+
"path",
|
|
367
|
+
{
|
|
368
|
+
d: "M512 301.2m-10 0a10 10 0 1 0 20 0 10 10 0 1 0-20 0Z",
|
|
369
|
+
fill: "#E73B37"
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
373
|
+
"path",
|
|
374
|
+
{
|
|
375
|
+
d: "M400.3 744.5c2.1-0.7 4.1-1.4 6.2-2-2 0.6-4.1 1.3-6.2 2z m0 0c2.1-0.7 4.1-1.4 6.2-2-2 0.6-4.1 1.3-6.2 2z",
|
|
376
|
+
fill: "#39393A"
|
|
377
|
+
}
|
|
378
|
+
),
|
|
379
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
+
"path",
|
|
381
|
+
{
|
|
382
|
+
d: "M511.8 256.6c24.4 0 44.2 19.8 44.2 44.2S536.2 345 511.8 345s-44.2-19.8-44.2-44.2 19.9-44.2 44.2-44.2m0-20c-35.5 0-64.2 28.7-64.2 64.2s28.7 64.2 64.2 64.2 64.2-28.7 64.2-64.2-28.7-64.2-64.2-64.2z",
|
|
383
|
+
fill: "#E73B37"
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
387
|
+
"path",
|
|
388
|
+
{
|
|
389
|
+
d: "M730.7 529.5c0.4-8.7 0.6-17.4 0.6-26.2 0-179.6-86.1-339.1-219.3-439.5-133.1 100.4-219.2 259.9-219.2 439.5 0 8.8 0.2 17.5 0.6 26.1-56 56-90.6 133.3-90.6 218.7 0 61.7 18 119.1 49.1 167.3 30.3-49.8 74.7-90.1 127.7-115.3 39-18.6 82.7-29 128.8-29 48.3 0 93.9 11.4 134.3 31.7 52.5 26.3 96.3 67.7 125.6 118.4 33.4-49.4 52.9-108.9 52.9-173.1 0-85.4-34.6-162.6-90.5-218.6zM351.1 383.4c9.2-37.9 22.9-74.7 40.6-109.5a502.1 502.1 0 0 1 63.6-95.9c17.4-20.6 36.4-39.9 56.8-57.5 20.4 17.6 39.4 36.9 56.8 57.5 24.8 29.5 46.2 61.8 63.6 95.9 17.7 34.8 31.4 71.6 40.6 109.5 8.7 35.8 13.5 72.7 14.2 109.9C637.4 459 577 438.9 512 438.9c-65 0-125.3 20.1-175.1 54.4 0.7-37.2 5.5-74.1 14.2-109.9z m-90.6 449.2c-9.1-27-13.7-55.5-13.7-84.4 0-35.8 7-70.6 20.8-103.2 8.4-19.8 19-38.4 31.9-55.5 9.7 61.5 29.5 119.7 57.8 172.6-36.4 17.8-69 41.6-96.8 70.5z m364.2-85.3c-0.7-0.3-1.5-0.5-2.2-0.8-0.4-0.2-0.9-0.3-1.3-0.5-0.6-0.2-1.3-0.5-1.9-0.7-0.8-0.3-1.5-0.5-2.3-0.8-0.8-0.3-1.5-0.5-2.3-0.7l-0.9-0.3c-1-0.3-2.1-0.7-3.1-1-1.2-0.4-2.4-0.7-3.5-1.1l-3-0.9c-0.2-0.1-0.4-0.1-0.7-0.2-1.1-0.3-2.3-0.7-3.4-1-1.2-0.3-2.4-0.6-3.5-0.9l-3.6-0.9-3.6-0.9c-1-0.3-2.1-0.5-3.1-0.7-1.2-0.3-2.4-0.5-3.6-0.8-1.3-0.3-2.5-0.6-3.8-0.8h-0.3c-0.9-0.2-1.9-0.4-2.8-0.6-0.4-0.1-0.7-0.1-1.1-0.2-1.1-0.2-2.2-0.4-3.4-0.6-1.2-0.2-2.4-0.4-3.6-0.7l-5.4-0.9c-0.9-0.1-1.9-0.3-2.8-0.4-0.8-0.1-1.6-0.3-2.5-0.4-2.6-0.4-5.1-0.7-7.7-1-1.2-0.1-2.3-0.3-3.5-0.4h-0.4c-0.9-0.1-1.8-0.2-2.8-0.3-1.1-0.1-2.1-0.2-3.2-0.3-1.7-0.2-3.4-0.3-5.1-0.4-0.8-0.1-1.5-0.1-2.3-0.2-0.9-0.1-1.9-0.1-2.8-0.2-0.4 0-0.8 0-1.2-0.1-1.1-0.1-2.1-0.1-3.2-0.2-0.5 0-1-0.1-1.5-0.1-1.3-0.1-2.6-0.1-3.9-0.1-0.8 0-1.5-0.1-2.3-0.1-1.2 0-2.4 0-3.5-0.1h-13.9c-2.3 0-4.6 0.1-6.9 0.2-0.9 0-1.9 0.1-2.8 0.1-0.8 0-1.5 0.1-2.3 0.1-1.4 0.1-2.8 0.2-4.1 0.3-1.4 0.1-2.7 0.2-4.1 0.3-1.4 0.1-2.7 0.2-4.1 0.4-0.6 0-1.2 0.1-1.8 0.2l-7.8 0.9c-1.1 0.1-2.1 0.3-3.2 0.4-1 0.1-2.1 0.3-3.1 0.4-3.2 0.5-6.4 0.9-9.5 1.5-0.7 0.1-1.4 0.2-2.1 0.4-0.9 0.1-1.7 0.3-2.6 0.5-1.1 0.2-2.3 0.4-3.4 0.6-0.9 0.2-1.7 0.3-2.6 0.5-0.4 0.1-0.8 0.1-1.1 0.2-0.7 0.1-1.4 0.3-2.1 0.4-1.2 0.3-2.4 0.5-3.6 0.8-1.2 0.3-2.4 0.5-3.6 0.8-0.2 0-0.4 0.1-0.6 0.1-0.5 0.1-1 0.2-1.5 0.4-1.1 0.3-2.3 0.6-3.5 0.9-1.3 0.3-2.5 0.6-3.8 1-0.4 0.1-0.9 0.2-1.4 0.4-1.3 0.4-2.7 0.7-4 1.1-1.5 0.4-3 0.9-4.6 1.3-1 0.3-2.1 0.6-3.1 1-2.1 0.6-4.1 1.3-6.2 2-0.7 0.2-1.4 0.5-2.1 0.7-15-27.5-27.4-56.4-37-86.2-11.7-36.1-19.2-73.6-22.5-111.6-0.6-6.7-1-13.3-1.3-20-0.1-1.2-0.1-2.4-0.1-3.6-0.1-1.2-0.1-2.4-0.1-3.6 0-1.2-0.1-2.4-0.1-3.6 0-1.2-0.1-2.4-0.1-3.7 18.8-14 39.2-25.8 61-35 36.1-15.3 74.5-23 114.1-23 39.6 0 78 7.8 114.1 23 21.8 9.2 42.2 20.9 61 35v0.1c0 1 0 1.9-0.1 2.9 0 1.4-0.1 2.8-0.1 4.3 0 0.7 0 1.3-0.1 2-0.1 1.8-0.1 3.5-0.2 5.3-0.3 6.7-0.8 13.3-1.3 20-3.3 38.5-11 76.5-23 113-9.7 30.3-22.3 59.4-37.6 87.1z m136.8 90.9a342.27 342.27 0 0 0-96.3-73.2c29.1-53.7 49.5-112.8 59.4-175.5 12.8 17.1 23.4 35.6 31.8 55.5 13.8 32.7 20.8 67.4 20.8 103.2 0 31-5.3 61.3-15.7 90z",
|
|
390
|
+
fill: "#39393A"
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
+
"path",
|
|
395
|
+
{
|
|
396
|
+
d: "M512 819.3c8.7 0 24.7 22.9 24.7 60.4s-16 60.4-24.7 60.4-24.7-22.9-24.7-60.4 16-60.4 24.7-60.4m0-20c-24.7 0-44.7 36-44.7 80.4 0 44.4 20 80.4 44.7 80.4s44.7-36 44.7-80.4c0-44.4-20-80.4-44.7-80.4z",
|
|
397
|
+
fill: "#E73B37"
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
var useFieldErrorsStore = zustand.create(
|
|
404
|
+
(set3) => ({
|
|
405
|
+
field: {},
|
|
406
|
+
addValidationError: (validationErrors) => set3((state) => {
|
|
407
|
+
let fieldErrorsByPath = {};
|
|
408
|
+
validationErrors == null ? void 0 : validationErrors.forEach(
|
|
409
|
+
({ position, path, code, message }) => {
|
|
410
|
+
path == null ? void 0 : path.shift();
|
|
411
|
+
if (position !== null) {
|
|
412
|
+
path == null ? void 0 : path.splice(1, 0, position == null ? void 0 : position.toString());
|
|
413
|
+
}
|
|
414
|
+
const fieldPathWithPosition = path.join(".").replace(".", "");
|
|
415
|
+
fieldErrorsByPath = {
|
|
416
|
+
...fieldErrorsByPath,
|
|
417
|
+
[fieldPathWithPosition]: {
|
|
418
|
+
code,
|
|
419
|
+
message
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
return {
|
|
425
|
+
...state,
|
|
426
|
+
field: {
|
|
427
|
+
...fieldErrorsByPath
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
}),
|
|
431
|
+
dismissAllValidationErrors: () => set3((state) => ({
|
|
432
|
+
field: {}
|
|
433
|
+
}))
|
|
434
|
+
})
|
|
435
|
+
);
|
|
436
|
+
var DatePickerInput = React2.forwardRef(
|
|
437
|
+
({
|
|
438
|
+
icon,
|
|
439
|
+
label,
|
|
440
|
+
registration,
|
|
441
|
+
error,
|
|
442
|
+
inputProps,
|
|
443
|
+
clearField,
|
|
444
|
+
control,
|
|
445
|
+
name,
|
|
446
|
+
required,
|
|
447
|
+
defaultValue,
|
|
448
|
+
onChangeFunction,
|
|
449
|
+
maxDate,
|
|
450
|
+
minDate,
|
|
451
|
+
disabled,
|
|
452
|
+
small,
|
|
453
|
+
onClear,
|
|
454
|
+
popoverOffset
|
|
455
|
+
}, ref) => {
|
|
456
|
+
var _a;
|
|
457
|
+
const [invalidDate, setInvalidDate] = React2.useState(false);
|
|
458
|
+
const [showCalendar, setShowCalendar] = React2.useState(false);
|
|
459
|
+
const [inputWidth, setInputWidth] = React2.useState(0);
|
|
460
|
+
const inputContainerRef = React2.useRef(null);
|
|
461
|
+
const dateFnsFormat = "dd/MM/yyyy";
|
|
462
|
+
React2.useEffect(() => {
|
|
463
|
+
const updateWidth = () => {
|
|
464
|
+
if (inputContainerRef.current) {
|
|
465
|
+
setInputWidth(inputContainerRef.current.offsetWidth + 10);
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
updateWidth();
|
|
469
|
+
window.addEventListener("resize", updateWidth);
|
|
470
|
+
return () => window.removeEventListener("resize", updateWidth);
|
|
471
|
+
}, []);
|
|
472
|
+
const finalOffset = popoverOffset || [inputWidth || 250, -46];
|
|
473
|
+
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
474
|
+
const fieldValidationMessages = [
|
|
475
|
+
(_a = fieldValidation[name ? name : registration == null ? void 0 : registration.name]) == null ? void 0 : _a.message,
|
|
476
|
+
error == null ? void 0 : error.message
|
|
477
|
+
];
|
|
478
|
+
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
479
|
+
const styles = {
|
|
480
|
+
input: `text-p-md border rounded block pb-[10px] h-[46px] w-full disabled:bg-light-gray-100 `,
|
|
481
|
+
icon: `absolute bg-light-gray-100 h-[44px] w-[38px] top-[1px] left-[1px] rounded-l-lg rounded-r-none ${hasError ? "text-dangerous-700" : "text-label"}`,
|
|
482
|
+
label: "absolute text-label text-sm",
|
|
483
|
+
clear: "absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]"
|
|
484
|
+
};
|
|
485
|
+
const input = name ? document == null ? void 0 : document.getElementById(name) : null;
|
|
486
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
+
reactHookForm.Controller,
|
|
489
|
+
{
|
|
490
|
+
control,
|
|
491
|
+
name,
|
|
492
|
+
render: ({ field }) => {
|
|
493
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
id: "group-input-calendar",
|
|
497
|
+
className: "relative",
|
|
498
|
+
ref: (node) => {
|
|
499
|
+
inputContainerRef.current = node;
|
|
500
|
+
if (typeof ref === "function") {
|
|
501
|
+
ref(node);
|
|
502
|
+
} else if (ref) {
|
|
503
|
+
ref.current = node;
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
style: {
|
|
507
|
+
["--popover-offset-x"]: `${finalOffset[0]}px`,
|
|
508
|
+
["--popover-offset-y"]: `${ -100}px`
|
|
509
|
+
},
|
|
510
|
+
children: [
|
|
511
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
512
|
+
"div",
|
|
513
|
+
{
|
|
514
|
+
id: "icon",
|
|
515
|
+
className: clsx7__default.default(
|
|
516
|
+
styles.icon,
|
|
517
|
+
"flex justify-center items-center text-[20px] bg-gray-100"
|
|
518
|
+
),
|
|
519
|
+
children: icon
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
523
|
+
datetime2.DateInput3,
|
|
524
|
+
{
|
|
525
|
+
outOfRangeMessage: "Data n\xE3o permitida",
|
|
526
|
+
invalidDateMessage: "Data inv\xE1lida",
|
|
527
|
+
onError: () => setInvalidDate(true),
|
|
528
|
+
defaultValue: field.value,
|
|
529
|
+
inputProps: {
|
|
530
|
+
className: styles.input,
|
|
531
|
+
style: { height: "46px" }
|
|
532
|
+
},
|
|
533
|
+
popoverProps: {
|
|
534
|
+
placement: "bottom",
|
|
535
|
+
usePortal: false,
|
|
536
|
+
minimal: true,
|
|
537
|
+
popoverClassName: "date-picker-popover"
|
|
538
|
+
},
|
|
539
|
+
disabled,
|
|
540
|
+
onChange: (e, isUserChange) => {
|
|
541
|
+
if (isUserChange) {
|
|
542
|
+
field.onChange(e);
|
|
543
|
+
setShowCalendar(false);
|
|
544
|
+
if (onChangeFunction) {
|
|
545
|
+
onChangeFunction(e);
|
|
546
|
+
}
|
|
547
|
+
setInvalidDate(false);
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
value: field.value,
|
|
551
|
+
locale: "pt",
|
|
552
|
+
highlightCurrentDay: true,
|
|
553
|
+
formatDate: (value) => dateFns.format(value, dateFnsFormat),
|
|
554
|
+
parseDate: (value) => dateFns.parse(value, dateFnsFormat, /* @__PURE__ */ new Date()),
|
|
555
|
+
maxDate,
|
|
556
|
+
minDate
|
|
557
|
+
}
|
|
558
|
+
),
|
|
559
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
560
|
+
"label",
|
|
561
|
+
{
|
|
562
|
+
className: clsx7__default.default(
|
|
563
|
+
"pointer-events-none ",
|
|
564
|
+
styles.label,
|
|
565
|
+
`
|
|
566
|
+
${field.value && field.value[0] !== null || invalidDate ? " scale-75 -translate-y-3 " : ""}
|
|
567
|
+
${icon ? "left-[3rem]" : "left-2.5"}`
|
|
568
|
+
),
|
|
569
|
+
style: { top: "13px" },
|
|
570
|
+
children: [
|
|
571
|
+
label,
|
|
572
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-700 ml-1", children: "*" })
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
clearField && (field == null ? void 0 : field.value) && (field == null ? void 0 : field.value) !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
577
|
+
"i",
|
|
578
|
+
{
|
|
579
|
+
className: clsx7__default.default(
|
|
580
|
+
{
|
|
581
|
+
[styles.clear]: true
|
|
582
|
+
},
|
|
583
|
+
"uil uil-times clear-icon"
|
|
584
|
+
),
|
|
585
|
+
onClick: () => {
|
|
586
|
+
if (input) {
|
|
587
|
+
input == null ? void 0 : input.focus();
|
|
588
|
+
}
|
|
589
|
+
if (onClear) {
|
|
590
|
+
onClear();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
602
|
+
"div",
|
|
603
|
+
{
|
|
604
|
+
className: "absolute text-dangerous-700 text-xs mt-[2px] ml-1",
|
|
605
|
+
role: "alert",
|
|
606
|
+
"aria-label": message,
|
|
607
|
+
children: message
|
|
608
|
+
},
|
|
609
|
+
index
|
|
610
|
+
))
|
|
611
|
+
] });
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
var variants2 = {
|
|
615
|
+
success: "bg-success-100 text-success-600",
|
|
616
|
+
warning: "bg-warning-100 text-warning-600",
|
|
617
|
+
blue: "bg-blue-100 text-blue-500",
|
|
618
|
+
gray: "bg-neutral-100 text-neutral-400",
|
|
619
|
+
dangerous: "bg-dangerous-100 text-dangerous-600",
|
|
620
|
+
light: "bg-neutral-100 text-neutral-400",
|
|
621
|
+
white: "bg-[#FFF] text-neutral-400 px-4 py-[6px] border border-light shadow-button text-paragraph",
|
|
622
|
+
primary: "bg-rose-100 text-rose-800",
|
|
623
|
+
dark: "bg-neutral-700 text-white",
|
|
624
|
+
outline: "bg-white text-rose-700 border border-neutral-200",
|
|
625
|
+
"dark-gray": "bg-neutral-100 text-neutral-600"
|
|
626
|
+
};
|
|
627
|
+
var Badge = ({
|
|
628
|
+
variant = "blue",
|
|
629
|
+
children,
|
|
630
|
+
className,
|
|
631
|
+
style
|
|
632
|
+
}) => {
|
|
633
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
634
|
+
"span",
|
|
635
|
+
{
|
|
636
|
+
className: clsx7__default.default(
|
|
637
|
+
{ [variants2[variant]]: (variant == null ? void 0 : variant.length) > 0 },
|
|
638
|
+
"py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",
|
|
639
|
+
className
|
|
640
|
+
),
|
|
641
|
+
style,
|
|
642
|
+
children
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
};
|
|
646
|
+
var Calendar = ({
|
|
647
|
+
registration,
|
|
648
|
+
error,
|
|
649
|
+
control,
|
|
650
|
+
name,
|
|
651
|
+
rangeCalendar = false,
|
|
652
|
+
shortcutsChange,
|
|
653
|
+
selectedShortcut,
|
|
654
|
+
setSelectedShortcut,
|
|
655
|
+
maxDate = /* @__PURE__ */ new Date(),
|
|
656
|
+
singleMonth = false
|
|
657
|
+
}) => {
|
|
658
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
659
|
+
const shorcuts = [
|
|
660
|
+
{
|
|
661
|
+
label: "Todo o per\xEDodo",
|
|
662
|
+
dateRange: []
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
label: "Hoje",
|
|
666
|
+
dateRange: [
|
|
667
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
668
|
+
hours: 0,
|
|
669
|
+
minutes: 0,
|
|
670
|
+
seconds: 0
|
|
671
|
+
}),
|
|
672
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
673
|
+
hours: 23,
|
|
674
|
+
minutes: 59,
|
|
675
|
+
seconds: 59
|
|
676
|
+
})
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
label: "Ontem",
|
|
681
|
+
dateRange: [
|
|
682
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 1 }), {
|
|
683
|
+
hours: 0,
|
|
684
|
+
minutes: 0,
|
|
685
|
+
seconds: 0
|
|
686
|
+
}),
|
|
687
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 1 }), {
|
|
688
|
+
hours: 23,
|
|
689
|
+
minutes: 59,
|
|
690
|
+
seconds: 59
|
|
691
|
+
})
|
|
692
|
+
]
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
label: "\xDAltimos 7 dias",
|
|
696
|
+
dateRange: [
|
|
697
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 }), {
|
|
698
|
+
hours: 0,
|
|
699
|
+
minutes: 0,
|
|
700
|
+
seconds: 0
|
|
701
|
+
}),
|
|
702
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
703
|
+
hours: 23,
|
|
704
|
+
minutes: 59,
|
|
705
|
+
seconds: 59
|
|
706
|
+
})
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
label: "\xDAltimos 14 dias",
|
|
711
|
+
dateRange: [
|
|
712
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 14 }), {
|
|
713
|
+
hours: 0,
|
|
714
|
+
minutes: 0,
|
|
715
|
+
seconds: 0
|
|
716
|
+
}),
|
|
717
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
718
|
+
hours: 23,
|
|
719
|
+
minutes: 59,
|
|
720
|
+
seconds: 59
|
|
721
|
+
})
|
|
722
|
+
]
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
label: "\xDAltimos 30 dias",
|
|
726
|
+
dateRange: [
|
|
727
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 30 }), {
|
|
728
|
+
hours: 0,
|
|
729
|
+
minutes: 0,
|
|
730
|
+
seconds: 0
|
|
731
|
+
}),
|
|
732
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
733
|
+
hours: 23,
|
|
734
|
+
minutes: 59,
|
|
735
|
+
seconds: 59
|
|
736
|
+
})
|
|
737
|
+
]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
label: "\xDAltimos 60 dias",
|
|
741
|
+
dateRange: [
|
|
742
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 60 }), {
|
|
743
|
+
hours: 0,
|
|
744
|
+
minutes: 0,
|
|
745
|
+
seconds: 0
|
|
746
|
+
}),
|
|
747
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
748
|
+
hours: 23,
|
|
749
|
+
minutes: 59,
|
|
750
|
+
seconds: 59
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
label: "\xDAltimos 90 dias",
|
|
756
|
+
dateRange: [
|
|
757
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 90 }), {
|
|
758
|
+
hours: 0,
|
|
759
|
+
minutes: 0,
|
|
760
|
+
seconds: 0
|
|
761
|
+
}),
|
|
762
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
763
|
+
hours: 23,
|
|
764
|
+
minutes: 59,
|
|
765
|
+
seconds: 59
|
|
766
|
+
})
|
|
767
|
+
]
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
label: "Esta semana",
|
|
771
|
+
dateRange: [
|
|
772
|
+
dateFns.startOfWeek(/* @__PURE__ */ new Date()),
|
|
773
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
774
|
+
hours: 23,
|
|
775
|
+
minutes: 59,
|
|
776
|
+
seconds: 59
|
|
777
|
+
})
|
|
778
|
+
]
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
label: "Semana passada",
|
|
782
|
+
dateRange: [
|
|
783
|
+
dateFns.startOfWeek(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 })),
|
|
784
|
+
dateFns.endOfWeek(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 }))
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
label: "Este M\xEAs",
|
|
789
|
+
dateRange: [
|
|
790
|
+
dateFns.startOfMonth(/* @__PURE__ */ new Date()),
|
|
791
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
792
|
+
hours: 23,
|
|
793
|
+
minutes: 59,
|
|
794
|
+
seconds: 59
|
|
795
|
+
})
|
|
796
|
+
]
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
label: "M\xEAs passado",
|
|
800
|
+
dateRange: [
|
|
801
|
+
dateFns.startOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 1 })),
|
|
802
|
+
dateFns.endOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 1 }))
|
|
803
|
+
]
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
label: "\xDAltimos 6 meses",
|
|
807
|
+
dateRange: [
|
|
808
|
+
dateFns.startOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 6 })),
|
|
809
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
810
|
+
hours: 23,
|
|
811
|
+
minutes: 59,
|
|
812
|
+
seconds: 59
|
|
813
|
+
}),
|
|
814
|
+
,
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
];
|
|
818
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
819
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
820
|
+
reactHookForm.Controller,
|
|
821
|
+
{
|
|
822
|
+
control,
|
|
823
|
+
name,
|
|
824
|
+
render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxRuntime.jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
825
|
+
datetime2.DateRangePicker3,
|
|
826
|
+
{
|
|
827
|
+
allowSingleDayRange: true,
|
|
828
|
+
shortcuts: shorcuts,
|
|
829
|
+
selectedShortcutIndex: selectedShortcut || shorcuts[0],
|
|
830
|
+
onChange: (e) => {
|
|
831
|
+
let date = [];
|
|
832
|
+
if (e[0] && e[0] !== null) {
|
|
833
|
+
date.push(
|
|
834
|
+
dateFns.set(e[0], {
|
|
835
|
+
hours: 0,
|
|
836
|
+
minutes: 0,
|
|
837
|
+
seconds: 0
|
|
838
|
+
})
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
if (e[1] && e[1] !== null) {
|
|
842
|
+
date.push(
|
|
843
|
+
dateFns.set(e[1], {
|
|
844
|
+
hours: 23,
|
|
845
|
+
minutes: 59,
|
|
846
|
+
seconds: 59
|
|
847
|
+
})
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
if (e[0] !== null && e[1] == null) {
|
|
851
|
+
if (shortcutsChange) shortcutsChange(null);
|
|
852
|
+
if (setSelectedShortcut) setSelectedShortcut(null);
|
|
853
|
+
}
|
|
854
|
+
if (shortcutsChange) shortcutsChange("");
|
|
855
|
+
onChange(date);
|
|
856
|
+
},
|
|
857
|
+
singleMonthOnly: singleMonth,
|
|
858
|
+
value,
|
|
859
|
+
highlightCurrentDay: true,
|
|
860
|
+
minDate: dateFns.subYears(/* @__PURE__ */ new Date(), 50),
|
|
861
|
+
maxDate,
|
|
862
|
+
locale: "pt",
|
|
863
|
+
onShortcutChange: (e) => {
|
|
864
|
+
const index = shorcuts.findIndex(
|
|
865
|
+
(item) => item.label === e.label
|
|
866
|
+
);
|
|
867
|
+
if (index !== -1 && setSelectedShortcut) {
|
|
868
|
+
setSelectedShortcut(index);
|
|
869
|
+
}
|
|
870
|
+
if (shortcutsChange) shortcutsChange(e);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
874
|
+
datetime2.DatePicker3,
|
|
875
|
+
{
|
|
876
|
+
onChange: (e) => {
|
|
877
|
+
onChange(e);
|
|
878
|
+
},
|
|
879
|
+
value,
|
|
880
|
+
highlightCurrentDay: true,
|
|
881
|
+
locale: "pt"
|
|
882
|
+
}
|
|
883
|
+
) })
|
|
884
|
+
}
|
|
885
|
+
),
|
|
886
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
887
|
+
"div",
|
|
888
|
+
{
|
|
889
|
+
className: "text-dangerous-500 text-xs mt-[2px]",
|
|
890
|
+
role: "alert",
|
|
891
|
+
"aria-label": message,
|
|
892
|
+
children: message
|
|
893
|
+
},
|
|
894
|
+
index
|
|
895
|
+
))
|
|
896
|
+
] });
|
|
897
|
+
};
|
|
898
|
+
var Checkbox = ({
|
|
899
|
+
key = "",
|
|
900
|
+
label,
|
|
901
|
+
registration,
|
|
902
|
+
disabled
|
|
903
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-start", children: [
|
|
904
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-5 items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
905
|
+
"input",
|
|
906
|
+
{
|
|
907
|
+
...registration,
|
|
908
|
+
id: registration ? registration.name : key,
|
|
909
|
+
disabled,
|
|
910
|
+
type: "checkbox",
|
|
911
|
+
className: clsx7__default.default(
|
|
912
|
+
"disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100"
|
|
913
|
+
)
|
|
914
|
+
}
|
|
915
|
+
) }),
|
|
916
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
917
|
+
"label",
|
|
918
|
+
{
|
|
919
|
+
htmlFor: registration == null ? void 0 : registration.name,
|
|
920
|
+
className: "cursor-pointer font-medium text-gray-700",
|
|
921
|
+
children: label
|
|
922
|
+
}
|
|
923
|
+
) })
|
|
924
|
+
] }) });
|
|
925
|
+
var FilterCalendar = ({
|
|
926
|
+
icon,
|
|
927
|
+
label,
|
|
928
|
+
onApply,
|
|
929
|
+
onClear,
|
|
930
|
+
control,
|
|
931
|
+
name,
|
|
932
|
+
rangeCalendar = true,
|
|
933
|
+
defaultShortcut,
|
|
934
|
+
shortcutsChange,
|
|
935
|
+
singleMonth = false,
|
|
936
|
+
maxDate = void 0
|
|
937
|
+
}) => {
|
|
938
|
+
const style = {
|
|
939
|
+
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
940
|
+
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
941
|
+
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
942
|
+
};
|
|
943
|
+
const [currentValue, setCurrentValue] = React2.useState([]);
|
|
944
|
+
const [calendarLabel, setCalendarLabel] = React2.useState("");
|
|
945
|
+
const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
|
|
946
|
+
const shorcuts = [
|
|
947
|
+
{
|
|
948
|
+
label: "Todo o per\xEDodo",
|
|
949
|
+
dateRange: []
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
label: "Hoje",
|
|
953
|
+
dateRange: [
|
|
954
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
955
|
+
hours: 0,
|
|
956
|
+
minutes: 0,
|
|
957
|
+
seconds: 0
|
|
958
|
+
}),
|
|
959
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
960
|
+
hours: 23,
|
|
961
|
+
minutes: 59,
|
|
962
|
+
seconds: 59
|
|
963
|
+
})
|
|
964
|
+
]
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
label: "Ontem",
|
|
968
|
+
dateRange: [
|
|
969
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 1 }), {
|
|
970
|
+
hours: 0,
|
|
971
|
+
minutes: 0,
|
|
972
|
+
seconds: 0
|
|
973
|
+
}),
|
|
974
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 1 }), {
|
|
975
|
+
hours: 23,
|
|
976
|
+
minutes: 59,
|
|
977
|
+
seconds: 59
|
|
978
|
+
})
|
|
979
|
+
]
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
label: "\xDAltimos 7 dias",
|
|
983
|
+
dateRange: [
|
|
984
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 }), {
|
|
985
|
+
hours: 0,
|
|
986
|
+
minutes: 0,
|
|
987
|
+
seconds: 0
|
|
988
|
+
}),
|
|
989
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
990
|
+
hours: 23,
|
|
991
|
+
minutes: 59,
|
|
992
|
+
seconds: 59
|
|
993
|
+
})
|
|
994
|
+
]
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
label: "\xDAltimos 14 dias",
|
|
998
|
+
dateRange: [
|
|
999
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 14 }), {
|
|
1000
|
+
hours: 0,
|
|
1001
|
+
minutes: 0,
|
|
1002
|
+
seconds: 0
|
|
1003
|
+
}),
|
|
1004
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1005
|
+
hours: 23,
|
|
1006
|
+
minutes: 59,
|
|
1007
|
+
seconds: 59
|
|
1008
|
+
})
|
|
1009
|
+
]
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
label: "\xDAltimos 30 dias",
|
|
1013
|
+
dateRange: [
|
|
1014
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 30 }), {
|
|
1015
|
+
hours: 0,
|
|
1016
|
+
minutes: 0,
|
|
1017
|
+
seconds: 0
|
|
1018
|
+
}),
|
|
1019
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1020
|
+
hours: 23,
|
|
1021
|
+
minutes: 59,
|
|
1022
|
+
seconds: 59
|
|
1023
|
+
})
|
|
1024
|
+
]
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
label: "\xDAltimos 60 dias",
|
|
1028
|
+
dateRange: [
|
|
1029
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 60 }), {
|
|
1030
|
+
hours: 0,
|
|
1031
|
+
minutes: 0,
|
|
1032
|
+
seconds: 0
|
|
1033
|
+
}),
|
|
1034
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1035
|
+
hours: 23,
|
|
1036
|
+
minutes: 59,
|
|
1037
|
+
seconds: 59
|
|
1038
|
+
})
|
|
1039
|
+
]
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
label: "\xDAltimos 90 dias",
|
|
1043
|
+
dateRange: [
|
|
1044
|
+
dateFns.set(dateFns.sub(/* @__PURE__ */ new Date(), { days: 90 }), {
|
|
1045
|
+
hours: 0,
|
|
1046
|
+
minutes: 0,
|
|
1047
|
+
seconds: 0
|
|
1048
|
+
}),
|
|
1049
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1050
|
+
hours: 23,
|
|
1051
|
+
minutes: 59,
|
|
1052
|
+
seconds: 59
|
|
1053
|
+
})
|
|
1054
|
+
]
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
label: "Esta semana",
|
|
1058
|
+
dateRange: [
|
|
1059
|
+
dateFns.startOfWeek(/* @__PURE__ */ new Date()),
|
|
1060
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1061
|
+
hours: 23,
|
|
1062
|
+
minutes: 59,
|
|
1063
|
+
seconds: 59
|
|
1064
|
+
})
|
|
1065
|
+
]
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
label: "Semana passada",
|
|
1069
|
+
dateRange: [
|
|
1070
|
+
dateFns.startOfWeek(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 })),
|
|
1071
|
+
dateFns.endOfWeek(dateFns.sub(/* @__PURE__ */ new Date(), { days: 7 }))
|
|
1072
|
+
]
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
label: "Este M\xEAs",
|
|
1076
|
+
dateRange: [
|
|
1077
|
+
dateFns.startOfMonth(/* @__PURE__ */ new Date()),
|
|
1078
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1079
|
+
hours: 23,
|
|
1080
|
+
minutes: 59,
|
|
1081
|
+
seconds: 59
|
|
1082
|
+
})
|
|
1083
|
+
]
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
label: "M\xEAs passado",
|
|
1087
|
+
dateRange: [
|
|
1088
|
+
dateFns.startOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 1 })),
|
|
1089
|
+
dateFns.endOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 1 }))
|
|
1090
|
+
]
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
label: "\xDAltimos 6 meses",
|
|
1094
|
+
dateRange: [
|
|
1095
|
+
dateFns.startOfMonth(dateFns.sub(/* @__PURE__ */ new Date(), { months: 6 })),
|
|
1096
|
+
dateFns.set(/* @__PURE__ */ new Date(), {
|
|
1097
|
+
hours: 23,
|
|
1098
|
+
minutes: 59,
|
|
1099
|
+
seconds: 59
|
|
1100
|
+
}),
|
|
1101
|
+
,
|
|
1102
|
+
]
|
|
1103
|
+
}
|
|
1104
|
+
];
|
|
1105
|
+
const [selectedShortcut, setSelectedShortcut] = React2.useState(
|
|
1106
|
+
defaultShortcut || shorcuts[0]
|
|
1107
|
+
);
|
|
1108
|
+
const calendar = /* @__PURE__ */ jsxRuntime.jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1109
|
+
datetime2.DateRangePicker3,
|
|
1110
|
+
{
|
|
1111
|
+
allowSingleDayRange: true,
|
|
1112
|
+
shortcuts: shorcuts,
|
|
1113
|
+
selectedShortcutIndex: selectedShortcut,
|
|
1114
|
+
onChange: (e) => {
|
|
1115
|
+
let date = [];
|
|
1116
|
+
if (e[0] && e[0] !== null) {
|
|
1117
|
+
date.push(
|
|
1118
|
+
dateFns.set(e[0], {
|
|
1119
|
+
hours: 0,
|
|
1120
|
+
minutes: 0,
|
|
1121
|
+
seconds: 0
|
|
1122
|
+
})
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
if (e[1] && e[1] !== null) {
|
|
1126
|
+
date.push(
|
|
1127
|
+
dateFns.set(e[1], {
|
|
1128
|
+
hours: 23,
|
|
1129
|
+
minutes: 59,
|
|
1130
|
+
seconds: 59
|
|
1131
|
+
})
|
|
1132
|
+
);
|
|
1133
|
+
}
|
|
1134
|
+
if (e[0] !== null && e[1] == null) {
|
|
1135
|
+
setCalendarLabel("");
|
|
1136
|
+
if (setSelectedShortcut) setSelectedShortcut(null);
|
|
1137
|
+
}
|
|
1138
|
+
setCalendarLabel("");
|
|
1139
|
+
setCurrentValue(date);
|
|
1140
|
+
},
|
|
1141
|
+
singleMonthOnly: singleMonth,
|
|
1142
|
+
value: currentValue,
|
|
1143
|
+
highlightCurrentDay: true,
|
|
1144
|
+
minDate: dateFns.subYears(/* @__PURE__ */ new Date(), 50),
|
|
1145
|
+
maxDate,
|
|
1146
|
+
locale: "pt",
|
|
1147
|
+
onShortcutChange: (e) => {
|
|
1148
|
+
const index = shorcuts.findIndex((item) => item.label === e.label);
|
|
1149
|
+
if (index !== -1 && setSelectedShortcut) {
|
|
1150
|
+
setSelectedShortcut(index);
|
|
1151
|
+
}
|
|
1152
|
+
setCalendarLabel(e == null ? void 0 : e.label);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1156
|
+
datetime2.DatePicker3,
|
|
1157
|
+
{
|
|
1158
|
+
onChange: (e) => {
|
|
1159
|
+
setCurrentValue(e);
|
|
1160
|
+
},
|
|
1161
|
+
value: currentValue,
|
|
1162
|
+
highlightCurrentDay: true,
|
|
1163
|
+
locale: "pt"
|
|
1164
|
+
}
|
|
1165
|
+
) });
|
|
1166
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1167
|
+
reactHookForm.Controller,
|
|
1168
|
+
{
|
|
1169
|
+
name,
|
|
1170
|
+
control,
|
|
1171
|
+
render: ({ field }) => {
|
|
1172
|
+
var _a;
|
|
1173
|
+
let hasValue = ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) > 0;
|
|
1174
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1175
|
+
react.Popover,
|
|
1176
|
+
{
|
|
1177
|
+
className: clsx7__default.default(
|
|
1178
|
+
{ ["w-full"]: isMobileSize },
|
|
1179
|
+
"relative text-paragraph"
|
|
1180
|
+
),
|
|
1181
|
+
children: ({ open }) => {
|
|
1182
|
+
var _a2, _b;
|
|
1183
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Float, { composable: true, shift: 8, zIndex: 99, offset: 2, children: [
|
|
1184
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverButton, { as: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1185
|
+
"div",
|
|
1186
|
+
{
|
|
1187
|
+
className: clsx7__default.default(
|
|
1188
|
+
{
|
|
1189
|
+
[style.filter]: !hasValue && !open,
|
|
1190
|
+
[style.filterOpen]: open && !hasValue,
|
|
1191
|
+
[style.filterActive]: open && hasValue || !open && hasValue
|
|
1192
|
+
},
|
|
1193
|
+
`group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2`
|
|
1194
|
+
),
|
|
1195
|
+
children: [
|
|
1196
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
|
+
"div",
|
|
1198
|
+
{
|
|
1199
|
+
className: clsx7__default.default({
|
|
1200
|
+
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1201
|
+
["text-blue-500"]: open && !field.value,
|
|
1202
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1203
|
+
}),
|
|
1204
|
+
children: icon
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1208
|
+
"label",
|
|
1209
|
+
{
|
|
1210
|
+
className: clsx7__default.default(
|
|
1211
|
+
{
|
|
1212
|
+
["text-paragraph group-active:text-blue-500"]: !field.value && !open,
|
|
1213
|
+
["text-blue-500"]: open && !field.value,
|
|
1214
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1215
|
+
},
|
|
1216
|
+
"truncate cursor-pointer"
|
|
1217
|
+
),
|
|
1218
|
+
children: calendarLabel ? calendarLabel : ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.length) > 0 ? (_b = field == null ? void 0 : field.value) == null ? void 0 : _b.map(
|
|
1219
|
+
(item) => item !== null ? dateFns.format(item, "dd/MM/yyyy") : ""
|
|
1220
|
+
).join(" - ") : label
|
|
1221
|
+
}
|
|
1222
|
+
),
|
|
1223
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1224
|
+
"i",
|
|
1225
|
+
{
|
|
1226
|
+
className: clsx7__default.default(
|
|
1227
|
+
{
|
|
1228
|
+
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1229
|
+
["text-blue-500"]: open && !field.value,
|
|
1230
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1231
|
+
},
|
|
1232
|
+
"uil uil-angle-down text-[18px]"
|
|
1233
|
+
)
|
|
1234
|
+
}
|
|
1235
|
+
)
|
|
1236
|
+
]
|
|
1237
|
+
}
|
|
1238
|
+
) }) }),
|
|
1239
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverPanel, { className: "p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300", children: ({ close }) => {
|
|
1240
|
+
const onClose = () => {
|
|
1241
|
+
setCurrentValue(field.value);
|
|
1242
|
+
close();
|
|
1243
|
+
};
|
|
1244
|
+
React2.useEffect(() => {
|
|
1245
|
+
setCurrentValue(field.value);
|
|
1246
|
+
}, [open]);
|
|
1247
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1248
|
+
calendar,
|
|
1249
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3", children: [
|
|
1250
|
+
onClear && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1251
|
+
Button,
|
|
1252
|
+
{
|
|
1253
|
+
variant: "link",
|
|
1254
|
+
size: "xxs",
|
|
1255
|
+
onClick: () => {
|
|
1256
|
+
if (onClear) {
|
|
1257
|
+
onClear();
|
|
1258
|
+
setCurrentValue([]);
|
|
1259
|
+
field.onChange([]);
|
|
1260
|
+
}
|
|
1261
|
+
close();
|
|
1262
|
+
},
|
|
1263
|
+
children: "Limpar"
|
|
1264
|
+
}
|
|
1265
|
+
) }),
|
|
1266
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
|
+
Button,
|
|
1268
|
+
{
|
|
1269
|
+
size: "xs",
|
|
1270
|
+
variant: "secondary",
|
|
1271
|
+
onClick: () => {
|
|
1272
|
+
onClose();
|
|
1273
|
+
},
|
|
1274
|
+
children: "Cancelar"
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1278
|
+
Button,
|
|
1279
|
+
{
|
|
1280
|
+
size: "xs",
|
|
1281
|
+
variant: "primary",
|
|
1282
|
+
disabled: JSON.stringify(currentValue) === JSON.stringify(field == null ? void 0 : field.value),
|
|
1283
|
+
onClick: () => {
|
|
1284
|
+
field.onChange(currentValue);
|
|
1285
|
+
if (onApply) onApply();
|
|
1286
|
+
close();
|
|
1287
|
+
},
|
|
1288
|
+
children: "Aplicar"
|
|
1289
|
+
}
|
|
1290
|
+
)
|
|
1291
|
+
] })
|
|
1292
|
+
] });
|
|
1293
|
+
} }) })
|
|
1294
|
+
] });
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
);
|
|
1301
|
+
};
|
|
1302
|
+
function InputSmall({
|
|
1303
|
+
type,
|
|
1304
|
+
registration,
|
|
1305
|
+
onClick,
|
|
1306
|
+
onBlur,
|
|
1307
|
+
onChange,
|
|
1308
|
+
inputProps,
|
|
1309
|
+
icon,
|
|
1310
|
+
clearField,
|
|
1311
|
+
disabled,
|
|
1312
|
+
placeholder,
|
|
1313
|
+
className,
|
|
1314
|
+
onKeyDown,
|
|
1315
|
+
value,
|
|
1316
|
+
searchOnClick,
|
|
1317
|
+
onClear,
|
|
1318
|
+
collapsed
|
|
1319
|
+
}) {
|
|
1320
|
+
const inputRef = React2.useRef(null);
|
|
1321
|
+
const styles = {
|
|
1322
|
+
input: `text-p-md text-paragraph w-full outline-none placeholder:text-label`,
|
|
1323
|
+
icon: "text-label group-focus-within:text-neutral-600 m-[10px]",
|
|
1324
|
+
wrapper: `shadow-input border border-neutral-300 focus-within:border-blue-500 group rounded-lg h-9 w-full text-paragraph flex items-center justify-between disabled:bg-neutral-100 ${disabled ? "bg-neutral-100" : "bg-white"} ${className}`,
|
|
1325
|
+
clear: "pr-[5px] cursor-pointer text-label text-[16px]"
|
|
1326
|
+
};
|
|
1327
|
+
const elem = inputRef == null ? void 0 : inputRef.current;
|
|
1328
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx7__default.default(styles.wrapper), children: [
|
|
1329
|
+
icon && !searchOnClick && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx7__default.default(styles.icon), children: icon }),
|
|
1330
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1331
|
+
"input",
|
|
1332
|
+
{
|
|
1333
|
+
...registration,
|
|
1334
|
+
...inputProps,
|
|
1335
|
+
type: "search-text",
|
|
1336
|
+
ref: inputRef,
|
|
1337
|
+
className: clsx7__default.default(
|
|
1338
|
+
{
|
|
1339
|
+
["pl-1"]: collapsed
|
|
1340
|
+
},
|
|
1341
|
+
styles.input
|
|
1342
|
+
),
|
|
1343
|
+
placeholder,
|
|
1344
|
+
onBlur,
|
|
1345
|
+
onChange: (e) => onChange(e.target.value),
|
|
1346
|
+
onClick,
|
|
1347
|
+
disabled,
|
|
1348
|
+
onKeyDown
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
clearField && value && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1352
|
+
"i",
|
|
1353
|
+
{
|
|
1354
|
+
className: clsx7__default.default(styles.clear, "uil uil-times"),
|
|
1355
|
+
onClick: () => {
|
|
1356
|
+
elem.value = "";
|
|
1357
|
+
elem == null ? void 0 : elem.focus();
|
|
1358
|
+
onChange("");
|
|
1359
|
+
if (onClear) {
|
|
1360
|
+
onClear();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
),
|
|
1365
|
+
searchOnClick && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1366
|
+
"button",
|
|
1367
|
+
{
|
|
1368
|
+
type: "button",
|
|
1369
|
+
className: clsx7__default.default({
|
|
1370
|
+
["border-l border-input pl-1"]: clearField && value && !disabled,
|
|
1371
|
+
["text-blue-500"]: !disabled,
|
|
1372
|
+
["text-neutral-300"]: disabled,
|
|
1373
|
+
["pl-[2px]"]: collapsed
|
|
1374
|
+
}),
|
|
1375
|
+
onClick: searchOnClick,
|
|
1376
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-search text-[16px] mr-2 pl-1" })
|
|
1377
|
+
}
|
|
1378
|
+
) })
|
|
1379
|
+
] });
|
|
1380
|
+
}
|
|
1381
|
+
var FilterOptions = ({
|
|
1382
|
+
icon,
|
|
1383
|
+
label,
|
|
1384
|
+
isMulti,
|
|
1385
|
+
options = [],
|
|
1386
|
+
onApply,
|
|
1387
|
+
onClear,
|
|
1388
|
+
onSelectAll,
|
|
1389
|
+
control,
|
|
1390
|
+
name,
|
|
1391
|
+
fetch,
|
|
1392
|
+
subFilters = [],
|
|
1393
|
+
emptyMessage,
|
|
1394
|
+
initialMessage,
|
|
1395
|
+
applyOnClick = false,
|
|
1396
|
+
showFilter = false
|
|
1397
|
+
}) => {
|
|
1398
|
+
const style = {
|
|
1399
|
+
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
1400
|
+
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
1401
|
+
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
1402
|
+
};
|
|
1403
|
+
const [currentValue, setCurrentValue] = React2.useState(isMulti ? [] : {});
|
|
1404
|
+
const [data, setData] = React2.useState(() => options);
|
|
1405
|
+
const [filter, setFilter] = React2.useState("");
|
|
1406
|
+
const [subFilter, setSubFilter] = React2.useState(
|
|
1407
|
+
(subFilters == null ? void 0 : subFilters.length) > 0 ? subFilters[0].id : null
|
|
1408
|
+
);
|
|
1409
|
+
const [loading, setLoading] = React2.useState(false);
|
|
1410
|
+
const search = async () => {
|
|
1411
|
+
if ((filter == null ? void 0 : filter.length) > 0 || (options == null ? void 0 : options.length) > 0) {
|
|
1412
|
+
if (fetch) {
|
|
1413
|
+
setData(await fetch(filter, subFilter));
|
|
1414
|
+
} else {
|
|
1415
|
+
const result = options.filter(
|
|
1416
|
+
(opt) => {
|
|
1417
|
+
var _a;
|
|
1418
|
+
return (_a = opt == null ? void 0 : opt.label) == null ? void 0 : _a.toLowerCase().includes(filter.toLowerCase());
|
|
1419
|
+
}
|
|
1420
|
+
);
|
|
1421
|
+
const order = result.sort((a, b) => {
|
|
1422
|
+
var _a;
|
|
1423
|
+
return (_a = a == null ? void 0 : a.label) == null ? void 0 : _a.toLowerCase();
|
|
1424
|
+
});
|
|
1425
|
+
setData(order);
|
|
1426
|
+
}
|
|
1427
|
+
} else {
|
|
1428
|
+
setData([]);
|
|
1429
|
+
}
|
|
1430
|
+
setLoading(false);
|
|
1431
|
+
};
|
|
1432
|
+
React2.useEffect(() => {
|
|
1433
|
+
setLoading(true);
|
|
1434
|
+
const timeout = setTimeout(() => {
|
|
1435
|
+
search();
|
|
1436
|
+
}, 400);
|
|
1437
|
+
return () => clearTimeout(timeout);
|
|
1438
|
+
}, [filter]);
|
|
1439
|
+
const optionStyle = (option, isSelected) => {
|
|
1440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1441
|
+
react.ListboxOption,
|
|
1442
|
+
{
|
|
1443
|
+
disabled: option.disabled,
|
|
1444
|
+
value: option,
|
|
1445
|
+
as: React2.Fragment,
|
|
1446
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1447
|
+
"div",
|
|
1448
|
+
{
|
|
1449
|
+
className: clsx7__default.default(
|
|
1450
|
+
"relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",
|
|
1451
|
+
{
|
|
1452
|
+
["hover:bg-neutral-200"]: !option.disabled && !isSelected,
|
|
1453
|
+
["text-gray-200"]: option.disabled,
|
|
1454
|
+
["bg-blue-500 hover:bg-blue-500"]: isSelected
|
|
1455
|
+
}
|
|
1456
|
+
),
|
|
1457
|
+
children: [
|
|
1458
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1459
|
+
"span",
|
|
1460
|
+
{
|
|
1461
|
+
className: clsx7__default.default(
|
|
1462
|
+
{
|
|
1463
|
+
["font-semibold text-white"]: isSelected
|
|
1464
|
+
},
|
|
1465
|
+
"text-wrap break-words font-normal block"
|
|
1466
|
+
),
|
|
1467
|
+
children: option == null ? void 0 : option.label
|
|
1468
|
+
}
|
|
1469
|
+
),
|
|
1470
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1471
|
+
"span",
|
|
1472
|
+
{
|
|
1473
|
+
className: clsx7__default.default(
|
|
1474
|
+
{
|
|
1475
|
+
["font-semibold text-white"]: isSelected
|
|
1476
|
+
},
|
|
1477
|
+
"w-[200px] whitespace-nowrap text-ellipsis overflow-hidden text-label text-p-sm block"
|
|
1478
|
+
),
|
|
1479
|
+
children: option == null ? void 0 : option.description
|
|
1480
|
+
}
|
|
1481
|
+
),
|
|
1482
|
+
isSelected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1483
|
+
"span",
|
|
1484
|
+
{
|
|
1485
|
+
className: clsx7__default.default(
|
|
1486
|
+
"absolute inset-y-0 text-white right-0 flex items-center pr-4"
|
|
1487
|
+
),
|
|
1488
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-check text-lg" })
|
|
1489
|
+
}
|
|
1490
|
+
) : null
|
|
1491
|
+
]
|
|
1492
|
+
}
|
|
1493
|
+
)
|
|
1494
|
+
},
|
|
1495
|
+
option.id
|
|
1496
|
+
);
|
|
1497
|
+
};
|
|
1498
|
+
const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
|
|
1499
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
|
+
reactHookForm.Controller,
|
|
1501
|
+
{
|
|
1502
|
+
name,
|
|
1503
|
+
control,
|
|
1504
|
+
render: ({ field }) => {
|
|
1505
|
+
var _a, _b;
|
|
1506
|
+
let hasValue = isMulti ? ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) > 0 : !!((_b = field == null ? void 0 : field.value) == null ? void 0 : _b.id);
|
|
1507
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1508
|
+
react.Popover,
|
|
1509
|
+
{
|
|
1510
|
+
className: clsx7__default.default(
|
|
1511
|
+
{ ["w-full"]: isMobileSize },
|
|
1512
|
+
"relative text-paragraph"
|
|
1513
|
+
),
|
|
1514
|
+
children: ({ open }) => {
|
|
1515
|
+
var _a2, _b2;
|
|
1516
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Float, { composable: true, shift: 8, zIndex: 99, offset: 2, children: [
|
|
1517
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverButton, { as: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1518
|
+
"div",
|
|
1519
|
+
{
|
|
1520
|
+
className: clsx7__default.default(
|
|
1521
|
+
{
|
|
1522
|
+
[style.filter]: !hasValue && !open,
|
|
1523
|
+
[style.filterOpen]: open && !hasValue,
|
|
1524
|
+
[style.filterActive]: open && hasValue || !open && hasValue
|
|
1525
|
+
},
|
|
1526
|
+
`group px-3 h-[36px] text-p-ls font-bold disabled:shadow-none active:shadow-none flex items-center justify-between outline-none gap-2`
|
|
1527
|
+
),
|
|
1528
|
+
children: [
|
|
1529
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1530
|
+
"div",
|
|
1531
|
+
{
|
|
1532
|
+
className: clsx7__default.default({
|
|
1533
|
+
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1534
|
+
["text-blue-500"]: open && !field.value,
|
|
1535
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1536
|
+
}),
|
|
1537
|
+
children: icon
|
|
1538
|
+
}
|
|
1539
|
+
),
|
|
1540
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1541
|
+
"label",
|
|
1542
|
+
{
|
|
1543
|
+
className: clsx7__default.default(
|
|
1544
|
+
{
|
|
1545
|
+
["text-paragraph group-active:text-blue-500"]: !field.value && !open,
|
|
1546
|
+
["text-blue-500"]: open && !field.value,
|
|
1547
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1548
|
+
},
|
|
1549
|
+
"truncate cursor-pointer"
|
|
1550
|
+
),
|
|
1551
|
+
children: isMulti ? label : ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.id) ? (_b2 = field == null ? void 0 : field.value) == null ? void 0 : _b2.label : label
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
isMulti && field.value && field.value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-blue-500 text-white text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500", children: field.value.length }),
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1556
|
+
"i",
|
|
1557
|
+
{
|
|
1558
|
+
className: clsx7__default.default(
|
|
1559
|
+
{
|
|
1560
|
+
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1561
|
+
["text-blue-500"]: open && !field.value,
|
|
1562
|
+
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
1563
|
+
},
|
|
1564
|
+
"uil uil-angle-down text-[18px]"
|
|
1565
|
+
)
|
|
1566
|
+
}
|
|
1567
|
+
)
|
|
1568
|
+
]
|
|
1569
|
+
}
|
|
1570
|
+
) }) }),
|
|
1571
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverPanel, { className: "p-3 whitespace-nowrap bg-white rounded-lg shadow-dropdown border-[0.5px] border-neutral-300", children: ({ close }) => {
|
|
1572
|
+
const onClose = () => {
|
|
1573
|
+
setCurrentValue(field.value);
|
|
1574
|
+
close();
|
|
1575
|
+
};
|
|
1576
|
+
React2.useEffect(() => {
|
|
1577
|
+
setCurrentValue(field.value);
|
|
1578
|
+
}, [open]);
|
|
1579
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1580
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1581
|
+
react.Listbox,
|
|
1582
|
+
{
|
|
1583
|
+
value: currentValue || [],
|
|
1584
|
+
onChange: setCurrentValue,
|
|
1585
|
+
multiple: isMulti,
|
|
1586
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1587
|
+
react.ListboxOptions,
|
|
1588
|
+
{
|
|
1589
|
+
static: true,
|
|
1590
|
+
className: "max-h-60 w-full overflow-x-hidden overflow-y-auto bg-white text-p-md focus:outline-none sm:text-sm relative",
|
|
1591
|
+
children: [
|
|
1592
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mr-1 sticky top-0 z-30", children: [
|
|
1593
|
+
showFilter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1594
|
+
InputSmall,
|
|
1595
|
+
{
|
|
1596
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-search" }),
|
|
1597
|
+
onChange: (e) => setFilter(e),
|
|
1598
|
+
value: filter,
|
|
1599
|
+
placeholder: "Pesquisar",
|
|
1600
|
+
clearField: true,
|
|
1601
|
+
onKeyDown: (e) => {
|
|
1602
|
+
if (e.key === " " || e.code === "Space") {
|
|
1603
|
+
e.stopPropagation();
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
),
|
|
1608
|
+
subFilters && fetch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 pt-2 bg-white", children: subFilters.map((item, index) => {
|
|
1609
|
+
const active = (item == null ? void 0 : item.id) === subFilter;
|
|
1610
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
+
"button",
|
|
1612
|
+
{
|
|
1613
|
+
className: clsx7__default.default(
|
|
1614
|
+
{
|
|
1615
|
+
["bg-blue-500 text-white"]: active,
|
|
1616
|
+
["text-paragraph"]: !active
|
|
1617
|
+
},
|
|
1618
|
+
`rounded-[20px] border-[0.5px] border-neutral-200 px-4 py-[6px]`
|
|
1619
|
+
),
|
|
1620
|
+
onClick: () => {
|
|
1621
|
+
if (subFilter == item.id) {
|
|
1622
|
+
setSubFilter(null);
|
|
1623
|
+
} else {
|
|
1624
|
+
setSubFilter(item.id);
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
children: item.name
|
|
1628
|
+
},
|
|
1629
|
+
index
|
|
1630
|
+
);
|
|
1631
|
+
}) })
|
|
1632
|
+
] }),
|
|
1633
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 w-full my-4", children: [
|
|
1634
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1635
|
+
"img",
|
|
1636
|
+
{
|
|
1637
|
+
className: "animate-spin",
|
|
1638
|
+
src: "/spinner-gray.svg",
|
|
1639
|
+
alt: "circle",
|
|
1640
|
+
width: 13,
|
|
1641
|
+
height: 13
|
|
1642
|
+
}
|
|
1643
|
+
),
|
|
1644
|
+
"Carregando"
|
|
1645
|
+
] }),
|
|
1646
|
+
(data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) > 0 && !loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label text-p-md", children: emptyMessage }) }),
|
|
1647
|
+
initialMessage && (data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) === 0 && !loading && (options == null ? void 0 : options.length) === 0 && !(currentValue == null ? void 0 : currentValue.id) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label text-p-md", children: initialMessage }) }),
|
|
1648
|
+
initialMessage && currentValue && (currentValue == null ? void 0 : currentValue.id) && (filter == null ? void 0 : filter.length) === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-2", children: isMulti ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: currentValue == null ? void 0 : currentValue.map((option) => {
|
|
1649
|
+
let isSelected = isMulti ? currentValue && (currentValue == null ? void 0 : currentValue.length) > 0 && (currentValue == null ? void 0 : currentValue.some(
|
|
1650
|
+
(e) => e.id === option.id
|
|
1651
|
+
)) : currentValue && (currentValue == null ? void 0 : currentValue.id) === option.id;
|
|
1652
|
+
return optionStyle(
|
|
1653
|
+
options,
|
|
1654
|
+
isSelected
|
|
1655
|
+
);
|
|
1656
|
+
}) }) : optionStyle(field.value, true) }),
|
|
1657
|
+
!loading && (data == null ? void 0 : data.map((option) => {
|
|
1658
|
+
let isSelected = isMulti ? currentValue && currentValue.length > 0 && currentValue.some(
|
|
1659
|
+
(e) => e.id === option.id
|
|
1660
|
+
) : currentValue && currentValue.id === option.id;
|
|
1661
|
+
return optionStyle(option, isSelected);
|
|
1662
|
+
}))
|
|
1663
|
+
]
|
|
1664
|
+
}
|
|
1665
|
+
)
|
|
1666
|
+
}
|
|
1667
|
+
),
|
|
1668
|
+
!applyOnClick && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center justify-end border-t border-t-neutral-200 pt-3", children: [
|
|
1669
|
+
isMulti && onSelectAll && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-r pr-2 border-neutral-300", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1670
|
+
Button,
|
|
1671
|
+
{
|
|
1672
|
+
variant: "link",
|
|
1673
|
+
size: "xxs",
|
|
1674
|
+
onClick: () => {
|
|
1675
|
+
onSelectAll();
|
|
1676
|
+
field.onChange(options);
|
|
1677
|
+
setCurrentValue(options);
|
|
1678
|
+
close();
|
|
1679
|
+
},
|
|
1680
|
+
children: "Marcar todos"
|
|
1681
|
+
}
|
|
1682
|
+
) }),
|
|
1683
|
+
onClear && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1684
|
+
Button,
|
|
1685
|
+
{
|
|
1686
|
+
variant: "link",
|
|
1687
|
+
size: "xxs",
|
|
1688
|
+
onClick: () => {
|
|
1689
|
+
if (onClear) {
|
|
1690
|
+
onClear();
|
|
1691
|
+
setCurrentValue([]);
|
|
1692
|
+
field.onChange([]);
|
|
1693
|
+
}
|
|
1694
|
+
close();
|
|
1695
|
+
},
|
|
1696
|
+
children: "Limpar"
|
|
1697
|
+
}
|
|
1698
|
+
) }),
|
|
1699
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1700
|
+
Button,
|
|
1701
|
+
{
|
|
1702
|
+
size: "xs",
|
|
1703
|
+
variant: "secondary",
|
|
1704
|
+
onClick: () => {
|
|
1705
|
+
onClose();
|
|
1706
|
+
},
|
|
1707
|
+
children: "Cancelar"
|
|
1708
|
+
}
|
|
1709
|
+
),
|
|
1710
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1711
|
+
Button,
|
|
1712
|
+
{
|
|
1713
|
+
size: "xs",
|
|
1714
|
+
variant: "primary",
|
|
1715
|
+
disabled: JSON.stringify(currentValue) === JSON.stringify(field == null ? void 0 : field.value),
|
|
1716
|
+
onClick: () => {
|
|
1717
|
+
field.onChange(currentValue);
|
|
1718
|
+
if (onApply) onApply();
|
|
1719
|
+
close();
|
|
1720
|
+
},
|
|
1721
|
+
children: "Aplicar"
|
|
1722
|
+
}
|
|
1723
|
+
)
|
|
1724
|
+
] })
|
|
1725
|
+
] });
|
|
1726
|
+
} }) })
|
|
1727
|
+
] });
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
);
|
|
1734
|
+
};
|
|
1735
|
+
var IntlCurrencyInput = (IntlCurrencyInputModule__namespace == null ? void 0 : IntlCurrencyInputModule__namespace.default) || IntlCurrencyInputModule__namespace;
|
|
1736
|
+
var InputMoney = React2.forwardRef(
|
|
1737
|
+
({
|
|
1738
|
+
label,
|
|
1739
|
+
type,
|
|
1740
|
+
onClick,
|
|
1741
|
+
error,
|
|
1742
|
+
onBlur,
|
|
1743
|
+
onChangeValue,
|
|
1744
|
+
inputProps,
|
|
1745
|
+
icon,
|
|
1746
|
+
clearField,
|
|
1747
|
+
name,
|
|
1748
|
+
required,
|
|
1749
|
+
disabled,
|
|
1750
|
+
value,
|
|
1751
|
+
placeholder,
|
|
1752
|
+
control,
|
|
1753
|
+
defaultValue,
|
|
1754
|
+
isWeightField,
|
|
1755
|
+
minFractionDigits = 2
|
|
1756
|
+
}, ref) => {
|
|
1757
|
+
const numberConfig = isWeightField ? {
|
|
1758
|
+
currency: "BRL",
|
|
1759
|
+
minimumFractionDigits: minFractionDigits,
|
|
1760
|
+
maximumFractionDigits: minFractionDigits,
|
|
1761
|
+
useGrouping: false
|
|
1762
|
+
} : {
|
|
1763
|
+
style: "currency",
|
|
1764
|
+
currency: "BRL",
|
|
1765
|
+
minimumFractionDigits: minFractionDigits,
|
|
1766
|
+
maximumFractionDigits: minFractionDigits
|
|
1767
|
+
};
|
|
1768
|
+
const currencyConfig = {
|
|
1769
|
+
locale: "pt-BR",
|
|
1770
|
+
formats: {
|
|
1771
|
+
number: {
|
|
1772
|
+
BRL: numberConfig
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
1777
|
+
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
1778
|
+
const styles = {
|
|
1779
|
+
input: `text-p-md pl-2 peer text-paragraph shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
1780
|
+
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] w-[38px] rounded-l-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
1781
|
+
`,
|
|
1782
|
+
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0"};
|
|
1783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1784
|
+
reactHookForm.Controller,
|
|
1785
|
+
{
|
|
1786
|
+
control,
|
|
1787
|
+
name,
|
|
1788
|
+
defaultValue,
|
|
1789
|
+
render: ({ field }) => {
|
|
1790
|
+
const handleChange = (event, value2, maskedValue) => {
|
|
1791
|
+
event.preventDefault();
|
|
1792
|
+
field.onChange(value2);
|
|
1793
|
+
if (onChangeValue) {
|
|
1794
|
+
onChangeValue(value2);
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
if (typeof field.value === "string")
|
|
1798
|
+
field.value = Number(field.value);
|
|
1799
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1800
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative outline-none", children: [
|
|
1801
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1802
|
+
"div",
|
|
1803
|
+
{
|
|
1804
|
+
className: clsx7__default.default(
|
|
1805
|
+
styles.icon,
|
|
1806
|
+
"flex justify-center items-center"
|
|
1807
|
+
),
|
|
1808
|
+
children: icon
|
|
1809
|
+
}
|
|
1810
|
+
),
|
|
1811
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1812
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1813
|
+
IntlCurrencyInput,
|
|
1814
|
+
{
|
|
1815
|
+
...inputProps,
|
|
1816
|
+
...field,
|
|
1817
|
+
type: "text",
|
|
1818
|
+
ref,
|
|
1819
|
+
className: clsx7__default.default({
|
|
1820
|
+
[styles.input]: true,
|
|
1821
|
+
["pr-10"]: clearField,
|
|
1822
|
+
["pr-2"]: !clearField,
|
|
1823
|
+
["pl-[46px]"]: !label && placeholder && icon || icon
|
|
1824
|
+
}),
|
|
1825
|
+
placeholder: !label && placeholder ? placeholder : " ",
|
|
1826
|
+
onClick,
|
|
1827
|
+
disabled,
|
|
1828
|
+
currency: "BRL",
|
|
1829
|
+
config: currencyConfig,
|
|
1830
|
+
onChange: handleChange,
|
|
1831
|
+
onBlur: () => {
|
|
1832
|
+
if (onBlur) {
|
|
1833
|
+
onBlur(field.value);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
),
|
|
1838
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1839
|
+
"label",
|
|
1840
|
+
{
|
|
1841
|
+
className: clsx7__default.default(
|
|
1842
|
+
{
|
|
1843
|
+
[styles.label]: true,
|
|
1844
|
+
["left-[46px]"]: icon,
|
|
1845
|
+
["left-2.5"]: !icon
|
|
1846
|
+
},
|
|
1847
|
+
"cursor-text"
|
|
1848
|
+
),
|
|
1849
|
+
children: [
|
|
1850
|
+
label,
|
|
1851
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
1852
|
+
]
|
|
1853
|
+
}
|
|
1854
|
+
)
|
|
1855
|
+
] })
|
|
1856
|
+
] }),
|
|
1857
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1858
|
+
"div",
|
|
1859
|
+
{
|
|
1860
|
+
className: "text-dangerous-500 text-xs mt-1 ml-[2px]",
|
|
1861
|
+
role: "alert",
|
|
1862
|
+
"aria-label": message,
|
|
1863
|
+
children: message
|
|
1864
|
+
},
|
|
1865
|
+
index
|
|
1866
|
+
))
|
|
1867
|
+
] });
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
);
|
|
1871
|
+
}
|
|
1872
|
+
);
|
|
1873
|
+
InputMoney.displayName = "InputMoney";
|
|
1874
|
+
function InputNumber({
|
|
1875
|
+
label,
|
|
1876
|
+
type,
|
|
1877
|
+
onClick,
|
|
1878
|
+
error,
|
|
1879
|
+
onBlur,
|
|
1880
|
+
onChangeValue,
|
|
1881
|
+
inputProps,
|
|
1882
|
+
icon,
|
|
1883
|
+
clearField,
|
|
1884
|
+
name,
|
|
1885
|
+
required,
|
|
1886
|
+
disabled,
|
|
1887
|
+
value,
|
|
1888
|
+
placeholder,
|
|
1889
|
+
control,
|
|
1890
|
+
defaultValue,
|
|
1891
|
+
hideArrows = false,
|
|
1892
|
+
maxLength,
|
|
1893
|
+
onlyNumbers,
|
|
1894
|
+
showZero,
|
|
1895
|
+
maxValue
|
|
1896
|
+
}) {
|
|
1897
|
+
const input = name ? document == null ? void 0 : document.getElementById(name) : null;
|
|
1898
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
1899
|
+
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
1900
|
+
const styles = {
|
|
1901
|
+
input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
1902
|
+
icon: `absolute bg-neutral-100 h-[44px] top-[2px] left-[1.5px] w-[38px] rounded-l-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
1903
|
+
`,
|
|
1904
|
+
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",
|
|
1905
|
+
buttonsWrapper: "absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",
|
|
1906
|
+
button: "border-[0.5px] border-neutral-300 rounded shadow-input h-4 w-4 flex items-center justify-center"
|
|
1907
|
+
};
|
|
1908
|
+
const [debouncedCount, setDebouncedCount] = React2.useState(0);
|
|
1909
|
+
const save = () => {
|
|
1910
|
+
if (onBlur) {
|
|
1911
|
+
onBlur(value);
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
const updateCount = React2.useMemo(() => {
|
|
1915
|
+
return _debounce__default.default(() => {
|
|
1916
|
+
save();
|
|
1917
|
+
}, 1e3);
|
|
1918
|
+
}, []);
|
|
1919
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
|
+
reactHookForm.Controller,
|
|
1921
|
+
{
|
|
1922
|
+
control,
|
|
1923
|
+
name,
|
|
1924
|
+
defaultValue,
|
|
1925
|
+
render: ({ field: { onChange, value: value2 } }) => {
|
|
1926
|
+
const update = (value3) => {
|
|
1927
|
+
updateCount();
|
|
1928
|
+
setDebouncedCount(value3);
|
|
1929
|
+
};
|
|
1930
|
+
const changeValue = (value3) => {
|
|
1931
|
+
onChange(value3);
|
|
1932
|
+
if (onChangeValue) {
|
|
1933
|
+
const val = {
|
|
1934
|
+
...value3,
|
|
1935
|
+
target: {
|
|
1936
|
+
...value3.target,
|
|
1937
|
+
value: value3.target.value.replace(/^0+/, "")
|
|
1938
|
+
}
|
|
1939
|
+
};
|
|
1940
|
+
onChangeValue(val);
|
|
1941
|
+
}
|
|
1942
|
+
update(debouncedCount + 1);
|
|
1943
|
+
};
|
|
1944
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1945
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative outline-none", children: [
|
|
1946
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1947
|
+
"div",
|
|
1948
|
+
{
|
|
1949
|
+
className: clsx7__default.default(
|
|
1950
|
+
styles.icon,
|
|
1951
|
+
"flex justify-center items-center"
|
|
1952
|
+
),
|
|
1953
|
+
children: icon
|
|
1954
|
+
}
|
|
1955
|
+
),
|
|
1956
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1957
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1958
|
+
"input",
|
|
1959
|
+
{
|
|
1960
|
+
type: "number",
|
|
1961
|
+
autoComplete: "off",
|
|
1962
|
+
id: name,
|
|
1963
|
+
className: clsx7__default.default({
|
|
1964
|
+
[styles.input]: true,
|
|
1965
|
+
["pr-10"]: clearField,
|
|
1966
|
+
["pr-2"]: !clearField,
|
|
1967
|
+
["pl-[57px]"]: !label && placeholder && icon
|
|
1968
|
+
}),
|
|
1969
|
+
placeholder: !label && placeholder ? placeholder : " ",
|
|
1970
|
+
onKeyDown: (e) => {
|
|
1971
|
+
if (e.code === "ArrowUp" || e.code === "ArrowDown" || e.code === "Enter" || e.key === "+" || e.key === "-" || e.key === "e" && !onlyNumbers) {
|
|
1972
|
+
e.preventDefault();
|
|
1973
|
+
}
|
|
1974
|
+
if (onlyNumbers && ![
|
|
1975
|
+
"Digit1",
|
|
1976
|
+
"Digit2",
|
|
1977
|
+
"Digit3",
|
|
1978
|
+
"Digit4",
|
|
1979
|
+
"Digit5",
|
|
1980
|
+
"Digit6",
|
|
1981
|
+
"Digit7",
|
|
1982
|
+
"Digit8",
|
|
1983
|
+
"Digit9",
|
|
1984
|
+
"Digit0",
|
|
1985
|
+
"Backspace"
|
|
1986
|
+
].includes(e.code)) {
|
|
1987
|
+
e.preventDefault();
|
|
1988
|
+
}
|
|
1989
|
+
},
|
|
1990
|
+
onClick,
|
|
1991
|
+
disabled,
|
|
1992
|
+
value: showZero ? String(value2) : String(value2).replace(/^0+/, ""),
|
|
1993
|
+
onChange: (e) => {
|
|
1994
|
+
let value3 = maxLength ? {
|
|
1995
|
+
...e,
|
|
1996
|
+
target: {
|
|
1997
|
+
...e.target,
|
|
1998
|
+
value: e.target.value.slice(0, maxLength)
|
|
1999
|
+
}
|
|
2000
|
+
} : e;
|
|
2001
|
+
if (!maxValue || maxValue && Number(e.target.value) <= maxValue) {
|
|
2002
|
+
changeValue(value3);
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
defaultValue: value2,
|
|
2006
|
+
onBlur: (evt) => {
|
|
2007
|
+
if (onBlur) onBlur(evt.target.value);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
),
|
|
2011
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2012
|
+
"label",
|
|
2013
|
+
{
|
|
2014
|
+
className: clsx7__default.default(
|
|
2015
|
+
{
|
|
2016
|
+
[styles.label]: true,
|
|
2017
|
+
["left-[3.5rem]"]: icon,
|
|
2018
|
+
["left-2.5"]: !icon
|
|
2019
|
+
},
|
|
2020
|
+
"cursor-text"
|
|
2021
|
+
),
|
|
2022
|
+
onClick: () => input == null ? void 0 : input.focus(),
|
|
2023
|
+
children: [
|
|
2024
|
+
label,
|
|
2025
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
)
|
|
2029
|
+
] }),
|
|
2030
|
+
!hideArrows && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx7__default.default([styles.buttonsWrapper]), children: [
|
|
2031
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2032
|
+
"button",
|
|
2033
|
+
{
|
|
2034
|
+
type: "button",
|
|
2035
|
+
className: clsx7__default.default([styles.button]),
|
|
2036
|
+
disabled,
|
|
2037
|
+
onClick: () => {
|
|
2038
|
+
if (!maxValue || maxValue && Number(value2 || 0) + 1 <= maxValue) {
|
|
2039
|
+
changeValue(String(Number(value2 || 0) + 1));
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-up text-[12px] text-neutral-600" })
|
|
2043
|
+
}
|
|
2044
|
+
),
|
|
2045
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2046
|
+
"button",
|
|
2047
|
+
{
|
|
2048
|
+
type: "button",
|
|
2049
|
+
className: clsx7__default.default([styles.button]),
|
|
2050
|
+
disabled,
|
|
2051
|
+
onClick: () => {
|
|
2052
|
+
if (!maxValue || maxValue && Number(value2 === 0 ? 0 : Number(value2) - 1) <= maxValue) {
|
|
2053
|
+
changeValue(
|
|
2054
|
+
value2 === 0 ? 0 : String(Number(value2) - 1)
|
|
2055
|
+
);
|
|
2056
|
+
}
|
|
2057
|
+
},
|
|
2058
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[12px] text-neutral-600" })
|
|
2059
|
+
}
|
|
2060
|
+
)
|
|
2061
|
+
] })
|
|
2062
|
+
] }),
|
|
2063
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2064
|
+
"div",
|
|
2065
|
+
{
|
|
2066
|
+
className: "absolute text-dangerous-500 text-xs left-[4px] -bottom-[18px]",
|
|
2067
|
+
role: "alert",
|
|
2068
|
+
"aria-label": message,
|
|
2069
|
+
children: message
|
|
2070
|
+
},
|
|
2071
|
+
index
|
|
2072
|
+
))
|
|
2073
|
+
] });
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2078
|
+
InputNumber.displayName = "InputNumber";
|
|
2079
|
+
var IntlCurrencyInput2 = (IntlCurrencyInputModule__namespace == null ? void 0 : IntlCurrencyInputModule__namespace.default) || IntlCurrencyInputModule__namespace;
|
|
2080
|
+
function InputPercentage({
|
|
2081
|
+
label,
|
|
2082
|
+
onClick,
|
|
2083
|
+
error,
|
|
2084
|
+
onBlur,
|
|
2085
|
+
inputProps,
|
|
2086
|
+
icon,
|
|
2087
|
+
clearField,
|
|
2088
|
+
name,
|
|
2089
|
+
required,
|
|
2090
|
+
disabled,
|
|
2091
|
+
placeholder,
|
|
2092
|
+
control,
|
|
2093
|
+
defaultValue,
|
|
2094
|
+
minFractionDigits = 2,
|
|
2095
|
+
onChangeValue,
|
|
2096
|
+
maxLength
|
|
2097
|
+
}) {
|
|
2098
|
+
const config = {
|
|
2099
|
+
currency: "BRL",
|
|
2100
|
+
minimumFractionDigits: minFractionDigits,
|
|
2101
|
+
maximumFractionDigits: minFractionDigits,
|
|
2102
|
+
useGrouping: false
|
|
2103
|
+
};
|
|
2104
|
+
const currencyConfig = {
|
|
2105
|
+
locale: "pt-BR",
|
|
2106
|
+
formats: {
|
|
2107
|
+
number: {
|
|
2108
|
+
BRL: config
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
let inputRef = React2.useRef(null);
|
|
2113
|
+
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
2114
|
+
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
2115
|
+
const styles = {
|
|
2116
|
+
input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
2117
|
+
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] text-[22px] rounded-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
2118
|
+
`,
|
|
2119
|
+
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0"};
|
|
2120
|
+
const input = name ? document == null ? void 0 : document.getElementById(name) : null;
|
|
2121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2122
|
+
reactHookForm.Controller,
|
|
2123
|
+
{
|
|
2124
|
+
control,
|
|
2125
|
+
name,
|
|
2126
|
+
defaultValue,
|
|
2127
|
+
render: ({ field }) => {
|
|
2128
|
+
const handleChange = (event, value, maskedValue) => {
|
|
2129
|
+
event.preventDefault();
|
|
2130
|
+
field.onChange(value.toString());
|
|
2131
|
+
if (onChangeValue) {
|
|
2132
|
+
onChangeValue(value.toString());
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
if (typeof field.value === "string") field.value = Number(field.value);
|
|
2136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2137
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative outline-none", children: [
|
|
2138
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2139
|
+
"div",
|
|
2140
|
+
{
|
|
2141
|
+
className: clsx7__default.default(
|
|
2142
|
+
styles.icon,
|
|
2143
|
+
"flex justify-center items-center"
|
|
2144
|
+
),
|
|
2145
|
+
children: icon
|
|
2146
|
+
}
|
|
2147
|
+
),
|
|
2148
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2150
|
+
IntlCurrencyInput2,
|
|
2151
|
+
{
|
|
2152
|
+
...inputProps,
|
|
2153
|
+
...field,
|
|
2154
|
+
type: "text",
|
|
2155
|
+
ref: inputRef,
|
|
2156
|
+
className: clsx7__default.default({
|
|
2157
|
+
[styles.input]: true,
|
|
2158
|
+
["pr-10"]: clearField,
|
|
2159
|
+
["pr-2"]: !clearField,
|
|
2160
|
+
["pl-[3rem]"]: icon
|
|
2161
|
+
}),
|
|
2162
|
+
placeholder: !label && placeholder ? placeholder : " ",
|
|
2163
|
+
onClick,
|
|
2164
|
+
disabled,
|
|
2165
|
+
currency: "BRL",
|
|
2166
|
+
config: currencyConfig,
|
|
2167
|
+
onChange: handleChange,
|
|
2168
|
+
max: maxLength
|
|
2169
|
+
}
|
|
2170
|
+
),
|
|
2171
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2172
|
+
"label",
|
|
2173
|
+
{
|
|
2174
|
+
className: clsx7__default.default(
|
|
2175
|
+
{
|
|
2176
|
+
[styles.label]: true,
|
|
2177
|
+
["left-[3rem]"]: icon,
|
|
2178
|
+
["left-2.5"]: !icon
|
|
2179
|
+
},
|
|
2180
|
+
"cursor-text"
|
|
2181
|
+
),
|
|
2182
|
+
onClick: () => input == null ? void 0 : input.focus(),
|
|
2183
|
+
children: [
|
|
2184
|
+
label,
|
|
2185
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-500", children: "\xA0*" })
|
|
2186
|
+
]
|
|
2187
|
+
}
|
|
2188
|
+
)
|
|
2189
|
+
] })
|
|
2190
|
+
] }),
|
|
2191
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2192
|
+
"div",
|
|
2193
|
+
{
|
|
2194
|
+
className: "text-dangerous-500 text-xs mt-1 ml-[2px]",
|
|
2195
|
+
role: "alert",
|
|
2196
|
+
"aria-label": message,
|
|
2197
|
+
children: message
|
|
2198
|
+
},
|
|
2199
|
+
index
|
|
2200
|
+
))
|
|
2201
|
+
] });
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
);
|
|
2205
|
+
}
|
|
2206
|
+
InputPercentage.displayName = "InputPercentage";
|
|
2207
|
+
var MaskedInput = ({
|
|
2208
|
+
type = "text",
|
|
2209
|
+
name,
|
|
2210
|
+
label,
|
|
2211
|
+
placeholder,
|
|
2212
|
+
error,
|
|
2213
|
+
mask,
|
|
2214
|
+
control,
|
|
2215
|
+
required,
|
|
2216
|
+
onKeyUp,
|
|
2217
|
+
maskChar = "",
|
|
2218
|
+
alwaysShowMask,
|
|
2219
|
+
defaultValue,
|
|
2220
|
+
disabled
|
|
2221
|
+
}) => {
|
|
2222
|
+
const ref = React2.useRef(null);
|
|
2223
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2224
|
+
reactHookForm.Controller,
|
|
2225
|
+
{
|
|
2226
|
+
name,
|
|
2227
|
+
control,
|
|
2228
|
+
defaultValue,
|
|
2229
|
+
render: ({ field }) => {
|
|
2230
|
+
const beforeMaskedValueChange = (states) => {
|
|
2231
|
+
const { nextState, previousState } = states;
|
|
2232
|
+
var { value } = nextState;
|
|
2233
|
+
var selection = nextState.selection;
|
|
2234
|
+
var cursorPosition = selection ? selection.start : null;
|
|
2235
|
+
var chars = [".", "-", "/", "(", ")", " "];
|
|
2236
|
+
var words = [...value];
|
|
2237
|
+
if (chars.includes(words[words.length - 1])) {
|
|
2238
|
+
if (cursorPosition === value.length) {
|
|
2239
|
+
cursorPosition--;
|
|
2240
|
+
selection = {
|
|
2241
|
+
start: cursorPosition,
|
|
2242
|
+
end: cursorPosition
|
|
2243
|
+
};
|
|
2244
|
+
}
|
|
2245
|
+
value = value.slice(0, -1);
|
|
2246
|
+
}
|
|
2247
|
+
return {
|
|
2248
|
+
value,
|
|
2249
|
+
selection
|
|
2250
|
+
};
|
|
2251
|
+
};
|
|
2252
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2253
|
+
InputMask__default.default,
|
|
2254
|
+
{
|
|
2255
|
+
...field,
|
|
2256
|
+
onKeyUp,
|
|
2257
|
+
disabled,
|
|
2258
|
+
mask,
|
|
2259
|
+
value: field.value || "",
|
|
2260
|
+
onChange: field.onChange,
|
|
2261
|
+
maskChar,
|
|
2262
|
+
alwaysShowMask,
|
|
2263
|
+
beforeMaskedStateChange: beforeMaskedValueChange,
|
|
2264
|
+
children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2265
|
+
Input,
|
|
2266
|
+
{
|
|
2267
|
+
onKeyUp,
|
|
2268
|
+
type,
|
|
2269
|
+
label,
|
|
2270
|
+
placeholder,
|
|
2271
|
+
required,
|
|
2272
|
+
inputProps,
|
|
2273
|
+
error,
|
|
2274
|
+
name,
|
|
2275
|
+
disabled,
|
|
2276
|
+
ref
|
|
2277
|
+
}
|
|
2278
|
+
)
|
|
2279
|
+
}
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
);
|
|
2284
|
+
};
|
|
2285
|
+
var Modal = ReactModalNamespace__namespace.default || ReactModalNamespace__namespace;
|
|
2286
|
+
var alertTypes = {
|
|
2287
|
+
success: "text-success-500",
|
|
2288
|
+
error: "text-dangerous-500",
|
|
2289
|
+
warning: "text-warning-500",
|
|
2290
|
+
info: "text-blue-500",
|
|
2291
|
+
primary: "text-rose-700"
|
|
2292
|
+
};
|
|
2293
|
+
var sizes2 = {
|
|
2294
|
+
xs: "w-[350px]",
|
|
2295
|
+
sm: "w-[662px]",
|
|
2296
|
+
md: "w-[960px]",
|
|
2297
|
+
lg: "w-[80%] min-w-[800px]",
|
|
2298
|
+
null: ""
|
|
2299
|
+
};
|
|
2300
|
+
var ModalDialog = ({
|
|
2301
|
+
open,
|
|
2302
|
+
onOpen = () => {
|
|
2303
|
+
},
|
|
2304
|
+
onClose,
|
|
2305
|
+
onCancel,
|
|
2306
|
+
triggerButton,
|
|
2307
|
+
confirmButton,
|
|
2308
|
+
title,
|
|
2309
|
+
cancelButton,
|
|
2310
|
+
icon,
|
|
2311
|
+
alertType,
|
|
2312
|
+
size = "sm",
|
|
2313
|
+
info,
|
|
2314
|
+
description,
|
|
2315
|
+
children
|
|
2316
|
+
}) => {
|
|
2317
|
+
const customStyles2 = {
|
|
2318
|
+
content: {
|
|
2319
|
+
top: "50%",
|
|
2320
|
+
left: "50%",
|
|
2321
|
+
right: "auto",
|
|
2322
|
+
bottom: "auto",
|
|
2323
|
+
marginRight: "-50%",
|
|
2324
|
+
transform: "translate(-50%, -50%)",
|
|
2325
|
+
border: "1px solid #E8E8E9",
|
|
2326
|
+
padding: "24px",
|
|
2327
|
+
borderRadius: "8px",
|
|
2328
|
+
overflow: "initial"
|
|
2329
|
+
},
|
|
2330
|
+
overlay: {
|
|
2331
|
+
backgroundColor: "rgb(107,114,128,0.50)",
|
|
2332
|
+
zIndex: 9999
|
|
2333
|
+
}
|
|
2334
|
+
};
|
|
2335
|
+
const trigger = triggerButton ? React2.cloneElement(triggerButton, {
|
|
2336
|
+
onClick: () => {
|
|
2337
|
+
onOpen();
|
|
2338
|
+
}
|
|
2339
|
+
}) : null;
|
|
2340
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2341
|
+
trigger,
|
|
2342
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2343
|
+
Modal,
|
|
2344
|
+
{
|
|
2345
|
+
ariaHideApp: false,
|
|
2346
|
+
isOpen: open,
|
|
2347
|
+
onRequestClose: onClose,
|
|
2348
|
+
style: customStyles2,
|
|
2349
|
+
contentLabel: "Example Modal",
|
|
2350
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx7__default.default(sizes2[size]), children: [
|
|
2351
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-2 border-b border-b-neutral-200 flex items-center justify-between", children: [
|
|
2352
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-[24px] font-bold flex items-center gap-2", children: [
|
|
2353
|
+
alertType && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx7__default.default([alertTypes[alertType]], "text-[30px]"), children: icon }),
|
|
2354
|
+
title
|
|
2355
|
+
] }),
|
|
2356
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onCancel, className: "text-neutral-500 text-[24px]", children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-times" }) })
|
|
2357
|
+
] }),
|
|
2358
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children }),
|
|
2359
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-6 border-t border-t-neutral-200 flex w-full items-center justify-between", children: [
|
|
2360
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2361
|
+
"div",
|
|
2362
|
+
{
|
|
2363
|
+
className: clsx7__default.default({
|
|
2364
|
+
["flex-1"]: info
|
|
2365
|
+
}),
|
|
2366
|
+
children: info
|
|
2367
|
+
}
|
|
2368
|
+
),
|
|
2369
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse md:flex-row gap-3 items-center md:justify-end w-full md:w-auto", children: [
|
|
2370
|
+
cancelButton || /* @__PURE__ */ jsxRuntime.jsx(
|
|
2371
|
+
Button,
|
|
2372
|
+
{
|
|
2373
|
+
onClick: () => {
|
|
2374
|
+
if (onCancel) {
|
|
2375
|
+
onCancel();
|
|
2376
|
+
}
|
|
2377
|
+
},
|
|
2378
|
+
variant: "secondary",
|
|
2379
|
+
size: "sm",
|
|
2380
|
+
children: "Cancelar"
|
|
2381
|
+
}
|
|
2382
|
+
),
|
|
2383
|
+
confirmButton
|
|
2384
|
+
] })
|
|
2385
|
+
] })
|
|
2386
|
+
] })
|
|
2387
|
+
}
|
|
2388
|
+
)
|
|
2389
|
+
] });
|
|
2390
|
+
};
|
|
2391
|
+
var Popover3 = ({
|
|
2392
|
+
id,
|
|
2393
|
+
displayArrow = true,
|
|
2394
|
+
openOnClick = false
|
|
2395
|
+
}) => {
|
|
2396
|
+
const style = {
|
|
2397
|
+
noArrow: "hidden"
|
|
2398
|
+
};
|
|
2399
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2400
|
+
reactTooltip.Tooltip,
|
|
2401
|
+
{
|
|
2402
|
+
id,
|
|
2403
|
+
className: "absolute bg-neutral-700 text-sm text-neutral-100 py-2 px-4 max-w-[430px] break-words whitespace-normal",
|
|
2404
|
+
classNameArrow: !displayArrow ? style.noArrow : "",
|
|
2405
|
+
openOnClick,
|
|
2406
|
+
delayHide: 0,
|
|
2407
|
+
delayShow: 0
|
|
2408
|
+
}
|
|
2409
|
+
) });
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
// src/components/Select/Select.styles.ts
|
|
2413
|
+
var customStyles = {
|
|
2414
|
+
indicatorSeparator: (provided, props) => {
|
|
2415
|
+
var _a;
|
|
2416
|
+
return {
|
|
2417
|
+
...provided,
|
|
2418
|
+
backgroundColor: props.hasValue && ((_a = provided == null ? void 0 : provided.selectProps) == null ? void 0 : _a.isSearchable) ? "var(--input)" : "transparent"
|
|
2419
|
+
};
|
|
2420
|
+
},
|
|
2421
|
+
clearIndicator: (provided) => ({
|
|
2422
|
+
...provided,
|
|
2423
|
+
color: "var(--label)",
|
|
2424
|
+
":hover": {
|
|
2425
|
+
color: "var(--label)"
|
|
2426
|
+
}
|
|
2427
|
+
}),
|
|
2428
|
+
dropdownIndicator: (provided, state) => {
|
|
2429
|
+
var _a;
|
|
2430
|
+
return {
|
|
2431
|
+
...provided,
|
|
2432
|
+
color: "var(--paragraph)",
|
|
2433
|
+
transform: ((_a = state == null ? void 0 : state.selectProps) == null ? void 0 : _a.menuIsOpen) ? "rotate(180deg)" : "rotate(0)",
|
|
2434
|
+
":hover": {
|
|
2435
|
+
color: "var(--paragraph)"
|
|
2436
|
+
}
|
|
2437
|
+
};
|
|
2438
|
+
},
|
|
2439
|
+
input: (provided, state) => ({
|
|
2440
|
+
...provided,
|
|
2441
|
+
paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
|
|
2442
|
+
paddingTop: state.selectProps.hasLabel ? "10px" : "0px"
|
|
2443
|
+
}),
|
|
2444
|
+
menu: (provided) => ({
|
|
2445
|
+
...provided,
|
|
2446
|
+
marginTop: "4px",
|
|
2447
|
+
border: "1px solid var(--neutral-300)",
|
|
2448
|
+
boxShadow: "none",
|
|
2449
|
+
borderRadius: "8px",
|
|
2450
|
+
background: "white",
|
|
2451
|
+
zIndex: 20
|
|
2452
|
+
}),
|
|
2453
|
+
menuList: (provided) => ({
|
|
2454
|
+
...provided,
|
|
2455
|
+
padding: "8px"
|
|
2456
|
+
}),
|
|
2457
|
+
singleValue: (base, state) => ({
|
|
2458
|
+
...base,
|
|
2459
|
+
paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
|
|
2460
|
+
paddingTop: state.selectProps.hasLabel ? "10px" : "0",
|
|
2461
|
+
color: state.data.value === "active" ? "#0EAF86" : state.selectProps.hasError ? "var(--dangerous-500)" : "black",
|
|
2462
|
+
display: "flex"
|
|
2463
|
+
}),
|
|
2464
|
+
control: (provided, state) => ({
|
|
2465
|
+
...provided,
|
|
2466
|
+
cursor: "pointer",
|
|
2467
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--dark-blue-300)",
|
|
2468
|
+
boxShadow: "none",
|
|
2469
|
+
outline: "none",
|
|
2470
|
+
borderRadius: "0.5rem",
|
|
2471
|
+
placeholder: " ",
|
|
2472
|
+
height: state.selectProps.smallField ? "30px" : "46px",
|
|
2473
|
+
backgroundColor: state.isDisabled ? "var(--light-100)" : "white",
|
|
2474
|
+
":hover": {
|
|
2475
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--neutral-300)"
|
|
2476
|
+
}
|
|
2477
|
+
}),
|
|
2478
|
+
multiValue: (provided) => ({
|
|
2479
|
+
...provided,
|
|
2480
|
+
borderRadius: "20px",
|
|
2481
|
+
backgroundColor: "var(--neutral-100)",
|
|
2482
|
+
padding: "0px 8px"
|
|
2483
|
+
}),
|
|
2484
|
+
multiValueLabel: (provided) => ({
|
|
2485
|
+
...provided,
|
|
2486
|
+
color: "var(--paragraph)"
|
|
2487
|
+
}),
|
|
2488
|
+
multiValueRemove: (provided) => ({
|
|
2489
|
+
...provided,
|
|
2490
|
+
color: "var(--neutral-400)",
|
|
2491
|
+
":hover": {
|
|
2492
|
+
color: "var(--dangerous-500)"
|
|
2493
|
+
}
|
|
2494
|
+
}),
|
|
2495
|
+
option: (provided, state) => {
|
|
2496
|
+
let color = state.isSelected ? "white" : (state == null ? void 0 : state.isDisabled) ? "var(--label)" : "var(--paragraph)";
|
|
2497
|
+
return {
|
|
2498
|
+
...provided,
|
|
2499
|
+
cursor: state.isDisabled ? "auto" : "pointer",
|
|
2500
|
+
pointerEvents: state.isDisabled ? "none" : "",
|
|
2501
|
+
borderRadius: "8px",
|
|
2502
|
+
margin: "4px 0px",
|
|
2503
|
+
padding: "12px",
|
|
2504
|
+
backgroundColor: state.isSelected ? "var(--blue-500)" : "white",
|
|
2505
|
+
color,
|
|
2506
|
+
fontWeight: state.isSelected ? 700 : 400,
|
|
2507
|
+
"&:hover": {
|
|
2508
|
+
backgroundColor: state.isSelected ? "var(--blue-500)" : "var(--neutral-200)"
|
|
2509
|
+
},
|
|
2510
|
+
"&:active": {
|
|
2511
|
+
backgroundColor: "var(--blue-500)",
|
|
2512
|
+
color: "white",
|
|
2513
|
+
fontWeight: 700
|
|
2514
|
+
},
|
|
2515
|
+
"&:active i": {
|
|
2516
|
+
color: "white",
|
|
2517
|
+
fontWeight: 700
|
|
2518
|
+
},
|
|
2519
|
+
" i": {
|
|
2520
|
+
color: "white"
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
},
|
|
2524
|
+
container: (provided) => ({
|
|
2525
|
+
...provided,
|
|
2526
|
+
border: "none",
|
|
2527
|
+
outline: "none",
|
|
2528
|
+
boxShadow: "none",
|
|
2529
|
+
padding: "none",
|
|
2530
|
+
margin: "none"
|
|
2531
|
+
})
|
|
2532
|
+
};
|
|
2533
|
+
var SelectField = ({
|
|
2534
|
+
name,
|
|
2535
|
+
error,
|
|
2536
|
+
label,
|
|
2537
|
+
defaultValue,
|
|
2538
|
+
control,
|
|
2539
|
+
placeholder,
|
|
2540
|
+
isSearchable = false,
|
|
2541
|
+
isClearable = false,
|
|
2542
|
+
onChange,
|
|
2543
|
+
required,
|
|
2544
|
+
debounce = 0,
|
|
2545
|
+
filterOptions,
|
|
2546
|
+
optionsList,
|
|
2547
|
+
disabled,
|
|
2548
|
+
onChangeValue,
|
|
2549
|
+
resize = true,
|
|
2550
|
+
optionStyle,
|
|
2551
|
+
valueStyle,
|
|
2552
|
+
icon,
|
|
2553
|
+
emptyMessage,
|
|
2554
|
+
small = false
|
|
2555
|
+
}) => {
|
|
2556
|
+
var _a;
|
|
2557
|
+
const { Option, DropdownIndicator, ClearIndicator, SingleValue } = reactSelect.components;
|
|
2558
|
+
const selectRef = React2.useRef(null);
|
|
2559
|
+
const [inputValue, setInputValue] = React2.useState("");
|
|
2560
|
+
const [loading, setLoading] = React2.useState(false);
|
|
2561
|
+
const [options, setOptions] = React2.useState(() => optionsList || []);
|
|
2562
|
+
const [availableHeight, setAvailableHeight] = React2.useState(300);
|
|
2563
|
+
const [isFocused, setIsFocused] = React2.useState(false);
|
|
2564
|
+
React2.useEffect(() => {
|
|
2565
|
+
const updateAvailableHeight = () => {
|
|
2566
|
+
var _a2, _b;
|
|
2567
|
+
if ((_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.getBoundingClientRect) {
|
|
2568
|
+
const rect = (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
2569
|
+
const bottomSpace = window.innerHeight - rect.bottom;
|
|
2570
|
+
const margin = bottomSpace - 24;
|
|
2571
|
+
setAvailableHeight(margin < 250 ? 276 : margin);
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
updateAvailableHeight();
|
|
2575
|
+
window.addEventListener("resize", updateAvailableHeight);
|
|
2576
|
+
return () => {
|
|
2577
|
+
window.removeEventListener("resize", updateAvailableHeight);
|
|
2578
|
+
};
|
|
2579
|
+
}, [selectRef]);
|
|
2580
|
+
const loadOptions = (inputValue2) => {
|
|
2581
|
+
setLoading(true);
|
|
2582
|
+
if (isSearchable && filterOptions) {
|
|
2583
|
+
if (debounce && inputValue2.length >= debounce || !debounce) {
|
|
2584
|
+
const result = filterOptions(inputValue2);
|
|
2585
|
+
setLoading(false);
|
|
2586
|
+
return result;
|
|
2587
|
+
}
|
|
2588
|
+
} else {
|
|
2589
|
+
setOptions(optionsList);
|
|
2590
|
+
}
|
|
2591
|
+
};
|
|
2592
|
+
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
2593
|
+
const fieldValidationMessages = [
|
|
2594
|
+
(_a = fieldValidation[name]) == null ? void 0 : _a.message,
|
|
2595
|
+
error == null ? void 0 : error.message
|
|
2596
|
+
];
|
|
2597
|
+
const hasError = {
|
|
2598
|
+
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
2599
|
+
};
|
|
2600
|
+
const smallField = {
|
|
2601
|
+
smallField: small
|
|
2602
|
+
};
|
|
2603
|
+
const hasLabel = {
|
|
2604
|
+
hasLabel: (label == null ? void 0 : label.length) > 0
|
|
2605
|
+
};
|
|
2606
|
+
const menuHeight = resize ? {
|
|
2607
|
+
menuHeight: availableHeight
|
|
2608
|
+
} : null;
|
|
2609
|
+
const hasIcon = {
|
|
2610
|
+
hasIcon: icon
|
|
2611
|
+
};
|
|
2612
|
+
React2.useEffect(() => {
|
|
2613
|
+
setOptions(() => optionsList);
|
|
2614
|
+
}, [optionsList]);
|
|
2615
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2616
|
+
reactHookForm.Controller,
|
|
2617
|
+
{
|
|
2618
|
+
name,
|
|
2619
|
+
control,
|
|
2620
|
+
defaultValue,
|
|
2621
|
+
render: ({ field }) => {
|
|
2622
|
+
const CustomSingleValue = (props) => {
|
|
2623
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SingleValue, { ...props, children: valueStyle ? valueStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2624
|
+
props.data.label,
|
|
2625
|
+
" "
|
|
2626
|
+
] }) });
|
|
2627
|
+
};
|
|
2628
|
+
const IconOption = (props) => {
|
|
2629
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Option, { ...props, children: optionStyle ? optionStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2630
|
+
"div",
|
|
2631
|
+
{
|
|
2632
|
+
style: {
|
|
2633
|
+
display: "flex",
|
|
2634
|
+
alignItems: "center",
|
|
2635
|
+
justifyContent: "space-between"
|
|
2636
|
+
},
|
|
2637
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx7__default.default("text-p-md focus:text-white"), children: props.data.label })
|
|
2638
|
+
}
|
|
2639
|
+
) });
|
|
2640
|
+
};
|
|
2641
|
+
const LoadingMessage = (props) => {
|
|
2642
|
+
if (!debounce || debounce && inputValue.length >= debounce) {
|
|
2643
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2644
|
+
"div",
|
|
2645
|
+
{
|
|
2646
|
+
...props.innerProps,
|
|
2647
|
+
className: "flex items-center gap-[6px] p-2",
|
|
2648
|
+
children: [
|
|
2649
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2650
|
+
"img",
|
|
2651
|
+
{
|
|
2652
|
+
className: "animate-spin ",
|
|
2653
|
+
src: "/spinner.svg",
|
|
2654
|
+
alt: "circle",
|
|
2655
|
+
width: 16,
|
|
2656
|
+
height: 16
|
|
2657
|
+
}
|
|
2658
|
+
),
|
|
2659
|
+
"Buscando..."
|
|
2660
|
+
]
|
|
2661
|
+
}
|
|
2662
|
+
);
|
|
2663
|
+
} else if (debounce && inputValue.length < debounce) {
|
|
2664
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
2665
|
+
"Digite ",
|
|
2666
|
+
debounce,
|
|
2667
|
+
" ou mais caracteres para pesquisar"
|
|
2668
|
+
] });
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
const NoOptionsMessage = (props) => {
|
|
2672
|
+
var _a2;
|
|
2673
|
+
if (props.selectProps.inputValue.length == 0 && debounce > 0 || debounce > 0 && props.selectProps.inputValue.length < debounce) {
|
|
2674
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-dangerous-500 text-sm", children: [
|
|
2675
|
+
"Digite ",
|
|
2676
|
+
debounce,
|
|
2677
|
+
" ou mais caracteres para pesquisar"
|
|
2678
|
+
] });
|
|
2679
|
+
} else if (props.selectProps.inputValue.length > 0 && ((_a2 = props == null ? void 0 : props.options) == null ? void 0 : _a2.length) == 0) {
|
|
2680
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-dangerous-500 text-sm", children: "Nenhum dado encontrado" });
|
|
2681
|
+
}
|
|
2682
|
+
};
|
|
2683
|
+
const DropdownIndicatorCustom = (props) => {
|
|
2684
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2685
|
+
"i",
|
|
2686
|
+
{
|
|
2687
|
+
className: `uil uil-angle-down text-[20px] ${small ? "h-[20px] -mt-[7px]" : "h-full"}`
|
|
2688
|
+
}
|
|
2689
|
+
) });
|
|
2690
|
+
};
|
|
2691
|
+
const ClearIndicatorCustom = (props) => {
|
|
2692
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ClearIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-times text-[16px]" }) });
|
|
2693
|
+
};
|
|
2694
|
+
const onChange2 = (value) => {
|
|
2695
|
+
field.onChange(value);
|
|
2696
|
+
if (onChangeValue) {
|
|
2697
|
+
onChangeValue(value);
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2700
|
+
const handleKeyDown = async (event) => {
|
|
2701
|
+
var _a2;
|
|
2702
|
+
if (event.key === "Enter") {
|
|
2703
|
+
event.preventDefault();
|
|
2704
|
+
const fetchedOptions = await loadOptions((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.value);
|
|
2705
|
+
if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
|
|
2706
|
+
onChange2(fetchedOptions[0]);
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
};
|
|
2710
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", id: "select", ref: selectRef, children: [
|
|
2711
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2712
|
+
"div",
|
|
2713
|
+
{
|
|
2714
|
+
className: clsx7__default.default(
|
|
2715
|
+
"z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",
|
|
2716
|
+
{
|
|
2717
|
+
"text-blue-500": isFocused && hasIcon.hasIcon,
|
|
2718
|
+
"text-red-500": hasError.hasError && hasIcon.hasIcon
|
|
2719
|
+
}
|
|
2720
|
+
),
|
|
2721
|
+
children: icon
|
|
2722
|
+
}
|
|
2723
|
+
),
|
|
2724
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2725
|
+
AsyncSelect__default.default,
|
|
2726
|
+
{
|
|
2727
|
+
onKeyDown: handleKeyDown,
|
|
2728
|
+
...field,
|
|
2729
|
+
...hasError,
|
|
2730
|
+
...hasLabel,
|
|
2731
|
+
...menuHeight,
|
|
2732
|
+
...hasIcon,
|
|
2733
|
+
...smallField,
|
|
2734
|
+
isDisabled: disabled,
|
|
2735
|
+
onFocus: () => setIsFocused(true),
|
|
2736
|
+
onBlur: () => setIsFocused(false),
|
|
2737
|
+
loadingMessage: () => /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Carregando" }),
|
|
2738
|
+
isLoading: loading,
|
|
2739
|
+
defaultOptions: debounce > 0 ? false : optionsList ? options : true,
|
|
2740
|
+
loadOptions,
|
|
2741
|
+
name: field.name,
|
|
2742
|
+
isClearable,
|
|
2743
|
+
styles: customStyles,
|
|
2744
|
+
placeholder: placeholder || " ",
|
|
2745
|
+
isSearchable,
|
|
2746
|
+
options,
|
|
2747
|
+
tabSelectsValue: true,
|
|
2748
|
+
components: {
|
|
2749
|
+
SingleValue: CustomSingleValue,
|
|
2750
|
+
ValueContainer,
|
|
2751
|
+
Option: IconOption,
|
|
2752
|
+
LoadingIndicator: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
2753
|
+
LoadingMessage,
|
|
2754
|
+
NoOptionsMessage,
|
|
2755
|
+
DropdownIndicator: DropdownIndicatorCustom,
|
|
2756
|
+
ClearIndicator: ClearIndicatorCustom
|
|
2757
|
+
},
|
|
2758
|
+
closeMenuOnSelect: true,
|
|
2759
|
+
hideSelectedOptions: false,
|
|
2760
|
+
onChange: onChange2
|
|
2761
|
+
}
|
|
2762
|
+
),
|
|
2763
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2764
|
+
"span",
|
|
2765
|
+
{
|
|
2766
|
+
className: clsx7__default.default(
|
|
2767
|
+
"text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",
|
|
2768
|
+
{
|
|
2769
|
+
"scale-75 -translate-y-3": field.value || inputValue,
|
|
2770
|
+
"ml-[35px]": hasIcon.hasIcon,
|
|
2771
|
+
"ml-[2px]": !hasIcon.hasIcon,
|
|
2772
|
+
"top-2.5": !(field.value || inputValue),
|
|
2773
|
+
"top-0": field.value || inputValue
|
|
2774
|
+
}
|
|
2775
|
+
),
|
|
2776
|
+
children: [
|
|
2777
|
+
label,
|
|
2778
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-700", children: "\xA0*" })
|
|
2779
|
+
]
|
|
2780
|
+
}
|
|
2781
|
+
),
|
|
2782
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2783
|
+
"div",
|
|
2784
|
+
{
|
|
2785
|
+
style: { color: "var(--dangerous-700)" },
|
|
2786
|
+
className: "text-xs ml-[2px]",
|
|
2787
|
+
role: "alert",
|
|
2788
|
+
"aria-label": message,
|
|
2789
|
+
children: message
|
|
2790
|
+
},
|
|
2791
|
+
index
|
|
2792
|
+
))
|
|
2793
|
+
] });
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
);
|
|
2797
|
+
};
|
|
2798
|
+
var ValueContainer = ({ children, ...props }) => {
|
|
2799
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSelect.components.ValueContainer, { ...props, children });
|
|
2800
|
+
};
|
|
2801
|
+
var Radio = ({
|
|
2802
|
+
disabled,
|
|
2803
|
+
control,
|
|
2804
|
+
name,
|
|
2805
|
+
label,
|
|
2806
|
+
defaultChecked
|
|
2807
|
+
}) => {
|
|
2808
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2809
|
+
reactHookForm.Controller,
|
|
2810
|
+
{
|
|
2811
|
+
name,
|
|
2812
|
+
control,
|
|
2813
|
+
render: ({ field }) => {
|
|
2814
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
2815
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "custom-radio flex items-center", children: [
|
|
2816
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2817
|
+
"input",
|
|
2818
|
+
{
|
|
2819
|
+
name,
|
|
2820
|
+
id: name,
|
|
2821
|
+
type: "radio",
|
|
2822
|
+
className: "",
|
|
2823
|
+
onClick: (e) => {
|
|
2824
|
+
field.onChange(e.target.value);
|
|
2825
|
+
},
|
|
2826
|
+
defaultChecked,
|
|
2827
|
+
disabled
|
|
2828
|
+
}
|
|
2829
|
+
),
|
|
2830
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", {})
|
|
2831
|
+
] }),
|
|
2832
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: name, className: "text-p-md cursor-pointer -pt-1", children: label })
|
|
2833
|
+
] });
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
);
|
|
2837
|
+
};
|
|
2838
|
+
var { Group, Label } = react.Switch;
|
|
2839
|
+
function classNames(...classes) {
|
|
2840
|
+
return classes.filter(Boolean).join(" ");
|
|
2841
|
+
}
|
|
2842
|
+
var Toggle = ({
|
|
2843
|
+
name,
|
|
2844
|
+
label,
|
|
2845
|
+
subLabel,
|
|
2846
|
+
control,
|
|
2847
|
+
disabled
|
|
2848
|
+
}) => {
|
|
2849
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Group, { as: "div", className: "flex items-center", children: [
|
|
2850
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2851
|
+
reactHookForm.Controller,
|
|
2852
|
+
{
|
|
2853
|
+
control,
|
|
2854
|
+
name,
|
|
2855
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2856
|
+
react.Switch,
|
|
2857
|
+
{
|
|
2858
|
+
disabled,
|
|
2859
|
+
...field,
|
|
2860
|
+
className: "h-[18px] w-[33px] focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-full",
|
|
2861
|
+
checked: Boolean(field.value),
|
|
2862
|
+
onChange: (value) => {
|
|
2863
|
+
field.onChange(value);
|
|
2864
|
+
},
|
|
2865
|
+
children: ({ checked }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2866
|
+
"div",
|
|
2867
|
+
{
|
|
2868
|
+
className: classNames(
|
|
2869
|
+
checked ? "bg-blue-500" : "bg-neutral-200",
|
|
2870
|
+
"relative inline-flex h-[18px] p-[2px] w-[33px] flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out "
|
|
2871
|
+
),
|
|
2872
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2873
|
+
"span",
|
|
2874
|
+
{
|
|
2875
|
+
className: classNames(
|
|
2876
|
+
"pointer-events-none relative inline-block -top-[2px] right-[2px] h-[14px] w-[14px] transform rounded-full shadow ring-0 transition duration-200 ease-in-out",
|
|
2877
|
+
checked ? "translate-x-[15px]" : "translate-x-0",
|
|
2878
|
+
disabled ? "bg-neutral-300" : "bg-white"
|
|
2879
|
+
),
|
|
2880
|
+
children: [
|
|
2881
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2882
|
+
"span",
|
|
2883
|
+
{
|
|
2884
|
+
className: classNames(
|
|
2885
|
+
checked ? "opacity-0 ease-out duration-100" : "opacity-100 ease-in duration-200",
|
|
2886
|
+
"absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"
|
|
2887
|
+
),
|
|
2888
|
+
"aria-hidden": "true"
|
|
2889
|
+
}
|
|
2890
|
+
),
|
|
2891
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2892
|
+
"span",
|
|
2893
|
+
{
|
|
2894
|
+
className: classNames(
|
|
2895
|
+
checked ? "opacity-100 ease-in duration-200" : "opacity-0 ease-out duration-100",
|
|
2896
|
+
"absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"
|
|
2897
|
+
),
|
|
2898
|
+
"aria-hidden": "true"
|
|
2899
|
+
}
|
|
2900
|
+
)
|
|
2901
|
+
]
|
|
2902
|
+
}
|
|
2903
|
+
)
|
|
2904
|
+
}
|
|
2905
|
+
)
|
|
2906
|
+
}
|
|
2907
|
+
)
|
|
2908
|
+
}
|
|
2909
|
+
),
|
|
2910
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(Label, { as: "span", className: "flex flex-col gap-1 ml-2 cursor-pointer", children: [
|
|
2911
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-paragraph", children: label }),
|
|
2912
|
+
subLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: subLabel })
|
|
2913
|
+
] })
|
|
2914
|
+
] });
|
|
2915
|
+
};
|
|
2916
|
+
function PaginationSelect({
|
|
2917
|
+
pageSizeOptions,
|
|
2918
|
+
table
|
|
2919
|
+
}) {
|
|
2920
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2921
|
+
const pageCount = table == null ? void 0 : table.getPageCount();
|
|
2922
|
+
const pagesArray = pageCount ? [...Array(pageCount)] : [];
|
|
2923
|
+
const options = pagesArray == null ? void 0 : pagesArray.map((item, index) => ({
|
|
2924
|
+
id: index,
|
|
2925
|
+
name: index
|
|
2926
|
+
}));
|
|
2927
|
+
const [pageSizeSelected, setPageSizeSelected] = React2.useState({
|
|
2928
|
+
id: ((_a = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a.id) || 20,
|
|
2929
|
+
name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
|
|
2930
|
+
});
|
|
2931
|
+
const [pageSelected, setPageSelected] = React2.useState({
|
|
2932
|
+
id: ((_d = (_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageIndex) || 0,
|
|
2933
|
+
name: ((_f = (_e = table == null ? void 0 : table.getState()) == null ? void 0 : _e.pagination) == null ? void 0 : _f.pageIndex) || 0
|
|
2934
|
+
});
|
|
2935
|
+
const [pagesOptions, setPagesOptions] = React2.useState(() => options);
|
|
2936
|
+
const [pageSizesOptions, setPagesSizesOptions] = React2.useState(
|
|
2937
|
+
pageSizeOptions == null ? void 0 : pageSizeOptions.map((item) => ({
|
|
2938
|
+
id: item,
|
|
2939
|
+
name: item
|
|
2940
|
+
}))
|
|
2941
|
+
);
|
|
2942
|
+
const [query, setQuery] = React2.useState("");
|
|
2943
|
+
const filter = () => {
|
|
2944
|
+
let copy = [...options];
|
|
2945
|
+
setPagesOptions(
|
|
2946
|
+
copy.filter((item) => {
|
|
2947
|
+
return (item.name + 1).toString().startsWith(query);
|
|
2948
|
+
})
|
|
2949
|
+
);
|
|
2950
|
+
};
|
|
2951
|
+
const saveSessionStorage = (key, values) => {
|
|
2952
|
+
sessionStorage.setItem(key, JSON.stringify(values));
|
|
2953
|
+
};
|
|
2954
|
+
React2.useEffect(() => {
|
|
2955
|
+
filter();
|
|
2956
|
+
}, [query]);
|
|
2957
|
+
React2.useEffect(() => {
|
|
2958
|
+
saveSessionStorage("pageSize", pageSizeSelected);
|
|
2959
|
+
table.setPageSize(pageSizeSelected == null ? void 0 : pageSizeSelected.id);
|
|
2960
|
+
table.setPageIndex(0);
|
|
2961
|
+
setPageSelected({
|
|
2962
|
+
id: 0,
|
|
2963
|
+
name: 0
|
|
2964
|
+
});
|
|
2965
|
+
}, [pageSizeSelected]);
|
|
2966
|
+
React2.useEffect(() => {
|
|
2967
|
+
setPagesOptions(
|
|
2968
|
+
pageCount ? [...Array(pageCount)].map((item, index) => ({
|
|
2969
|
+
id: index,
|
|
2970
|
+
name: index
|
|
2971
|
+
})) : []
|
|
2972
|
+
);
|
|
2973
|
+
}, [table == null ? void 0 : table.getPageCount()]);
|
|
2974
|
+
React2.useEffect(() => {
|
|
2975
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
2976
|
+
if (((_b2 = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
|
|
2977
|
+
setPageSelected({
|
|
2978
|
+
id: (_d2 = (_c2 = table == null ? void 0 : table.getState()) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageIndex,
|
|
2979
|
+
name: (_f2 = (_e2 = table == null ? void 0 : table.getState()) == null ? void 0 : _e2.pagination) == null ? void 0 : _f2.pageIndex
|
|
2980
|
+
});
|
|
2981
|
+
}
|
|
2982
|
+
}, [table == null ? void 0 : table.getState().pagination]);
|
|
2983
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden md:flex items-center gap-2", children: [
|
|
2984
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-paragraph", children: [
|
|
2985
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Exibir " }),
|
|
2986
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2987
|
+
react.Combobox,
|
|
2988
|
+
{
|
|
2989
|
+
value: pageSizeSelected,
|
|
2990
|
+
onChange: (value) => {
|
|
2991
|
+
setPageSizeSelected(value);
|
|
2992
|
+
},
|
|
2993
|
+
children: ({ open }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2994
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Button, { className: "flex items-center justify-between w-[70px] h-[42px] text-paragraph outline-none text-p-sm cursor-pointer peer relative shadow-input rounded-lg border p-2 disabled:bg-neutral-100 border-neutral-300", children: [
|
|
2995
|
+
pageSizeSelected == null ? void 0 : pageSizeSelected.name,
|
|
2996
|
+
open ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-up text-base top-[13px] pl-3 cursor-pointer text-label" }) : /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-base top-[13px] pl-3 cursor-pointer text-label" })
|
|
2997
|
+
] }),
|
|
2998
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Options, { className: "w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white", children: pageSizesOptions == null ? void 0 : pageSizesOptions.map((opt) => {
|
|
2999
|
+
const selected = (opt == null ? void 0 : opt.id) === (pageSizeSelected == null ? void 0 : pageSizeSelected.id);
|
|
3000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3001
|
+
react.Combobox.Option,
|
|
3002
|
+
{
|
|
3003
|
+
value: opt,
|
|
3004
|
+
className: clsx7__default.default(
|
|
3005
|
+
"p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
|
|
3006
|
+
{
|
|
3007
|
+
"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
|
|
3008
|
+
},
|
|
3009
|
+
{
|
|
3010
|
+
"hover:bg-neutral-100 text-paragraph": !selected
|
|
3011
|
+
}
|
|
3012
|
+
),
|
|
3013
|
+
children: opt.name
|
|
3014
|
+
},
|
|
3015
|
+
(pageSizeSelected == null ? void 0 : pageSizeSelected.id) + "size"
|
|
3016
|
+
);
|
|
3017
|
+
}) })
|
|
3018
|
+
] })
|
|
3019
|
+
}
|
|
3020
|
+
),
|
|
3021
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: " resultados" })
|
|
3022
|
+
] }),
|
|
3023
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-neutral-300 h-[20px] w-[1px]" }),
|
|
3024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-paragraph", children: [
|
|
3025
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Ir para a p\xE1gina " }),
|
|
3026
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3027
|
+
react.Combobox,
|
|
3028
|
+
{
|
|
3029
|
+
value: pageSelected,
|
|
3030
|
+
onChange: (value) => {
|
|
3031
|
+
if (value && (value == null ? void 0 : value.id)) {
|
|
3032
|
+
setPageSelected({
|
|
3033
|
+
id: value == null ? void 0 : value.id,
|
|
3034
|
+
name: value == null ? void 0 : value.id
|
|
3035
|
+
});
|
|
3036
|
+
saveSessionStorage("pageIndex", value == null ? void 0 : value.id);
|
|
3037
|
+
table.setPageIndex(value == null ? void 0 : value.id);
|
|
3038
|
+
setQuery("");
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
children: ({ open }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3042
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Button, { className: "relative", children: [
|
|
3043
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
|
+
react.Combobox.Input,
|
|
3045
|
+
{
|
|
3046
|
+
as: "input",
|
|
3047
|
+
onKeyDown: (e) => {
|
|
3048
|
+
var _a2;
|
|
3049
|
+
const val = Number((_a2 = e.target) == null ? void 0 : _a2.value);
|
|
3050
|
+
if (e.key == "Enter" && val && val <= pageCount) {
|
|
3051
|
+
setPageSelected({
|
|
3052
|
+
id: val - 1,
|
|
3053
|
+
name: val - 1
|
|
3054
|
+
});
|
|
3055
|
+
saveSessionStorage("pageIndex", val);
|
|
3056
|
+
table.setPageIndex(val - 1);
|
|
3057
|
+
setQuery("");
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
displayValue: (item) => {
|
|
3061
|
+
return pageSelected ? (pageSelected == null ? void 0 : pageSelected.id) + 1 : (item == null ? void 0 : item.id) + 1;
|
|
3062
|
+
},
|
|
3063
|
+
onChange: (e) => {
|
|
3064
|
+
if (e.target.value) {
|
|
3065
|
+
setQuery(e.target.value);
|
|
3066
|
+
}
|
|
3067
|
+
},
|
|
3068
|
+
className: "h-[42px] w-[70px] outline-none text-p-md text-paragraph cursor-pointer border-neutral-300 peer shadow-input rounded-lg border block disabled:bg-neutral-100 p-2"
|
|
3069
|
+
}
|
|
3070
|
+
),
|
|
3071
|
+
open ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-up text-base absolute top-[10px] right-2 cursor-pointer text-label" }) : /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-base absolute top-[10px] right-2 cursor-pointer text-label" })
|
|
3072
|
+
] }),
|
|
3073
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Options, { className: "w-full outline-none max-h-[200px] overflow-auto border-[0.5px] mt-1 color-neutral-300 flex flex-col gap-y-2 p-1 absolute right-0 bottom-12 z-[999] rounded-lg bg-white", children: pagesOptions.map((opt) => {
|
|
3074
|
+
const selected = (opt == null ? void 0 : opt.id) === (pageSelected == null ? void 0 : pageSelected.id);
|
|
3075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3076
|
+
react.Combobox.Option,
|
|
3077
|
+
{
|
|
3078
|
+
value: opt,
|
|
3079
|
+
className: clsx7__default.default(
|
|
3080
|
+
"p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
|
|
3081
|
+
{
|
|
3082
|
+
"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
|
|
3083
|
+
},
|
|
3084
|
+
{
|
|
3085
|
+
"hover:bg-neutral-100 text-paragraph": !selected
|
|
3086
|
+
}
|
|
3087
|
+
),
|
|
3088
|
+
children: (opt == null ? void 0 : opt.name) + 1
|
|
3089
|
+
},
|
|
3090
|
+
(pageSelected == null ? void 0 : pageSelected.id) + "page"
|
|
3091
|
+
);
|
|
3092
|
+
}) })
|
|
3093
|
+
] })
|
|
3094
|
+
}
|
|
3095
|
+
)
|
|
3096
|
+
] })
|
|
3097
|
+
] });
|
|
3098
|
+
}
|
|
3099
|
+
var Table = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3100
|
+
"table",
|
|
3101
|
+
{
|
|
3102
|
+
ref,
|
|
3103
|
+
className: clsx7.clsx(
|
|
3104
|
+
"table-scroll block text-left border-separate border-spacing-0 w-full",
|
|
3105
|
+
className
|
|
3106
|
+
),
|
|
3107
|
+
onScroll: props.onScroll,
|
|
3108
|
+
...props
|
|
3109
|
+
}
|
|
3110
|
+
));
|
|
3111
|
+
Table.displayName = "Table";
|
|
3112
|
+
var TableHeader = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3113
|
+
"thead",
|
|
3114
|
+
{
|
|
3115
|
+
ref,
|
|
3116
|
+
className: clsx7.clsx("w-full sticky top-0 z-[90]", className),
|
|
3117
|
+
...props
|
|
3118
|
+
}
|
|
3119
|
+
));
|
|
3120
|
+
TableHeader.displayName = "TableHeader";
|
|
3121
|
+
var TableBody = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx7.clsx(className), ...props }));
|
|
3122
|
+
TableBody.displayName = "TableBody";
|
|
3123
|
+
var TableFooter = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3124
|
+
"div",
|
|
3125
|
+
{
|
|
3126
|
+
ref,
|
|
3127
|
+
className: clsx7.clsx(
|
|
3128
|
+
" flex flex-col md:flex-row gap-2 md:gap-0 justify-between items-center py-4 px-6 bg-white w-full h-full border border-neutral-200 rounded-t-lg",
|
|
3129
|
+
className
|
|
3130
|
+
),
|
|
3131
|
+
...props
|
|
3132
|
+
}
|
|
3133
|
+
));
|
|
3134
|
+
TableFooter.displayName = "TableFooter";
|
|
3135
|
+
var TableRow = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx7.clsx(className), ...props }));
|
|
3136
|
+
TableRow.displayName = "TableRow";
|
|
3137
|
+
var TableHead = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3138
|
+
"th",
|
|
3139
|
+
{
|
|
3140
|
+
ref,
|
|
3141
|
+
className: clsx7.clsx(
|
|
3142
|
+
{
|
|
3143
|
+
"hover:bg-neutral-100": props.sortable
|
|
3144
|
+
},
|
|
3145
|
+
"text-p-md z-[50] bg-white font-normal text-neutral-700 p-4 text-left border-t border-b border-neutral-200 first:border-l last:border-r first:rounded-tl-lg first:rounded-bl-lg last:rounded-tr-lg last:rounded-br-lg",
|
|
3146
|
+
className
|
|
3147
|
+
),
|
|
3148
|
+
...props
|
|
3149
|
+
}
|
|
3150
|
+
));
|
|
3151
|
+
TableHead.displayName = "TableHead";
|
|
3152
|
+
var TableCell = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3153
|
+
"td",
|
|
3154
|
+
{
|
|
3155
|
+
ref,
|
|
3156
|
+
className: clsx7.clsx(
|
|
3157
|
+
"align-middle h-[80px] border-b border-neutral-200 whitespace-nowrap py-4 px-5",
|
|
3158
|
+
className
|
|
3159
|
+
),
|
|
3160
|
+
...props
|
|
3161
|
+
}
|
|
3162
|
+
));
|
|
3163
|
+
TableCell.displayName = "TableCell";
|
|
3164
|
+
var TableCaption = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3165
|
+
"caption",
|
|
3166
|
+
{
|
|
3167
|
+
ref,
|
|
3168
|
+
className: clsx7.clsx("text-default mt-4 text-sm", className),
|
|
3169
|
+
...props
|
|
3170
|
+
}
|
|
3171
|
+
));
|
|
3172
|
+
TableCaption.displayName = "TableCaption";
|
|
3173
|
+
function DataTablePagination({
|
|
3174
|
+
table,
|
|
3175
|
+
footer = /* @__PURE__ */ jsxRuntime.jsx("div", {}),
|
|
3176
|
+
totalData,
|
|
3177
|
+
selectAllOption,
|
|
3178
|
+
onSelectAll,
|
|
3179
|
+
rowsSelected,
|
|
3180
|
+
onRemoveAll,
|
|
3181
|
+
tableRef,
|
|
3182
|
+
paginationScroll,
|
|
3183
|
+
pageSizeOptions = []
|
|
3184
|
+
}) {
|
|
3185
|
+
var _a, _b, _c, _d, _e;
|
|
3186
|
+
const selectedPage = (_a = table == null ? void 0 : table.getState()) == null ? void 0 : _a.pagination.pageIndex;
|
|
3187
|
+
const results = totalData;
|
|
3188
|
+
const pageCount = table == null ? void 0 : table.getPageCount();
|
|
3189
|
+
const limitPagePositive = ((_b = table == null ? void 0 : table.getState()) == null ? void 0 : _b.pagination.pageIndex) + 2;
|
|
3190
|
+
const limitPageNegative = ((_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination.pageIndex) - 2;
|
|
3191
|
+
const pagesArray = pageCount ? [...Array(pageCount)] : [];
|
|
3192
|
+
const pageRowsCount = ((_e = (_d = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _d.rows) == null ? void 0 : _e.length) || 0;
|
|
3193
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col sticky z-[90] bottom-0", children: [
|
|
3194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3195
|
+
"div",
|
|
3196
|
+
{
|
|
3197
|
+
className: "bg-none overflow-x-hidden md:overflow-x-auto overflow-y-hidden table-scroll rounded-lg relative top-[8px] -space-y-1 z-[302] h-[12px]",
|
|
3198
|
+
onScroll: (evt) => {
|
|
3199
|
+
tableRef == null ? void 0 : tableRef.current.scrollTo({
|
|
3200
|
+
left: evt.currentTarget.scrollLeft
|
|
3201
|
+
});
|
|
3202
|
+
},
|
|
3203
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3204
|
+
"div",
|
|
3205
|
+
{
|
|
3206
|
+
style: {
|
|
3207
|
+
width: paginationScroll ? paginationScroll - 2 : 0
|
|
3208
|
+
},
|
|
3209
|
+
children: "\xA0"
|
|
3210
|
+
}
|
|
3211
|
+
)
|
|
3212
|
+
}
|
|
3213
|
+
),
|
|
3214
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TableFooter, { children: [
|
|
3215
|
+
(pageSizeOptions == null ? void 0 : pageSizeOptions.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(PaginationSelect, { table, pageSizeOptions }),
|
|
3216
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4", children: [
|
|
3217
|
+
footer,
|
|
3218
|
+
selectAllOption && /* @__PURE__ */ jsxRuntime.jsx("div", { children: rowsSelected !== totalData ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "xxs", onClick: onSelectAll, variant: "link", children: [
|
|
3219
|
+
"Selecionar todos os ",
|
|
3220
|
+
totalData
|
|
3221
|
+
] }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "xxs", onClick: onRemoveAll, variant: "link", children: "Desmarcar todos" }) }) })
|
|
3222
|
+
] }),
|
|
3223
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1", children: [
|
|
3224
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-p-md text-paragraph mr-1", children: [
|
|
3225
|
+
"Mostrando ",
|
|
3226
|
+
pageRowsCount,
|
|
3227
|
+
" de ",
|
|
3228
|
+
results,
|
|
3229
|
+
" resultados"
|
|
3230
|
+
] }),
|
|
3231
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3232
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3233
|
+
Button,
|
|
3234
|
+
{
|
|
3235
|
+
onClick: () => table.previousPage(),
|
|
3236
|
+
disabled: !table.getCanPreviousPage(),
|
|
3237
|
+
variant: "icon",
|
|
3238
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-left text-base" }),
|
|
3239
|
+
size: "xs",
|
|
3240
|
+
className: "justify-center"
|
|
3241
|
+
}
|
|
3242
|
+
),
|
|
3243
|
+
limitPageNegative >= 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3244
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3245
|
+
Button,
|
|
3246
|
+
{
|
|
3247
|
+
onClick: () => table.setPageIndex(0),
|
|
3248
|
+
variant: "icon",
|
|
3249
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3250
|
+
"div",
|
|
3251
|
+
{
|
|
3252
|
+
style: {
|
|
3253
|
+
fontSize: "12px",
|
|
3254
|
+
color: "#393C4D"
|
|
3255
|
+
},
|
|
3256
|
+
children: 1
|
|
3257
|
+
}
|
|
3258
|
+
),
|
|
3259
|
+
size: "xs",
|
|
3260
|
+
className: "justify-center"
|
|
3261
|
+
}
|
|
3262
|
+
),
|
|
3263
|
+
limitPageNegative !== 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3264
|
+
Button,
|
|
3265
|
+
{
|
|
3266
|
+
disabled: true,
|
|
3267
|
+
variant: "icon",
|
|
3268
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "..." }),
|
|
3269
|
+
size: "xs",
|
|
3270
|
+
className: "justify-center"
|
|
3271
|
+
}
|
|
3272
|
+
)
|
|
3273
|
+
] }),
|
|
3274
|
+
pagesArray.map((elem, index) => {
|
|
3275
|
+
const checkPageIndexLimit = index <= limitPagePositive && index >= limitPageNegative;
|
|
3276
|
+
const isSelectedPage = index === selectedPage;
|
|
3277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React2.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3278
|
+
Button,
|
|
3279
|
+
{
|
|
3280
|
+
onClick: () => table.setPageIndex(index),
|
|
3281
|
+
className: "font-normal text-xs justify-center",
|
|
3282
|
+
variant: isSelectedPage ? "blue" : "icon",
|
|
3283
|
+
size: "xs",
|
|
3284
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3285
|
+
"div",
|
|
3286
|
+
{
|
|
3287
|
+
style: {
|
|
3288
|
+
fontSize: "12px",
|
|
3289
|
+
color: isSelectedPage ? "#FFF" : "#393C4D"
|
|
3290
|
+
},
|
|
3291
|
+
children: (index + 1).toLocaleString("pt-BR")
|
|
3292
|
+
}
|
|
3293
|
+
)
|
|
3294
|
+
}
|
|
3295
|
+
) }, index + "pagination");
|
|
3296
|
+
}),
|
|
3297
|
+
limitPagePositive + 1 < pageCount && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
3298
|
+
limitPagePositive !== pagesArray.length - 2 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3299
|
+
Button,
|
|
3300
|
+
{
|
|
3301
|
+
disabled: true,
|
|
3302
|
+
variant: "icon",
|
|
3303
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "..." }),
|
|
3304
|
+
size: "xs",
|
|
3305
|
+
className: "justify-center"
|
|
3306
|
+
}
|
|
3307
|
+
),
|
|
3308
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3309
|
+
Button,
|
|
3310
|
+
{
|
|
3311
|
+
onClick: () => table.setPageIndex(pageCount),
|
|
3312
|
+
variant: "icon",
|
|
3313
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3314
|
+
"div",
|
|
3315
|
+
{
|
|
3316
|
+
style: {
|
|
3317
|
+
fontSize: "12px",
|
|
3318
|
+
color: "#393C4D"
|
|
3319
|
+
},
|
|
3320
|
+
children: pageCount.toLocaleString("pt-BR")
|
|
3321
|
+
}
|
|
3322
|
+
),
|
|
3323
|
+
size: "xs",
|
|
3324
|
+
className: "font-normal justify-center"
|
|
3325
|
+
}
|
|
3326
|
+
)
|
|
3327
|
+
] }),
|
|
3328
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3329
|
+
Button,
|
|
3330
|
+
{
|
|
3331
|
+
onClick: () => table.nextPage(),
|
|
3332
|
+
disabled: !table.getCanNextPage(),
|
|
3333
|
+
variant: "icon",
|
|
3334
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-right text-base" }),
|
|
3335
|
+
size: "xs",
|
|
3336
|
+
className: "justify-center"
|
|
3337
|
+
}
|
|
3338
|
+
)
|
|
3339
|
+
] })
|
|
3340
|
+
] })
|
|
3341
|
+
] })
|
|
3342
|
+
] });
|
|
3343
|
+
}
|
|
3344
|
+
var fuzzyFilter = (row, columnId, value, addMeta) => {
|
|
3345
|
+
const itemRank = matchSorterUtils.rankItem(row.getValue(columnId), value);
|
|
3346
|
+
addMeta({
|
|
3347
|
+
itemRank
|
|
3348
|
+
});
|
|
3349
|
+
return itemRank.passed;
|
|
3350
|
+
};
|
|
3351
|
+
function DataTable({
|
|
3352
|
+
columns,
|
|
3353
|
+
tableClass = "",
|
|
3354
|
+
data = [],
|
|
3355
|
+
hidePagination,
|
|
3356
|
+
emptyButtonAction,
|
|
3357
|
+
hideBlankState,
|
|
3358
|
+
renderSubComponent = () => {
|
|
3359
|
+
},
|
|
3360
|
+
footer,
|
|
3361
|
+
borderFull = false,
|
|
3362
|
+
withShadow = true,
|
|
3363
|
+
actionsSelection,
|
|
3364
|
+
backgroundColor,
|
|
3365
|
+
emptyState,
|
|
3366
|
+
totalData = 0,
|
|
3367
|
+
showFilter,
|
|
3368
|
+
placeholder,
|
|
3369
|
+
fetchData,
|
|
3370
|
+
openedSubComponent = false,
|
|
3371
|
+
getRowCanExpand,
|
|
3372
|
+
enableRowSelection,
|
|
3373
|
+
onScroll,
|
|
3374
|
+
tableContainerRef,
|
|
3375
|
+
setRows,
|
|
3376
|
+
selectAllOption,
|
|
3377
|
+
autoPagination,
|
|
3378
|
+
rowClassName,
|
|
3379
|
+
listUpdate,
|
|
3380
|
+
setRowSelection,
|
|
3381
|
+
rowSelection,
|
|
3382
|
+
perPage,
|
|
3383
|
+
pageSizeOptions,
|
|
3384
|
+
onFinishFetch
|
|
3385
|
+
}) {
|
|
3386
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3387
|
+
const tableRef = React2.useRef(null);
|
|
3388
|
+
const [columnVisibility, setColumnVisibility] = React2.useState({});
|
|
3389
|
+
const [columnFilters, setColumnFilters] = React2.useState([]);
|
|
3390
|
+
const [sorting, setSorting] = React2.useState([]);
|
|
3391
|
+
const [arrRowSelected, setArrRowSelected] = React2.useState([]);
|
|
3392
|
+
const [globalFilter, setGlobalFilter] = React2.useState("");
|
|
3393
|
+
const [dataTable, setDataTable] = React2.useState([]);
|
|
3394
|
+
const [loading, setLoading] = React2.useState(true);
|
|
3395
|
+
const [expanded, setExpanded] = React2.useState({});
|
|
3396
|
+
const [total, setTotal] = React2.useState(() => totalData);
|
|
3397
|
+
const [{ pageIndex, pageSize }, setPagination] = React2.useState({
|
|
3398
|
+
pageIndex: 0,
|
|
3399
|
+
pageSize: hidePagination ? 999999 : perPage ? perPage : 20
|
|
3400
|
+
});
|
|
3401
|
+
const [paginationScroll, setPaginationScroll] = React2.useState();
|
|
3402
|
+
const pagination = React2.useMemo(
|
|
3403
|
+
() => ({
|
|
3404
|
+
pageIndex,
|
|
3405
|
+
pageSize
|
|
3406
|
+
}),
|
|
3407
|
+
[pageIndex, pageSize]
|
|
3408
|
+
);
|
|
3409
|
+
const fetch = () => {
|
|
3410
|
+
var _a2, _b2;
|
|
3411
|
+
if (fetchData && !autoPagination) {
|
|
3412
|
+
fetchData({
|
|
3413
|
+
pageSize,
|
|
3414
|
+
pageIndex,
|
|
3415
|
+
order: (_a2 = sorting[0]) == null ? void 0 : _a2.id,
|
|
3416
|
+
orderDir: ((_b2 = sorting[0]) == null ? void 0 : _b2.desc) ? "DESC" : "ASC"
|
|
3417
|
+
}).then((response) => {
|
|
3418
|
+
setDataTable(response.rows);
|
|
3419
|
+
if (!(response == null ? void 0 : response.rows) && totalData > 0) {
|
|
3420
|
+
setPagination({
|
|
3421
|
+
pageIndex: pageIndex - 1,
|
|
3422
|
+
pageSize
|
|
3423
|
+
});
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
} else {
|
|
3427
|
+
manualPagination(pageIndex, pageSize).then((response) => {
|
|
3428
|
+
setDataTable(response.rows);
|
|
3429
|
+
if (!(response == null ? void 0 : response.rows) && totalData > 0) {
|
|
3430
|
+
setPagination({
|
|
3431
|
+
pageIndex: pageIndex - 1,
|
|
3432
|
+
pageSize
|
|
3433
|
+
});
|
|
3434
|
+
}
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
setTimeout(() => {
|
|
3438
|
+
if (onFinishFetch) {
|
|
3439
|
+
onFinishFetch();
|
|
3440
|
+
}
|
|
3441
|
+
}, 1e3);
|
|
3442
|
+
};
|
|
3443
|
+
const manualPagination = async (pageIndex2, pageSize2) => {
|
|
3444
|
+
const promise = new Promise((resolve, reject) => {
|
|
3445
|
+
let shortArrays = [], i, len;
|
|
3446
|
+
for (i = 0, len = totalData; i < len; i += pageSize2) {
|
|
3447
|
+
shortArrays.push(data == null ? void 0 : data.slice(i, i + pageSize2));
|
|
3448
|
+
}
|
|
3449
|
+
resolve(shortArrays);
|
|
3450
|
+
});
|
|
3451
|
+
let dataPromise = await promise;
|
|
3452
|
+
return {
|
|
3453
|
+
rows: dataPromise[pageIndex2],
|
|
3454
|
+
pageCount: Number(pageSize2)
|
|
3455
|
+
};
|
|
3456
|
+
};
|
|
3457
|
+
React2.useEffect(() => {
|
|
3458
|
+
if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
|
|
3459
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
3460
|
+
var _a2;
|
|
3461
|
+
setPaginationScroll((_a2 = tableContainerRef == null ? void 0 : tableContainerRef.current) == null ? void 0 : _a2.scrollWidth);
|
|
3462
|
+
});
|
|
3463
|
+
resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
|
|
3464
|
+
return () => resizeObserver.disconnect();
|
|
3465
|
+
}, []);
|
|
3466
|
+
React2.useEffect(() => {
|
|
3467
|
+
if (fetchData || autoPagination) {
|
|
3468
|
+
fetch();
|
|
3469
|
+
}
|
|
3470
|
+
}, [pageIndex, pageSize, sorting]);
|
|
3471
|
+
React2.useEffect(() => {
|
|
3472
|
+
if (totalData !== total) {
|
|
3473
|
+
setPagination({
|
|
3474
|
+
pageIndex: 0,
|
|
3475
|
+
pageSize: pagination.pageSize
|
|
3476
|
+
});
|
|
3477
|
+
setTotal(totalData);
|
|
3478
|
+
}
|
|
3479
|
+
}, [totalData]);
|
|
3480
|
+
React2.useEffect(() => {
|
|
3481
|
+
if (data) {
|
|
3482
|
+
setDataTable(
|
|
3483
|
+
() => autoPagination ? data.slice(0, pageSize) : data
|
|
3484
|
+
);
|
|
3485
|
+
setLoading(false);
|
|
3486
|
+
}
|
|
3487
|
+
}, [data]);
|
|
3488
|
+
const pages = totalData < pagination.pageSize ? 1 : Math.ceil(totalData / pagination.pageSize);
|
|
3489
|
+
let table = reactTable.useReactTable({
|
|
3490
|
+
data: (dataTable == null ? void 0 : dataTable.length) > 0 ? dataTable : [],
|
|
3491
|
+
columns,
|
|
3492
|
+
state: {
|
|
3493
|
+
sorting,
|
|
3494
|
+
columnVisibility,
|
|
3495
|
+
rowSelection,
|
|
3496
|
+
globalFilter,
|
|
3497
|
+
columnFilters,
|
|
3498
|
+
pagination,
|
|
3499
|
+
expanded
|
|
3500
|
+
},
|
|
3501
|
+
pageCount: pages,
|
|
3502
|
+
manualPagination: true,
|
|
3503
|
+
enableRowSelection,
|
|
3504
|
+
onRowSelectionChange: setRowSelection,
|
|
3505
|
+
onSortingChange: setSorting,
|
|
3506
|
+
onColumnFiltersChange: setColumnFilters,
|
|
3507
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
3508
|
+
onGlobalFilterChange: setGlobalFilter,
|
|
3509
|
+
globalFilterFn: fuzzyFilter,
|
|
3510
|
+
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
3511
|
+
getFilteredRowModel: reactTable.getFilteredRowModel(),
|
|
3512
|
+
// getSortedRowModel: getSortedRowModel(),
|
|
3513
|
+
getFacetedRowModel: reactTable.getFacetedRowModel(),
|
|
3514
|
+
getFacetedUniqueValues: reactTable.getFacetedUniqueValues(),
|
|
3515
|
+
onPaginationChange: setPagination,
|
|
3516
|
+
getRowCanExpand,
|
|
3517
|
+
onExpandedChange: setExpanded,
|
|
3518
|
+
getExpandedRowModel: reactTable.getExpandedRowModel(),
|
|
3519
|
+
enableExpanding: true,
|
|
3520
|
+
getRowId: (row) => {
|
|
3521
|
+
return row.id;
|
|
3522
|
+
},
|
|
3523
|
+
meta: {
|
|
3524
|
+
getRowStyles: rowClassName
|
|
3525
|
+
}
|
|
3526
|
+
});
|
|
3527
|
+
React2.useEffect(() => {
|
|
3528
|
+
if (enableRowSelection && rowSelection) {
|
|
3529
|
+
setArrRowSelected(Object.keys(rowSelection));
|
|
3530
|
+
}
|
|
3531
|
+
}, [rowSelection, enableRowSelection]);
|
|
3532
|
+
const onSelectAll = () => {
|
|
3533
|
+
table.toggleAllRowsSelected(true);
|
|
3534
|
+
const araysIds = data == null ? void 0 : data.map((item) => item == null ? void 0 : item.id);
|
|
3535
|
+
let selected = {};
|
|
3536
|
+
araysIds == null ? void 0 : araysIds.forEach((id) => {
|
|
3537
|
+
selected = {
|
|
3538
|
+
...selected,
|
|
3539
|
+
[id]: true
|
|
3540
|
+
};
|
|
3541
|
+
});
|
|
3542
|
+
setRowSelection(selected);
|
|
3543
|
+
return;
|
|
3544
|
+
};
|
|
3545
|
+
const onRemoveAll = () => {
|
|
3546
|
+
table.toggleAllRowsSelected();
|
|
3547
|
+
setRowSelection({});
|
|
3548
|
+
return;
|
|
3549
|
+
};
|
|
3550
|
+
const hideTableData = dataTable && (dataTable == null ? void 0 : dataTable.length) == 0 && !loading && !hideBlankState || !dataTable || ((_b = (_a = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _a.rows) == null ? void 0 : _b.length) == 0;
|
|
3551
|
+
const canShowTableData = !hidePagination && totalData > 0 && table;
|
|
3552
|
+
function renderBottomTable() {
|
|
3553
|
+
var _a2;
|
|
3554
|
+
if (hideTableData && totalData !== null) {
|
|
3555
|
+
if (emptyState) {
|
|
3556
|
+
return emptyState;
|
|
3557
|
+
} else {
|
|
3558
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", {});
|
|
3559
|
+
}
|
|
3560
|
+
} else if (canShowTableData && totalData !== null) {
|
|
3561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3562
|
+
DataTablePagination,
|
|
3563
|
+
{
|
|
3564
|
+
table,
|
|
3565
|
+
footer,
|
|
3566
|
+
totalData,
|
|
3567
|
+
tableRef: tableContainerRef,
|
|
3568
|
+
selectAllOption,
|
|
3569
|
+
onSelectAll,
|
|
3570
|
+
rowsSelected: (_a2 = Object.keys(rowSelection || {})) == null ? void 0 : _a2.length,
|
|
3571
|
+
onRemoveAll,
|
|
3572
|
+
paginationScroll,
|
|
3573
|
+
pageSizeOptions
|
|
3574
|
+
}
|
|
3575
|
+
);
|
|
3576
|
+
} else if (totalData == null) {
|
|
3577
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
React2.useEffect(() => {
|
|
3581
|
+
if (rowSelection && Object.keys(rowSelection).length == 0) {
|
|
3582
|
+
const elements = document.getElementsByClassName("th-shadow");
|
|
3583
|
+
Object.keys(elements).forEach((index) => {
|
|
3584
|
+
var _a2, _b2;
|
|
3585
|
+
(_b2 = (_a2 = elements[index]) == null ? void 0 : _a2.classList) == null ? void 0 : _b2.add("with-shadow");
|
|
3586
|
+
});
|
|
3587
|
+
} else if (rowSelection && Object.keys(rowSelection).length == 1) {
|
|
3588
|
+
const elements = document.getElementsByClassName("th-shadow");
|
|
3589
|
+
Object.keys(elements).forEach((index) => {
|
|
3590
|
+
var _a2, _b2;
|
|
3591
|
+
(_b2 = (_a2 = elements[index]) == null ? void 0 : _a2.classList) == null ? void 0 : _b2.remove("with-shadow");
|
|
3592
|
+
});
|
|
3593
|
+
}
|
|
3594
|
+
}, [rowSelection]);
|
|
3595
|
+
const stylesRow = (row) => {
|
|
3596
|
+
var _a2, _b2;
|
|
3597
|
+
const tb = table;
|
|
3598
|
+
return rowClassName ? (_b2 = (_a2 = tb == null ? void 0 : tb.options) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.getRowStyles(row) : {};
|
|
3599
|
+
};
|
|
3600
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
3601
|
+
showFilter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex justify-between md:items-center flex-col md:flex-row gap-y-2 md:gap-y-0", children: [
|
|
3602
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full md:max-w-[350px]", id: "filter-table", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3603
|
+
Input,
|
|
3604
|
+
{
|
|
3605
|
+
onChange: (e) => setGlobalFilter(e.target.value),
|
|
3606
|
+
name: "filter",
|
|
3607
|
+
value: globalFilter,
|
|
3608
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-search" }),
|
|
3609
|
+
placeholder: "Buscar pedido por ID, C\xF3digo ou Cliente",
|
|
3610
|
+
clearField: true,
|
|
3611
|
+
onClear: () => setGlobalFilter("")
|
|
3612
|
+
}
|
|
3613
|
+
) }),
|
|
3614
|
+
listUpdate
|
|
3615
|
+
] }),
|
|
3616
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3617
|
+
"div",
|
|
3618
|
+
{
|
|
3619
|
+
className: clsx7__default.default("w-full flex mt-4 flex-col justify-between", {
|
|
3620
|
+
"flex-1": !hideTableData,
|
|
3621
|
+
[tableClass]: tableClass
|
|
3622
|
+
}),
|
|
3623
|
+
children: [
|
|
3624
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3625
|
+
Table,
|
|
3626
|
+
{
|
|
3627
|
+
className: clsx7__default.default(
|
|
3628
|
+
"w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"
|
|
3629
|
+
),
|
|
3630
|
+
onScroll,
|
|
3631
|
+
ref: tableContainerRef,
|
|
3632
|
+
children: [
|
|
3633
|
+
rowSelection && ((_c = Object.keys(rowSelection)) == null ? void 0 : _c.length) > 0 && actionsSelection && (dataTable == null ? void 0 : dataTable.length) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[76px] flex items-center justify-between px-4 bg-gradient-to-b from-blue-start to-blue-end rounded-lg -mb-[1px]", children: [
|
|
3634
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-6", children: [
|
|
3635
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-white text-p-lg", children: [
|
|
3636
|
+
Object.keys(rowSelection).length,
|
|
3637
|
+
" selecionado(s)"
|
|
3638
|
+
] }),
|
|
3639
|
+
actionsSelection
|
|
3640
|
+
] }),
|
|
3641
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { title: "set-row", onClick: () => setRowSelection({}), children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-times text-white" }) })
|
|
3642
|
+
] }),
|
|
3643
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "table w-full mr-[2px]", ref: tableRef, children: [
|
|
3644
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: (_d = table == null ? void 0 : table.getHeaderGroups()) == null ? void 0 : _d.map((headerGroup, headerIndex) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header, index) => {
|
|
3645
|
+
var _a2, _b2, _c2;
|
|
3646
|
+
const classes = header.column.columnDef.meta;
|
|
3647
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3648
|
+
TableHead,
|
|
3649
|
+
{
|
|
3650
|
+
style: {
|
|
3651
|
+
width: header.getSize()
|
|
3652
|
+
},
|
|
3653
|
+
scope: "col",
|
|
3654
|
+
className: clsx7__default.default(
|
|
3655
|
+
{
|
|
3656
|
+
"hover:bg-neutral-100 th-shadow cursor-pointer": header.column.getCanSort(),
|
|
3657
|
+
["with-shadow"]: (arrRowSelected == null ? void 0 : arrRowSelected.length) == 0 && withShadow
|
|
3658
|
+
},
|
|
3659
|
+
classes == null ? void 0 : classes.header,
|
|
3660
|
+
classes == null ? void 0 : classes.className
|
|
3661
|
+
),
|
|
3662
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick: header.column.getToggleSortingHandler(), children: [
|
|
3663
|
+
header.isPlaceholder ? null : reactTable.flexRender(
|
|
3664
|
+
header.column.columnDef.header,
|
|
3665
|
+
header.getContext()
|
|
3666
|
+
),
|
|
3667
|
+
((_a2 = sorting[0]) == null ? void 0 : _a2.id) == header.column.id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3668
|
+
"i",
|
|
3669
|
+
{
|
|
3670
|
+
className: clsx7__default.default(
|
|
3671
|
+
{
|
|
3672
|
+
["rotate-0"]: !((_b2 = sorting[0]) == null ? void 0 : _b2.desc),
|
|
3673
|
+
["rotate-180"]: (_c2 = sorting[0]) == null ? void 0 : _c2.desc
|
|
3674
|
+
},
|
|
3675
|
+
"uil uil-arrow-down text-blue-500 transform ml-1 text-[18px] duration-75"
|
|
3676
|
+
)
|
|
3677
|
+
}
|
|
3678
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
3679
|
+
] })
|
|
3680
|
+
},
|
|
3681
|
+
headerIndex + index + "th"
|
|
3682
|
+
);
|
|
3683
|
+
}) }, headerGroup.id + headerIndex + "header")) }),
|
|
3684
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: (_f = (_e = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _e.rows) == null ? void 0 : _f.map((row, rowIndex) => {
|
|
3685
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React2__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React2__namespace.default.Fragment, { children: [
|
|
3686
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3687
|
+
TableRow,
|
|
3688
|
+
{
|
|
3689
|
+
id: row.id,
|
|
3690
|
+
className: `text-p-md font-normal h-[80px] text-paragraph w-fit`,
|
|
3691
|
+
style: stylesRow(row),
|
|
3692
|
+
children: row.getVisibleCells().map((cell, index) => {
|
|
3693
|
+
const classes = cell.column.columnDef.meta;
|
|
3694
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
|
+
TableCell,
|
|
3696
|
+
{
|
|
3697
|
+
id: cell.id,
|
|
3698
|
+
style: {
|
|
3699
|
+
width: cell.column.getSize(),
|
|
3700
|
+
backgroundColor: backgroundColor ? backgroundColor : "",
|
|
3701
|
+
...stylesRow(row)
|
|
3702
|
+
},
|
|
3703
|
+
className: clsx7__default.default(
|
|
3704
|
+
{
|
|
3705
|
+
["hidden"]: cell.row.original._destroy,
|
|
3706
|
+
["first:border-l last:border-r"]: borderFull,
|
|
3707
|
+
["first:rounded-bl-lg last:rounded-br-lg"]: borderFull && row.index === (data == null ? void 0 : data.length) - 1
|
|
3708
|
+
},
|
|
3709
|
+
classes == null ? void 0 : classes.cell,
|
|
3710
|
+
classes == null ? void 0 : classes.className
|
|
3711
|
+
),
|
|
3712
|
+
children: reactTable.flexRender(
|
|
3713
|
+
cell.column.columnDef.cell,
|
|
3714
|
+
cell.getContext()
|
|
3715
|
+
)
|
|
3716
|
+
},
|
|
3717
|
+
cell.id
|
|
3718
|
+
);
|
|
3719
|
+
})
|
|
3720
|
+
},
|
|
3721
|
+
row.id
|
|
3722
|
+
),
|
|
3723
|
+
(row.getIsExpanded() || openedSubComponent) && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: row.getVisibleCells().length, children: renderSubComponent({
|
|
3724
|
+
row
|
|
3725
|
+
}) }) })
|
|
3726
|
+
] }) }, rowIndex + "row");
|
|
3727
|
+
}) })
|
|
3728
|
+
] })
|
|
3729
|
+
]
|
|
3730
|
+
}
|
|
3731
|
+
),
|
|
3732
|
+
renderBottomTable()
|
|
3733
|
+
]
|
|
3734
|
+
}
|
|
3735
|
+
)
|
|
3736
|
+
] });
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
exports.Badge = Badge;
|
|
3740
|
+
exports.Button = Button;
|
|
3741
|
+
exports.Calendar = Calendar;
|
|
3742
|
+
exports.Checkbox = Checkbox;
|
|
3743
|
+
exports.DataTable = DataTable;
|
|
3744
|
+
exports.DataTablePagination = DataTablePagination;
|
|
3745
|
+
exports.DatePickerInput = DatePickerInput;
|
|
3746
|
+
exports.FilterCalendar = FilterCalendar;
|
|
3747
|
+
exports.FilterOptions = FilterOptions;
|
|
3748
|
+
exports.Input = Input;
|
|
3749
|
+
exports.InputMoney = InputMoney;
|
|
3750
|
+
exports.InputNumber = InputNumber;
|
|
3751
|
+
exports.InputPercentage = InputPercentage;
|
|
3752
|
+
exports.Logo = Logo;
|
|
3753
|
+
exports.MaskedInput = MaskedInput;
|
|
3754
|
+
exports.ModalDialog = ModalDialog;
|
|
3755
|
+
exports.PaginationSelect = PaginationSelect;
|
|
3756
|
+
exports.Popover = Popover3;
|
|
3757
|
+
exports.Radio = Radio;
|
|
3758
|
+
exports.RocketIcon = RocketIcon;
|
|
3759
|
+
exports.SelectField = SelectField;
|
|
3760
|
+
exports.SpinnerIcon = SpinnerIcon;
|
|
3761
|
+
exports.Table = Table;
|
|
3762
|
+
exports.TableBody = TableBody;
|
|
3763
|
+
exports.TableCaption = TableCaption;
|
|
3764
|
+
exports.TableCell = TableCell;
|
|
3765
|
+
exports.TableFooter = TableFooter;
|
|
3766
|
+
exports.TableHead = TableHead;
|
|
3767
|
+
exports.TableHeader = TableHeader;
|
|
3768
|
+
exports.TableRow = TableRow;
|
|
3769
|
+
exports.Toggle = Toggle;
|
|
3770
|
+
exports.ValueContainer = ValueContainer;
|
|
3771
|
+
//# sourceMappingURL=index.cjs.map
|
|
15
3772
|
//# sourceMappingURL=index.cjs.map
|