@magicx-eng/ai-autocomplete-angular 0.41.0 → 0.42.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/esm2020/lib/ai-autocomplete/ai-autocomplete.component.mjs +3 -4
- package/esm2020/lib/controller/ai-autocomplete.controller.mjs +7 -1
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +8 -3
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +8 -3
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts.map +1 -1
- package/lib/controller/ai-autocomplete.controller.d.ts +2 -0
- package/lib/controller/ai-autocomplete.controller.d.ts.map +1 -1
- package/package.json +24 -3
|
@@ -1454,6 +1454,12 @@ class AIAutocompleteController {
|
|
|
1454
1454
|
return;
|
|
1455
1455
|
this.core.reset();
|
|
1456
1456
|
}
|
|
1457
|
+
/** Prepare the typed word before you build a submit result from your own button. */
|
|
1458
|
+
prepareSubmit() {
|
|
1459
|
+
if (this.isDestroyed)
|
|
1460
|
+
return;
|
|
1461
|
+
this.core.prepareSubmit();
|
|
1462
|
+
}
|
|
1457
1463
|
/**
|
|
1458
1464
|
* Records a submit in telemetry. Enter is recorded by the SDK; call this
|
|
1459
1465
|
* from a submit button you render, so each submit is counted once.
|
|
@@ -2466,9 +2472,8 @@ class AIAutocompleteComponent {
|
|
|
2466
2472
|
const state = this.controller.getState();
|
|
2467
2473
|
if (!this.canSubmit(state))
|
|
2468
2474
|
return;
|
|
2469
|
-
|
|
2470
|
-
// the
|
|
2471
|
-
// can take either entry point.
|
|
2475
|
+
this.controller.prepareSubmit();
|
|
2476
|
+
// Use the same handler for button clicks and Enter.
|
|
2472
2477
|
this.handleSubmit({
|
|
2473
2478
|
query: state.text.trim(),
|
|
2474
2479
|
raw_query: "",
|