@charlesgomes/leafcode-shared-lib-react 1.0.2 → 1.0.4
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 +0 -9
- package/dist/index.js +36 -22
- package/dist/index.mjs +36 -22
- package/dist/styles/table.css +0 -12
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -274,15 +274,6 @@ th {
|
|
|
274
274
|
padding: 6px;
|
|
275
275
|
margin-left: 4px;
|
|
276
276
|
}
|
|
277
|
-
th:has(.p-column-filter-menu-button.p-column-filter-menu-button-active) .p-icon.p-sortable-column-icon {
|
|
278
|
-
background-color: #094394;
|
|
279
|
-
color: #ffffff !important;
|
|
280
|
-
padding: 6px;
|
|
281
|
-
margin-left: 4px;
|
|
282
|
-
width: 1.5rem;
|
|
283
|
-
height: 1.5rem;
|
|
284
|
-
border-radius: 5rem;
|
|
285
|
-
}
|
|
286
277
|
[aria-sort=ascending] .p-sortable-column-icon,
|
|
287
278
|
[aria-sort=descending] .p-sortable-column-icon {
|
|
288
279
|
background-color: #094394;
|
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
|
@@ -325,18 +325,6 @@ th {
|
|
|
325
325
|
margin-left: 4px;
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
/* Quando o botão de filtro está ativo, muda também a cor do ícone de ordenação */
|
|
329
|
-
th:has(.p-column-filter-menu-button.p-column-filter-menu-button-active)
|
|
330
|
-
.p-icon.p-sortable-column-icon {
|
|
331
|
-
background-color: #094394;
|
|
332
|
-
color: #ffffff !important;
|
|
333
|
-
padding: 6px;
|
|
334
|
-
margin-left: 4px;
|
|
335
|
-
width: 1.5rem;
|
|
336
|
-
height: 1.5rem;
|
|
337
|
-
border-radius: 5rem;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
328
|
[aria-sort="ascending"] .p-sortable-column-icon,
|
|
341
329
|
[aria-sort="descending"] .p-sortable-column-icon {
|
|
342
330
|
background-color: #094394;
|