nexaas-ui-components 1.0.57 → 1.0.59

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.cjs CHANGED
@@ -833,7 +833,10 @@ var DatePickerInput = React5.forwardRef(
833
833
  value: normalizedValue,
834
834
  locale: "pt-BR",
835
835
  highlightCurrentDay: true,
836
- formatDate: (value) => dateFns.format(value, dateFnsFormat),
836
+ formatDate: (value) => {
837
+ const adjusted = new Date(value.getTime() + value.getTimezoneOffset() * 6e4);
838
+ return dateFns.format(adjusted, dateFnsFormat);
839
+ },
837
840
  parseDate: (value) => dateFns.parse(value, dateFnsFormat, /* @__PURE__ */ new Date()),
838
841
  maxDate: maxDate || new Date((/* @__PURE__ */ new Date()).getFullYear() + 5, 11, 31),
839
842
  minDate: minDate || new Date(1900, 0, 1)
@@ -3431,11 +3434,13 @@ var SelectFieldBip = React5.forwardRef(
3431
3434
  onChange(fetchedOptions[0]);
3432
3435
  setTimeout(() => {
3433
3436
  var _a3, _b, _c;
3434
- setInputValue("");
3435
- (_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.clearValue();
3436
- (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.focus();
3437
- (_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.onMenuClose();
3438
- field.onChange(null);
3437
+ if (clearAfterSelect) {
3438
+ setInputValue("");
3439
+ (_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.clearValue();
3440
+ (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.focus();
3441
+ (_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.onMenuClose();
3442
+ field.onChange(null);
3443
+ }
3439
3444
  }, 10);
3440
3445
  } else {
3441
3446
  onErrorBip((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.value);
@@ -3446,7 +3451,7 @@ var SelectFieldBip = React5.forwardRef(
3446
3451
  };
3447
3452
  const handleInputChange = (value, actionMeta) => {
3448
3453
  if (actionMeta.action === "input-change") {
3449
- setInputValue(value);
3454
+ if (clearAfterSelect) setInputValue(value);
3450
3455
  }
3451
3456
  return value;
3452
3457
  };
@@ -3462,15 +3467,19 @@ var SelectFieldBip = React5.forwardRef(
3462
3467
  field.onChange(null);
3463
3468
  } else {
3464
3469
  field.onChange(value);
3465
- setInputValue("");
3466
- (_d = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _d.onMenuClose();
3470
+ if (clearAfterSelect) {
3471
+ setInputValue("");
3472
+ (_d = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _d.onMenuClose();
3473
+ }
3467
3474
  }
3468
3475
  }
3469
3476
  if (action === "clear-value") {
3470
- setInputValue("");
3471
- setCachedOptions([]);
3472
- (_e = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _e.clearValue();
3473
- field.onChange(null);
3477
+ if (clearAfterSelect) {
3478
+ setInputValue("");
3479
+ setCachedOptions([]);
3480
+ (_e = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _e.clearValue();
3481
+ field.onChange(null);
3482
+ }
3474
3483
  }
3475
3484
  };
3476
3485
  const loadOptions = (value, callback) => {
@@ -3488,9 +3497,13 @@ var SelectFieldBip = React5.forwardRef(
3488
3497
  ...hasIcon,
3489
3498
  ref: selectRef,
3490
3499
  isDisabled: disabled,
3491
- onBlur: () => handleInputChange("", {
3492
- action: "input-change"
3493
- }),
3500
+ onBlur: () => {
3501
+ if (clearAfterSelect) {
3502
+ handleInputChange("", {
3503
+ action: "input-change"
3504
+ });
3505
+ }
3506
+ },
3494
3507
  loadingMessage: () => /* @__PURE__ */ jsxRuntime.jsx("div", { children: messages.loading }),
3495
3508
  isLoading: loading,
3496
3509
  loadOptions,