design-zystem 1.0.457 → 1.0.458
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/ui/index.js +5 -1
- package/dist/ui/index.mjs +5 -1
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -10042,8 +10042,11 @@ var DatePicker = ({
|
|
|
10042
10042
|
setIsEditing(true);
|
|
10043
10043
|
};
|
|
10044
10044
|
const commitDraft = () => {
|
|
10045
|
+
const isCleared = !draftValue && hasValue;
|
|
10045
10046
|
if (isDirty) {
|
|
10046
|
-
if (
|
|
10047
|
+
if (isCleared) {
|
|
10048
|
+
handleReset();
|
|
10049
|
+
} else if (isRange) {
|
|
10047
10050
|
const parsed = parseTypedRange(draftValue, minDate, maxDate);
|
|
10048
10051
|
if (parsed) onRangeChange == null ? void 0 : onRangeChange(parsed[0], parsed[1]);
|
|
10049
10052
|
} else {
|
|
@@ -10060,6 +10063,7 @@ var DatePicker = ({
|
|
|
10060
10063
|
}
|
|
10061
10064
|
if (event.key === "Escape") {
|
|
10062
10065
|
event.preventDefault();
|
|
10066
|
+
setIsDirty(false);
|
|
10063
10067
|
setIsEditing(false);
|
|
10064
10068
|
}
|
|
10065
10069
|
};
|
package/dist/ui/index.mjs
CHANGED
|
@@ -9858,8 +9858,11 @@ var DatePicker = ({
|
|
|
9858
9858
|
setIsEditing(true);
|
|
9859
9859
|
};
|
|
9860
9860
|
const commitDraft = () => {
|
|
9861
|
+
const isCleared = !draftValue && hasValue;
|
|
9861
9862
|
if (isDirty) {
|
|
9862
|
-
if (
|
|
9863
|
+
if (isCleared) {
|
|
9864
|
+
handleReset();
|
|
9865
|
+
} else if (isRange) {
|
|
9863
9866
|
const parsed = parseTypedRange(draftValue, minDate, maxDate);
|
|
9864
9867
|
if (parsed) onRangeChange == null ? void 0 : onRangeChange(parsed[0], parsed[1]);
|
|
9865
9868
|
} else {
|
|
@@ -9876,6 +9879,7 @@ var DatePicker = ({
|
|
|
9876
9879
|
}
|
|
9877
9880
|
if (event.key === "Escape") {
|
|
9878
9881
|
event.preventDefault();
|
|
9882
|
+
setIsDirty(false);
|
|
9879
9883
|
setIsEditing(false);
|
|
9880
9884
|
}
|
|
9881
9885
|
};
|