@wistia/vhs 6.0.3 → 6.0.4-beta.8ce13944.f2b2a1d
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.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +19 -21
- package/CHANGELOG.md +0 -386
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/vhs v6.0.
|
|
3
|
+
* @license @wistia/vhs v6.0.4-beta.8ce13944.f2b2a1d
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -9146,7 +9146,7 @@ const EnhancedDay = styled(Day)`
|
|
|
9146
9146
|
}
|
|
9147
9147
|
`}
|
|
9148
9148
|
`;
|
|
9149
|
-
const isValidRange
|
|
9149
|
+
const isValidRange = (range) => {
|
|
9150
9150
|
if (isNil(range)) return false;
|
|
9151
9151
|
const { start, end } = range;
|
|
9152
9152
|
return start instanceof Date && end instanceof Date && isBefore(start, end);
|
|
@@ -9192,7 +9192,7 @@ const RangeSelectorCalendar = ({ range = DEFAULT_RANGE$1, rangePartToShow = "",
|
|
|
9192
9192
|
const [hoveredDate, setHoveredDate] = useState();
|
|
9193
9193
|
const internalRange = useRange(firstDate, secondDate);
|
|
9194
9194
|
const priorInternalRange = usePreviousValue(internalRange);
|
|
9195
|
-
const tempRange = useRange(!isValidRange
|
|
9195
|
+
const tempRange = useRange(!isValidRange(internalRange) && firstDate, hoveredDate);
|
|
9196
9196
|
const setDisplayDateDebounced = useMemo(() => debounce(0, setDisplayDate), []);
|
|
9197
9197
|
useEffect(() => {
|
|
9198
9198
|
setDisplayDateDebounced(range.end);
|
|
@@ -9211,13 +9211,13 @@ const RangeSelectorCalendar = ({ range = DEFAULT_RANGE$1, rangePartToShow = "",
|
|
|
9211
9211
|
]);
|
|
9212
9212
|
useEffect(() => {
|
|
9213
9213
|
const onIsValidChangeDebounced = debounce(100, onIsValidChange);
|
|
9214
|
-
onIsValidChangeDebounced(isValidRange
|
|
9214
|
+
onIsValidChangeDebounced(isValidRange(internalRange));
|
|
9215
9215
|
return () => {
|
|
9216
9216
|
onIsValidChangeDebounced.cancel();
|
|
9217
9217
|
};
|
|
9218
9218
|
}, [internalRange, onIsValidChange]);
|
|
9219
9219
|
useEffect(() => {
|
|
9220
|
-
if (isValidRange
|
|
9220
|
+
if (isValidRange(range)) {
|
|
9221
9221
|
let date = void 0;
|
|
9222
9222
|
if (priorInternalRange && !isEqual$1(range.start, priorInternalRange.start)) date = range.start;
|
|
9223
9223
|
if (priorInternalRange && !isEqual$1(range.end, priorInternalRange.end)) date = range.end;
|
|
@@ -9276,7 +9276,7 @@ const RangeSelectorCalendar = ({ range = DEFAULT_RANGE$1, rangePartToShow = "",
|
|
|
9276
9276
|
secondDate: nextSecond
|
|
9277
9277
|
});
|
|
9278
9278
|
const nextRange = makeRange(nextFirst, nextSecond);
|
|
9279
|
-
if (isValidRange
|
|
9279
|
+
if (isValidRange(nextRange) && onChange) onChange(nextRange);
|
|
9280
9280
|
setHoveredDate(void 0);
|
|
9281
9281
|
},
|
|
9282
9282
|
onMouseOver: () => {
|
|
@@ -9504,7 +9504,7 @@ const preventDoubleClick = (event) => {
|
|
|
9504
9504
|
timeout = void 0;
|
|
9505
9505
|
}, delay);
|
|
9506
9506
|
};
|
|
9507
|
-
const
|
|
9507
|
+
const hasValidDates = ({ start, end }) => isValid(start) && isValid(end);
|
|
9508
9508
|
const getFieldId = ([start], positions) => {
|
|
9509
9509
|
const currentPosition = positions.find((pos) => pos.start === start);
|
|
9510
9510
|
return isNotNil(currentPosition) && isNotNil(currentPosition.id) ? currentPosition.id : "";
|
|
@@ -9692,7 +9692,7 @@ const RangeSelectorInput = ({ onChange, onSelectedRangePartChange, range, earlie
|
|
|
9692
9692
|
}),
|
|
9693
9693
|
minDate: earliestDate
|
|
9694
9694
|
});
|
|
9695
|
-
if (
|
|
9695
|
+
if (hasValidDates(nextRange)) {
|
|
9696
9696
|
setValue(rangeToString(nextRange));
|
|
9697
9697
|
if (!isNonEmptyArray(errors) && isNotUndefined(onChange)) onChange(orderRange(nextRange));
|
|
9698
9698
|
}
|