@lucca-front/ng 22.1.0-rc.3 → 22.1.0-rc.4

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.
@@ -780,7 +780,9 @@ class Calendar2Component {
780
780
  return isLastDay ? { ...rest, 'is-end': isEnd } : rest;
781
781
  }
782
782
  getRangeInfo(date, scope, isOverflow = false) {
783
- const range = this.ranges().find((range) => {
783
+ // Ranges given by the date range input can be open on one side, even if the public input type does not say so yet
784
+ const ranges = this.ranges();
785
+ const range = ranges.find((range) => {
784
786
  const isSameScope = (range.scope || 'day') === scope;
785
787
  if (isSameScope) {
786
788
  if (range.start && range.end) {
@@ -1653,6 +1655,7 @@ class DateRangeInputComponent extends AbstractDateComponent {
1653
1655
  this.calendarRanges = computed(() => {
1654
1656
  const selectedRange = this.selectedRange();
1655
1657
  if (selectedRange) {
1658
+ // The calendar handles ranges open on one side, but its public input type still requires a start date
1656
1659
  return [selectedRange, ...this.ranges()];
1657
1660
  }
1658
1661
  return this.ranges();
@@ -1920,7 +1923,9 @@ class DateRangeInputComponent extends AbstractDateComponent {
1920
1923
  }
1921
1924
  registerOnChange(fn) {
1922
1925
  this.#onChange = (dateRange) => {
1923
- fn(dateRange && this.inDateISOFormat() ? transformDateRangeToDateRangeInput(dateRange) : dateRange);
1926
+ const value = dateRange && this.inDateISOFormat() ? transformDateRangeToDateRangeInput(dateRange) : dateRange;
1927
+ // The emitted range can be open on one side, but the public type still requires a start date
1928
+ fn(value);
1924
1929
  };
1925
1930
  }
1926
1931
  setDisabledState(isDisabled) {