@charlesgomes/leafcode-shared-lib-react 1.0.16 → 1.0.18
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.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +161 -85
- package/dist/index.mjs +143 -68
- package/package.json +4 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode as ReactNode$1 } from 'react';
|
|
2
3
|
import { FilterMatchMode } from 'primereact/api';
|
|
3
4
|
export { FilterMatchMode, FilterOperator } from 'primereact/api';
|
|
4
5
|
export { DataTableProps } from 'primereact/datatable';
|
|
@@ -15,6 +16,19 @@ interface ButtonProps {
|
|
|
15
16
|
}
|
|
16
17
|
declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
17
18
|
|
|
19
|
+
interface Props {
|
|
20
|
+
show: boolean;
|
|
21
|
+
onHide: () => void;
|
|
22
|
+
onAction: () => void;
|
|
23
|
+
title: string;
|
|
24
|
+
children: ReactNode$1;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
btnCancel?: string;
|
|
27
|
+
btnSuccess?: string;
|
|
28
|
+
disabledBtnSuccess?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, disabledBtnSuccess, }: Props): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
18
32
|
type IDataTableProps<T extends object> = {
|
|
19
33
|
queryKey: string;
|
|
20
34
|
mutationFn: (
|
|
@@ -90,4 +104,4 @@ declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean) => {
|
|
|
90
104
|
value: FilterMatchMode;
|
|
91
105
|
}[];
|
|
92
106
|
|
|
93
|
-
export { Button, type ColumnCustom, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, SelectFilterTemplate, ValueFilterTemplate, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsString };
|
|
107
|
+
export { Button, type ColumnCustom, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, ModalBase, SelectFilterTemplate, ValueFilterTemplate, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsString };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode as ReactNode$1 } from 'react';
|
|
2
3
|
import { FilterMatchMode } from 'primereact/api';
|
|
3
4
|
export { FilterMatchMode, FilterOperator } from 'primereact/api';
|
|
4
5
|
export { DataTableProps } from 'primereact/datatable';
|
|
@@ -15,6 +16,19 @@ interface ButtonProps {
|
|
|
15
16
|
}
|
|
16
17
|
declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
17
18
|
|
|
19
|
+
interface Props {
|
|
20
|
+
show: boolean;
|
|
21
|
+
onHide: () => void;
|
|
22
|
+
onAction: () => void;
|
|
23
|
+
title: string;
|
|
24
|
+
children: ReactNode$1;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
btnCancel?: string;
|
|
27
|
+
btnSuccess?: string;
|
|
28
|
+
disabledBtnSuccess?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, disabledBtnSuccess, }: Props): react_jsx_runtime.JSX.Element;
|
|
31
|
+
|
|
18
32
|
type IDataTableProps<T extends object> = {
|
|
19
33
|
queryKey: string;
|
|
20
34
|
mutationFn: (
|
|
@@ -90,4 +104,4 @@ declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean) => {
|
|
|
90
104
|
value: FilterMatchMode;
|
|
91
105
|
}[];
|
|
92
106
|
|
|
93
|
-
export { Button, type ColumnCustom, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, SelectFilterTemplate, ValueFilterTemplate, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsString };
|
|
107
|
+
export { Button, type ColumnCustom, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, ModalBase, SelectFilterTemplate, ValueFilterTemplate, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsString };
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
DateTimeFilterTemplate: () => DateTimeFilterTemplate,
|
|
37
37
|
FilterMatchMode: () => import_api4.FilterMatchMode,
|
|
38
38
|
FilterOperator: () => import_api4.FilterOperator,
|
|
39
|
+
ModalBase: () => ModalBase,
|
|
39
40
|
SelectFilterTemplate: () => SelectFilterTemplate,
|
|
40
41
|
ValueFilterTemplate: () => ValueFilterTemplate,
|
|
41
42
|
getDefaultFilterMatchOptionsDate: () => getDefaultFilterMatchOptionsDate,
|
|
@@ -96,11 +97,85 @@ function Button({
|
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
// src/components/ModalBase/ModalBase.tsx
|
|
101
|
+
var import_react = require("@phosphor-icons/react");
|
|
102
|
+
|
|
103
|
+
// src/components/ModalBase/FooterButtons.tsx
|
|
104
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
105
|
+
function FooterButtons({ children }) {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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 });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/components/ModalBase/ModalBase.tsx
|
|
110
|
+
var import_react2 = require("react");
|
|
111
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
112
|
+
function ModalBase({
|
|
113
|
+
show,
|
|
114
|
+
onHide,
|
|
115
|
+
onAction,
|
|
116
|
+
title,
|
|
117
|
+
children,
|
|
118
|
+
loading,
|
|
119
|
+
btnCancel = "Cancel",
|
|
120
|
+
btnSuccess = "Save",
|
|
121
|
+
disabledBtnSuccess
|
|
122
|
+
}) {
|
|
123
|
+
(0, import_react2.useEffect)(() => {
|
|
124
|
+
const handleKeyDown = (event) => {
|
|
125
|
+
if (event.key === "Escape") {
|
|
126
|
+
onHide();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
130
|
+
return () => {
|
|
131
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
132
|
+
};
|
|
133
|
+
}, [onHide]);
|
|
134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: show ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("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__ */ (0, import_jsx_runtime3.jsx)("div", { className: "relative w-auto my-6 mx-auto max-w-xl", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-theme-dark outline-none focus:outline-none", children: [
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-start justify-between p-2", children: [
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("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 }),
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
139
|
+
"button",
|
|
140
|
+
{
|
|
141
|
+
className: "p-1 ml-auto mr-1 cursor-pointer",
|
|
142
|
+
onClick: onHide,
|
|
143
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react.X, { size: 18, color: "#ffffff" })
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-full p-6", children }),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(FooterButtons, { children: [
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
150
|
+
Button,
|
|
151
|
+
{
|
|
152
|
+
color: "danger",
|
|
153
|
+
title: btnCancel,
|
|
154
|
+
type: "button",
|
|
155
|
+
onClick: onHide
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
159
|
+
Button,
|
|
160
|
+
{
|
|
161
|
+
type: "button",
|
|
162
|
+
title: btnSuccess,
|
|
163
|
+
onClick: onAction,
|
|
164
|
+
loading,
|
|
165
|
+
disabled: disabledBtnSuccess
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] })
|
|
169
|
+
] }) }) }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "opacity-40 fixed inset-0 z-50 bg-black" })
|
|
171
|
+
] }) : null });
|
|
172
|
+
}
|
|
173
|
+
|
|
99
174
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
100
|
-
var
|
|
175
|
+
var import_react8 = require("react");
|
|
101
176
|
|
|
102
177
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
103
|
-
var
|
|
178
|
+
var import_react6 = require("react");
|
|
104
179
|
var import_react_query = require("@tanstack/react-query");
|
|
105
180
|
|
|
106
181
|
// src/primereact-compat.ts
|
|
@@ -112,13 +187,13 @@ var import_calendar = require("primereact/calendar");
|
|
|
112
187
|
var import_api = require("primereact/api");
|
|
113
188
|
|
|
114
189
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
115
|
-
var
|
|
190
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
116
191
|
var TableHeader = ({
|
|
117
192
|
globalFilterValue,
|
|
118
193
|
onGlobalFilterChange,
|
|
119
194
|
isLanguagePtBr
|
|
120
195
|
}) => {
|
|
121
|
-
return /* @__PURE__ */ (0,
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
122
197
|
import_inputtext.InputText,
|
|
123
198
|
{
|
|
124
199
|
value: globalFilterValue,
|
|
@@ -131,10 +206,10 @@ var TableHeader = ({
|
|
|
131
206
|
var TableHeader_default = TableHeader;
|
|
132
207
|
|
|
133
208
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
134
|
-
var
|
|
209
|
+
var import_react7 = require("@phosphor-icons/react");
|
|
135
210
|
|
|
136
211
|
// src/components/DataTableAdvancedFilter/TableActions.tsx
|
|
137
|
-
var
|
|
212
|
+
var import_react3 = require("@phosphor-icons/react");
|
|
138
213
|
|
|
139
214
|
// src/utils/utils.ts
|
|
140
215
|
var import_clsx = require("clsx");
|
|
@@ -153,9 +228,9 @@ function centsToReal(value) {
|
|
|
153
228
|
|
|
154
229
|
// src/components/TooltipCustom.tsx
|
|
155
230
|
var import_react_tooltip = require("react-tooltip");
|
|
156
|
-
var
|
|
231
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
157
232
|
function TooltipCustom({ label, id }) {
|
|
158
|
-
return /* @__PURE__ */ (0,
|
|
233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
159
234
|
import_react_tooltip.Tooltip,
|
|
160
235
|
{
|
|
161
236
|
className: "tooltip-icone",
|
|
@@ -166,13 +241,13 @@ function TooltipCustom({ label, id }) {
|
|
|
166
241
|
zIndex: 9999
|
|
167
242
|
},
|
|
168
243
|
positionStrategy: "fixed",
|
|
169
|
-
children: /* @__PURE__ */ (0,
|
|
244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "tooltip-custom", children: label })
|
|
170
245
|
}
|
|
171
246
|
);
|
|
172
247
|
}
|
|
173
248
|
|
|
174
249
|
// src/components/DataTableAdvancedFilter/TableActions.tsx
|
|
175
|
-
var
|
|
250
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
176
251
|
function TableActions({
|
|
177
252
|
onNew,
|
|
178
253
|
onEdit,
|
|
@@ -184,9 +259,9 @@ function TableActions({
|
|
|
184
259
|
const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
|
|
185
260
|
const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
|
|
186
261
|
const resolvedCustomActions = typeof customActions === "function" ? customActions(selectedRows) : customActions;
|
|
187
|
-
return /* @__PURE__ */ (0,
|
|
188
|
-
onNew && /* @__PURE__ */ (0,
|
|
189
|
-
/* @__PURE__ */ (0,
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "box-icones-table-actions", children: [
|
|
263
|
+
onNew && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
190
265
|
"button",
|
|
191
266
|
{
|
|
192
267
|
id: "add",
|
|
@@ -196,10 +271,10 @@ function TableActions({
|
|
|
196
271
|
enableButtonsNotMultiplesSelecteds && "disable-button-table-actions"
|
|
197
272
|
),
|
|
198
273
|
disabled: enableButtonsNotMultiplesSelecteds,
|
|
199
|
-
children: /* @__PURE__ */ (0,
|
|
274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react3.Plus, { size: 18 })
|
|
200
275
|
}
|
|
201
276
|
),
|
|
202
|
-
/* @__PURE__ */ (0,
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
203
278
|
TooltipCustom,
|
|
204
279
|
{
|
|
205
280
|
id: "add",
|
|
@@ -207,7 +282,7 @@ function TableActions({
|
|
|
207
282
|
}
|
|
208
283
|
)
|
|
209
284
|
] }),
|
|
210
|
-
onEdit && /* @__PURE__ */ (0,
|
|
285
|
+
onEdit && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
211
286
|
"button",
|
|
212
287
|
{
|
|
213
288
|
id: "edit",
|
|
@@ -218,8 +293,8 @@ function TableActions({
|
|
|
218
293
|
),
|
|
219
294
|
disabled: disableButtonsNotMultiplesSelecteds,
|
|
220
295
|
children: [
|
|
221
|
-
/* @__PURE__ */ (0,
|
|
222
|
-
/* @__PURE__ */ (0,
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react3.PencilSimple, { size: 18 }),
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
223
298
|
TooltipCustom,
|
|
224
299
|
{
|
|
225
300
|
id: "edit",
|
|
@@ -229,7 +304,7 @@ function TableActions({
|
|
|
229
304
|
]
|
|
230
305
|
}
|
|
231
306
|
) }),
|
|
232
|
-
onDelete && /* @__PURE__ */ (0,
|
|
307
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
233
308
|
"button",
|
|
234
309
|
{
|
|
235
310
|
id: "delete",
|
|
@@ -240,8 +315,8 @@ function TableActions({
|
|
|
240
315
|
),
|
|
241
316
|
disabled: !enableButtonsNotMultiplesSelecteds,
|
|
242
317
|
children: [
|
|
243
|
-
/* @__PURE__ */ (0,
|
|
244
|
-
/* @__PURE__ */ (0,
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react3.Trash, { size: 18 }),
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
245
320
|
TooltipCustom,
|
|
246
321
|
{
|
|
247
322
|
id: "delete",
|
|
@@ -253,7 +328,7 @@ function TableActions({
|
|
|
253
328
|
) }),
|
|
254
329
|
resolvedCustomActions?.map((action) => {
|
|
255
330
|
const id = `action-table${phraseToId(action.label)}`;
|
|
256
|
-
return /* @__PURE__ */ (0,
|
|
331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
257
332
|
"button",
|
|
258
333
|
{
|
|
259
334
|
id,
|
|
@@ -261,7 +336,7 @@ function TableActions({
|
|
|
261
336
|
className: cn("enable-button-table-actions", action.className),
|
|
262
337
|
children: [
|
|
263
338
|
action.icon,
|
|
264
|
-
/* @__PURE__ */ (0,
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TooltipCustom, { id, label: action.label })
|
|
265
340
|
]
|
|
266
341
|
},
|
|
267
342
|
id
|
|
@@ -271,8 +346,8 @@ function TableActions({
|
|
|
271
346
|
}
|
|
272
347
|
|
|
273
348
|
// src/components/DataTableAdvancedFilter/ActionsColumn.tsx
|
|
274
|
-
var
|
|
275
|
-
var
|
|
349
|
+
var import_react4 = require("@phosphor-icons/react");
|
|
350
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
276
351
|
function ActionsColumn({
|
|
277
352
|
row,
|
|
278
353
|
onEdit,
|
|
@@ -281,8 +356,8 @@ function ActionsColumn({
|
|
|
281
356
|
isLanguagePtBr
|
|
282
357
|
}) {
|
|
283
358
|
const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
|
|
284
|
-
return /* @__PURE__ */ (0,
|
|
285
|
-
onEdit && /* @__PURE__ */ (0,
|
|
359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "box-icones-actions-column", children: [
|
|
360
|
+
onEdit && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
286
361
|
"button",
|
|
287
362
|
{
|
|
288
363
|
id: "edit-column",
|
|
@@ -291,8 +366,8 @@ function ActionsColumn({
|
|
|
291
366
|
onEdit && onEdit([row]);
|
|
292
367
|
},
|
|
293
368
|
children: [
|
|
294
|
-
/* @__PURE__ */ (0,
|
|
295
|
-
/* @__PURE__ */ (0,
|
|
369
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.PencilSimple, { size: 17, weight: "regular" }),
|
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
296
371
|
TooltipCustom,
|
|
297
372
|
{
|
|
298
373
|
id: "edit-column",
|
|
@@ -302,7 +377,7 @@ function ActionsColumn({
|
|
|
302
377
|
]
|
|
303
378
|
}
|
|
304
379
|
) }),
|
|
305
|
-
onDelete && /* @__PURE__ */ (0,
|
|
380
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
306
381
|
"button",
|
|
307
382
|
{
|
|
308
383
|
id: "delete-column",
|
|
@@ -311,8 +386,8 @@ function ActionsColumn({
|
|
|
311
386
|
onDelete && onDelete([row]);
|
|
312
387
|
},
|
|
313
388
|
children: [
|
|
314
|
-
/* @__PURE__ */ (0,
|
|
315
|
-
/* @__PURE__ */ (0,
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.Trash, { size: 17, weight: "regular" }),
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
316
391
|
TooltipCustom,
|
|
317
392
|
{
|
|
318
393
|
id: "delete-column",
|
|
@@ -324,7 +399,7 @@ function ActionsColumn({
|
|
|
324
399
|
) }),
|
|
325
400
|
resolvedCustomActions?.map((action) => {
|
|
326
401
|
const id = `action-colunm-${phraseToId(action.label)}`;
|
|
327
|
-
return /* @__PURE__ */ (0,
|
|
402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
328
403
|
"button",
|
|
329
404
|
{
|
|
330
405
|
id,
|
|
@@ -332,7 +407,7 @@ function ActionsColumn({
|
|
|
332
407
|
className: cn("btn-icone-actions-column", action.className),
|
|
333
408
|
children: [
|
|
334
409
|
action.icon,
|
|
335
|
-
/* @__PURE__ */ (0,
|
|
410
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipCustom, { id, label: action.label })
|
|
336
411
|
]
|
|
337
412
|
},
|
|
338
413
|
id
|
|
@@ -342,7 +417,7 @@ function ActionsColumn({
|
|
|
342
417
|
}
|
|
343
418
|
|
|
344
419
|
// src/components/DataTableAdvancedFilter/DynamicColumns.tsx
|
|
345
|
-
var
|
|
420
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
346
421
|
function DynamicColumns({
|
|
347
422
|
columns,
|
|
348
423
|
isMultiSelectionMode = true,
|
|
@@ -354,7 +429,7 @@ function DynamicColumns({
|
|
|
354
429
|
const array = [];
|
|
355
430
|
if (isMultiSelectionMode) {
|
|
356
431
|
array.push(
|
|
357
|
-
/* @__PURE__ */ (0,
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
358
433
|
import_column.Column,
|
|
359
434
|
{
|
|
360
435
|
selectionMode: "multiple",
|
|
@@ -371,7 +446,7 @@ function DynamicColumns({
|
|
|
371
446
|
const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
|
|
372
447
|
const placeholder = isLanguagePtBr ? "Procurar" : "Search";
|
|
373
448
|
array.push(
|
|
374
|
-
/* @__PURE__ */ (0,
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
375
450
|
import_column.Column,
|
|
376
451
|
{
|
|
377
452
|
field: isActionsCol ? void 0 : col.field,
|
|
@@ -387,7 +462,7 @@ function DynamicColumns({
|
|
|
387
462
|
resizeable: col.enableResizeable ?? true
|
|
388
463
|
},
|
|
389
464
|
style: isActionsCol ? { width, minWidth: width, position: "relative" } : {},
|
|
390
|
-
body: (rowData) => isActionsCol ? /* @__PURE__ */ (0,
|
|
465
|
+
body: (rowData) => isActionsCol ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
391
466
|
ActionsColumn,
|
|
392
467
|
{
|
|
393
468
|
row: rowData,
|
|
@@ -396,7 +471,7 @@ function DynamicColumns({
|
|
|
396
471
|
customActionsColums,
|
|
397
472
|
isLanguagePtBr
|
|
398
473
|
}
|
|
399
|
-
) : col.body ? col.body(rowData) : /* @__PURE__ */ (0,
|
|
474
|
+
) : col.body ? col.body(rowData) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: String(rowData[col.field]) }),
|
|
400
475
|
sortable: !isActionsCol ? col.enableSorting ?? true : false
|
|
401
476
|
},
|
|
402
477
|
`${String(col.field)}-${idx}`
|
|
@@ -421,10 +496,10 @@ var getUrlParams = (sortFieldInitial, sortOrderInitial) => {
|
|
|
421
496
|
};
|
|
422
497
|
|
|
423
498
|
// src/hooks/use-debounce.ts
|
|
424
|
-
var
|
|
499
|
+
var import_react5 = require("react");
|
|
425
500
|
var useDebounce = (value, delay) => {
|
|
426
|
-
const [debouncedValue, setDebouncedValue] = (0,
|
|
427
|
-
(0,
|
|
501
|
+
const [debouncedValue, setDebouncedValue] = (0, import_react5.useState)(value);
|
|
502
|
+
(0, import_react5.useEffect)(() => {
|
|
428
503
|
const timer = setTimeout(() => {
|
|
429
504
|
setDebouncedValue(value);
|
|
430
505
|
}, delay || 500);
|
|
@@ -436,7 +511,7 @@ var useDebounce = (value, delay) => {
|
|
|
436
511
|
};
|
|
437
512
|
|
|
438
513
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
439
|
-
var
|
|
514
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
440
515
|
function DataTableAdvancedFilterWrapper({
|
|
441
516
|
queryKey,
|
|
442
517
|
mutationFn,
|
|
@@ -453,8 +528,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
453
528
|
isMultiSelectionMode = true,
|
|
454
529
|
isLanguagePtBr = true
|
|
455
530
|
}) {
|
|
456
|
-
const [isClient, setIsClient] = (0,
|
|
457
|
-
(0,
|
|
531
|
+
const [isClient, setIsClient] = (0, import_react6.useState)(false);
|
|
532
|
+
(0, import_react6.useEffect)(() => {
|
|
458
533
|
setIsClient(true);
|
|
459
534
|
}, []);
|
|
460
535
|
const {
|
|
@@ -464,26 +539,26 @@ function DataTableAdvancedFilterWrapper({
|
|
|
464
539
|
sortOrder: urlSortOrder,
|
|
465
540
|
filter: urlFilter
|
|
466
541
|
} = getUrlParams(sortFieldInitial, sortOrderInitial);
|
|
467
|
-
const [page, setPage] = (0,
|
|
468
|
-
const [rows, setRows] = (0,
|
|
469
|
-
const [first, setFirst] = (0,
|
|
470
|
-
const [sortField, setSortField] = (0,
|
|
471
|
-
const [sortOrder, setSortOrder] = (0,
|
|
472
|
-
const [searchText, setSearchText] = (0,
|
|
473
|
-
const [filters, setFilters] = (0,
|
|
542
|
+
const [page, setPage] = (0, import_react6.useState)(urlPage);
|
|
543
|
+
const [rows, setRows] = (0, import_react6.useState)(urlRows);
|
|
544
|
+
const [first, setFirst] = (0, import_react6.useState)((urlPage - 1) * urlRows);
|
|
545
|
+
const [sortField, setSortField] = (0, import_react6.useState)(urlSortField);
|
|
546
|
+
const [sortOrder, setSortOrder] = (0, import_react6.useState)(urlSortOrder);
|
|
547
|
+
const [searchText, setSearchText] = (0, import_react6.useState)(urlFilter);
|
|
548
|
+
const [filters, setFilters] = (0, import_react6.useState)({
|
|
474
549
|
...initFilters,
|
|
475
550
|
global: { value: urlFilter, matchMode: "contains" }
|
|
476
551
|
});
|
|
477
|
-
const [selectedRowsData, setSelectedRowsData] = (0,
|
|
552
|
+
const [selectedRowsData, setSelectedRowsData] = (0, import_react6.useState)([]);
|
|
478
553
|
const debouncedSearch = useDebounce(searchText, 500);
|
|
479
|
-
const debouncedFilters = (0,
|
|
554
|
+
const debouncedFilters = (0, import_react6.useMemo)(() => {
|
|
480
555
|
const f = { ...filters };
|
|
481
556
|
if (!f.global) f.global = { value: "", matchMode: "contains" };
|
|
482
557
|
f.global.value = debouncedSearch;
|
|
483
558
|
return f;
|
|
484
559
|
}, [filters, debouncedSearch]);
|
|
485
560
|
const filtersKey = JSON.stringify(debouncedFilters);
|
|
486
|
-
const globalFilterFields = (0,
|
|
561
|
+
const globalFilterFields = (0, import_react6.useMemo)(() => {
|
|
487
562
|
return columns?.filter(
|
|
488
563
|
(col) => col.filterGlobal === true && (col.field !== "acoes" || col.field !== "actions")
|
|
489
564
|
).map((col) => col.field) ?? [];
|
|
@@ -540,10 +615,10 @@ function DataTableAdvancedFilterWrapper({
|
|
|
540
615
|
setSortOrder(e.sortOrder);
|
|
541
616
|
updateUrlParams({ sortField: e.sortField, sortOrder: e.sortOrder });
|
|
542
617
|
};
|
|
543
|
-
(0,
|
|
618
|
+
(0, import_react6.useEffect)(() => {
|
|
544
619
|
updateUrlParams({ page: 1, filter: debouncedSearch });
|
|
545
620
|
}, [debouncedSearch]);
|
|
546
|
-
(0,
|
|
621
|
+
(0, import_react6.useEffect)(() => {
|
|
547
622
|
if (customers?.items && selectedRowsData.length > 0) {
|
|
548
623
|
const currentIds = new Set(customers.items.map((item) => item.id));
|
|
549
624
|
const filteredSelection = selectedRowsData.filter(
|
|
@@ -554,9 +629,9 @@ function DataTableAdvancedFilterWrapper({
|
|
|
554
629
|
}
|
|
555
630
|
}
|
|
556
631
|
}, [customers?.items, selectedRowsData]);
|
|
557
|
-
const TableHeaderAndTableActions = (0,
|
|
558
|
-
() => /* @__PURE__ */ (0,
|
|
559
|
-
globalFilterFields.length > 0 && /* @__PURE__ */ (0,
|
|
632
|
+
const TableHeaderAndTableActions = (0, import_react6.useMemo)(
|
|
633
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
634
|
+
globalFilterFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
560
635
|
TableHeader_default,
|
|
561
636
|
{
|
|
562
637
|
isLanguagePtBr,
|
|
@@ -564,7 +639,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
564
639
|
onGlobalFilterChange
|
|
565
640
|
}
|
|
566
641
|
),
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
568
643
|
TableActions,
|
|
569
644
|
{
|
|
570
645
|
selectedRows: selectedRowsData,
|
|
@@ -587,9 +662,9 @@ function DataTableAdvancedFilterWrapper({
|
|
|
587
662
|
customActions
|
|
588
663
|
]
|
|
589
664
|
);
|
|
590
|
-
return /* @__PURE__ */ (0,
|
|
591
|
-
disablePagination && /* @__PURE__ */ (0,
|
|
592
|
-
/* @__PURE__ */ (0,
|
|
665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
666
|
+
disablePagination && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "disablePagination", children: TableHeaderAndTableActions }),
|
|
667
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
593
668
|
import_datatable.DataTable,
|
|
594
669
|
{
|
|
595
670
|
value: customers?.items ?? [],
|
|
@@ -615,7 +690,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
615
690
|
sortOrder,
|
|
616
691
|
paginatorTemplate: {
|
|
617
692
|
layout: "RowsPerPageDropdown PrevPageLink CurrentPageReport NextPageLink",
|
|
618
|
-
RowsPerPageDropdown: (options) => /* @__PURE__ */ (0,
|
|
693
|
+
RowsPerPageDropdown: (options) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
619
694
|
"select",
|
|
620
695
|
{
|
|
621
696
|
value: options.value,
|
|
@@ -624,19 +699,19 @@ function DataTableAdvancedFilterWrapper({
|
|
|
624
699
|
value: Number(e.target.value)
|
|
625
700
|
}),
|
|
626
701
|
className: "custom-input custom-select",
|
|
627
|
-
children: options.options.map((opt) => /* @__PURE__ */ (0,
|
|
702
|
+
children: options.options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
|
|
628
703
|
}
|
|
629
704
|
),
|
|
630
|
-
PrevPageLink: (options) => /* @__PURE__ */ (0,
|
|
705
|
+
PrevPageLink: (options) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
631
706
|
"button",
|
|
632
707
|
{
|
|
633
708
|
onClick: options.onClick,
|
|
634
709
|
disabled: options.disabled,
|
|
635
710
|
className: `PrevPage ${options.disabled ? "PrevPageDisabled" : "PrevPageEnabled"}`,
|
|
636
|
-
children: /* @__PURE__ */ (0,
|
|
711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.CaretLeft, { size: 18, color: "#fff" })
|
|
637
712
|
}
|
|
638
713
|
),
|
|
639
|
-
CurrentPageReport: (options) => /* @__PURE__ */ (0,
|
|
714
|
+
CurrentPageReport: (options) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "pageReport", children: [
|
|
640
715
|
isLanguagePtBr ? "Mostrando" : "Showing",
|
|
641
716
|
" ",
|
|
642
717
|
options.first,
|
|
@@ -649,20 +724,20 @@ function DataTableAdvancedFilterWrapper({
|
|
|
649
724
|
" ",
|
|
650
725
|
options.totalRecords
|
|
651
726
|
] }),
|
|
652
|
-
NextPageLink: (options) => /* @__PURE__ */ (0,
|
|
727
|
+
NextPageLink: (options) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
653
728
|
"button",
|
|
654
729
|
{
|
|
655
730
|
onClick: options.onClick,
|
|
656
731
|
disabled: options.disabled,
|
|
657
732
|
className: `NextPage ${options.disabled ? "NextPageDisabled" : "NextPageEnabled"}`,
|
|
658
|
-
children: /* @__PURE__ */ (0,
|
|
733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.CaretRight, { size: 18, color: "#fff" })
|
|
659
734
|
}
|
|
660
735
|
)
|
|
661
736
|
},
|
|
662
737
|
paginatorPosition: "top",
|
|
663
|
-
paginatorLeft: /* @__PURE__ */ (0,
|
|
738
|
+
paginatorLeft: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
|
|
664
739
|
currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
|
|
665
|
-
emptyMessage: /* @__PURE__ */ (0,
|
|
740
|
+
emptyMessage: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
|
|
666
741
|
onFilter: (e) => setFilters(e.filters),
|
|
667
742
|
rowsPerPageOptions: [10, 25, 50, 100],
|
|
668
743
|
className: "p-datatable-sm",
|
|
@@ -840,7 +915,7 @@ var localePtBr = {
|
|
|
840
915
|
};
|
|
841
916
|
|
|
842
917
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
843
|
-
var
|
|
918
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
844
919
|
function DataTableAdvancedFilter({
|
|
845
920
|
queryKey,
|
|
846
921
|
mutationFn,
|
|
@@ -857,21 +932,21 @@ function DataTableAdvancedFilter({
|
|
|
857
932
|
isMultiSelectionMode = true,
|
|
858
933
|
isLanguagePtBr = true
|
|
859
934
|
}) {
|
|
860
|
-
const [isClient, setIsClient] = (0,
|
|
861
|
-
(0,
|
|
935
|
+
const [isClient, setIsClient] = (0, import_react8.useState)(false);
|
|
936
|
+
(0, import_react8.useEffect)(() => {
|
|
862
937
|
(0, import_api2.addLocale)("pt", localePtBr);
|
|
863
938
|
}, []);
|
|
864
|
-
(0,
|
|
939
|
+
(0, import_react8.useEffect)(() => {
|
|
865
940
|
(0, import_api2.locale)(isLanguagePtBr ? "pt" : "en");
|
|
866
941
|
}, [isLanguagePtBr]);
|
|
867
|
-
(0,
|
|
942
|
+
(0, import_react8.useEffect)(() => {
|
|
868
943
|
setIsClient(true);
|
|
869
944
|
}, []);
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
871
946
|
import_api2.PrimeReactProvider,
|
|
872
947
|
{
|
|
873
948
|
value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
|
|
874
|
-
children: /* @__PURE__ */ (0,
|
|
949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
875
950
|
DataTableAdvancedFilterWrapper,
|
|
876
951
|
{
|
|
877
952
|
queryKey,
|
|
@@ -896,10 +971,10 @@ function DataTableAdvancedFilter({
|
|
|
896
971
|
|
|
897
972
|
// src/components/DataTableAdvancedFilter/FilterTemplates.tsx
|
|
898
973
|
var import_react_select = __toESM(require("react-select"));
|
|
899
|
-
var
|
|
974
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
900
975
|
var DateFilterTemplate = (options, mask) => {
|
|
901
976
|
const parsedValue = options.value && typeof options.value === "string" ? /* @__PURE__ */ new Date(options.value + "T00:00:00") : options.value;
|
|
902
|
-
return /* @__PURE__ */ (0,
|
|
977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
903
978
|
import_calendar.Calendar,
|
|
904
979
|
{
|
|
905
980
|
value: parsedValue,
|
|
@@ -924,7 +999,7 @@ var DateFilterTemplate = (options, mask) => {
|
|
|
924
999
|
};
|
|
925
1000
|
var DateTimeFilterTemplate = (options, mask) => {
|
|
926
1001
|
const parsedValue = options.value && typeof options.value === "string" ? new Date(options.value) : options.value;
|
|
927
|
-
return /* @__PURE__ */ (0,
|
|
1002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
928
1003
|
import_calendar.Calendar,
|
|
929
1004
|
{
|
|
930
1005
|
value: parsedValue,
|
|
@@ -954,7 +1029,7 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
954
1029
|
const valueToFilter = mask ? mask(rawValue) : rawValue;
|
|
955
1030
|
options.filterCallback(valueToFilter, options.index);
|
|
956
1031
|
};
|
|
957
|
-
return /* @__PURE__ */ (0,
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
958
1033
|
import_inputnumber.InputNumber,
|
|
959
1034
|
{
|
|
960
1035
|
value: parsedValue,
|
|
@@ -973,7 +1048,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
973
1048
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
974
1049
|
];
|
|
975
1050
|
const currentValue = selectOptions.find((opt) => opt.value === options.value) || selectOptions[0];
|
|
976
|
-
return /* @__PURE__ */ (0,
|
|
1051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
977
1052
|
import_react_select.default,
|
|
978
1053
|
{
|
|
979
1054
|
options: selectOptions,
|
|
@@ -1088,6 +1163,7 @@ var import_api4 = require("primereact/api");
|
|
|
1088
1163
|
DateTimeFilterTemplate,
|
|
1089
1164
|
FilterMatchMode,
|
|
1090
1165
|
FilterOperator,
|
|
1166
|
+
ModalBase,
|
|
1091
1167
|
SelectFilterTemplate,
|
|
1092
1168
|
ValueFilterTemplate,
|
|
1093
1169
|
getDefaultFilterMatchOptionsDate,
|
package/dist/index.mjs
CHANGED
|
@@ -51,11 +51,85 @@ function Button({
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// src/components/ModalBase/ModalBase.tsx
|
|
55
|
+
import { X } from "@phosphor-icons/react";
|
|
56
|
+
|
|
57
|
+
// src/components/ModalBase/FooterButtons.tsx
|
|
58
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
59
|
+
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 });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/components/ModalBase/ModalBase.tsx
|
|
64
|
+
import { useEffect } from "react";
|
|
65
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
66
|
+
function ModalBase({
|
|
67
|
+
show,
|
|
68
|
+
onHide,
|
|
69
|
+
onAction,
|
|
70
|
+
title,
|
|
71
|
+
children,
|
|
72
|
+
loading,
|
|
73
|
+
btnCancel = "Cancel",
|
|
74
|
+
btnSuccess = "Save",
|
|
75
|
+
disabledBtnSuccess
|
|
76
|
+
}) {
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const handleKeyDown = (event) => {
|
|
79
|
+
if (event.key === "Escape") {
|
|
80
|
+
onHide();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
84
|
+
return () => {
|
|
85
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
86
|
+
};
|
|
87
|
+
}, [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(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
className: "p-1 ml-auto mr-1 cursor-pointer",
|
|
96
|
+
onClick: onHide,
|
|
97
|
+
children: /* @__PURE__ */ jsx3(X, { size: 18, color: "#ffffff" })
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsx3("div", { className: "w-full p-6", children }),
|
|
102
|
+
/* @__PURE__ */ jsxs2(FooterButtons, { children: [
|
|
103
|
+
/* @__PURE__ */ jsx3(
|
|
104
|
+
Button,
|
|
105
|
+
{
|
|
106
|
+
color: "danger",
|
|
107
|
+
title: btnCancel,
|
|
108
|
+
type: "button",
|
|
109
|
+
onClick: onHide
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsx3(
|
|
113
|
+
Button,
|
|
114
|
+
{
|
|
115
|
+
type: "button",
|
|
116
|
+
title: btnSuccess,
|
|
117
|
+
onClick: onAction,
|
|
118
|
+
loading,
|
|
119
|
+
disabled: disabledBtnSuccess
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] })
|
|
123
|
+
] }) }) }),
|
|
124
|
+
/* @__PURE__ */ jsx3("div", { className: "opacity-40 fixed inset-0 z-50 bg-black" })
|
|
125
|
+
] }) : null });
|
|
126
|
+
}
|
|
127
|
+
|
|
54
128
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
55
|
-
import { useEffect as
|
|
129
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
56
130
|
|
|
57
131
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
58
|
-
import { useEffect as
|
|
132
|
+
import { useEffect as useEffect3, useMemo, useState as useState2 } from "react";
|
|
59
133
|
import { useQuery } from "@tanstack/react-query";
|
|
60
134
|
|
|
61
135
|
// src/primereact-compat.ts
|
|
@@ -67,13 +141,13 @@ import { Calendar } from "primereact/calendar";
|
|
|
67
141
|
import { FilterMatchMode } from "primereact/api";
|
|
68
142
|
|
|
69
143
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
70
|
-
import { jsx as
|
|
144
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
71
145
|
var TableHeader = ({
|
|
72
146
|
globalFilterValue,
|
|
73
147
|
onGlobalFilterChange,
|
|
74
148
|
isLanguagePtBr
|
|
75
149
|
}) => {
|
|
76
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ jsx4(
|
|
77
151
|
InputText,
|
|
78
152
|
{
|
|
79
153
|
value: globalFilterValue,
|
|
@@ -108,9 +182,9 @@ function centsToReal(value) {
|
|
|
108
182
|
|
|
109
183
|
// src/components/TooltipCustom.tsx
|
|
110
184
|
import { Tooltip } from "react-tooltip";
|
|
111
|
-
import { jsx as
|
|
185
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
112
186
|
function TooltipCustom({ label, id }) {
|
|
113
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ jsx5(
|
|
114
188
|
Tooltip,
|
|
115
189
|
{
|
|
116
190
|
className: "tooltip-icone",
|
|
@@ -121,13 +195,13 @@ function TooltipCustom({ label, id }) {
|
|
|
121
195
|
zIndex: 9999
|
|
122
196
|
},
|
|
123
197
|
positionStrategy: "fixed",
|
|
124
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ jsx5("div", { className: "tooltip-custom", children: label })
|
|
125
199
|
}
|
|
126
200
|
);
|
|
127
201
|
}
|
|
128
202
|
|
|
129
203
|
// src/components/DataTableAdvancedFilter/TableActions.tsx
|
|
130
|
-
import { Fragment, jsx as
|
|
204
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
131
205
|
function TableActions({
|
|
132
206
|
onNew,
|
|
133
207
|
onEdit,
|
|
@@ -139,9 +213,9 @@ function TableActions({
|
|
|
139
213
|
const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
|
|
140
214
|
const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
|
|
141
215
|
const resolvedCustomActions = typeof customActions === "function" ? customActions(selectedRows) : customActions;
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
onNew && /* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ jsxs3("div", { className: "box-icones-table-actions", children: [
|
|
217
|
+
onNew && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
218
|
+
/* @__PURE__ */ jsx6(
|
|
145
219
|
"button",
|
|
146
220
|
{
|
|
147
221
|
id: "add",
|
|
@@ -151,10 +225,10 @@ function TableActions({
|
|
|
151
225
|
enableButtonsNotMultiplesSelecteds && "disable-button-table-actions"
|
|
152
226
|
),
|
|
153
227
|
disabled: enableButtonsNotMultiplesSelecteds,
|
|
154
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ jsx6(Plus, { size: 18 })
|
|
155
229
|
}
|
|
156
230
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ jsx6(
|
|
158
232
|
TooltipCustom,
|
|
159
233
|
{
|
|
160
234
|
id: "add",
|
|
@@ -162,7 +236,7 @@ function TableActions({
|
|
|
162
236
|
}
|
|
163
237
|
)
|
|
164
238
|
] }),
|
|
165
|
-
onEdit && /* @__PURE__ */
|
|
239
|
+
onEdit && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs3(
|
|
166
240
|
"button",
|
|
167
241
|
{
|
|
168
242
|
id: "edit",
|
|
@@ -173,8 +247,8 @@ function TableActions({
|
|
|
173
247
|
),
|
|
174
248
|
disabled: disableButtonsNotMultiplesSelecteds,
|
|
175
249
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ jsx6(PencilSimple, { size: 18 }),
|
|
251
|
+
/* @__PURE__ */ jsx6(
|
|
178
252
|
TooltipCustom,
|
|
179
253
|
{
|
|
180
254
|
id: "edit",
|
|
@@ -184,7 +258,7 @@ function TableActions({
|
|
|
184
258
|
]
|
|
185
259
|
}
|
|
186
260
|
) }),
|
|
187
|
-
onDelete && /* @__PURE__ */
|
|
261
|
+
onDelete && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs3(
|
|
188
262
|
"button",
|
|
189
263
|
{
|
|
190
264
|
id: "delete",
|
|
@@ -195,8 +269,8 @@ function TableActions({
|
|
|
195
269
|
),
|
|
196
270
|
disabled: !enableButtonsNotMultiplesSelecteds,
|
|
197
271
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ jsx6(Trash, { size: 18 }),
|
|
273
|
+
/* @__PURE__ */ jsx6(
|
|
200
274
|
TooltipCustom,
|
|
201
275
|
{
|
|
202
276
|
id: "delete",
|
|
@@ -208,7 +282,7 @@ function TableActions({
|
|
|
208
282
|
) }),
|
|
209
283
|
resolvedCustomActions?.map((action) => {
|
|
210
284
|
const id = `action-table${phraseToId(action.label)}`;
|
|
211
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ jsxs3(
|
|
212
286
|
"button",
|
|
213
287
|
{
|
|
214
288
|
id,
|
|
@@ -216,7 +290,7 @@ function TableActions({
|
|
|
216
290
|
className: cn("enable-button-table-actions", action.className),
|
|
217
291
|
children: [
|
|
218
292
|
action.icon,
|
|
219
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ jsx6(TooltipCustom, { id, label: action.label })
|
|
220
294
|
]
|
|
221
295
|
},
|
|
222
296
|
id
|
|
@@ -227,7 +301,7 @@ function TableActions({
|
|
|
227
301
|
|
|
228
302
|
// src/components/DataTableAdvancedFilter/ActionsColumn.tsx
|
|
229
303
|
import { PencilSimple as PencilSimple2, Trash as Trash2 } from "@phosphor-icons/react";
|
|
230
|
-
import { Fragment as
|
|
304
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
231
305
|
function ActionsColumn({
|
|
232
306
|
row,
|
|
233
307
|
onEdit,
|
|
@@ -236,8 +310,8 @@ function ActionsColumn({
|
|
|
236
310
|
isLanguagePtBr
|
|
237
311
|
}) {
|
|
238
312
|
const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
onEdit && /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ jsxs4("div", { className: "box-icones-actions-column", children: [
|
|
314
|
+
onEdit && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs4(
|
|
241
315
|
"button",
|
|
242
316
|
{
|
|
243
317
|
id: "edit-column",
|
|
@@ -246,8 +320,8 @@ function ActionsColumn({
|
|
|
246
320
|
onEdit && onEdit([row]);
|
|
247
321
|
},
|
|
248
322
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ jsx7(PencilSimple2, { size: 17, weight: "regular" }),
|
|
324
|
+
/* @__PURE__ */ jsx7(
|
|
251
325
|
TooltipCustom,
|
|
252
326
|
{
|
|
253
327
|
id: "edit-column",
|
|
@@ -257,7 +331,7 @@ function ActionsColumn({
|
|
|
257
331
|
]
|
|
258
332
|
}
|
|
259
333
|
) }),
|
|
260
|
-
onDelete && /* @__PURE__ */
|
|
334
|
+
onDelete && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs4(
|
|
261
335
|
"button",
|
|
262
336
|
{
|
|
263
337
|
id: "delete-column",
|
|
@@ -266,8 +340,8 @@ function ActionsColumn({
|
|
|
266
340
|
onDelete && onDelete([row]);
|
|
267
341
|
},
|
|
268
342
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ jsx7(Trash2, { size: 17, weight: "regular" }),
|
|
344
|
+
/* @__PURE__ */ jsx7(
|
|
271
345
|
TooltipCustom,
|
|
272
346
|
{
|
|
273
347
|
id: "delete-column",
|
|
@@ -279,7 +353,7 @@ function ActionsColumn({
|
|
|
279
353
|
) }),
|
|
280
354
|
resolvedCustomActions?.map((action) => {
|
|
281
355
|
const id = `action-colunm-${phraseToId(action.label)}`;
|
|
282
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ jsxs4(
|
|
283
357
|
"button",
|
|
284
358
|
{
|
|
285
359
|
id,
|
|
@@ -287,7 +361,7 @@ function ActionsColumn({
|
|
|
287
361
|
className: cn("btn-icone-actions-column", action.className),
|
|
288
362
|
children: [
|
|
289
363
|
action.icon,
|
|
290
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ jsx7(TooltipCustom, { id, label: action.label })
|
|
291
365
|
]
|
|
292
366
|
},
|
|
293
367
|
id
|
|
@@ -297,7 +371,7 @@ function ActionsColumn({
|
|
|
297
371
|
}
|
|
298
372
|
|
|
299
373
|
// src/components/DataTableAdvancedFilter/DynamicColumns.tsx
|
|
300
|
-
import { jsx as
|
|
374
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
301
375
|
function DynamicColumns({
|
|
302
376
|
columns,
|
|
303
377
|
isMultiSelectionMode = true,
|
|
@@ -309,7 +383,7 @@ function DynamicColumns({
|
|
|
309
383
|
const array = [];
|
|
310
384
|
if (isMultiSelectionMode) {
|
|
311
385
|
array.push(
|
|
312
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ jsx8(
|
|
313
387
|
Column,
|
|
314
388
|
{
|
|
315
389
|
selectionMode: "multiple",
|
|
@@ -326,7 +400,7 @@ function DynamicColumns({
|
|
|
326
400
|
const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
|
|
327
401
|
const placeholder = isLanguagePtBr ? "Procurar" : "Search";
|
|
328
402
|
array.push(
|
|
329
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ jsx8(
|
|
330
404
|
Column,
|
|
331
405
|
{
|
|
332
406
|
field: isActionsCol ? void 0 : col.field,
|
|
@@ -342,7 +416,7 @@ function DynamicColumns({
|
|
|
342
416
|
resizeable: col.enableResizeable ?? true
|
|
343
417
|
},
|
|
344
418
|
style: isActionsCol ? { width, minWidth: width, position: "relative" } : {},
|
|
345
|
-
body: (rowData) => isActionsCol ? /* @__PURE__ */
|
|
419
|
+
body: (rowData) => isActionsCol ? /* @__PURE__ */ jsx8(
|
|
346
420
|
ActionsColumn,
|
|
347
421
|
{
|
|
348
422
|
row: rowData,
|
|
@@ -351,7 +425,7 @@ function DynamicColumns({
|
|
|
351
425
|
customActionsColums,
|
|
352
426
|
isLanguagePtBr
|
|
353
427
|
}
|
|
354
|
-
) : col.body ? col.body(rowData) : /* @__PURE__ */
|
|
428
|
+
) : col.body ? col.body(rowData) : /* @__PURE__ */ jsx8("span", { children: String(rowData[col.field]) }),
|
|
355
429
|
sortable: !isActionsCol ? col.enableSorting ?? true : false
|
|
356
430
|
},
|
|
357
431
|
`${String(col.field)}-${idx}`
|
|
@@ -376,10 +450,10 @@ var getUrlParams = (sortFieldInitial, sortOrderInitial) => {
|
|
|
376
450
|
};
|
|
377
451
|
|
|
378
452
|
// src/hooks/use-debounce.ts
|
|
379
|
-
import { useEffect, useState } from "react";
|
|
453
|
+
import { useEffect as useEffect2, useState } from "react";
|
|
380
454
|
var useDebounce = (value, delay) => {
|
|
381
455
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
382
|
-
|
|
456
|
+
useEffect2(() => {
|
|
383
457
|
const timer = setTimeout(() => {
|
|
384
458
|
setDebouncedValue(value);
|
|
385
459
|
}, delay || 500);
|
|
@@ -391,7 +465,7 @@ var useDebounce = (value, delay) => {
|
|
|
391
465
|
};
|
|
392
466
|
|
|
393
467
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
394
|
-
import { Fragment as
|
|
468
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
395
469
|
function DataTableAdvancedFilterWrapper({
|
|
396
470
|
queryKey,
|
|
397
471
|
mutationFn,
|
|
@@ -409,7 +483,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
409
483
|
isLanguagePtBr = true
|
|
410
484
|
}) {
|
|
411
485
|
const [isClient, setIsClient] = useState2(false);
|
|
412
|
-
|
|
486
|
+
useEffect3(() => {
|
|
413
487
|
setIsClient(true);
|
|
414
488
|
}, []);
|
|
415
489
|
const {
|
|
@@ -495,10 +569,10 @@ function DataTableAdvancedFilterWrapper({
|
|
|
495
569
|
setSortOrder(e.sortOrder);
|
|
496
570
|
updateUrlParams({ sortField: e.sortField, sortOrder: e.sortOrder });
|
|
497
571
|
};
|
|
498
|
-
|
|
572
|
+
useEffect3(() => {
|
|
499
573
|
updateUrlParams({ page: 1, filter: debouncedSearch });
|
|
500
574
|
}, [debouncedSearch]);
|
|
501
|
-
|
|
575
|
+
useEffect3(() => {
|
|
502
576
|
if (customers?.items && selectedRowsData.length > 0) {
|
|
503
577
|
const currentIds = new Set(customers.items.map((item) => item.id));
|
|
504
578
|
const filteredSelection = selectedRowsData.filter(
|
|
@@ -510,8 +584,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
510
584
|
}
|
|
511
585
|
}, [customers?.items, selectedRowsData]);
|
|
512
586
|
const TableHeaderAndTableActions = useMemo(
|
|
513
|
-
() => /* @__PURE__ */
|
|
514
|
-
globalFilterFields.length > 0 && /* @__PURE__ */
|
|
587
|
+
() => /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
588
|
+
globalFilterFields.length > 0 && /* @__PURE__ */ jsx9(
|
|
515
589
|
TableHeader_default,
|
|
516
590
|
{
|
|
517
591
|
isLanguagePtBr,
|
|
@@ -519,7 +593,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
519
593
|
onGlobalFilterChange
|
|
520
594
|
}
|
|
521
595
|
),
|
|
522
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ jsx9(
|
|
523
597
|
TableActions,
|
|
524
598
|
{
|
|
525
599
|
selectedRows: selectedRowsData,
|
|
@@ -542,9 +616,9 @@ function DataTableAdvancedFilterWrapper({
|
|
|
542
616
|
customActions
|
|
543
617
|
]
|
|
544
618
|
);
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
disablePagination && /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ jsx9(Fragment4, { children: isClient && /* @__PURE__ */ jsxs5("div", { children: [
|
|
620
|
+
disablePagination && /* @__PURE__ */ jsx9("div", { className: "disablePagination", children: TableHeaderAndTableActions }),
|
|
621
|
+
/* @__PURE__ */ jsxs5(
|
|
548
622
|
DataTable,
|
|
549
623
|
{
|
|
550
624
|
value: customers?.items ?? [],
|
|
@@ -570,7 +644,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
570
644
|
sortOrder,
|
|
571
645
|
paginatorTemplate: {
|
|
572
646
|
layout: "RowsPerPageDropdown PrevPageLink CurrentPageReport NextPageLink",
|
|
573
|
-
RowsPerPageDropdown: (options) => /* @__PURE__ */
|
|
647
|
+
RowsPerPageDropdown: (options) => /* @__PURE__ */ jsx9(
|
|
574
648
|
"select",
|
|
575
649
|
{
|
|
576
650
|
value: options.value,
|
|
@@ -579,19 +653,19 @@ function DataTableAdvancedFilterWrapper({
|
|
|
579
653
|
value: Number(e.target.value)
|
|
580
654
|
}),
|
|
581
655
|
className: "custom-input custom-select",
|
|
582
|
-
children: options.options.map((opt) => /* @__PURE__ */
|
|
656
|
+
children: options.options.map((opt) => /* @__PURE__ */ jsx9("option", { value: opt.value, children: opt.label }, opt.value))
|
|
583
657
|
}
|
|
584
658
|
),
|
|
585
|
-
PrevPageLink: (options) => /* @__PURE__ */
|
|
659
|
+
PrevPageLink: (options) => /* @__PURE__ */ jsx9(
|
|
586
660
|
"button",
|
|
587
661
|
{
|
|
588
662
|
onClick: options.onClick,
|
|
589
663
|
disabled: options.disabled,
|
|
590
664
|
className: `PrevPage ${options.disabled ? "PrevPageDisabled" : "PrevPageEnabled"}`,
|
|
591
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ jsx9(CaretLeft, { size: 18, color: "#fff" })
|
|
592
666
|
}
|
|
593
667
|
),
|
|
594
|
-
CurrentPageReport: (options) => /* @__PURE__ */
|
|
668
|
+
CurrentPageReport: (options) => /* @__PURE__ */ jsxs5("span", { className: "pageReport", children: [
|
|
595
669
|
isLanguagePtBr ? "Mostrando" : "Showing",
|
|
596
670
|
" ",
|
|
597
671
|
options.first,
|
|
@@ -604,20 +678,20 @@ function DataTableAdvancedFilterWrapper({
|
|
|
604
678
|
" ",
|
|
605
679
|
options.totalRecords
|
|
606
680
|
] }),
|
|
607
|
-
NextPageLink: (options) => /* @__PURE__ */
|
|
681
|
+
NextPageLink: (options) => /* @__PURE__ */ jsx9(
|
|
608
682
|
"button",
|
|
609
683
|
{
|
|
610
684
|
onClick: options.onClick,
|
|
611
685
|
disabled: options.disabled,
|
|
612
686
|
className: `NextPage ${options.disabled ? "NextPageDisabled" : "NextPageEnabled"}`,
|
|
613
|
-
children: /* @__PURE__ */
|
|
687
|
+
children: /* @__PURE__ */ jsx9(CaretRight, { size: 18, color: "#fff" })
|
|
614
688
|
}
|
|
615
689
|
)
|
|
616
690
|
},
|
|
617
691
|
paginatorPosition: "top",
|
|
618
|
-
paginatorLeft: /* @__PURE__ */
|
|
692
|
+
paginatorLeft: /* @__PURE__ */ jsx9("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
|
|
619
693
|
currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
|
|
620
|
-
emptyMessage: /* @__PURE__ */
|
|
694
|
+
emptyMessage: /* @__PURE__ */ jsx9("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx9("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
|
|
621
695
|
onFilter: (e) => setFilters(e.filters),
|
|
622
696
|
rowsPerPageOptions: [10, 25, 50, 100],
|
|
623
697
|
className: "p-datatable-sm",
|
|
@@ -795,7 +869,7 @@ var localePtBr = {
|
|
|
795
869
|
};
|
|
796
870
|
|
|
797
871
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
798
|
-
import { Fragment as
|
|
872
|
+
import { Fragment as Fragment5, jsx as jsx10 } from "react/jsx-runtime";
|
|
799
873
|
function DataTableAdvancedFilter({
|
|
800
874
|
queryKey,
|
|
801
875
|
mutationFn,
|
|
@@ -813,20 +887,20 @@ function DataTableAdvancedFilter({
|
|
|
813
887
|
isLanguagePtBr = true
|
|
814
888
|
}) {
|
|
815
889
|
const [isClient, setIsClient] = useState3(false);
|
|
816
|
-
|
|
890
|
+
useEffect4(() => {
|
|
817
891
|
addLocale("pt", localePtBr);
|
|
818
892
|
}, []);
|
|
819
|
-
|
|
893
|
+
useEffect4(() => {
|
|
820
894
|
locale(isLanguagePtBr ? "pt" : "en");
|
|
821
895
|
}, [isLanguagePtBr]);
|
|
822
|
-
|
|
896
|
+
useEffect4(() => {
|
|
823
897
|
setIsClient(true);
|
|
824
898
|
}, []);
|
|
825
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ jsx10(Fragment5, { children: isClient && /* @__PURE__ */ jsx10(
|
|
826
900
|
PrimeReactProvider,
|
|
827
901
|
{
|
|
828
902
|
value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
|
|
829
|
-
children: /* @__PURE__ */
|
|
903
|
+
children: /* @__PURE__ */ jsx10(
|
|
830
904
|
DataTableAdvancedFilterWrapper,
|
|
831
905
|
{
|
|
832
906
|
queryKey,
|
|
@@ -851,10 +925,10 @@ function DataTableAdvancedFilter({
|
|
|
851
925
|
|
|
852
926
|
// src/components/DataTableAdvancedFilter/FilterTemplates.tsx
|
|
853
927
|
import Select from "react-select";
|
|
854
|
-
import { jsx as
|
|
928
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
855
929
|
var DateFilterTemplate = (options, mask) => {
|
|
856
930
|
const parsedValue = options.value && typeof options.value === "string" ? /* @__PURE__ */ new Date(options.value + "T00:00:00") : options.value;
|
|
857
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ jsx11(
|
|
858
932
|
Calendar,
|
|
859
933
|
{
|
|
860
934
|
value: parsedValue,
|
|
@@ -879,7 +953,7 @@ var DateFilterTemplate = (options, mask) => {
|
|
|
879
953
|
};
|
|
880
954
|
var DateTimeFilterTemplate = (options, mask) => {
|
|
881
955
|
const parsedValue = options.value && typeof options.value === "string" ? new Date(options.value) : options.value;
|
|
882
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ jsx11(
|
|
883
957
|
Calendar,
|
|
884
958
|
{
|
|
885
959
|
value: parsedValue,
|
|
@@ -909,7 +983,7 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
909
983
|
const valueToFilter = mask ? mask(rawValue) : rawValue;
|
|
910
984
|
options.filterCallback(valueToFilter, options.index);
|
|
911
985
|
};
|
|
912
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ jsx11(
|
|
913
987
|
InputNumber,
|
|
914
988
|
{
|
|
915
989
|
value: parsedValue,
|
|
@@ -928,7 +1002,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
928
1002
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
929
1003
|
];
|
|
930
1004
|
const currentValue = selectOptions.find((opt) => opt.value === options.value) || selectOptions[0];
|
|
931
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsx11(
|
|
932
1006
|
Select,
|
|
933
1007
|
{
|
|
934
1008
|
options: selectOptions,
|
|
@@ -1042,6 +1116,7 @@ export {
|
|
|
1042
1116
|
DateTimeFilterTemplate,
|
|
1043
1117
|
FilterMatchMode4 as FilterMatchMode,
|
|
1044
1118
|
FilterOperator,
|
|
1119
|
+
ModalBase,
|
|
1045
1120
|
SelectFilterTemplate,
|
|
1046
1121
|
ValueFilterTemplate,
|
|
1047
1122
|
getDefaultFilterMatchOptionsDate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charlesgomes/leafcode-shared-lib-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Lib de componentes react",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"react-dom": ">=17"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"react": "^19.1.1",
|
|
42
|
+
"react-dom": "^19.1.1",
|
|
41
43
|
"@tailwindcss/postcss": "^4.1.12",
|
|
42
44
|
"@tanstack/react-query": "^5.85.9",
|
|
43
45
|
"@types/react": "^19.1.12",
|
|
@@ -52,11 +54,8 @@
|
|
|
52
54
|
"dependencies": {
|
|
53
55
|
"@phosphor-icons/react": "^2.1.10",
|
|
54
56
|
"clsx": "^2.1.1",
|
|
55
|
-
"primereact": "^10.9.7",
|
|
56
|
-
"react": "^19.1.1",
|
|
57
|
-
"react-dom": "^19.1.1",
|
|
58
57
|
"react-select": "^5.10.2",
|
|
59
58
|
"react-tooltip": "^5.29.1",
|
|
60
59
|
"tailwind-merge": "^3.3.1"
|
|
61
60
|
}
|
|
62
|
-
}
|
|
61
|
+
}
|