@northlight/ui 2.38.0 → 2.38.1

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.
@@ -7886,7 +7886,8 @@
7886
7886
  },
7887
7887
  savedDateRange = value,
7888
7888
  defaultDateRange = value,
7889
- CustomResetButton
7889
+ CustomResetButton,
7890
+ onCancelChanges
7890
7891
  } = props;
7891
7892
  const ref = React.useRef();
7892
7893
  const { group } = react.useMultiStyleConfig("DatePicker");
@@ -7971,7 +7972,11 @@
7971
7972
  const isCurrentDateSaved = isDatesEqual(value, savedDateRange);
7972
7973
  const isCurrentDateDefault = isDatesEqual(value, defaultDateRange);
7973
7974
  const cancelDateChange = () => {
7974
- onChangeCallback(savedDateRange);
7975
+ if (onCancelChanges) {
7976
+ onCancelChanges();
7977
+ } else {
7978
+ resetDate();
7979
+ }
7975
7980
  };
7976
7981
  const handleSave = () => {
7977
7982
  onSave == null ? void 0 : onSave();
@@ -8032,7 +8037,7 @@
8032
8037
  isClearable,
8033
8038
  firstDayOfWeek,
8034
8039
  onSave,
8035
- onCancel: cancelDateChange,
8040
+ onCancel: onCancelChanges,
8036
8041
  clearButtonLabel,
8037
8042
  buttonLabel
8038
8043
  })