@magicx-eng/ai-autocomplete-angular 0.26.0 → 0.27.0

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.
@@ -1951,6 +1951,14 @@ class AIAutocompleteComponent {
1951
1951
  * and run no custom search.
1952
1952
  */
1953
1953
  this.showProducts = true;
1954
+ /**
1955
+ * When true (default), the editor is cleared and a new session starts after
1956
+ * `submitted` emits — on Enter and on the submit button. Set to false to
1957
+ * leave the query in place: when the handler navigates away, a cleared field
1958
+ * flashes empty until the next page paints. Call `reset()` yourself when you
1959
+ * want a fresh session.
1960
+ */
1961
+ this.resetOnSubmit = true;
1954
1962
  // === Outputs ===
1955
1963
  /** Called on Enter or submit-button click. */
1956
1964
  this.submitted = new EventEmitter();
@@ -2235,7 +2243,8 @@ class AIAutocompleteComponent {
2235
2243
  isReady: state.isReady,
2236
2244
  customFields: state.customFields,
2237
2245
  }));
2238
- this.controller.reset();
2246
+ if (this.resetOnSubmit)
2247
+ this.controller.reset();
2239
2248
  }
2240
2249
  handleSubmitFromUserAction() {
2241
2250
  const state = this.controller.getState();
@@ -2277,7 +2286,7 @@ class AIAutocompleteComponent {
2277
2286
  }
2278
2287
  }
2279
2288
  AIAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AIAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2280
- AIAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteComponent, isStandalone: true, selector: "ai-autocomplete", inputs: { apiConfig: "apiConfig", additionalContext: "additionalContext", optionOverrides: "optionOverrides", maskCompletedText: "maskCompletedText", columns: "columns", pillPlacement: "pillPlacement", mode: "mode", optionsPosition: "optionsPosition", animations: "animations", dropdownTrigger: "dropdownTrigger", closeDropdownOnBlur: "closeDropdownOnBlur", showNonTappableOptions: "showNonTappableOptions", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", showChipIcons: "showChipIcons", showChipImages: "showChipImages", autoFocus: "autoFocus", value: "value", completedParams: "completedParams", showProducts: "showProducts", products: "products", submitButton: "submitButton" }, outputs: { submitted: "submitted", resultChange: "resultChange", errored: "errored", valueChange: "valueChange", completedParamsChange: "completedParamsChange", focused: "focused", blurred: "blurred", productSelect: "productSelect" }, providers: [
2289
+ AIAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AIAutocompleteComponent, isStandalone: true, selector: "ai-autocomplete", inputs: { apiConfig: "apiConfig", additionalContext: "additionalContext", optionOverrides: "optionOverrides", maskCompletedText: "maskCompletedText", columns: "columns", pillPlacement: "pillPlacement", mode: "mode", optionsPosition: "optionsPosition", animations: "animations", dropdownTrigger: "dropdownTrigger", closeDropdownOnBlur: "closeDropdownOnBlur", showNonTappableOptions: "showNonTappableOptions", showSkipButton: "showSkipButton", showOptionIcons: "showOptionIcons", showOptionImages: "showOptionImages", showOptionCounts: "showOptionCounts", productsLayout: "productsLayout", productImageFallback: "productImageFallback", showChipIcons: "showChipIcons", showChipImages: "showChipImages", autoFocus: "autoFocus", value: "value", completedParams: "completedParams", showProducts: "showProducts", products: "products", submitButton: "submitButton", resetOnSubmit: "resetOnSubmit" }, outputs: { submitted: "submitted", resultChange: "resultChange", errored: "errored", valueChange: "valueChange", completedParamsChange: "completedParamsChange", focused: "focused", blurred: "blurred", productSelect: "productSelect" }, providers: [
2281
2290
  {
2282
2291
  provide: NG_VALUE_ACCESSOR,
2283
2292
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -2353,6 +2362,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2353
2362
  type: Input
2354
2363
  }], submitButton: [{
2355
2364
  type: Input
2365
+ }], resetOnSubmit: [{
2366
+ type: Input
2356
2367
  }], submitted: [{
2357
2368
  type: Output
2358
2369
  }], resultChange: [{