@charlesgomes/leafcode-shared-lib-react 1.0.35 → 1.0.37

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 CHANGED
@@ -177,24 +177,17 @@ th {
177
177
  vertical-align: middle;
178
178
  position: relative;
179
179
  }
180
- .p-datatable .p-datatable-thead > tr > th.p-selection-column .p-checkbox-input {
181
- text-align: center !important;
182
- position: absolute;
183
- }
184
180
  .p-selection-column .p-column-header-content {
185
181
  position: relative;
186
182
  top: 0;
187
- right: 0;
183
+ right: -2px;
188
184
  transform: translate(-40%, 0);
189
185
  }
190
186
  .p-checkbox-input {
191
- position: absolute;
187
+ position: relative;
192
188
  }
193
189
  .p-selection-column .p-checkbox {
194
- display: inline-flex;
195
190
  vertical-align: middle;
196
- justify-content: center;
197
- align-items: center;
198
191
  }
199
192
  .p-column-header-content .p-checkbox {
200
193
  position: static;
package/dist/index.js CHANGED
@@ -1148,12 +1148,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1148
1148
  const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr);
1149
1149
  const rawFilter = options.value ?? {};
1150
1150
  const currentMatchMode = rawFilter.matchMode ?? "contains";
1151
- let currentValue = "";
1152
- if (typeof rawFilter.value === "string") {
1153
- currentValue = rawFilter.value;
1154
- } else if (rawFilter.value && typeof rawFilter.value === "object" && typeof rawFilter.value.value === "string") {
1155
- currentValue = rawFilter.value.value;
1156
- }
1151
+ const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
1157
1152
  const isSpecial = currentMatchMode === customMatchModes.empty || currentMatchMode === customMatchModes.notEmpty;
1158
1153
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1159
1154
  "div",
@@ -1178,8 +1173,15 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1178
1173
  onChange: (e) => {
1179
1174
  const newMatchMode = e.value;
1180
1175
  const isNewSpecial = newMatchMode === customMatchModes.empty || newMatchMode === customMatchModes.notEmpty;
1176
+ if (isNewSpecial) {
1177
+ options.filterCallback({
1178
+ text: null,
1179
+ matchMode: newMatchMode
1180
+ });
1181
+ return;
1182
+ }
1181
1183
  options.filterCallback({
1182
- text: isNewSpecial ? null : null,
1184
+ text: null,
1183
1185
  matchMode: newMatchMode
1184
1186
  });
1185
1187
  }
@@ -1190,8 +1192,8 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1190
1192
  {
1191
1193
  value: currentValue,
1192
1194
  placeholder: isLanguagePtBr ? "Pesquisar" : "Search",
1193
- className: "p-column-filter",
1194
1195
  style: { width: "100%" },
1196
+ className: "p-column-filter",
1195
1197
  onChange: (e) => {
1196
1198
  const value = e.target.value;
1197
1199
  if (value.trim()) {
package/dist/index.mjs CHANGED
@@ -1097,12 +1097,7 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1097
1097
  const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr);
1098
1098
  const rawFilter = options.value ?? {};
1099
1099
  const currentMatchMode = rawFilter.matchMode ?? "contains";
1100
- let currentValue = "";
1101
- if (typeof rawFilter.value === "string") {
1102
- currentValue = rawFilter.value;
1103
- } else if (rawFilter.value && typeof rawFilter.value === "object" && typeof rawFilter.value.value === "string") {
1104
- currentValue = rawFilter.value.value;
1105
- }
1100
+ const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
1106
1101
  const isSpecial = currentMatchMode === customMatchModes.empty || currentMatchMode === customMatchModes.notEmpty;
1107
1102
  return /* @__PURE__ */ jsxs6(
1108
1103
  "div",
@@ -1127,8 +1122,15 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1127
1122
  onChange: (e) => {
1128
1123
  const newMatchMode = e.value;
1129
1124
  const isNewSpecial = newMatchMode === customMatchModes.empty || newMatchMode === customMatchModes.notEmpty;
1125
+ if (isNewSpecial) {
1126
+ options.filterCallback({
1127
+ text: null,
1128
+ matchMode: newMatchMode
1129
+ });
1130
+ return;
1131
+ }
1130
1132
  options.filterCallback({
1131
- text: isNewSpecial ? null : null,
1133
+ text: null,
1132
1134
  matchMode: newMatchMode
1133
1135
  });
1134
1136
  }
@@ -1139,8 +1141,8 @@ var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
1139
1141
  {
1140
1142
  value: currentValue,
1141
1143
  placeholder: isLanguagePtBr ? "Pesquisar" : "Search",
1142
- className: "p-column-filter",
1143
1144
  style: { width: "100%" },
1145
+ className: "p-column-filter",
1144
1146
  onChange: (e) => {
1145
1147
  const value = e.target.value;
1146
1148
  if (value.trim()) {
@@ -203,15 +203,6 @@ th {
203
203
  color: #ffffff;
204
204
  }
205
205
 
206
- /* .p-checkbox-box {
207
- display: flex;
208
- justify-content: center;
209
- align-items: center;
210
- min-width: 1rem !important;
211
- min-height: 1px !important;
212
- max-height: 1rem;
213
- } */
214
-
215
206
  .p-datatable .p-datatable-tbody > tr > td.p-selection-column {
216
207
  text-align: center !important;
217
208
  display: table-cell;
@@ -219,27 +210,29 @@ th {
219
210
  position: relative;
220
211
  }
221
212
 
222
- .p-datatable .p-datatable-thead > tr > th.p-selection-column .p-checkbox-input {
213
+ /* .p-datatable .p-datatable-thead > tr > th.p-selection-column .p-checkbox-input {
223
214
  text-align: center !important;
224
215
  position: absolute;
225
- }
216
+ right: -8px;
217
+ transform: translateX(-50%);
218
+ } */
226
219
 
227
220
  .p-selection-column .p-column-header-content {
228
221
  position: relative;
229
222
  top: 0;
230
- right: 0;
223
+ right: -2px;
231
224
  transform: translate(-40%, 0);
232
225
  }
233
226
 
234
227
  .p-checkbox-input {
235
- position: absolute;
228
+ position: relative;
236
229
  }
237
230
 
238
231
  .p-selection-column .p-checkbox {
239
- display: inline-flex;
232
+ /* display: inline-flex; */
240
233
  vertical-align: middle;
241
- justify-content: center;
242
- align-items: center;
234
+ /* justify-content: center;
235
+ align-items: center; */
243
236
  }
244
237
 
245
238
  .p-column-header-content .p-checkbox {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlesgomes/leafcode-shared-lib-react",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",