@charlesgomes/leafcode-shared-lib-react 1.0.0 → 1.0.2
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 -12
- package/dist/index.js +14 -4
- package/dist/index.mjs +14 -4
- package/dist/styles/table.css +25 -14
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -11,15 +11,18 @@
|
|
|
11
11
|
}
|
|
12
12
|
.tableClassName {
|
|
13
13
|
font-weight: 500;
|
|
14
|
+
font-family: "Roboto", sans-serif;
|
|
14
15
|
font-size: 0.875rem;
|
|
15
16
|
}
|
|
16
17
|
.paginatorClassName {
|
|
17
18
|
padding: 0 0 0.75rem 0;
|
|
18
19
|
font-weight: 500;
|
|
20
|
+
font-family: "Roboto", sans-serif;
|
|
19
21
|
font-size: 0.875rem;
|
|
20
22
|
}
|
|
21
23
|
.custom-input {
|
|
22
24
|
font-weight: 500;
|
|
25
|
+
font-family: "Roboto", sans-serif;
|
|
23
26
|
font-size: 0.875rem;
|
|
24
27
|
color: #1c1c1c;
|
|
25
28
|
padding: 0 1.25rem;
|
|
@@ -61,6 +64,7 @@
|
|
|
61
64
|
}
|
|
62
65
|
.pageReport {
|
|
63
66
|
font-weight: 500;
|
|
67
|
+
font-family: "Roboto", sans-serif;
|
|
64
68
|
font-size: 0.875rem;
|
|
65
69
|
color: #191919;
|
|
66
70
|
padding: 0 0.5rem;
|
|
@@ -70,19 +74,16 @@
|
|
|
70
74
|
max-height: 34px;
|
|
71
75
|
margin-inline-end: 1rem;
|
|
72
76
|
}
|
|
73
|
-
@media (min-width: 640px) {
|
|
74
|
-
.custom-select {
|
|
75
|
-
margin-inline-end: 2rem;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
77
|
.custom-select-filtro {
|
|
79
78
|
height: 2rem;
|
|
80
79
|
font-weight: 500;
|
|
80
|
+
font-family: "Roboto", sans-serif;
|
|
81
81
|
font-size: 0.875rem;
|
|
82
82
|
}
|
|
83
83
|
.mensagem-nenhum-dado {
|
|
84
84
|
text-align: center;
|
|
85
85
|
font-weight: 500;
|
|
86
|
+
font-family: "Roboto", sans-serif;
|
|
86
87
|
padding: 2rem 0;
|
|
87
88
|
color: #191919;
|
|
88
89
|
}
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
}
|
|
101
102
|
table {
|
|
102
103
|
border-collapse: separate;
|
|
104
|
+
border-right: 1px solid #edf0f2;
|
|
103
105
|
}
|
|
104
106
|
th {
|
|
105
107
|
border-top: 1px solid #edf0f2;
|
|
@@ -114,7 +116,7 @@ th {
|
|
|
114
116
|
td {
|
|
115
117
|
border-bottom: 1px solid #edf0f2;
|
|
116
118
|
border-left: 1px solid #edf0f2;
|
|
117
|
-
padding: 5px
|
|
119
|
+
padding: 5px 1rem;
|
|
118
120
|
}
|
|
119
121
|
.p-datatable .p-datatable-header {
|
|
120
122
|
background: transparent;
|
|
@@ -130,7 +132,6 @@ td {
|
|
|
130
132
|
-webkit-appearance: none;
|
|
131
133
|
-moz-appearance: none;
|
|
132
134
|
background: #fff url("./seta-T37FWQKV.svg") no-repeat right 6px center;
|
|
133
|
-
padding-right: 2rem;
|
|
134
135
|
}
|
|
135
136
|
.react-tooltip {
|
|
136
137
|
z-index: 99 !important;
|
|
@@ -153,8 +154,8 @@ th {
|
|
|
153
154
|
font-weight: 500;
|
|
154
155
|
}
|
|
155
156
|
.p-checkbox .p-checkbox-box {
|
|
156
|
-
width:
|
|
157
|
-
height:
|
|
157
|
+
width: 1rem;
|
|
158
|
+
height: 1rem;
|
|
158
159
|
border: 1px solid #094394 !important;
|
|
159
160
|
border-radius: 4px !important;
|
|
160
161
|
background-color: #fff;
|
|
@@ -164,8 +165,12 @@ th {
|
|
|
164
165
|
background: #094394;
|
|
165
166
|
}
|
|
166
167
|
.p-checkbox {
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
168
|
+
width: 1rem;
|
|
169
|
+
height: 1rem;
|
|
170
|
+
}
|
|
171
|
+
.p-column-header-content .p-checkbox {
|
|
172
|
+
position: relative;
|
|
173
|
+
left: -2px;
|
|
169
174
|
}
|
|
170
175
|
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover).p-highlight .p-checkbox-box {
|
|
171
176
|
border-color: #094394;
|
|
@@ -194,6 +199,7 @@ th {
|
|
|
194
199
|
.p-dropdown-item-label {
|
|
195
200
|
padding: 6px 1rem;
|
|
196
201
|
font-weight: 500;
|
|
202
|
+
font-family: "Roboto", sans-serif;
|
|
197
203
|
}
|
|
198
204
|
.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
|
|
199
205
|
margin: 0;
|
|
@@ -454,9 +460,14 @@ th:has(.p-column-filter-menu-button.p-column-filter-menu-button-active) .p-icon.
|
|
|
454
460
|
position: relative;
|
|
455
461
|
top: 4px !important;
|
|
456
462
|
}
|
|
463
|
+
}
|
|
464
|
+
@media (max-width: 567px) {
|
|
457
465
|
.disablePagination,
|
|
458
466
|
.paginatorLeft {
|
|
459
|
-
display:
|
|
467
|
+
display: grid;
|
|
460
468
|
gap: 1rem;
|
|
461
469
|
}
|
|
470
|
+
.custom-select {
|
|
471
|
+
min-width: 100%;
|
|
472
|
+
}
|
|
462
473
|
}
|
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var import_api = require("primereact/api");
|
|
|
83
83
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
84
84
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
85
85
|
var TableHeader = ({ globalFilterValue, onGlobalFilterChange }) => {
|
|
86
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
87
87
|
import_inputtext.InputText,
|
|
88
88
|
{
|
|
89
89
|
value: globalFilterValue,
|
|
@@ -91,7 +91,7 @@ var TableHeader = ({ globalFilterValue, onGlobalFilterChange }) => {
|
|
|
91
91
|
placeholder: "Pesquisar...",
|
|
92
92
|
className: "custom-input"
|
|
93
93
|
}
|
|
94
|
-
)
|
|
94
|
+
);
|
|
95
95
|
};
|
|
96
96
|
var TableHeader_default = TableHeader;
|
|
97
97
|
|
|
@@ -463,13 +463,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
463
463
|
setSearchText(value);
|
|
464
464
|
setPage(1);
|
|
465
465
|
setFirst(0);
|
|
466
|
-
updateUrlParams({ page: 1, filter: value });
|
|
467
466
|
};
|
|
468
467
|
const onSort = (e) => {
|
|
469
468
|
setSortField(e.sortField);
|
|
470
469
|
setSortOrder(e.sortOrder);
|
|
471
470
|
updateUrlParams({ sortField: e.sortField, sortOrder: e.sortOrder });
|
|
472
471
|
};
|
|
472
|
+
(0, import_react4.useEffect)(() => {
|
|
473
|
+
updateUrlParams({ page: 1, filter: debouncedSearch });
|
|
474
|
+
}, [debouncedSearch]);
|
|
473
475
|
(0, import_react4.useEffect)(() => {
|
|
474
476
|
if (customers?.items && selectedRowsData.length > 0) {
|
|
475
477
|
const currentIds = new Set(customers.items.map((item) => item.id));
|
|
@@ -501,7 +503,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
501
503
|
}
|
|
502
504
|
)
|
|
503
505
|
] }),
|
|
504
|
-
[
|
|
506
|
+
[
|
|
507
|
+
searchText,
|
|
508
|
+
onGlobalFilterChange,
|
|
509
|
+
selectedRowsData,
|
|
510
|
+
onNew,
|
|
511
|
+
onEdit,
|
|
512
|
+
onDelete,
|
|
513
|
+
customActions
|
|
514
|
+
]
|
|
505
515
|
);
|
|
506
516
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
507
517
|
disablePagination && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "disablePagination", children: globalFilterFields.length > 0 && TableHeaderAndTableActions }),
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ import { FilterMatchMode } from "primereact/api";
|
|
|
38
38
|
// src/components/DataTableAdvancedFilter/TableHeader.tsx
|
|
39
39
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
40
40
|
var TableHeader = ({ globalFilterValue, onGlobalFilterChange }) => {
|
|
41
|
-
return /* @__PURE__ */ jsx2(
|
|
41
|
+
return /* @__PURE__ */ jsx2(
|
|
42
42
|
InputText,
|
|
43
43
|
{
|
|
44
44
|
value: globalFilterValue,
|
|
@@ -46,7 +46,7 @@ var TableHeader = ({ globalFilterValue, onGlobalFilterChange }) => {
|
|
|
46
46
|
placeholder: "Pesquisar...",
|
|
47
47
|
className: "custom-input"
|
|
48
48
|
}
|
|
49
|
-
)
|
|
49
|
+
);
|
|
50
50
|
};
|
|
51
51
|
var TableHeader_default = TableHeader;
|
|
52
52
|
|
|
@@ -418,13 +418,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
418
418
|
setSearchText(value);
|
|
419
419
|
setPage(1);
|
|
420
420
|
setFirst(0);
|
|
421
|
-
updateUrlParams({ page: 1, filter: value });
|
|
422
421
|
};
|
|
423
422
|
const onSort = (e) => {
|
|
424
423
|
setSortField(e.sortField);
|
|
425
424
|
setSortOrder(e.sortOrder);
|
|
426
425
|
updateUrlParams({ sortField: e.sortField, sortOrder: e.sortOrder });
|
|
427
426
|
};
|
|
427
|
+
useEffect2(() => {
|
|
428
|
+
updateUrlParams({ page: 1, filter: debouncedSearch });
|
|
429
|
+
}, [debouncedSearch]);
|
|
428
430
|
useEffect2(() => {
|
|
429
431
|
if (customers?.items && selectedRowsData.length > 0) {
|
|
430
432
|
const currentIds = new Set(customers.items.map((item) => item.id));
|
|
@@ -456,7 +458,15 @@ function DataTableAdvancedFilterWrapper({
|
|
|
456
458
|
}
|
|
457
459
|
)
|
|
458
460
|
] }),
|
|
459
|
-
[
|
|
461
|
+
[
|
|
462
|
+
searchText,
|
|
463
|
+
onGlobalFilterChange,
|
|
464
|
+
selectedRowsData,
|
|
465
|
+
onNew,
|
|
466
|
+
onEdit,
|
|
467
|
+
onDelete,
|
|
468
|
+
customActions
|
|
469
|
+
]
|
|
460
470
|
);
|
|
461
471
|
return /* @__PURE__ */ jsx7(Fragment3, { children: isClient && /* @__PURE__ */ jsxs3("div", { children: [
|
|
462
472
|
disablePagination && /* @__PURE__ */ jsx7("div", { className: "disablePagination", children: globalFilterFields.length > 0 && TableHeaderAndTableActions }),
|
package/dist/styles/table.css
CHANGED
|
@@ -12,17 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
.tableClassName {
|
|
14
14
|
font-weight: 500;
|
|
15
|
+
font-family: "Roboto", sans-serif;
|
|
15
16
|
font-size: 0.875rem;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.paginatorClassName {
|
|
19
20
|
padding: 0 0 0.75rem 0;
|
|
20
21
|
font-weight: 500;
|
|
22
|
+
font-family: "Roboto", sans-serif;
|
|
21
23
|
font-size: 0.875rem;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
.custom-input {
|
|
25
27
|
font-weight: 500;
|
|
28
|
+
font-family: "Roboto", sans-serif;
|
|
26
29
|
font-size: 0.875rem;
|
|
27
30
|
color: #1c1c1c;
|
|
28
31
|
padding: 0 1.25rem;
|
|
@@ -71,6 +74,7 @@
|
|
|
71
74
|
|
|
72
75
|
.pageReport {
|
|
73
76
|
font-weight: 500;
|
|
77
|
+
font-family: "Roboto", sans-serif;
|
|
74
78
|
font-size: 0.875rem;
|
|
75
79
|
color: #191919;
|
|
76
80
|
padding: 0 0.5rem;
|
|
@@ -82,21 +86,17 @@
|
|
|
82
86
|
margin-inline-end: 1rem;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
@media (min-width: 640px) {
|
|
86
|
-
.custom-select {
|
|
87
|
-
margin-inline-end: 2rem;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
89
|
.custom-select-filtro {
|
|
92
90
|
height: 2rem;
|
|
93
91
|
font-weight: 500;
|
|
92
|
+
font-family: "Roboto", sans-serif;
|
|
94
93
|
font-size: 0.875rem;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
.mensagem-nenhum-dado {
|
|
98
97
|
text-align: center;
|
|
99
98
|
font-weight: 500;
|
|
99
|
+
font-family: "Roboto", sans-serif;
|
|
100
100
|
padding: 2rem 0;
|
|
101
101
|
color: #191919;
|
|
102
102
|
}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
|
|
118
118
|
table {
|
|
119
119
|
border-collapse: separate;
|
|
120
|
-
|
|
120
|
+
border-right: 1px solid #edf0f2;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
th {
|
|
@@ -134,7 +134,7 @@ th {
|
|
|
134
134
|
td {
|
|
135
135
|
border-bottom: 1px solid #edf0f2;
|
|
136
136
|
border-left: 1px solid #edf0f2;
|
|
137
|
-
padding: 5px
|
|
137
|
+
padding: 5px 1rem;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.p-datatable .p-datatable-header {
|
|
@@ -154,7 +154,6 @@ td {
|
|
|
154
154
|
-webkit-appearance: none;
|
|
155
155
|
-moz-appearance: none;
|
|
156
156
|
background: #fff url("../assets/images/seta.svg") no-repeat right 6px center;
|
|
157
|
-
padding-right: 2rem;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
159
|
.react-tooltip {
|
|
@@ -183,8 +182,8 @@ th {
|
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
.p-checkbox .p-checkbox-box {
|
|
186
|
-
width:
|
|
187
|
-
height:
|
|
185
|
+
width: 1rem;
|
|
186
|
+
height: 1rem;
|
|
188
187
|
border: 1px solid #094394 !important;
|
|
189
188
|
border-radius: 4px !important;
|
|
190
189
|
background-color: #fff;
|
|
@@ -196,8 +195,13 @@ th {
|
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
.p-checkbox {
|
|
199
|
-
width:
|
|
200
|
-
height:
|
|
198
|
+
width: 1rem;
|
|
199
|
+
height: 1rem;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.p-column-header-content .p-checkbox {
|
|
203
|
+
position: relative;
|
|
204
|
+
left: -2px;
|
|
201
205
|
}
|
|
202
206
|
|
|
203
207
|
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover).p-highlight
|
|
@@ -232,6 +236,7 @@ th {
|
|
|
232
236
|
.p-dropdown-item-label {
|
|
233
237
|
padding: 6px 1rem;
|
|
234
238
|
font-weight: 500;
|
|
239
|
+
font-family: "Roboto", sans-serif;
|
|
235
240
|
}
|
|
236
241
|
|
|
237
242
|
.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
|
|
@@ -539,10 +544,16 @@ th:has(.p-column-filter-menu-button.p-column-filter-menu-button-active)
|
|
|
539
544
|
position: relative;
|
|
540
545
|
top: 4px !important;
|
|
541
546
|
}
|
|
547
|
+
}
|
|
542
548
|
|
|
549
|
+
@media (max-width: 567px) {
|
|
543
550
|
.disablePagination,
|
|
544
551
|
.paginatorLeft {
|
|
545
|
-
display:
|
|
552
|
+
display: grid;
|
|
546
553
|
gap: 1rem;
|
|
547
554
|
}
|
|
555
|
+
|
|
556
|
+
.custom-select {
|
|
557
|
+
min-width: 100%;
|
|
558
|
+
}
|
|
548
559
|
}
|
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.2",
|
|
4
4
|
"description": "Lib de componentes react",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"tailwind-merge": "^3.3.1",
|
|
57
57
|
"primereact": "^10.9.7"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|