@charlesgomes/leafcode-shared-lib-react 1.0.5 → 1.0.7
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.js +59 -15
- package/dist/index.mjs +59 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -82,13 +82,17 @@ var import_api = require("primereact/api");
|
|
|
82
82
|
|
|
83
83
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
84
84
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
85
|
-
var TableHeader = ({
|
|
85
|
+
var TableHeader = ({
|
|
86
|
+
globalFilterValue,
|
|
87
|
+
onGlobalFilterChange,
|
|
88
|
+
isLanguagePtBr
|
|
89
|
+
}) => {
|
|
86
90
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
87
91
|
import_inputtext.InputText,
|
|
88
92
|
{
|
|
89
93
|
value: globalFilterValue,
|
|
90
94
|
onChange: onGlobalFilterChange,
|
|
91
|
-
placeholder: "Pesquisar...",
|
|
95
|
+
placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
|
|
92
96
|
className: "custom-input"
|
|
93
97
|
}
|
|
94
98
|
);
|
|
@@ -143,7 +147,8 @@ function TableActions({
|
|
|
143
147
|
onEdit,
|
|
144
148
|
onDelete,
|
|
145
149
|
selectedRows,
|
|
146
|
-
customActions = []
|
|
150
|
+
customActions = [],
|
|
151
|
+
isLanguagePtBr
|
|
147
152
|
}) {
|
|
148
153
|
const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
|
|
149
154
|
const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
|
|
@@ -163,7 +168,13 @@ function TableActions({
|
|
|
163
168
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react.Plus, { size: 18 })
|
|
164
169
|
}
|
|
165
170
|
),
|
|
166
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
172
|
+
TooltipCustom,
|
|
173
|
+
{
|
|
174
|
+
id: "add",
|
|
175
|
+
label: isLanguagePtBr ? "Adicionar" : "Add"
|
|
176
|
+
}
|
|
177
|
+
)
|
|
167
178
|
] }),
|
|
168
179
|
onEdit && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
169
180
|
"button",
|
|
@@ -177,7 +188,13 @@ function TableActions({
|
|
|
177
188
|
disabled: disableButtonsNotMultiplesSelecteds,
|
|
178
189
|
children: [
|
|
179
190
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react.PencilSimple, { size: 18 }),
|
|
180
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
192
|
+
TooltipCustom,
|
|
193
|
+
{
|
|
194
|
+
id: "edit",
|
|
195
|
+
label: isLanguagePtBr ? "Editar" : "Edit"
|
|
196
|
+
}
|
|
197
|
+
)
|
|
181
198
|
]
|
|
182
199
|
}
|
|
183
200
|
) }),
|
|
@@ -193,7 +210,13 @@ function TableActions({
|
|
|
193
210
|
disabled: !enableButtonsNotMultiplesSelecteds,
|
|
194
211
|
children: [
|
|
195
212
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react.Trash, { size: 18 }),
|
|
196
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
214
|
+
TooltipCustom,
|
|
215
|
+
{
|
|
216
|
+
id: "delete",
|
|
217
|
+
label: isLanguagePtBr ? "Excluir" : "Delete"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
197
220
|
]
|
|
198
221
|
}
|
|
199
222
|
) }),
|
|
@@ -223,7 +246,8 @@ function ActionsColumn({
|
|
|
223
246
|
row,
|
|
224
247
|
onEdit,
|
|
225
248
|
onDelete,
|
|
226
|
-
customActionsColums
|
|
249
|
+
customActionsColums,
|
|
250
|
+
isLanguagePtBr
|
|
227
251
|
}) {
|
|
228
252
|
const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
|
|
229
253
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "box-icones-actions-column", children: [
|
|
@@ -237,7 +261,13 @@ function ActionsColumn({
|
|
|
237
261
|
},
|
|
238
262
|
children: [
|
|
239
263
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react2.PencilSimple, { size: 17, weight: "regular" }),
|
|
240
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
265
|
+
TooltipCustom,
|
|
266
|
+
{
|
|
267
|
+
id: "edit-column",
|
|
268
|
+
label: isLanguagePtBr ? "Editar" : "Edit"
|
|
269
|
+
}
|
|
270
|
+
)
|
|
241
271
|
]
|
|
242
272
|
}
|
|
243
273
|
) }),
|
|
@@ -251,7 +281,13 @@ function ActionsColumn({
|
|
|
251
281
|
},
|
|
252
282
|
children: [
|
|
253
283
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react2.Trash, { size: 17, weight: "regular" }),
|
|
254
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
285
|
+
TooltipCustom,
|
|
286
|
+
{
|
|
287
|
+
id: "delete-column",
|
|
288
|
+
label: isLanguagePtBr ? "Excluir" : "Delete"
|
|
289
|
+
}
|
|
290
|
+
)
|
|
255
291
|
]
|
|
256
292
|
}
|
|
257
293
|
) }),
|
|
@@ -326,7 +362,8 @@ function DynamicColumns({
|
|
|
326
362
|
row: rowData,
|
|
327
363
|
onEdit,
|
|
328
364
|
onDelete,
|
|
329
|
-
customActionsColums
|
|
365
|
+
customActionsColums,
|
|
366
|
+
isLanguagePtBr
|
|
330
367
|
}
|
|
331
368
|
) : col.body ? col.body(rowData) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: String(rowData[col.field]) }),
|
|
332
369
|
sortable: !isActionsCol ? col.enableSorting ?? true : false
|
|
@@ -491,6 +528,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
491
528
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
492
529
|
TableHeader_default,
|
|
493
530
|
{
|
|
531
|
+
isLanguagePtBr,
|
|
494
532
|
globalFilterValue: searchText,
|
|
495
533
|
onGlobalFilterChange
|
|
496
534
|
}
|
|
@@ -502,7 +540,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
502
540
|
onNew,
|
|
503
541
|
onEdit,
|
|
504
542
|
onDelete,
|
|
505
|
-
customActions
|
|
543
|
+
customActions,
|
|
544
|
+
isLanguagePtBr
|
|
506
545
|
}
|
|
507
546
|
)
|
|
508
547
|
] }),
|
|
@@ -566,11 +605,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
566
605
|
}
|
|
567
606
|
),
|
|
568
607
|
CurrentPageReport: (options) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "pageReport", children: [
|
|
569
|
-
"Mostrando ",
|
|
608
|
+
isLanguagePtBr ? "Mostrando" : "Showing",
|
|
609
|
+
" ",
|
|
570
610
|
options.first,
|
|
571
|
-
"
|
|
611
|
+
" ",
|
|
612
|
+
isLanguagePtBr ? "a" : "the",
|
|
613
|
+
" ",
|
|
572
614
|
options.last,
|
|
573
|
-
"
|
|
615
|
+
" ",
|
|
616
|
+
isLanguagePtBr ? "de" : "of",
|
|
574
617
|
" ",
|
|
575
618
|
options.totalRecords
|
|
576
619
|
] }),
|
|
@@ -587,7 +630,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
587
630
|
paginatorPosition: "top",
|
|
588
631
|
paginatorLeft: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "paginatorLeft", children: globalFilterFields.length > 0 && TableHeaderAndTableActions }),
|
|
589
632
|
currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
|
|
590
|
-
emptyMessage: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "Nenhum dado encontrado" }) }),
|
|
633
|
+
emptyMessage: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
|
|
591
634
|
onFilter: (e) => setFilters(e.filters),
|
|
592
635
|
rowsPerPageOptions: [10, 25, 50, 100],
|
|
593
636
|
className: "p-datatable-sm",
|
|
@@ -908,6 +951,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true) => {
|
|
|
908
951
|
isClearable: false,
|
|
909
952
|
isSearchable: false,
|
|
910
953
|
className: "custom-select-filtro",
|
|
954
|
+
classNamePrefix: "custom-select-filtro",
|
|
911
955
|
styles: {
|
|
912
956
|
control: (baseStyles, state) => ({
|
|
913
957
|
...baseStyles,
|
package/dist/index.mjs
CHANGED
|
@@ -37,13 +37,17 @@ import { FilterMatchMode } from "primereact/api";
|
|
|
37
37
|
|
|
38
38
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
39
39
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
40
|
-
var TableHeader = ({
|
|
40
|
+
var TableHeader = ({
|
|
41
|
+
globalFilterValue,
|
|
42
|
+
onGlobalFilterChange,
|
|
43
|
+
isLanguagePtBr
|
|
44
|
+
}) => {
|
|
41
45
|
return /* @__PURE__ */ jsx2(
|
|
42
46
|
InputText,
|
|
43
47
|
{
|
|
44
48
|
value: globalFilterValue,
|
|
45
49
|
onChange: onGlobalFilterChange,
|
|
46
|
-
placeholder: "Pesquisar...",
|
|
50
|
+
placeholder: isLanguagePtBr ? "Pesquisar..." : "Search...",
|
|
47
51
|
className: "custom-input"
|
|
48
52
|
}
|
|
49
53
|
);
|
|
@@ -98,7 +102,8 @@ function TableActions({
|
|
|
98
102
|
onEdit,
|
|
99
103
|
onDelete,
|
|
100
104
|
selectedRows,
|
|
101
|
-
customActions = []
|
|
105
|
+
customActions = [],
|
|
106
|
+
isLanguagePtBr
|
|
102
107
|
}) {
|
|
103
108
|
const disableButtonsNotMultiplesSelecteds = selectedRows?.length !== 1 ? true : false;
|
|
104
109
|
const enableButtonsNotMultiplesSelecteds = selectedRows?.length > 0 ? true : false;
|
|
@@ -118,7 +123,13 @@ function TableActions({
|
|
|
118
123
|
children: /* @__PURE__ */ jsx4(Plus, { size: 18 })
|
|
119
124
|
}
|
|
120
125
|
),
|
|
121
|
-
/* @__PURE__ */ jsx4(
|
|
126
|
+
/* @__PURE__ */ jsx4(
|
|
127
|
+
TooltipCustom,
|
|
128
|
+
{
|
|
129
|
+
id: "add",
|
|
130
|
+
label: isLanguagePtBr ? "Adicionar" : "Add"
|
|
131
|
+
}
|
|
132
|
+
)
|
|
122
133
|
] }),
|
|
123
134
|
onEdit && /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
124
135
|
"button",
|
|
@@ -132,7 +143,13 @@ function TableActions({
|
|
|
132
143
|
disabled: disableButtonsNotMultiplesSelecteds,
|
|
133
144
|
children: [
|
|
134
145
|
/* @__PURE__ */ jsx4(PencilSimple, { size: 18 }),
|
|
135
|
-
/* @__PURE__ */ jsx4(
|
|
146
|
+
/* @__PURE__ */ jsx4(
|
|
147
|
+
TooltipCustom,
|
|
148
|
+
{
|
|
149
|
+
id: "edit",
|
|
150
|
+
label: isLanguagePtBr ? "Editar" : "Edit"
|
|
151
|
+
}
|
|
152
|
+
)
|
|
136
153
|
]
|
|
137
154
|
}
|
|
138
155
|
) }),
|
|
@@ -148,7 +165,13 @@ function TableActions({
|
|
|
148
165
|
disabled: !enableButtonsNotMultiplesSelecteds,
|
|
149
166
|
children: [
|
|
150
167
|
/* @__PURE__ */ jsx4(Trash, { size: 18 }),
|
|
151
|
-
/* @__PURE__ */ jsx4(
|
|
168
|
+
/* @__PURE__ */ jsx4(
|
|
169
|
+
TooltipCustom,
|
|
170
|
+
{
|
|
171
|
+
id: "delete",
|
|
172
|
+
label: isLanguagePtBr ? "Excluir" : "Delete"
|
|
173
|
+
}
|
|
174
|
+
)
|
|
152
175
|
]
|
|
153
176
|
}
|
|
154
177
|
) }),
|
|
@@ -178,7 +201,8 @@ function ActionsColumn({
|
|
|
178
201
|
row,
|
|
179
202
|
onEdit,
|
|
180
203
|
onDelete,
|
|
181
|
-
customActionsColums
|
|
204
|
+
customActionsColums,
|
|
205
|
+
isLanguagePtBr
|
|
182
206
|
}) {
|
|
183
207
|
const resolvedCustomActions = typeof customActionsColums === "function" ? customActionsColums(row) : customActionsColums;
|
|
184
208
|
return /* @__PURE__ */ jsxs2("div", { className: "box-icones-actions-column", children: [
|
|
@@ -192,7 +216,13 @@ function ActionsColumn({
|
|
|
192
216
|
},
|
|
193
217
|
children: [
|
|
194
218
|
/* @__PURE__ */ jsx5(PencilSimple2, { size: 17, weight: "regular" }),
|
|
195
|
-
/* @__PURE__ */ jsx5(
|
|
219
|
+
/* @__PURE__ */ jsx5(
|
|
220
|
+
TooltipCustom,
|
|
221
|
+
{
|
|
222
|
+
id: "edit-column",
|
|
223
|
+
label: isLanguagePtBr ? "Editar" : "Edit"
|
|
224
|
+
}
|
|
225
|
+
)
|
|
196
226
|
]
|
|
197
227
|
}
|
|
198
228
|
) }),
|
|
@@ -206,7 +236,13 @@ function ActionsColumn({
|
|
|
206
236
|
},
|
|
207
237
|
children: [
|
|
208
238
|
/* @__PURE__ */ jsx5(Trash2, { size: 17, weight: "regular" }),
|
|
209
|
-
/* @__PURE__ */ jsx5(
|
|
239
|
+
/* @__PURE__ */ jsx5(
|
|
240
|
+
TooltipCustom,
|
|
241
|
+
{
|
|
242
|
+
id: "delete-column",
|
|
243
|
+
label: isLanguagePtBr ? "Excluir" : "Delete"
|
|
244
|
+
}
|
|
245
|
+
)
|
|
210
246
|
]
|
|
211
247
|
}
|
|
212
248
|
) }),
|
|
@@ -281,7 +317,8 @@ function DynamicColumns({
|
|
|
281
317
|
row: rowData,
|
|
282
318
|
onEdit,
|
|
283
319
|
onDelete,
|
|
284
|
-
customActionsColums
|
|
320
|
+
customActionsColums,
|
|
321
|
+
isLanguagePtBr
|
|
285
322
|
}
|
|
286
323
|
) : col.body ? col.body(rowData) : /* @__PURE__ */ jsx6("span", { children: String(rowData[col.field]) }),
|
|
287
324
|
sortable: !isActionsCol ? col.enableSorting ?? true : false
|
|
@@ -446,6 +483,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
446
483
|
/* @__PURE__ */ jsx7(
|
|
447
484
|
TableHeader_default,
|
|
448
485
|
{
|
|
486
|
+
isLanguagePtBr,
|
|
449
487
|
globalFilterValue: searchText,
|
|
450
488
|
onGlobalFilterChange
|
|
451
489
|
}
|
|
@@ -457,7 +495,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
457
495
|
onNew,
|
|
458
496
|
onEdit,
|
|
459
497
|
onDelete,
|
|
460
|
-
customActions
|
|
498
|
+
customActions,
|
|
499
|
+
isLanguagePtBr
|
|
461
500
|
}
|
|
462
501
|
)
|
|
463
502
|
] }),
|
|
@@ -521,11 +560,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
521
560
|
}
|
|
522
561
|
),
|
|
523
562
|
CurrentPageReport: (options) => /* @__PURE__ */ jsxs3("span", { className: "pageReport", children: [
|
|
524
|
-
"Mostrando ",
|
|
563
|
+
isLanguagePtBr ? "Mostrando" : "Showing",
|
|
564
|
+
" ",
|
|
525
565
|
options.first,
|
|
526
|
-
"
|
|
566
|
+
" ",
|
|
567
|
+
isLanguagePtBr ? "a" : "the",
|
|
568
|
+
" ",
|
|
527
569
|
options.last,
|
|
528
|
-
"
|
|
570
|
+
" ",
|
|
571
|
+
isLanguagePtBr ? "de" : "of",
|
|
529
572
|
" ",
|
|
530
573
|
options.totalRecords
|
|
531
574
|
] }),
|
|
@@ -542,7 +585,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
542
585
|
paginatorPosition: "top",
|
|
543
586
|
paginatorLeft: /* @__PURE__ */ jsx7("div", { className: "paginatorLeft", children: globalFilterFields.length > 0 && TableHeaderAndTableActions }),
|
|
544
587
|
currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
|
|
545
|
-
emptyMessage: /* @__PURE__ */ jsx7("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx7("p", { children: "Nenhum dado encontrado" }) }),
|
|
588
|
+
emptyMessage: /* @__PURE__ */ jsx7("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx7("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
|
|
546
589
|
onFilter: (e) => setFilters(e.filters),
|
|
547
590
|
rowsPerPageOptions: [10, 25, 50, 100],
|
|
548
591
|
className: "p-datatable-sm",
|
|
@@ -863,6 +906,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true) => {
|
|
|
863
906
|
isClearable: false,
|
|
864
907
|
isSearchable: false,
|
|
865
908
|
className: "custom-select-filtro",
|
|
909
|
+
classNamePrefix: "custom-select-filtro",
|
|
866
910
|
styles: {
|
|
867
911
|
control: (baseStyles, state) => ({
|
|
868
912
|
...baseStyles,
|