@charlesgomes/leafcode-shared-lib-react 1.0.55 → 1.0.57
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.css +23 -1
- package/dist/index.js +53 -44
- package/dist/index.mjs +37 -28
- package/dist/styles/table.css +26 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
color: #1c1c1c;
|
|
29
29
|
padding: 0 1.25rem;
|
|
30
30
|
width: 13rem;
|
|
31
|
-
height:
|
|
31
|
+
height: 2.5rem;
|
|
32
32
|
border: 1px solid #dadada;
|
|
33
33
|
border-radius: 0.375rem;
|
|
34
34
|
}
|
|
@@ -525,3 +525,25 @@ th {
|
|
|
525
525
|
.p-datatable.p-datatable-gridlines .p-datatable-scrollable-table > .p-datatable-thead {
|
|
526
526
|
top: 0;
|
|
527
527
|
}
|
|
528
|
+
.input-search {
|
|
529
|
+
padding-right: 2rem;
|
|
530
|
+
height: 2.25rem;
|
|
531
|
+
padding-left: 14px;
|
|
532
|
+
}
|
|
533
|
+
.close-search {
|
|
534
|
+
position: absolute;
|
|
535
|
+
top: 50%;
|
|
536
|
+
right: 10px;
|
|
537
|
+
transform: translateY(-50%);
|
|
538
|
+
cursor: pointer;
|
|
539
|
+
color: #bf1717;
|
|
540
|
+
width: 1.25rem;
|
|
541
|
+
height: 1.25rem;
|
|
542
|
+
padding: 3px;
|
|
543
|
+
transition: all 0.3s ease-in-out;
|
|
544
|
+
&:hover {
|
|
545
|
+
background-color: #bf1717;
|
|
546
|
+
color: #fff;
|
|
547
|
+
border-radius: 5rem;
|
|
548
|
+
}
|
|
549
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -181,10 +181,10 @@ function ModalBase({
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
184
|
-
var
|
|
184
|
+
var import_react9 = require("react");
|
|
185
185
|
|
|
186
186
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
187
|
-
var
|
|
187
|
+
var import_react7 = require("react");
|
|
188
188
|
var import_react_query = require("@tanstack/react-query");
|
|
189
189
|
|
|
190
190
|
// src/primereact-compat.ts
|
|
@@ -196,29 +196,38 @@ var import_calendar = require("primereact/calendar");
|
|
|
196
196
|
var import_api = require("primereact/api");
|
|
197
197
|
|
|
198
198
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
199
|
+
var import_react3 = require("@phosphor-icons/react");
|
|
199
200
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
200
201
|
var TableHeader = ({
|
|
201
202
|
globalFilterValue,
|
|
202
203
|
onGlobalFilterChange,
|
|
203
204
|
isLanguagePtBr
|
|
204
205
|
}) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
const limparCampo = () => {
|
|
207
|
+
onGlobalFilterChange({
|
|
208
|
+
target: { value: "" }
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { position: "relative" }, children: [
|
|
212
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
213
|
+
import_inputtext.InputText,
|
|
214
|
+
{
|
|
215
|
+
value: globalFilterValue,
|
|
216
|
+
onChange: onGlobalFilterChange,
|
|
217
|
+
placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
|
|
218
|
+
className: "custom-input input-search"
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react3.X, { size: 16, className: "close-search", onClick: limparCampo })
|
|
222
|
+
] });
|
|
214
223
|
};
|
|
215
224
|
var TableHeader_default = TableHeader;
|
|
216
225
|
|
|
217
226
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
218
|
-
var
|
|
227
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
219
228
|
|
|
220
229
|
// src/components/DataTableAdvancedFilter/TableActions.tsx
|
|
221
|
-
var
|
|
230
|
+
var import_react4 = require("@phosphor-icons/react");
|
|
222
231
|
|
|
223
232
|
// src/utils/utils.ts
|
|
224
233
|
var import_clsx = require("clsx");
|
|
@@ -283,7 +292,7 @@ function TableActions({
|
|
|
283
292
|
enableButtonsNotMultiplesSelecteds && "disable-button-table-actions"
|
|
284
293
|
),
|
|
285
294
|
disabled: enableButtonsNotMultiplesSelecteds,
|
|
286
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react4.Plus, { size: 18 })
|
|
287
296
|
}
|
|
288
297
|
),
|
|
289
298
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -306,7 +315,7 @@ function TableActions({
|
|
|
306
315
|
),
|
|
307
316
|
disabled: disableButtonsNotMultiplesSelecteds,
|
|
308
317
|
children: [
|
|
309
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react4.PencilSimple, { size: 18 }),
|
|
310
319
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
311
320
|
TooltipCustom,
|
|
312
321
|
{
|
|
@@ -329,7 +338,7 @@ function TableActions({
|
|
|
329
338
|
),
|
|
330
339
|
disabled: !enableButtonsNotMultiplesSelecteds,
|
|
331
340
|
children: [
|
|
332
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react4.Trash, { size: 18 }),
|
|
333
342
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
334
343
|
TooltipCustom,
|
|
335
344
|
{
|
|
@@ -361,7 +370,7 @@ function TableActions({
|
|
|
361
370
|
}
|
|
362
371
|
|
|
363
372
|
// src/components/DataTableAdvancedFilter/ActionsColumn.tsx
|
|
364
|
-
var
|
|
373
|
+
var import_react5 = require("@phosphor-icons/react");
|
|
365
374
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
366
375
|
function ActionsColumn({
|
|
367
376
|
row,
|
|
@@ -382,7 +391,7 @@ function ActionsColumn({
|
|
|
382
391
|
onEdit && onEdit([row]);
|
|
383
392
|
},
|
|
384
393
|
children: [
|
|
385
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react5.PencilSimple, { size: 17, weight: "regular" }),
|
|
386
395
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
387
396
|
TooltipCustom,
|
|
388
397
|
{
|
|
@@ -403,7 +412,7 @@ function ActionsColumn({
|
|
|
403
412
|
onDelete && onDelete([row]);
|
|
404
413
|
},
|
|
405
414
|
children: [
|
|
406
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
415
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react5.Trash, { size: 17, weight: "regular" }),
|
|
407
416
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
408
417
|
TooltipCustom,
|
|
409
418
|
{
|
|
@@ -502,10 +511,10 @@ function DynamicColumns({
|
|
|
502
511
|
}
|
|
503
512
|
|
|
504
513
|
// src/hooks/use-debounce.ts
|
|
505
|
-
var
|
|
514
|
+
var import_react6 = require("react");
|
|
506
515
|
var useDebounce = (value, delay) => {
|
|
507
|
-
const [debouncedValue, setDebouncedValue] = (0,
|
|
508
|
-
(0,
|
|
516
|
+
const [debouncedValue, setDebouncedValue] = (0, import_react6.useState)(value);
|
|
517
|
+
(0, import_react6.useEffect)(() => {
|
|
509
518
|
const timer = setTimeout(() => {
|
|
510
519
|
setDebouncedValue(value);
|
|
511
520
|
}, delay || 500);
|
|
@@ -537,8 +546,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
537
546
|
state,
|
|
538
547
|
onStateChange
|
|
539
548
|
}) {
|
|
540
|
-
const [isClient, setIsClient] = (0,
|
|
541
|
-
(0,
|
|
549
|
+
const [isClient, setIsClient] = (0, import_react7.useState)(false);
|
|
550
|
+
(0, import_react7.useEffect)(() => {
|
|
542
551
|
setIsClient(true);
|
|
543
552
|
}, []);
|
|
544
553
|
const initialState = state ?? {
|
|
@@ -548,26 +557,26 @@ function DataTableAdvancedFilterWrapper({
|
|
|
548
557
|
sortOrder: sortOrderInitial,
|
|
549
558
|
filter: ""
|
|
550
559
|
};
|
|
551
|
-
const [page, setPage] = (0,
|
|
552
|
-
const [rows, setRows] = (0,
|
|
553
|
-
const [first, setFirst] = (0,
|
|
554
|
-
const [sortField, setSortField] = (0,
|
|
555
|
-
const [sortOrder, setSortOrder] = (0,
|
|
556
|
-
const [searchText, setSearchText] = (0,
|
|
557
|
-
const [filters, setFilters] = (0,
|
|
560
|
+
const [page, setPage] = (0, import_react7.useState)(initialState.page);
|
|
561
|
+
const [rows, setRows] = (0, import_react7.useState)(initialState.rows);
|
|
562
|
+
const [first, setFirst] = (0, import_react7.useState)((initialState.page - 1) * initialState.rows);
|
|
563
|
+
const [sortField, setSortField] = (0, import_react7.useState)(initialState.sortField);
|
|
564
|
+
const [sortOrder, setSortOrder] = (0, import_react7.useState)(initialState.sortOrder ?? 1);
|
|
565
|
+
const [searchText, setSearchText] = (0, import_react7.useState)(initialState.filter ?? "");
|
|
566
|
+
const [filters, setFilters] = (0, import_react7.useState)({
|
|
558
567
|
...initFilters,
|
|
559
568
|
global: { value: initialState.filter, matchMode: "contains" }
|
|
560
569
|
});
|
|
561
|
-
const [selectedRowsData, setSelectedRowsData] = (0,
|
|
570
|
+
const [selectedRowsData, setSelectedRowsData] = (0, import_react7.useState)([]);
|
|
562
571
|
const debouncedSearch = useDebounce(searchText, 500);
|
|
563
|
-
const debouncedFilters = (0,
|
|
572
|
+
const debouncedFilters = (0, import_react7.useMemo)(() => {
|
|
564
573
|
const f = { ...filters };
|
|
565
574
|
if (!f.global) f.global = { value: "", matchMode: "contains" };
|
|
566
575
|
f.global.value = debouncedSearch;
|
|
567
576
|
return f;
|
|
568
577
|
}, [filters, debouncedSearch]);
|
|
569
578
|
const filtersKey = JSON.stringify(debouncedFilters);
|
|
570
|
-
const globalFilterFields = (0,
|
|
579
|
+
const globalFilterFields = (0, import_react7.useMemo)(() => {
|
|
571
580
|
return columns?.filter(
|
|
572
581
|
(col) => col.filterGlobal === true && (col.field !== "acoes" || col.field !== "actions")
|
|
573
582
|
).map((col) => col.field) ?? [];
|
|
@@ -583,7 +592,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
583
592
|
globalFilterFields
|
|
584
593
|
)
|
|
585
594
|
});
|
|
586
|
-
(0,
|
|
595
|
+
(0, import_react7.useEffect)(() => {
|
|
587
596
|
if (!state) return;
|
|
588
597
|
setPage(state.page);
|
|
589
598
|
setRows(state.rows);
|
|
@@ -639,7 +648,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
639
648
|
filter: searchText
|
|
640
649
|
});
|
|
641
650
|
};
|
|
642
|
-
(0,
|
|
651
|
+
(0, import_react7.useEffect)(() => {
|
|
643
652
|
emitStateChange({
|
|
644
653
|
page: 1,
|
|
645
654
|
rows,
|
|
@@ -648,7 +657,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
648
657
|
filter: debouncedSearch
|
|
649
658
|
});
|
|
650
659
|
}, [debouncedSearch]);
|
|
651
|
-
(0,
|
|
660
|
+
(0, import_react7.useEffect)(() => {
|
|
652
661
|
if (customers?.items && selectedRowsData.length > 0) {
|
|
653
662
|
const currentIds = new Set(customers.items.map((item) => item.id));
|
|
654
663
|
const filteredSelection = selectedRowsData.filter(
|
|
@@ -659,7 +668,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
659
668
|
}
|
|
660
669
|
}
|
|
661
670
|
}, [customers?.items, selectedRowsData]);
|
|
662
|
-
const TableHeaderAndTableActions = (0,
|
|
671
|
+
const TableHeaderAndTableActions = (0, import_react7.useMemo)(
|
|
663
672
|
() => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
664
673
|
globalFilterFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
665
674
|
TableHeader_default,
|
|
@@ -739,7 +748,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
739
748
|
onClick: options.onClick,
|
|
740
749
|
disabled: options.disabled,
|
|
741
750
|
className: `PrevPage ${options.disabled ? "PrevPageDisabled" : "PrevPageEnabled"}`,
|
|
742
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react8.CaretLeft, { size: 18, color: "#fff" })
|
|
743
752
|
}
|
|
744
753
|
),
|
|
745
754
|
CurrentPageReport: (options) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "pageReport", children: [
|
|
@@ -762,7 +771,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
762
771
|
onClick: options.onClick,
|
|
763
772
|
disabled: options.disabled,
|
|
764
773
|
className: `NextPage ${options.disabled ? "NextPageDisabled" : "NextPageEnabled"}`,
|
|
765
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react8.CaretRight, { size: 18, color: "#fff" })
|
|
766
775
|
}
|
|
767
776
|
)
|
|
768
777
|
},
|
|
@@ -988,14 +997,14 @@ function DataTableAdvancedFilter({
|
|
|
988
997
|
state,
|
|
989
998
|
onStateChange
|
|
990
999
|
}) {
|
|
991
|
-
const [isClient, setIsClient] = (0,
|
|
992
|
-
(0,
|
|
1000
|
+
const [isClient, setIsClient] = (0, import_react9.useState)(false);
|
|
1001
|
+
(0, import_react9.useEffect)(() => {
|
|
993
1002
|
(0, import_api2.addLocale)("pt", localePtBr);
|
|
994
1003
|
}, []);
|
|
995
|
-
(0,
|
|
1004
|
+
(0, import_react9.useEffect)(() => {
|
|
996
1005
|
(0, import_api2.locale)(isLanguagePtBr ? "pt" : "en");
|
|
997
1006
|
}, [isLanguagePtBr]);
|
|
998
|
-
(0,
|
|
1007
|
+
(0, import_react9.useEffect)(() => {
|
|
999
1008
|
setIsClient(true);
|
|
1000
1009
|
}, []);
|
|
1001
1010
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
package/dist/index.mjs
CHANGED
|
@@ -141,21 +141,30 @@ import { Calendar } from "primereact/calendar";
|
|
|
141
141
|
import { FilterMatchMode } from "primereact/api";
|
|
142
142
|
|
|
143
143
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
144
|
-
import {
|
|
144
|
+
import { X as X2 } from "@phosphor-icons/react";
|
|
145
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
145
146
|
var TableHeader = ({
|
|
146
147
|
globalFilterValue,
|
|
147
148
|
onGlobalFilterChange,
|
|
148
149
|
isLanguagePtBr
|
|
149
150
|
}) => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
const limparCampo = () => {
|
|
152
|
+
onGlobalFilterChange({
|
|
153
|
+
target: { value: "" }
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
return /* @__PURE__ */ jsxs3("div", { style: { position: "relative" }, children: [
|
|
157
|
+
/* @__PURE__ */ jsx4(
|
|
158
|
+
InputText,
|
|
159
|
+
{
|
|
160
|
+
value: globalFilterValue,
|
|
161
|
+
onChange: onGlobalFilterChange,
|
|
162
|
+
placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
|
|
163
|
+
className: "custom-input input-search"
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx4(X2, { size: 16, className: "close-search", onClick: limparCampo })
|
|
167
|
+
] });
|
|
159
168
|
};
|
|
160
169
|
var TableHeader_default = TableHeader;
|
|
161
170
|
|
|
@@ -203,7 +212,7 @@ function TooltipCustom({ label, id }) {
|
|
|
203
212
|
}
|
|
204
213
|
|
|
205
214
|
// src/components/DataTableAdvancedFilter/TableActions.tsx
|
|
206
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as
|
|
215
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
207
216
|
function TableActions({
|
|
208
217
|
onNew,
|
|
209
218
|
onEdit,
|
|
@@ -215,8 +224,8 @@ function TableActions({
|
|
|
215
224
|
const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
|
|
216
225
|
const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
|
|
217
226
|
const resolvedCustomActions = typeof customActions === "function" ? customActions(selectedRows) : customActions;
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
onNew && /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsxs4("div", { className: "box-icones-table-actions", children: [
|
|
228
|
+
onNew && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
220
229
|
/* @__PURE__ */ jsx6(
|
|
221
230
|
"button",
|
|
222
231
|
{
|
|
@@ -239,7 +248,7 @@ function TableActions({
|
|
|
239
248
|
}
|
|
240
249
|
)
|
|
241
250
|
] }),
|
|
242
|
-
onEdit && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */
|
|
251
|
+
onEdit && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs4(
|
|
243
252
|
"button",
|
|
244
253
|
{
|
|
245
254
|
id: "edit",
|
|
@@ -262,7 +271,7 @@ function TableActions({
|
|
|
262
271
|
]
|
|
263
272
|
}
|
|
264
273
|
) }),
|
|
265
|
-
onDelete && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */
|
|
274
|
+
onDelete && /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsxs4(
|
|
266
275
|
"button",
|
|
267
276
|
{
|
|
268
277
|
id: "delete",
|
|
@@ -287,7 +296,7 @@ function TableActions({
|
|
|
287
296
|
) }),
|
|
288
297
|
resolvedCustomActions?.map((action) => {
|
|
289
298
|
const id = `action-table${phraseToId(action.label)}`;
|
|
290
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ jsxs4(
|
|
291
300
|
"button",
|
|
292
301
|
{
|
|
293
302
|
id,
|
|
@@ -307,7 +316,7 @@ function TableActions({
|
|
|
307
316
|
|
|
308
317
|
// src/components/DataTableAdvancedFilter/ActionsColumn.tsx
|
|
309
318
|
import { PencilSimple as PencilSimple2, Trash as Trash2 } from "@phosphor-icons/react";
|
|
310
|
-
import { Fragment as Fragment3, jsx as jsx7, jsxs as
|
|
319
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
311
320
|
function ActionsColumn({
|
|
312
321
|
row,
|
|
313
322
|
onEdit,
|
|
@@ -316,8 +325,8 @@ function ActionsColumn({
|
|
|
316
325
|
isLanguagePtBr
|
|
317
326
|
}) {
|
|
318
327
|
const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
|
|
319
|
-
return /* @__PURE__ */
|
|
320
|
-
onEdit && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ jsxs5("div", { className: "box-icones-actions-column", children: [
|
|
329
|
+
onEdit && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs5(
|
|
321
330
|
"button",
|
|
322
331
|
{
|
|
323
332
|
id: "edit-column",
|
|
@@ -338,7 +347,7 @@ function ActionsColumn({
|
|
|
338
347
|
]
|
|
339
348
|
}
|
|
340
349
|
) }),
|
|
341
|
-
onDelete && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */
|
|
350
|
+
onDelete && /* @__PURE__ */ jsx7(Fragment3, { children: /* @__PURE__ */ jsxs5(
|
|
342
351
|
"button",
|
|
343
352
|
{
|
|
344
353
|
id: "delete-column",
|
|
@@ -361,7 +370,7 @@ function ActionsColumn({
|
|
|
361
370
|
) }),
|
|
362
371
|
resolvedCustomActions?.map((action) => {
|
|
363
372
|
const id = `action-colunm-${phraseToId(action.label)}`;
|
|
364
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ jsxs5(
|
|
365
374
|
"button",
|
|
366
375
|
{
|
|
367
376
|
id,
|
|
@@ -462,7 +471,7 @@ var useDebounce = (value, delay) => {
|
|
|
462
471
|
};
|
|
463
472
|
|
|
464
473
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilterWrapper.tsx
|
|
465
|
-
import { Fragment as Fragment4, jsx as jsx9, jsxs as
|
|
474
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
466
475
|
function DataTableAdvancedFilterWrapper({
|
|
467
476
|
queryKey,
|
|
468
477
|
mutationFn,
|
|
@@ -605,7 +614,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
605
614
|
}
|
|
606
615
|
}, [customers?.items, selectedRowsData]);
|
|
607
616
|
const TableHeaderAndTableActions = useMemo(
|
|
608
|
-
() => /* @__PURE__ */
|
|
617
|
+
() => /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
609
618
|
globalFilterFields.length > 0 && /* @__PURE__ */ jsx9(
|
|
610
619
|
TableHeader_default,
|
|
611
620
|
{
|
|
@@ -637,9 +646,9 @@ function DataTableAdvancedFilterWrapper({
|
|
|
637
646
|
customActions
|
|
638
647
|
]
|
|
639
648
|
);
|
|
640
|
-
return /* @__PURE__ */ jsx9(Fragment4, { children: isClient && /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ jsx9(Fragment4, { children: isClient && /* @__PURE__ */ jsxs6("div", { children: [
|
|
641
650
|
disablePagination && /* @__PURE__ */ jsx9("div", { className: "disablePagination", children: TableHeaderAndTableActions }),
|
|
642
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ jsxs6(
|
|
643
652
|
DataTable,
|
|
644
653
|
{
|
|
645
654
|
value: customers?.items ?? [],
|
|
@@ -687,7 +696,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
687
696
|
children: /* @__PURE__ */ jsx9(CaretLeft, { size: 18, color: "#fff" })
|
|
688
697
|
}
|
|
689
698
|
),
|
|
690
|
-
CurrentPageReport: (options) => /* @__PURE__ */
|
|
699
|
+
CurrentPageReport: (options) => /* @__PURE__ */ jsxs6("span", { className: "pageReport", children: [
|
|
691
700
|
isLanguagePtBr ? "Mostrando" : "Showing",
|
|
692
701
|
" ",
|
|
693
702
|
options.first,
|
|
@@ -977,7 +986,7 @@ function DataTableAdvancedFilter({
|
|
|
977
986
|
import Select from "react-select";
|
|
978
987
|
import { Dropdown } from "primereact/dropdown";
|
|
979
988
|
import moment2 from "moment";
|
|
980
|
-
import { jsx as jsx11, jsxs as
|
|
989
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
981
990
|
var DateFilterTemplate = (options, mask) => {
|
|
982
991
|
const parsedValue = options.value && typeof options.value === "string" ? /* @__PURE__ */ new Date(options.value + "T00:00:00") : options.value;
|
|
983
992
|
return /* @__PURE__ */ jsx11(
|
|
@@ -1117,7 +1126,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
|
|
|
1117
1126
|
const currentMatchMode = rawFilter.matchMode ?? "contains";
|
|
1118
1127
|
const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
|
|
1119
1128
|
const isSpecial = currentMatchMode === customMatchModes.empty || currentMatchMode === customMatchModes.notEmpty;
|
|
1120
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsxs7(
|
|
1121
1130
|
"div",
|
|
1122
1131
|
{
|
|
1123
1132
|
className: "filter-wrapper",
|
package/dist/styles/table.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
color: #1c1c1c;
|
|
32
32
|
padding: 0 1.25rem;
|
|
33
33
|
width: 13rem;
|
|
34
|
-
height:
|
|
34
|
+
height: 2.5rem;
|
|
35
35
|
border: 1px solid #dadada;
|
|
36
36
|
border-radius: 0.375rem;
|
|
37
37
|
}
|
|
@@ -639,3 +639,28 @@ th {
|
|
|
639
639
|
> .p-datatable-thead {
|
|
640
640
|
top: 0;
|
|
641
641
|
}
|
|
642
|
+
|
|
643
|
+
.input-search {
|
|
644
|
+
padding-right: 2rem;
|
|
645
|
+
height: 2.25rem;
|
|
646
|
+
padding-left: 14px;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.close-search {
|
|
650
|
+
position: absolute;
|
|
651
|
+
top: 50%;
|
|
652
|
+
right: 10px;
|
|
653
|
+
transform: translateY(-50%);
|
|
654
|
+
cursor: pointer;
|
|
655
|
+
color: #bf1717;
|
|
656
|
+
width: 1.25rem;
|
|
657
|
+
height: 1.25rem;
|
|
658
|
+
padding: 3px;
|
|
659
|
+
transition: all 0.3s ease-in-out;
|
|
660
|
+
|
|
661
|
+
&:hover {
|
|
662
|
+
background-color: #bf1717;
|
|
663
|
+
color: #fff;
|
|
664
|
+
border-radius: 5rem;
|
|
665
|
+
}
|
|
666
|
+
}
|