@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.
- package/dist/es/northlight.d.ts +1 -0
- package/dist/es/northlight.js +8 -3
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +8 -3
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +2 -2
package/dist/es/northlight.d.ts
CHANGED
|
@@ -1010,6 +1010,7 @@ interface DateRangePickerProps extends Omit<AriaDateRangePickerProps<DateValue>,
|
|
|
1010
1010
|
defaultDateRange?: DateRange | null;
|
|
1011
1011
|
CustomResetButton?: React.ReactNode;
|
|
1012
1012
|
clearButtonLabel?: string;
|
|
1013
|
+
onCancelChanges?: () => void;
|
|
1013
1014
|
}
|
|
1014
1015
|
interface DatePickerFieldProps extends Omit<InputProps, 'onChange'>, InputFieldProps {
|
|
1015
1016
|
name: string;
|
package/dist/es/northlight.js
CHANGED
|
@@ -7908,7 +7908,8 @@ const DateRangePicker = (props) => {
|
|
|
7908
7908
|
},
|
|
7909
7909
|
savedDateRange = value,
|
|
7910
7910
|
defaultDateRange = value,
|
|
7911
|
-
CustomResetButton
|
|
7911
|
+
CustomResetButton,
|
|
7912
|
+
onCancelChanges
|
|
7912
7913
|
} = props;
|
|
7913
7914
|
const ref = useRef();
|
|
7914
7915
|
const { group } = useMultiStyleConfig("DatePicker");
|
|
@@ -7993,7 +7994,11 @@ const DateRangePicker = (props) => {
|
|
|
7993
7994
|
const isCurrentDateSaved = isDatesEqual(value, savedDateRange);
|
|
7994
7995
|
const isCurrentDateDefault = isDatesEqual(value, defaultDateRange);
|
|
7995
7996
|
const cancelDateChange = () => {
|
|
7996
|
-
|
|
7997
|
+
if (onCancelChanges) {
|
|
7998
|
+
onCancelChanges();
|
|
7999
|
+
} else {
|
|
8000
|
+
resetDate();
|
|
8001
|
+
}
|
|
7997
8002
|
};
|
|
7998
8003
|
const handleSave = () => {
|
|
7999
8004
|
onSave == null ? void 0 : onSave();
|
|
@@ -8054,7 +8059,7 @@ const DateRangePicker = (props) => {
|
|
|
8054
8059
|
isClearable,
|
|
8055
8060
|
firstDayOfWeek,
|
|
8056
8061
|
onSave,
|
|
8057
|
-
onCancel:
|
|
8062
|
+
onCancel: onCancelChanges,
|
|
8058
8063
|
clearButtonLabel,
|
|
8059
8064
|
buttonLabel
|
|
8060
8065
|
})
|