@charlesgomes/leafcode-shared-lib-react 1.0.3 → 1.0.5
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 +4 -0
- package/dist/index.js +36 -22
- package/dist/index.mjs +36 -22
- package/dist/styles/table.css +13 -9
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -273,6 +273,10 @@ th {
|
|
|
273
273
|
color: #ffffff;
|
|
274
274
|
padding: 6px;
|
|
275
275
|
margin-left: 4px;
|
|
276
|
+
width: 1.5rem;
|
|
277
|
+
height: 1.5rem;
|
|
278
|
+
margin-left: 4px;
|
|
279
|
+
border-radius: 5rem;
|
|
276
280
|
}
|
|
277
281
|
[aria-sort=ascending] .p-sortable-column-icon,
|
|
278
282
|
[aria-sort=descending] .p-sortable-column-icon {
|
package/dist/index.js
CHANGED
|
@@ -279,6 +279,7 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
|
279
279
|
function DynamicColumns({
|
|
280
280
|
columns,
|
|
281
281
|
isMultiSelectionMode = true,
|
|
282
|
+
isLanguagePtBr,
|
|
282
283
|
onEdit,
|
|
283
284
|
onDelete,
|
|
284
285
|
customActionsColums = []
|
|
@@ -301,6 +302,7 @@ function DynamicColumns({
|
|
|
301
302
|
columns.forEach((col, idx) => {
|
|
302
303
|
const isActionsCol = col.field === "acoes";
|
|
303
304
|
const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
|
|
305
|
+
const placeholder = isLanguagePtBr ? "Procurar" : "Search";
|
|
304
306
|
array.push(
|
|
305
307
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
306
308
|
import_column.Column,
|
|
@@ -313,7 +315,7 @@ function DynamicColumns({
|
|
|
313
315
|
dataType: col.dataType,
|
|
314
316
|
filterElement: col.filterElement ? (options) => col.filterElement?.(options, col.mask) ?? void 0 : void 0,
|
|
315
317
|
filterMatchModeOptions: col.filterMatchModeOptions,
|
|
316
|
-
filterPlaceholder: !isActionsCol ?
|
|
318
|
+
filterPlaceholder: !isActionsCol ? placeholder : void 0,
|
|
317
319
|
...col.field !== "acoes" && {
|
|
318
320
|
resizeable: col.enableResizeable ?? true
|
|
319
321
|
},
|
|
@@ -380,7 +382,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
380
382
|
disablePagination = false,
|
|
381
383
|
sortFieldInitial,
|
|
382
384
|
sortOrderInitial = 1,
|
|
383
|
-
isMultiSelectionMode = true
|
|
385
|
+
isMultiSelectionMode = true,
|
|
386
|
+
isLanguagePtBr = true
|
|
384
387
|
}) {
|
|
385
388
|
const [isClient, setIsClient] = (0, import_react4.useState)(false);
|
|
386
389
|
(0, import_react4.useEffect)(() => {
|
|
@@ -596,7 +599,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
596
599
|
isMultiSelectionMode,
|
|
597
600
|
onEdit,
|
|
598
601
|
onDelete,
|
|
599
|
-
customActionsColums
|
|
602
|
+
customActionsColums,
|
|
603
|
+
isLanguagePtBr
|
|
600
604
|
})
|
|
601
605
|
]
|
|
602
606
|
}
|
|
@@ -779,30 +783,40 @@ function DataTableAdvancedFilter({
|
|
|
779
783
|
isLanguagePtBr = true
|
|
780
784
|
}) {
|
|
781
785
|
const [isClient, setIsClient] = (0, import_react6.useState)(false);
|
|
782
|
-
(0,
|
|
783
|
-
|
|
786
|
+
(0, import_react6.useEffect)(() => {
|
|
787
|
+
(0, import_api2.addLocale)("pt", localePtBr);
|
|
788
|
+
}, []);
|
|
789
|
+
(0, import_react6.useEffect)(() => {
|
|
790
|
+
(0, import_api2.locale)(isLanguagePtBr ? "pt" : "en");
|
|
791
|
+
}, [isLanguagePtBr]);
|
|
784
792
|
(0, import_react6.useEffect)(() => {
|
|
785
793
|
setIsClient(true);
|
|
786
794
|
}, []);
|
|
787
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
788
|
-
|
|
795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
796
|
+
import_api2.PrimeReactProvider,
|
|
789
797
|
{
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
798
|
+
value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
|
|
799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
800
|
+
DataTableAdvancedFilterWrapper,
|
|
801
|
+
{
|
|
802
|
+
queryKey,
|
|
803
|
+
mutationFn,
|
|
804
|
+
columns,
|
|
805
|
+
initFilters,
|
|
806
|
+
onNew,
|
|
807
|
+
onEdit,
|
|
808
|
+
onDelete,
|
|
809
|
+
customActions,
|
|
810
|
+
customActionsColums,
|
|
811
|
+
disablePagination,
|
|
812
|
+
sortFieldInitial,
|
|
813
|
+
sortOrderInitial,
|
|
814
|
+
isMultiSelectionMode,
|
|
815
|
+
isLanguagePtBr
|
|
816
|
+
}
|
|
817
|
+
)
|
|
804
818
|
}
|
|
805
|
-
) })
|
|
819
|
+
) });
|
|
806
820
|
}
|
|
807
821
|
|
|
808
822
|
// src/components/DataTableAdvancedFilter/FilterTemplates.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -234,6 +234,7 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
234
234
|
function DynamicColumns({
|
|
235
235
|
columns,
|
|
236
236
|
isMultiSelectionMode = true,
|
|
237
|
+
isLanguagePtBr,
|
|
237
238
|
onEdit,
|
|
238
239
|
onDelete,
|
|
239
240
|
customActionsColums = []
|
|
@@ -256,6 +257,7 @@ function DynamicColumns({
|
|
|
256
257
|
columns.forEach((col, idx) => {
|
|
257
258
|
const isActionsCol = col.field === "acoes";
|
|
258
259
|
const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
|
|
260
|
+
const placeholder = isLanguagePtBr ? "Procurar" : "Search";
|
|
259
261
|
array.push(
|
|
260
262
|
/* @__PURE__ */ jsx6(
|
|
261
263
|
Column,
|
|
@@ -268,7 +270,7 @@ function DynamicColumns({
|
|
|
268
270
|
dataType: col.dataType,
|
|
269
271
|
filterElement: col.filterElement ? (options) => col.filterElement?.(options, col.mask) ?? void 0 : void 0,
|
|
270
272
|
filterMatchModeOptions: col.filterMatchModeOptions,
|
|
271
|
-
filterPlaceholder: !isActionsCol ?
|
|
273
|
+
filterPlaceholder: !isActionsCol ? placeholder : void 0,
|
|
272
274
|
...col.field !== "acoes" && {
|
|
273
275
|
resizeable: col.enableResizeable ?? true
|
|
274
276
|
},
|
|
@@ -335,7 +337,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
335
337
|
disablePagination = false,
|
|
336
338
|
sortFieldInitial,
|
|
337
339
|
sortOrderInitial = 1,
|
|
338
|
-
isMultiSelectionMode = true
|
|
340
|
+
isMultiSelectionMode = true,
|
|
341
|
+
isLanguagePtBr = true
|
|
339
342
|
}) {
|
|
340
343
|
const [isClient, setIsClient] = useState2(false);
|
|
341
344
|
useEffect2(() => {
|
|
@@ -551,7 +554,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
551
554
|
isMultiSelectionMode,
|
|
552
555
|
onEdit,
|
|
553
556
|
onDelete,
|
|
554
|
-
customActionsColums
|
|
557
|
+
customActionsColums,
|
|
558
|
+
isLanguagePtBr
|
|
555
559
|
})
|
|
556
560
|
]
|
|
557
561
|
}
|
|
@@ -734,30 +738,40 @@ function DataTableAdvancedFilter({
|
|
|
734
738
|
isLanguagePtBr = true
|
|
735
739
|
}) {
|
|
736
740
|
const [isClient, setIsClient] = useState3(false);
|
|
737
|
-
|
|
738
|
-
|
|
741
|
+
useEffect3(() => {
|
|
742
|
+
addLocale("pt", localePtBr);
|
|
743
|
+
}, []);
|
|
744
|
+
useEffect3(() => {
|
|
745
|
+
locale(isLanguagePtBr ? "pt" : "en");
|
|
746
|
+
}, [isLanguagePtBr]);
|
|
739
747
|
useEffect3(() => {
|
|
740
748
|
setIsClient(true);
|
|
741
749
|
}, []);
|
|
742
|
-
return /* @__PURE__ */ jsx8(Fragment4, { children: isClient && /* @__PURE__ */ jsx8(
|
|
743
|
-
|
|
750
|
+
return /* @__PURE__ */ jsx8(Fragment4, { children: isClient && /* @__PURE__ */ jsx8(
|
|
751
|
+
PrimeReactProvider,
|
|
744
752
|
{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
753
|
+
value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
|
|
754
|
+
children: /* @__PURE__ */ jsx8(
|
|
755
|
+
DataTableAdvancedFilterWrapper,
|
|
756
|
+
{
|
|
757
|
+
queryKey,
|
|
758
|
+
mutationFn,
|
|
759
|
+
columns,
|
|
760
|
+
initFilters,
|
|
761
|
+
onNew,
|
|
762
|
+
onEdit,
|
|
763
|
+
onDelete,
|
|
764
|
+
customActions,
|
|
765
|
+
customActionsColums,
|
|
766
|
+
disablePagination,
|
|
767
|
+
sortFieldInitial,
|
|
768
|
+
sortOrderInitial,
|
|
769
|
+
isMultiSelectionMode,
|
|
770
|
+
isLanguagePtBr
|
|
771
|
+
}
|
|
772
|
+
)
|
|
759
773
|
}
|
|
760
|
-
) })
|
|
774
|
+
) });
|
|
761
775
|
}
|
|
762
776
|
|
|
763
777
|
// src/components/DataTableAdvancedFilter/FilterTemplates.tsx
|
package/dist/styles/table.css
CHANGED
|
@@ -174,7 +174,7 @@ th {
|
|
|
174
174
|
font-weight: bold;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.p-datatable .p-datatable-tbody
|
|
177
|
+
.p-datatable .p-datatable-tbody>tr {
|
|
178
178
|
background: #fff;
|
|
179
179
|
color: #000;
|
|
180
180
|
font-family: "roboto", sans-serif;
|
|
@@ -204,14 +204,13 @@ th {
|
|
|
204
204
|
left: -2px;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover).p-highlight
|
|
208
|
-
.p-checkbox-box {
|
|
207
|
+
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover).p-highlight .p-checkbox-box {
|
|
209
208
|
border-color: #094394;
|
|
210
209
|
background: #094394;
|
|
211
210
|
color: #ffffff;
|
|
212
211
|
}
|
|
213
212
|
|
|
214
|
-
.p-datatable .p-datatable-tbody
|
|
213
|
+
.p-datatable .p-datatable-tbody>tr.p-highlight {
|
|
215
214
|
background: #fafbfc;
|
|
216
215
|
}
|
|
217
216
|
|
|
@@ -323,6 +322,10 @@ th {
|
|
|
323
322
|
color: #ffffff;
|
|
324
323
|
padding: 6px;
|
|
325
324
|
margin-left: 4px;
|
|
325
|
+
width: 1.5rem;
|
|
326
|
+
height: 1.5rem;
|
|
327
|
+
margin-left: 4px;
|
|
328
|
+
border-radius: 5rem;
|
|
326
329
|
}
|
|
327
330
|
|
|
328
331
|
[aria-sort="ascending"] .p-sortable-column-icon,
|
|
@@ -356,7 +359,7 @@ th {
|
|
|
356
359
|
padding: 10px 0;
|
|
357
360
|
}
|
|
358
361
|
|
|
359
|
-
.p-column-filter-add-button
|
|
362
|
+
.p-column-filter-add-button>svg {
|
|
360
363
|
width: 12px;
|
|
361
364
|
height: 12px;
|
|
362
365
|
}
|
|
@@ -400,7 +403,7 @@ th {
|
|
|
400
403
|
padding: 10px 0 0 0;
|
|
401
404
|
}
|
|
402
405
|
|
|
403
|
-
.p-column-filter-remove-button
|
|
406
|
+
.p-column-filter-remove-button>svg {
|
|
404
407
|
width: 12px;
|
|
405
408
|
height: 12px;
|
|
406
409
|
}
|
|
@@ -413,8 +416,8 @@ th {
|
|
|
413
416
|
z-index: 99;
|
|
414
417
|
}
|
|
415
418
|
|
|
416
|
-
.NextPage
|
|
417
|
-
.PrevPage
|
|
419
|
+
.NextPage>svg,
|
|
420
|
+
.PrevPage>svg {
|
|
418
421
|
fill: #fff;
|
|
419
422
|
}
|
|
420
423
|
|
|
@@ -535,6 +538,7 @@ th {
|
|
|
535
538
|
}
|
|
536
539
|
|
|
537
540
|
@media (max-width: 567px) {
|
|
541
|
+
|
|
538
542
|
.disablePagination,
|
|
539
543
|
.paginatorLeft {
|
|
540
544
|
display: grid;
|
|
@@ -544,4 +548,4 @@ th {
|
|
|
544
548
|
.custom-select {
|
|
545
549
|
min-width: 100%;
|
|
546
550
|
}
|
|
547
|
-
}
|
|
551
|
+
}
|