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

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
@@ -180,11 +180,12 @@ th {
180
180
  .p-datatable .p-datatable-thead > tr > th.p-selection-column .p-checkbox-input {
181
181
  text-align: center !important;
182
182
  position: absolute;
183
+ left: 7px;
183
184
  }
184
185
  .p-selection-column .p-column-header-content {
185
186
  position: relative;
186
187
  top: 0;
187
- right: 0;
188
+ right: -2px;
188
189
  transform: translate(-40%, 0);
189
190
  }
190
191
  .p-checkbox-input {
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;
@@ -222,12 +213,13 @@ th {
222
213
  .p-datatable .p-datatable-thead > tr > th.p-selection-column .p-checkbox-input {
223
214
  text-align: center !important;
224
215
  position: absolute;
216
+ left: 7px;
225
217
  }
226
218
 
227
219
  .p-selection-column .p-column-header-content {
228
220
  position: relative;
229
221
  top: 0;
230
- right: 0;
222
+ right: -2px;
231
223
  transform: translate(-40%, 0);
232
224
  }
233
225
 
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.36",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",