@mtes-mct/monitor-ui 6.2.0 → 6.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [6.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v6.1.1...v6.2.0) (2023-05-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * **elements:** add withUnpropagatedClick prop to Button & IconButton ([67943f5](https://github.com/MTES-MCT/monitor-ui/commit/67943f5c2bc9e225a13b0185869fef86bebec069))
7
+
1
8
  ## [6.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v6.1.0...v6.1.1) (2023-05-21)
2
9
 
3
10
 
package/index.js CHANGED
@@ -21117,7 +21117,7 @@ function CalendarPicker({ isHistorical, isOpen, onChange, value }) {
21117
21117
  const { forceUpdate } = useForceUpdate();
21118
21118
  const utcTodayAsDayjs = useMemo(() => customDayjs().utc().endOf('day'), []);
21119
21119
  const controlledValue = useMemo(() => (value ? getLocalizedDayjs(value).toDate() : undefined), [value]);
21120
- const disabledDate = useMemo(() => (date) => date && isHistorical ? getUtcizedDayjs(date).isAfter(utcTodayAsDayjs) : false, [isHistorical, utcTodayAsDayjs]);
21120
+ const shouldDisableDate = useMemo(() => (date) => date && isHistorical ? getUtcizedDayjs(date).isAfter(utcTodayAsDayjs) : false, [isHistorical, utcTodayAsDayjs]);
21121
21121
  const handleSelect = useCallback((nextLocalDate) => {
21122
21122
  // We utcize the date picked by the user
21123
21123
  const nextUtcDateAsDayjs = getUtcizedDayjs(nextLocalDate);
@@ -21129,7 +21129,7 @@ function CalendarPicker({ isHistorical, isOpen, onChange, value }) {
21129
21129
  // and can be used as a container for <RsuiteDatePicker />
21130
21130
  forceUpdate();
21131
21131
  }, [forceUpdate]);
21132
- return (jsx(Box$b, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DatePicker$1, { container: boxRef.current, disabledDate: disabledDate, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, oneTap: true, onSelect: handleSelect, open: isOpen, ranges: [],
21132
+ return (jsx(Box$b, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DatePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, oneTap: true, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate,
21133
21133
  // eslint-disable-next-line no-null/no-null
21134
21134
  value: controlledValue ?? null })) }));
21135
21135
  }
@@ -21875,7 +21875,7 @@ function RangeCalendarPicker({ defaultValue, isHistorical, isOpen, onChange }) {
21875
21875
  const { forceUpdate } = useForceUpdate();
21876
21876
  const controlledValue = useMemo(() => (defaultValue ? sortDates(defaultValue) : undefined), [defaultValue]);
21877
21877
  const utcTodayAsDayjs = useMemo(() => customDayjs().utc().endOf('day'), []);
21878
- const disabledDate = useMemo(() => (date) => isHistorical ? getUtcizedDayjs(date).isAfter(utcTodayAsDayjs) : false, [isHistorical, utcTodayAsDayjs]);
21878
+ const shouldDisableDate = useMemo(() => (date) => isHistorical ? getUtcizedDayjs(date).isAfter(utcTodayAsDayjs) : false, [isHistorical, utcTodayAsDayjs]);
21879
21879
  const handleSelect = useCallback((nextLocalDate) => {
21880
21880
  // We utcize the date picked by the user
21881
21881
  const nextUtcDate = getUtcizedDayjs(nextLocalDate).toDate();
@@ -21897,7 +21897,7 @@ function RangeCalendarPicker({ defaultValue, isHistorical, isOpen, onChange }) {
21897
21897
  // and can be used as a container for <RsuiteDateRangePicker />
21898
21898
  forceUpdate();
21899
21899
  }, [forceUpdate]);
21900
- return (jsx(Box$6, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DateRangePicker$1, { container: boxRef.current, disabledDate: disabledDate, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, onSelect: handleSelect, open: isOpen, ranges: [],
21900
+ return (jsx(Box$6, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DateRangePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate,
21901
21901
  // `defaultValue` seems to be immediatly cancelled so we come down to using a controlled `value`
21902
21902
  // eslint-disable-next-line no-null/no-null
21903
21903
  value: controlledValue ?? null })) }));