@charlesgomes/leafcode-shared-lib-react 1.0.56 → 1.0.58

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.mjs CHANGED
@@ -51,18 +51,265 @@ function Button({
51
51
  );
52
52
  }
53
53
 
54
+ // src/components/Input/Input.tsx
55
+ import {
56
+ forwardRef,
57
+ useState as useState2
58
+ } from "react";
59
+
60
+ // src/components/Tooltips/TooltipErrorInput.tsx
61
+ import { WarningCircle, X } from "@phosphor-icons/react";
62
+ import { useEffect, useState } from "react";
63
+ import { Tooltip } from "react-tooltip";
64
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
65
+ function TooltipErrorInput({
66
+ error,
67
+ name,
68
+ isSelect = false,
69
+ isInvalid = false
70
+ }) {
71
+ const [isTooltipOpen, setIsTooltipOpen] = useState(true);
72
+ const handleClose = () => setIsTooltipOpen(false);
73
+ useEffect(() => {
74
+ setIsTooltipOpen(true);
75
+ }, [error]);
76
+ return /* @__PURE__ */ jsx2(
77
+ "div",
78
+ {
79
+ className: `absolute ${isSelect ? isInvalid ? "right-[4.5rem]" : "right-11" : "right-2"} top-1/2 transform -translate-y-1/2 cursor-pointer z-20`,
80
+ children: /* @__PURE__ */ jsx2(Fragment, { children: error?.message && /* @__PURE__ */ jsxs2(Fragment, { children: [
81
+ /* @__PURE__ */ jsx2(
82
+ "a",
83
+ {
84
+ "data-tooltip-id": name,
85
+ "data-tooltip-content": "",
86
+ "data-tooltip-place": "top-end",
87
+ onClick: () => setIsTooltipOpen(true),
88
+ children: /* @__PURE__ */ jsx2(WarningCircle, { size: 22, className: "text-red-400" })
89
+ }
90
+ ),
91
+ /* @__PURE__ */ jsx2(
92
+ Tooltip,
93
+ {
94
+ className: "max-w-[15rem] relative z-50 tooltip-content cursor-default",
95
+ id: name,
96
+ style: {
97
+ backgroundColor: "#f87171",
98
+ color: "#fff",
99
+ padding: "8px 14px"
100
+ },
101
+ opacity: 1,
102
+ delayShow: 300,
103
+ delayHide: 150,
104
+ clickable: true,
105
+ openOnClick: true,
106
+ isOpen: isTooltipOpen,
107
+ children: isTooltipOpen && /* @__PURE__ */ jsxs2("div", { className: "flex justify-between gap-1 items-center font-Roboto text-[13px] leading-[125%] transition-all", children: [
108
+ /* @__PURE__ */ jsx2("span", { children: error?.message }),
109
+ /* @__PURE__ */ jsx2(
110
+ "button",
111
+ {
112
+ onClick: handleClose,
113
+ className: "text-white hover:text-black",
114
+ style: {
115
+ border: "none",
116
+ background: "transparent",
117
+ cursor: "pointer"
118
+ },
119
+ children: /* @__PURE__ */ jsx2(X, { size: 16, weight: "bold" })
120
+ }
121
+ )
122
+ ] })
123
+ }
124
+ )
125
+ ] }) })
126
+ }
127
+ );
128
+ }
129
+
130
+ // src/components/Input/Input.tsx
131
+ import { Eye, EyeSlash } from "@phosphor-icons/react";
132
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
133
+ var InputBase = ({
134
+ name,
135
+ label,
136
+ placeholder,
137
+ onFocus,
138
+ error = null,
139
+ disabled,
140
+ isUppercaseLabel = true,
141
+ isUppercaseText = false,
142
+ validationMode = "default",
143
+ showPasswordToggle = false,
144
+ onChange,
145
+ value,
146
+ colors,
147
+ fonts,
148
+ ...rest
149
+ }, ref) => {
150
+ const styleVars = {
151
+ "--label-font-family": fonts?.labelFamily,
152
+ "--label-font-weight": fonts?.labelWeight,
153
+ "--input-font-family": fonts?.inputFamily,
154
+ "--input-font-weight": fonts?.inputWeight,
155
+ "--label-color": colors?.label,
156
+ "--label-bg": colors?.labelBg,
157
+ "--input-border": colors?.inputBorder,
158
+ "--input-bg": colors?.inputBg,
159
+ "--input-text": colors?.inputText,
160
+ "--input-focus-border": colors?.inputFocusBorder,
161
+ "--input-placeholder": colors?.inputPlaceholder,
162
+ "--input-error-border": colors?.inputErrorBorder,
163
+ "--autofill-box-shadow": colors?.autofillBoxShadow,
164
+ "--autofill-text-color": colors?.autofillTextColor,
165
+ "--autofill-color-border": colors?.autofillColorBorder,
166
+ "--color-password-toggle": colors?.colorPasswordToggle
167
+ };
168
+ const handleChange = (e) => {
169
+ let val = e.target.value;
170
+ if (validationMode === "restricted") {
171
+ val = val.replace(/[^a-zA-Z0-9_.-]/g, "");
172
+ val = val.replace(/^\.+/, "");
173
+ val = val.replace(/\.+$/, "");
174
+ val = val.replace(/\s+/g, "");
175
+ }
176
+ e.target.value = val;
177
+ onChange?.(e);
178
+ };
179
+ const [show, setShow] = useState2(false);
180
+ const handleClick = () => setShow(!show);
181
+ return /* @__PURE__ */ jsxs3(
182
+ "div",
183
+ {
184
+ className: `input-wrapper ${disabled ? "is-disabled" : ""}`,
185
+ style: styleVars,
186
+ children: [
187
+ !!label && /* @__PURE__ */ jsx3(
188
+ "label",
189
+ {
190
+ className: `label-input ${isUppercaseLabel && "is-uppercase"}`,
191
+ htmlFor: name,
192
+ children: label
193
+ }
194
+ ),
195
+ /* @__PURE__ */ jsxs3("div", { style: { position: "relative", width: "100%" }, children: [
196
+ /* @__PURE__ */ jsx3(
197
+ "input",
198
+ {
199
+ id: name,
200
+ name,
201
+ disabled,
202
+ type: show ? "text" : "password",
203
+ className: `input ${error && "input-error"} ${isUppercaseText && "is-uppercase"}`,
204
+ placeholder,
205
+ onFocus,
206
+ onChange: handleChange,
207
+ value,
208
+ ref,
209
+ ...rest
210
+ }
211
+ ),
212
+ showPasswordToggle && /* @__PURE__ */ jsx3(
213
+ "div",
214
+ {
215
+ onClick: handleClick,
216
+ className: `password-toggle ${error ? "error" : "no-error"}`,
217
+ children: show ? /* @__PURE__ */ jsx3(Eye, { size: 21 }) : /* @__PURE__ */ jsx3(EyeSlash, { size: 21 })
218
+ }
219
+ )
220
+ ] }),
221
+ /* @__PURE__ */ jsx3(TooltipErrorInput, { error, name })
222
+ ]
223
+ }
224
+ );
225
+ };
226
+ var Input = forwardRef(InputBase);
227
+
228
+ // src/components/Input/TextArea.tsx
229
+ import { forwardRef as forwardRef2 } from "react";
230
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
231
+ var TextAreaBase = ({
232
+ name,
233
+ label,
234
+ placeholder,
235
+ isUppercaseText = false,
236
+ isUppercaseLabel = true,
237
+ disabled,
238
+ onFocus,
239
+ error,
240
+ colors,
241
+ fonts,
242
+ height,
243
+ ...rest
244
+ }, ref) => {
245
+ const styleVars = {
246
+ "--label-font-family": fonts?.labelFamily,
247
+ "--label-font-weight": fonts?.labelWeight,
248
+ "--input-font-family": fonts?.inputFamily,
249
+ "--input-font-weight": fonts?.inputWeight,
250
+ "--height-text-area": height?.heightTextArea,
251
+ "--label-color": colors?.label,
252
+ "--label-bg": colors?.labelBg,
253
+ "--input-border": colors?.inputBorder,
254
+ "--input-bg": colors?.inputBg,
255
+ "--input-text": colors?.inputText,
256
+ "--input-focus-border": colors?.inputFocusBorder,
257
+ "--input-placeholder": colors?.inputPlaceholder,
258
+ "--input-error-border": colors?.inputErrorBorder,
259
+ "--autofill-box-shadow": colors?.autofillBoxShadow,
260
+ "--autofill-text-color": colors?.autofillTextColor,
261
+ "--autofill-color-border": colors?.autofillColorBorder
262
+ };
263
+ return /* @__PURE__ */ jsxs4(
264
+ "div",
265
+ {
266
+ className: `input-wrapper ${disabled ? "is-disabled" : ""}`,
267
+ style: styleVars,
268
+ children: [
269
+ !!label && /* @__PURE__ */ jsx4(
270
+ "label",
271
+ {
272
+ className: `label-input ${isUppercaseLabel ? "is-uppercase" : ""}`,
273
+ htmlFor: name,
274
+ children: label
275
+ }
276
+ ),
277
+ /* @__PURE__ */ jsxs4("div", { style: { position: "relative", width: "100%" }, children: [
278
+ /* @__PURE__ */ jsx4(
279
+ "textarea",
280
+ {
281
+ ref,
282
+ id: name,
283
+ name,
284
+ disabled,
285
+ className: `input textArea ${error ? "input-error" : ""} ${isUppercaseText ? "is-uppercase" : ""}`,
286
+ placeholder,
287
+ onFocus,
288
+ ...rest
289
+ }
290
+ ),
291
+ /* @__PURE__ */ jsx4("div", { className: "absolute top-6 right-1", children: /* @__PURE__ */ jsx4(TooltipErrorInput, { error, name }) })
292
+ ] })
293
+ ]
294
+ }
295
+ );
296
+ };
297
+ var TextArea = forwardRef2(
298
+ TextAreaBase
299
+ );
300
+
54
301
  // src/components/ModalBase/ModalBase.tsx
