@magicx-eng/ai-autocomplete-angular 0.47.0 → 0.47.2

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.
@@ -1,4 +1,4 @@
1
- import { WEEKDAY_LABELS as WEEKDAY_LABELS$1, cellIso as cellIso$1, monthLabel as monthLabel$1, cellDay as cellDay$1, isoDate as isoDate$1, dateCellMarks as dateCellMarks$1, visibleDateRange as visibleDateRange$1, SMART_SUGGESTION_SPARKLE_SVG, isSmartSuggestion, isTraditionalAutocompleteSuggestion, uiStringsFor, productInitial, productImageSources as productImageSources$1, productPhotoFill, attachProductRowWheel, optionsGridTemplateColumns, highlightParts, optionLabel as optionLabel$1, optionImageSources as optionImageSources$1, formatOptionCount as formatOptionCount$1, sanitizeOptionIconSvg as sanitizeOptionIconSvg$1, isMultiSelectToggleTap, planOptionsGrid, optionsShowLeadingVisuals as optionsShowLeadingVisuals$1, sameOptionRows, isOptionsGridMobileViewport, needsOptionsGridMeasurement, measureOptionsGrid, optionEnterDelayMs, TIME_WHEEL_COLUMNS, formatTime as formatTime$1, timeWheelRows, timeWheelIndex, TIME_WHEEL_ROW_HEIGHT, withTimeWheelIndex, timeWheelIndexFromScroll, buildAttributionUrl, containScroll, attachScrollArrow, attachViewportFit, hasSkippablePill, isCalendarFormat, labelTraditionalAutocomplete, getFooterHint, AIAutocomplete, withoutTraditionalAutocomplete, dateSelectionFor, identifiedParamLabel, renderEditableContent, chipIdFromTap, keepCaretOnChip, getCursorOffset, extractPlainText, plainTextLength, setCursorOffset, ModeController, watchEditorHeight, buildSubmitResult as buildSubmitResult$1, withSkippedParams as withSkippedParams$1, formatDate as formatDate$1, parseDate as parseDate$1, parseLooseDate as parseLooseDate$1, DATE_RANGE_META_END as DATE_RANGE_META_END$1, DATE_RANGE_META_START as DATE_RANGE_META_START$1, formatDateRange as formatDateRange$1, parseLooseDateRange as parseLooseDateRange$1, selectedRangeFor as selectedRangeFor$1, parseTime as parseTime$1, TIME_META_KEY as TIME_META_KEY$1, formatPlace as formatPlace$1, LOCATION_META_KEY as LOCATION_META_KEY$1, DEFAULT_OPTION_COUNT_UNIT as DEFAULT_OPTION_COUNT_UNIT$1, optionCountLabel as optionCountLabel$1, optionHasImage as optionHasImage$1, optionImageSrc as optionImageSrc$1, PRODUCT_PATH_PREFIX as PRODUCT_PATH_PREFIX$1, productFromMatchedItem as productFromMatchedItem$1, productsFromCustomFields as productsFromCustomFields$1 } from '@magicx-eng/ai-autocomplete-vanilla';
1
+ import { WEEKDAY_LABELS as WEEKDAY_LABELS$1, cellIso as cellIso$1, monthLabel as monthLabel$1, cellDay as cellDay$1, isoDate as isoDate$1, isDimmedDay, dateCellMarks as dateCellMarks$1, visibleDateRange as visibleDateRange$1, SMART_SUGGESTION_SPARKLE_SVG, isSmartSuggestion, isTraditionalAutocompleteSuggestion, uiStringsFor, productInitial, productImageSources as productImageSources$1, productPhotoFill, attachProductRowWheel, optionsGridTemplateColumns, highlightParts, optionLabel as optionLabel$1, optionImageSources as optionImageSources$1, formatOptionCount as formatOptionCount$1, sanitizeOptionIconSvg as sanitizeOptionIconSvg$1, isMultiSelectToggleTap, planOptionsGrid, optionsShowLeadingVisuals as optionsShowLeadingVisuals$1, sameOptionRows, isOptionsGridMobileViewport, needsOptionsGridMeasurement, measureOptionsGrid, optionEnterDelayMs, TIME_WHEEL_COLUMNS, formatTime as formatTime$1, timeWheelRows, timeWheelIndex, TIME_WHEEL_ROW_HEIGHT, withTimeWheelIndex, timeWheelIndexFromScroll, buildAttributionUrl, containScroll, attachScrollArrow, attachViewportFit, hasSkippablePill, isCalendarFormat, labelTraditionalAutocomplete, getFooterHint, dateFloorFor, AIAutocomplete, withoutTraditionalAutocomplete, dateSelectionFor, identifiedParamLabel, renderEditableContent, chipIdFromTap, keepCaretOnChip, getCursorOffset, extractPlainText, plainTextLength, setCursorOffset, ModeController, watchEditorHeight, buildSubmitResult as buildSubmitResult$1, withSkippedParams as withSkippedParams$1, formatDate as formatDate$1, parseDate as parseDate$1, parseLooseDate as parseLooseDate$1, DATE_RANGE_META_END as DATE_RANGE_META_END$1, DATE_RANGE_META_START as DATE_RANGE_META_START$1, formatDateRange as formatDateRange$1, parseLooseDateRange as parseLooseDateRange$1, selectedRangeFor as selectedRangeFor$1, parseTime as parseTime$1, TIME_META_KEY as TIME_META_KEY$1, formatPlace as formatPlace$1, LOCATION_META_KEY as LOCATION_META_KEY$1, DEFAULT_OPTION_COUNT_UNIT as DEFAULT_OPTION_COUNT_UNIT$1, optionCountLabel as optionCountLabel$1, optionHasImage as optionHasImage$1, optionImageSrc as optionImageSrc$1, PRODUCT_PATH_PREFIX as PRODUCT_PATH_PREFIX$1, productFromMatchedItem as productFromMatchedItem$1, productsFromCustomFields as productsFromCustomFields$1 } from '@magicx-eng/ai-autocomplete-vanilla';
2
2
  import * as i1 from '@angular/common';
3
3
  import { CommonModule, isPlatformBrowser } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
@@ -53,11 +53,10 @@ class DateGridComponent {
53
53
  isToday(option) {
54
54
  return cellIso$1(option) === isoDate$1(new Date());
55
55
  }
56
- /** Before today: rendered dimmed, but every bit as pickable as the rest. */
56
+ /** Before today, or before the earliest day the question takes: rendered dimmed. A day gone by stays pickable. A day before the earliest one does not. */
57
57
  isPast(option) {
58
- const iso = cellIso$1(option);
59
58
  // ISO strings order the same way the dates they name do.
60
- return iso != null && iso < isoDate$1(new Date());
59
+ return isDimmedDay(cellIso$1(option), isoDate$1(new Date()), this.selection.floor);
61
60
  }
62
61
  isSelected(option) {
63
62
  return dateCellMarks$1(cellIso$1(option), {
@@ -85,6 +84,7 @@ class DateGridComponent {
85
84
  pendingStart: this.selection.rangeStart,
86
85
  highlightedIso: cellIso$1(this.options[this.activeIndex]),
87
86
  selected: this.selection.selectedRange,
87
+ floor: this.selection.floor,
88
88
  });
89
89
  }
90
90
  onSelect(option, index) {
@@ -1847,6 +1847,7 @@ class AIAutocompleteDropdownComponent {
1847
1847
  selectedIso: dd.selectedDateIso ?? null,
1848
1848
  selectedRange: dd.selectedDateRange ?? null,
1849
1849
  rangeStart: dd.dateRangeStart ?? null,
1850
+ floor: dateFloorFor(dd.formatType, dd.dateRangeStart),
1850
1851
  },
1851
1852
  showsTimeWheel,
1852
1853
  timeView: dd.timeView ?? null,
@@ -2156,7 +2157,10 @@ class AIAutocompleteController {
2156
2157
  return;
2157
2158
  this.core.reset();
2158
2159
  }
2159
- /** Prepare the typed word before you build a submit result from your own button. */
2160
+ /**
2161
+ * Prepare the typed word before you build a submit result from your own button.
2162
+ * A typed value with no pill yet joins `identifiedParams` only in this call. Read `getState()` after it.
2163
+ */
2160
2164
  prepareSubmit() {
2161
2165
  if (this.isDestroyed)
2162
2166
  return;