55
- import { X } from "@phosphor-icons/react";
302
+ import { X as X2 } from "@phosphor-icons/react";
56
303
 
57
304
  // src/components/ModalBase/FooterButtons.tsx
58
- import { jsx as jsx2 } from "react/jsx-runtime";
305
+ import { jsx as jsx5 } from "react/jsx-runtime";
59
306
  function FooterButtons({ children }) {
60
- return /* @__PURE__ */ jsx2("div", { className: "sm:flex pt-8 justify-end text-right sm:space-x-6 space-x-0 sm:space-y-0 space-y-4 p-6", children });
307
+ return /* @__PURE__ */ jsx5("div", { className: "sm:flex pt-8 justify-end text-right sm:space-x-6 space-x-0 sm:space-y-0 space-y-4 p-6", children });
61
308
  }
62
309
 
63
310
  // src/components/ModalBase/ModalBase.tsx
64
- import { useEffect } from "react";
65
- import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
311
+ import { useEffect as useEffect2 } from "react";
312
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
66
313
  function ModalBase({
67
314
  show,
68
315
  onHide,
@@ -74,7 +321,7 @@ function ModalBase({
74
321
  btnSuccess = "Save",
75
322
  disabledBtnSuccess
76
323
  }) {
77
- useEffect(() => {
324
+ useEffect2(() => {
78
325
  const handleKeyDown = (event) => {
79
326
  if (event.key === "Escape") {
80
327
  onHide();
@@ -85,22 +332,22 @@ function ModalBase({
85
332
  document.removeEventListener("keydown", handleKeyDown);
86
333
  };
87
334
  }, [onHide]);
88
- return /* @__PURE__ */ jsx3(Fragment, { children: show ? /* @__PURE__ */ jsxs2(Fragment, { children: [
89
- /* @__PURE__ */ jsx3("div", { className: "justify-center items-start pt-11 overflow-x-hidden overflow-y-auto fixed inset-0 z-[60] outline-none focus:outline-none", children: /* @__PURE__ */ jsx3("div", { className: "relative w-auto my-6 mx-auto max-w-xl", children: /* @__PURE__ */ jsxs2("div", { className: "border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-theme-dark outline-none focus:outline-none", children: [
90
- /* @__PURE__ */ jsxs2("div", { className: "flex items-start justify-between p-2", children: [
91
- /* @__PURE__ */ jsx3("h3", { className: "text-lg text-center absolute top-6 left-1/2 transform -translate-x-1/2 -translate-y-1/2 font-SegoeUIVF font-bold text-light-dark-100", children: title }),
92
- /* @__PURE__ */ jsx3(
335
+ return /* @__PURE__ */ jsx6(Fragment2, { children: show ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
336
+ /* @__PURE__ */ jsx6("div", { className: "justify-center items-start pt-11 overflow-x-hidden overflow-y-auto fixed inset-0 z-[60] outline-none focus:outline-none", children: /* @__PURE__ */ jsx6("div", { className: "relative w-auto my-6 mx-auto max-w-xl", children: /* @__PURE__ */ jsxs5("div", { className: "border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-theme-dark outline-none focus:outline-none", children: [
337
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between p-2", children: [
338
+ /* @__PURE__ */ jsx6("h3", { className: "text-lg text-center absolute top-6 left-1/2 transform -translate-x-1/2 -translate-y-1/2 font-SegoeUIVF font-bold text-light-dark-100", children: title }),
339
+ /* @__PURE__ */ jsx6(
93
340
  "button",
94
341
  {
95
342
  className: "p-1 ml-auto mr-1 cursor-pointer",
96
343
  onClick: onHide,
97
- children: /* @__PURE__ */ jsx3(X, { size: 18, color: "#ffffff" })
344
+ children: /* @__PURE__ */ jsx6(X2, { size: 18, color: "#ffffff" })
98
345
  }
99
346
  )
100
347
  ] }),
101
- /* @__PURE__ */ jsx3("div", { className: "w-full p-6", children }),
102
- /* @__PURE__ */ jsxs2(FooterButtons, { children: [
103
- /* @__PURE__ */ jsx3(
348
+ /* @__PURE__ */ jsx6("div", { className: "w-full p-6", children }),
349
+ /* @__PURE__ */ jsxs5(FooterButtons, { children: [
350
+ /* @__PURE__ */ jsx6(
104
351
  Button,
105
352
  {
106
353
  color: "danger",
@@ -109,7 +356,7 @@ function ModalBase({
109
356
  onClick: onHide
110
357
  }
111
358
  ),
112
- /* @__PURE__ */ jsx3(
359
+ /* @__PURE__ */ jsx6(
113
360
  Button,
114
361
  {
115
362
  type: "button",
@@ -121,15 +368,15 @@ function ModalBase({
121
368
  )
122
369
  ] })
123
370
  ] }) }) }),
124
- /* @__PURE__ */ jsx3("div", { className: "opacity-40 fixed inset-0 z-50 bg-black" })
371
+ /* @__PURE__ */ jsx6("div", { className: "opacity-40 fixed inset-0 z-50 bg-black" })
125
372
  ] }) : null });
126
373
  }
127
374
 
128
375
  // src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
129
- import { useEffect as useEffect4, useState as useState3 } from "react";
376
+ import { useEffect as useEffect5, useState as useState5 } from "react";
130
377
 
131
378
  // src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
132
- import { useEffect as useEffect3, useMemo, useState as useState2 } from "react";
379
+ import { useEffect as useEffect4, useMemo, useState as useState4 } from "react";
133
380
  import { useQuery } from "@tanstack/react-query";
134
381
 
135
382
  // src/primereact-compat.ts
@@ -141,21 +388,30 @@ import { Calendar } from "primereact/calendar";
141
388
  import { FilterMatchMode } from "primereact/api";
142
389
 
143
390
  // src/components/DataTableAdvancedFilter/TableHeader.tsx
144
- import { jsx as jsx4 } from "react/jsx-runtime";
391
+ import { X as X3 } from "@phosphor-icons/react";
392
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
145
393
  var TableHeader = ({
146
394
  globalFilterValue,
147
395
  onGlobalFilterChange,
148
396
  isLanguagePtBr
149
397
  }) => {
150
- return /* @__PURE__ */ jsx4(
151
- InputText,
152
- {
153
- value: globalFilterValue,
154
- onChange: onGlobalFilterChange,
155
- placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
156
- className: "custom-input"
157
- }
158
- );
398
+ const limparCampo = () => {
399
+ onGlobalFilterChange({
400
+ target: { value: "" }
401
+ });
402
+ };
403
+ return /* @__PURE__ */ jsxs6("div", { style: { position: "relative" }, children: [
404
+ /* @__PURE__ */ jsx7(
405
+ InputText,
406
+ {
407
+ value: globalFilterValue,
408
+ onChange: onGlobalFilterChange,
409
+ placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
410
+ className: "custom-input input-search"
411
+ }
412
+ ),
413
+ /* @__PURE__ */ jsx7(X3, { size: 16, className: "close-search", onClick: limparCampo })
414
+ ] });
159
415
  };
160
416
  var TableHeader_default = TableHeader;
161
417
 
@@ -182,20 +438,20 @@ function centsToReal(value) {
182
438
  }
183
439
 
184
440
  // src/components/TooltipCustom.tsx
185
- import { Tooltip } from "react-tooltip";
441
+ import { Tooltip as Tooltip2 } from "react-tooltip";
186
442
  import { createPortal } from "react-dom";
187
- import { jsx as jsx5 } from "react/jsx-runtime";
443
+ import { jsx as jsx8 } from "react/jsx-runtime";
188
444
  function TooltipCustom({ label, id }) {
189
445
  return createPortal(
190
- /* @__PURE__ */ jsx5(
191
- Tooltip,
446
+ /* @__PURE__ */ jsx8(
447
+ Tooltip2,
192
448
  {
193
449
  anchorSelect: `#${id}`,
194
450
  place: "top",
195
451
  positionStrategy: "fixed",
196
452
  className: "tooltip-icone",
197
453
  style: { zIndex: 13 },
198
- children: /* @__PURE__ */ jsx5("div", { className: "tooltip-custom", children: label })
454
+ children: /* @__PURE__ */ jsx8("div", { className: "tooltip-custom", children: label })
199
455
  }
200
456
  ),
201
457
  document.body
@@ -203,7 +459,7 @@ function TooltipCustom({ label, id }) {
203
459
  }
204
460
 
205
461
  // src/components/DataTableAdvancedFilter/TableActions.tsx
206
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
462
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
207
463
  function TableActions({
208
464
  onNew,
209
465
  onEdit,
@@ -215,9 +471,9 @@ function TableActions({
215
471
  const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
216
472
  const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
217
473
  const resolvedCustomActions = typeof customActions === "function" ? customActions(selectedRows) : customActions;
218
- return /* @__PURE__ */ jsxs3("div", { className: "box-icones-table-actions", children: [
219
- onNew && /* @__PURE__ */ jsxs3(Fragment2, { children: [
220
- /* @__PURE__ */ jsx6(
474
+ return /* @__PURE__ */ jsxs7("div", { className: "box-icones-table-actions", children: [
475
+ onNew && /* @__PURE__ */ jsxs7(Fragment3, { children: [
476
+ /* @__PURE__ */ jsx9(
221
477
  "button",
222
478
  {
223
479
  id: "add",
@@ -228,10 +484,10 @@ function TableActions({
228
484
  enableButtonsNotMultiplesSelecteds && "disable-button-table-actions"
229
485
  ),
230
486
  disabled: enableButtonsNotMultiplesSelecteds,
231
- children: /* @__PURE__ */ jsx6(Plus, { size: 18 })
487
+ children: /* @__PURE__ */ jsx9(Plus, { size: 18 })
232
488
  }
233
489
  ),
234
- /* @__PURE__ */ jsx6(
490
+ /* @__PURE__ */ jsx9(
235
491
  TooltipCustom,
236
492
  {
237
493
  id: "add",
@@ -239,7 +495,7 @@ function TableActions({
239
495
  }
240
496
  )
241
497
  ] }),
242
- onEdit && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs3(
498
+ onEdit && /* @__PURE__ */ jsx9(Fragment3, { children: /* @__PURE__ */ jsxs7(
243
499
  "button",
244
500
  {
245
501
  id: "edit",
@@ -251,8 +507,8 @@ function TableActions({
251
507
  ),
252
508
  disabled: disableButtonsNotMultiplesSelecteds,
253
509
  children: [
254
- /* @__PURE__ */ jsx6(PencilSimple, { size: 18 }),
255
- /* @__PURE__ */ jsx6(
510
+ /* @__PURE__ */ jsx9(PencilSimple, { size: 18 }),
511
+ /* @__PURE__ */ jsx9(
256
512
  TooltipCustom,
257
513
  {
258
514
  id: "edit",
@@ -262,7 +518,7 @@ function TableActions({
262
518
  ]
263
519
  }
264
520
  ) }),
265
- onDelete && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs3(
521
+ onDelete && /* @__PURE__ */ jsx9(Fragment3, { children: /* @__PURE__ */ jsxs7(
266
522
  "button",
267
523
  {
268
524
  id: "delete",
@@ -274,8 +530,8 @@ function TableActions({
274
530
  ),
275
531
  disabled: !enableButtonsNotMultiplesSelecteds,
276
532
  children: [
277
- /* @__PURE__ */ jsx6(Trash, { size: 18 }),
278
- /* @__PURE__ */ jsx6(
533
+ /* @__PURE__ */ jsx9(Trash, { size: 18 }),
534
+ /* @__PURE__ */ jsx9(
279
535
  TooltipCustom,
280
536
  {
281
537
  id: "delete",
@@ -287,7 +543,7 @@ function TableActions({
287
543
  ) }),
288
544
  resolvedCustomActions?.map((action) => {
289
545
  const id = `action-table${phraseToId(action.label)}`;
290
- return /* @__PURE__ */ jsxs3(
546
+ return /* @__PURE__ */ jsxs7(
291
547
  "button",
292
548
  {
293
549
  id,
@@ -296,7 +552,7 @@ function TableActions({
296
552
  className: cn("enable-button-table-actions", action.className),
297
553
  children: [
298
554
  action.icon,
299
- /* @__PURE__ */ jsx6(TooltipCustom, { id, label: action.label })
555
+ /* @__PURE__ */ jsx9(TooltipCustom, { id, label: action.label })
300
556
  ]
301
557
  },
302
558
  id
@@ -307,7 +563,7 @@ function TableActions({
307
563
 
308
564
  // src/components/DataTableAdvancedFilter/ActionsColumn.tsx
309
565
  import { PencilSimple as PencilSimple2, Trash as Trash2 } from "@phosphor-icons/react";
310
- import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
566
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
311
567
  function ActionsColumn({
312
568
  row,
313
569
  onEdit,
@@ -316,8 +572,8 @@ function ActionsColumn({
316
572
  isLanguagePtBr
317
573
  }) {
318
574
  const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
319
- return /* @__PURE__ */ jsxs4("div", { className: "box-icones-actions-column", children: [
320
- onEdit && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs4(
575
+ return /* @__PURE__ */ jsxs8("div", { className: "box-icones-actions-column", children: [
576
+ onEdit && /* @__PURE__ */ jsx10(Fragment4, { children: /* @__PURE__ */ jsxs8(
321
577
  "button",
322
578
  {
323
579
  id: "edit-column",
@@ -327,8 +583,8 @@ function ActionsColumn({
327
583
  onEdit && onEdit([row]);
328
584
  },
329
585
  children: [
330
- /* @__PURE__ */ jsx7(PencilSimple2, { size: 17, weight: "regular" }),
331
- /* @__PURE__ */ jsx7(
586
+ /* @__PURE__ */ jsx10(PencilSimple2, { size: 17, weight: "regular" }),
587
+ /* @__PURE__ */ jsx10(
332
588
  TooltipCustom,
333
589
  {
334
590
  id: "edit-column",
@@ -338,7 +594,7 @@ function ActionsColumn({
338
594
  ]
339
595
  }
340
596
  ) }),
341
- onDelete && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs4(
597
+ onDelete && /* @__PURE__ */ jsx10(Fragment4, { children: /* @__PURE__ */ jsxs8(
342
598
  "button",
343
599
  {
344
600
  id: "delete-column",
@@ -348,8 +604,8 @@ function ActionsColumn({
348
604
  onDelete && onDelete([row]);
349
605
  },
350
606
  children: [
351
- /* @__PURE__ */ jsx7(Trash2, { size: 17, weight: "regular" }),
352
- /* @__PURE__ */ jsx7(
607
+ /* @__PURE__ */ jsx10(Trash2, { size: 17, weight: "regular" }),
608
+ /* @__PURE__ */ jsx10(
353
609
  TooltipCustom,
354
610
  {
355
611
  id: "delete-column",
@@ -361,7 +617,7 @@ function ActionsColumn({
361
617
  ) }),
362
618
  resolvedCustomActions?.map((action) => {
363
619
  const id = `action-colunm-${phraseToId(action.label)}`;
364
- return /* @__PURE__ */ jsxs4(
620
+ return /* @__PURE__ */ jsxs8(
365
621
  "button",
366
622
  {
367
623
  id,
@@ -370,7 +626,7 @@ function ActionsColumn({
370
626
  className: cn("btn-icone-actions-column", action.className),
371
627
  children: [
372
628
  action.icon,
373
- /* @__PURE__ */ jsx7(TooltipCustom, { id, label: action.label })
629
+ /* @__PURE__ */ jsx10(TooltipCustom, { id, label: action.label })
374
630
  ]
375
631
  },
376
632
  id
@@ -380,7 +636,7 @@ function ActionsColumn({
380
636
  }
381
637
 
382
638
  // src/components/DataTableAdvancedFilter/DynamicColumns.tsx
383
- import { jsx as jsx8 } from "react/jsx-runtime";
639
+ import { jsx as jsx11 } from "react/jsx-runtime";
384
640
  function DynamicColumns({
385
641
  columns,
386
642
  isMultiSelectionMode = true,
@@ -392,7 +648,7 @@ function DynamicColumns({
392
648
  const array = [];
393
649
  if (isMultiSelectionMode) {
394
650
  array.push(
395
- /* @__PURE__ */ jsx8(
651
+ /* @__PURE__ */ jsx11(
396
652
  Column,
397
653
  {
398
654
  selectionMode: "multiple",
@@ -409,7 +665,7 @@ function DynamicColumns({
409
665
  const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
410
666
  const placeholder = isLanguagePtBr ? "Procurar" : "Search";
411
667
  array.push(
412
- /* @__PURE__ */ jsx8(
668
+ /* @__PURE__ */ jsx11(
413
669
  Column,
414
670
  {
415
671
  field: isActionsCol ? void 0 : col.field,
@@ -427,7 +683,7 @@ function DynamicColumns({
427
683
  resizeable: col.enableResizeable ?? true
428
684
  },
429
685
  style: isActionsCol ? { width, minWidth: width, position: "relative" } : {},
430
- body: (rowData) => isActionsCol ? /* @__PURE__ */ jsx8(
686
+ body: (rowData) => isActionsCol ? /* @__PURE__ */ jsx11(
431
687
  ActionsColumn,
432
688
  {
433
689
  row: rowData,
@@ -436,7 +692,7 @@ function DynamicColumns({
436
692
  customActionsColums,
437
693
  isLanguagePtBr
438
694
  }
439
- ) : col.body ? col.body(rowData) : /* @__PURE__ */ jsx8("span", { children: String(rowData[col.field]) }),
695
+ ) : col.body ? col.body(rowData) : /* @__PURE__ */ jsx11("span", { children: String(rowData[col.field]) }),
440
696
  sortable: !isActionsCol ? col.enableSorting ?? true : false
441
697
  },
442
698
  `${String(col.field)}-${idx}`
@@ -447,10 +703,10 @@ function DynamicColumns({
447
703
  }
448
704
 
449
705
  // src/hooks/use-debounce.ts
450
- import { useEffect as useEffect2, useState } from "react";
706
+ import { useEffect as useEffect3, useState as useState3 } from "react";
451
707
  var useDebounce = (value, delay) => {
452
- const [debouncedValue, setDebouncedValue] = useState(value);
453
- useEffect2(() => {
708
+ const [debouncedValue, setDebouncedValue] = useState3(value);
709
+ useEffect3(() => {
454
710
  const timer = setTimeout(() => {
455
711
  setDebouncedValue(value);
456
712
  }, delay || 500);
@@ -462,7 +718,7 @@ var useDebounce = (value, delay) => {
462
718
  };
463
719
 
464
720
  // src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
465
- import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
721
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
466
722
  function DataTableAdvancedFilterWrapper({
467
723
  queryKey,
468
724
  mutationFn,
@@ -482,8 +738,8 @@ function DataTableAdvancedFilterWrapper({
482
738
  state,
483
739
  onStateChange
484
740
  }) {
485
- const [isClient, setIsClient] = useState2(false);
486
- useEffect3(() => {
741
+ const [isClient, setIsClient] = useState4(false);
742
+ useEffect4(() => {
487
743
  setIsClient(true);
488
744
  }, []);
489
745
  const initialState = state ?? {
@@ -493,17 +749,17 @@ function DataTableAdvancedFilterWrapper({
493
749
  sortOrder: sortOrderInitial,
494
750
  filter: ""
495
751
  };
496
- const [page, setPage] = useState2(initialState.page);
497
- const [rows, setRows] = useState2(initialState.rows);
498
- const [first, setFirst] = useState2((initialState.page - 1) * initialState.rows);
499
- const [sortField, setSortField] = useState2(initialState.sortField);
500
- const [sortOrder, setSortOrder] = useState2(initialState.sortOrder ?? 1);
501
- const [searchText, setSearchText] = useState2(initialState.filter ?? "");
502
- const [filters, setFilters] = useState2({
752
+ const [page, setPage] = useState4(initialState.page);
753
+ const [rows, setRows] = useState4(initialState.rows);
754
+ const [first, setFirst] = useState4((initialState.page - 1) * initialState.rows);
755
+ const [sortField, setSortField] = useState4(initialState.sortField);
756
+ const [sortOrder, setSortOrder] = useState4(initialState.sortOrder ?? 1);
757
+ const [searchText, setSearchText] = useState4(initialState.filter ?? "");
758
+ const [filters, setFilters] = useState4({
503
759
  ...initFilters,
504
760
  global: { value: initialState.filter, matchMode: "contains" }
505
761
  });
506
- const [selectedRowsData, setSelectedRowsData] = useState2([]);
762
+ const [selectedRowsData, setSelectedRowsData] = useState4([]);
507
763
  const debouncedSearch = useDebounce(searchText, 500);
508
764
  const debouncedFilters = useMemo(() => {
509
765
  const f = { ...filters };
@@ -528,7 +784,7 @@ function DataTableAdvancedFilterWrapper({
528
784
  globalFilterFields
529
785
  )
530
786
  });
531
- useEffect3(() => {
787
+ useEffect4(() => {
532
788
  if (!state) return;
533
789
  setPage(state.page);
534
790
  setRows(state.rows);
@@ -584,7 +840,7 @@ function DataTableAdvancedFilterWrapper({
584
840
  filter: searchText
585
841
  });
586
842
  };
587
- useEffect3(() => {
843
+ useEffect4(() => {
588
844
  emitStateChange({
589
845
  page: 1,
590
846
  rows,
@@ -593,7 +849,7 @@ function DataTableAdvancedFilterWrapper({
593
849
  filter: debouncedSearch
594
850
  });
595
851
  }, [debouncedSearch]);
596
- useEffect3(() => {
852
+ useEffect4(() => {
597
853
  if (customers?.items && selectedRowsData.length > 0) {
598
854
  const currentIds = new Set(customers.items.map((item) => item.id));
599
855
  const filteredSelection = selectedRowsData.filter(
@@ -605,8 +861,8 @@ function DataTableAdvancedFilterWrapper({
605
861
  }
606
862
  }, [customers?.items, selectedRowsData]);
607
863
  const TableHeaderAndTableActions = useMemo(
608
- () => /* @__PURE__ */ jsxs5(Fragment4, { children: [
609
- globalFilterFields.length > 0 && /* @__PURE__ */ jsx9(
864
+ () => /* @__PURE__ */ jsxs9(Fragment5, { children: [
865
+ globalFilterFields.length > 0 && /* @__PURE__ */ jsx12(
610
866
  TableHeader_default,
611
867
  {
612
868
  isLanguagePtBr,
@@ -614,7 +870,7 @@ function DataTableAdvancedFilterWrapper({
614
870
  onGlobalFilterChange
615
871
  }
616
872
  ),
617
- /* @__PURE__ */ jsx9(
873
+ /* @__PURE__ */ jsx12(
618
874
  TableActions,
619
875
  {
620
876
  selectedRows: selectedRowsData,
@@ -637,9 +893,9 @@ function DataTableAdvancedFilterWrapper({
637
893
  customActions
638
894
  ]
639
895
  );
640
- return /* @__PURE__ */ jsx9(Fragment4, { children: isClient && /* @__PURE__ */ jsxs5("div", { children: [
641
- disablePagination && /* @__PURE__ */ jsx9("div", { className: "disablePagination", children: TableHeaderAndTableActions }),
642
- /* @__PURE__ */ jsxs5(
896
+ return /* @__PURE__ */ jsx12(Fragment5, { children: isClient && /* @__PURE__ */ jsxs9("div", { children: [
897
+ disablePagination && /* @__PURE__ */ jsx12("div", { className: "disablePagination", children: TableHeaderAndTableActions }),
898
+ /* @__PURE__ */ jsxs9(
643
899
  DataTable,
644
900
  {
645
901
  value: customers?.items ?? [],
@@ -665,7 +921,7 @@ function DataTableAdvancedFilterWrapper({
665
921
  sortOrder,
666
922
  paginatorTemplate: {
667
923
  layout: "RowsPerPageDropdown PrevPageLink CurrentPageReport NextPageLink",
668
- RowsPerPageDropdown: (options) => /* @__PURE__ */ jsx9(
924
+ RowsPerPageDropdown: (options) => /* @__PURE__ */ jsx12(
669
925
  "select",
670
926
  {
671
927
  value: options.value,
@@ -674,20 +930,20 @@ function DataTableAdvancedFilterWrapper({
674
930
  value: Number(e.target.value)
675
931
  }),
676
932
  className: "custom-input custom-select",
677
- children: options.options.map((opt) => /* @__PURE__ */ jsx9("option", { value: opt.value, children: opt.label }, opt.value))
933
+ children: options.options.map((opt) => /* @__PURE__ */ jsx12("option", { value: opt.value, children: opt.label }, opt.value))
678
934
  }
679
935
  ),
680
- PrevPageLink: (options) => /* @__PURE__ */ jsx9(
936
+ PrevPageLink: (options) => /* @__PURE__ */ jsx12(
681
937
  "button",
682
938
  {
683
939
  type: "button",
684
940
  onClick: options.onClick,
685
941
  disabled: options.disabled,
686
942
  className: `PrevPage ${options.disabled ? "PrevPageDisabled" : "PrevPageEnabled"}`,
687
- children: /* @__PURE__ */ jsx9(CaretLeft, { size: 18, color: "#fff" })
943
+ children: /* @__PURE__ */ jsx12(CaretLeft, { size: 18, color: "#fff" })
688
944
  }
689
945
  ),
690
- CurrentPageReport: (options) => /* @__PURE__ */ jsxs5("span", { className: "pageReport", children: [
946
+ CurrentPageReport: (options) => /* @__PURE__ */ jsxs9("span", { className: "pageReport", children: [
691
947
  isLanguagePtBr ? "Mostrando" : "Showing",
692
948
  " ",
693
949
  options.first,
@@ -700,21 +956,21 @@ function DataTableAdvancedFilterWrapper({
700
956
  " ",
701
957
  options.totalRecords
702
958
  ] }),
703
- NextPageLink: (options) => /* @__PURE__ */ jsx9(
959
+ NextPageLink: (options) => /* @__PURE__ */ jsx12(
704
960
  "button",
705
961
  {
706
962
  type: "button",
707
963
  onClick: options.onClick,
708
964
  disabled: options.disabled,
709
965
  className: `NextPage ${options.disabled ? "NextPageDisabled" : "NextPageEnabled"}`,
710
- children: /* @__PURE__ */ jsx9(CaretRight, { size: 18, color: "#fff" })
966
+ children: /* @__PURE__ */ jsx12(CaretRight, { size: 18, color: "#fff" })
711
967
  }
712
968
  )
713
969
  },
714
970
  paginatorPosition: "top",
715
- paginatorLeft: /* @__PURE__ */ jsx9("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
971
+ paginatorLeft: /* @__PURE__ */ jsx12("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
716
972
  currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
717
- emptyMessage: /* @__PURE__ */ jsx9("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx9("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
973
+ emptyMessage: /* @__PURE__ */ jsx12("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx12("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
718
974
  onFilter: (e) => {
719
975
  const newFilters = { ...e.filters };
720
976
  Object.keys(filters).forEach((key) => {
@@ -913,7 +1169,7 @@ var localePtBr = {
913
1169
  };
914
1170
 
915
1171
  // src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
916
- import { Fragment as Fragment5, jsx as jsx10 } from "react/jsx-runtime";
1172
+ import { Fragment as Fragment6, jsx as jsx13 } from "react/jsx-runtime";
917
1173
  function DataTableAdvancedFilter({
918
1174
  queryKey,
919
1175
  mutationFn,
@@ -933,21 +1189,21 @@ function DataTableAdvancedFilter({
933
1189
  state,
934
1190
  onStateChange
935
1191
  }) {
936
- const [isClient, setIsClient] = useState3(false);
937
- useEffect4(() => {
1192
+ const [isClient, setIsClient] = useState5(false);
1193
+ useEffect5(() => {
938
1194
  addLocale("pt", localePtBr);
939
1195
  }, []);
940
- useEffect4(() => {
1196
+ useEffect5(() => {
941
1197
  locale(isLanguagePtBr ? "pt" : "en");
942
1198
  }, [isLanguagePtBr]);
943
- useEffect4(() => {
1199
+ useEffect5(() => {
944
1200
  setIsClient(true);
945
1201
  }, []);
946
- return /* @__PURE__ */ jsx10(Fragment5, { children: isClient && /* @__PURE__ */ jsx10(
1202
+ return /* @__PURE__ */ jsx13(Fragment6, { children: isClient && /* @__PURE__ */ jsx13(
947
1203
  PrimeReactProvider,
948
1204
  {
949
1205
  value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
950
- children: /* @__PURE__ */ jsx10(
1206
+ children: /* @__PURE__ */ jsx13(
951
1207
  DataTableAdvancedFilterWrapper,
952
1208
  {
953
1209
  rowsPerPageOptions,
@@ -977,10 +1233,10 @@ function DataTableAdvancedFilter({
977
1233
  import Select from "react-select";
978
1234
  import { Dropdown } from "primereact/dropdown";
979
1235
  import moment2 from "moment";
980
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
1236
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
981
1237
  var DateFilterTemplate = (options, mask) => {
982
1238
  const parsedValue = options.value && typeof options.value === "string" ? /* @__PURE__ */ new Date(options.value + "T00:00:00") : options.value;
983
- return /* @__PURE__ */ jsx11(
1239
+ return /* @__PURE__ */ jsx14(
984
1240
  Calendar,
985
1241
  {
986
1242
  value: parsedValue,
@@ -1005,7 +1261,7 @@ var DateFilterTemplate = (options, mask) => {
1005
1261
  };
1006
1262
  var DateTimeFilterTemplate = (options, mask) => {
1007
1263
  const value = typeof options.value === "string" ? moment2(options.value).toDate() : options.value ?? null;
1008
- return /* @__PURE__ */ jsx11(
1264
+ return /* @__PURE__ */ jsx14(
1009
1265
  Calendar,
1010
1266
  {
1011
1267
  value,
@@ -1039,7 +1295,7 @@ var ValueFilterTemplate = (options, mask) => {
1039
1295
  const valueToFilter = mask ? mask(rawValue) : rawValue;
1040
1296
  options.filterCallback(valueToFilter, options.index);
1041
1297
  };
1042
- return /* @__PURE__ */ jsx11(
1298
+ return /* @__PURE__ */ jsx14(
1043
1299
  InputNumber,
1044
1300
  {
1045
1301
  value: parsedValue,
@@ -1058,7 +1314,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
1058
1314
  { label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
1059
1315
  ];
1060
1316
  const currentValue = selectOptions.find((opt) => opt.value === options.value) || null;
1061
- return /* @__PURE__ */ jsx11(
1317
+ return /* @__PURE__ */ jsx14(
1062
1318
  Select,
1063
1319
  {
1064
1320
  options: selectOptions,
@@ -1117,7 +1373,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1117
1373
  const currentMatchMode = rawFilter.matchMode ?? "contains";
1118
1374
  const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
1119
1375
  const isSpecial = currentMatchMode === customMatchModes.empty || currentMatchMode === customMatchModes.notEmpty;
1120
- return /* @__PURE__ */ jsxs6(
1376
+ return /* @__PURE__ */ jsxs10(
1121
1377
  "div",
1122
1378
  {
1123
1379
  className: "filter-wrapper",
@@ -1128,7 +1384,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1128
1384
  minWidth: "200px"
1129
1385
  },
1130
1386
  children: [
1131
- /* @__PURE__ */ jsx11(
1387
+ /* @__PURE__ */ jsx14(
1132
1388
  Dropdown,
1133
1389
  {
1134
1390
  value: currentMatchMode,
@@ -1154,7 +1410,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1154
1410
  }
1155
1411
  }
1156
1412
  ),
1157
- !isSpecial && /* @__PURE__ */ jsx11(
1413
+ !isSpecial && /* @__PURE__ */ jsx14(
1158
1414
  InputText,
1159
1415
  {
1160
1416
  value: currentValue,
@@ -1573,8 +1829,10 @@ export {
1573
1829
  DateTimeFilterTemplate,
1574
1830
  FilterMatchMode5 as FilterMatchMode,
1575
1831
  FilterOperator2 as FilterOperator,
1832
+ Input,
1576
1833
  ModalBase,
1577
1834
  SelectFilterTemplate,
1835
+ TextArea,
1578
1836
  ValueFilterTemplate,
1579
1837
  buildDynamicCampoFilters,
1580
1838
  buildSortingWithFilters,