@magicx-eng/ai-autocomplete-angular 0.58.4 → 0.59.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/README.md +3 -1
- package/REFERENCE.md +7 -0
- package/esm2020/lib/ai-autocomplete/ai-autocomplete.component.mjs +8 -4
- package/esm2020/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.mjs +7 -3
- package/esm2020/lib/internal/product-strip/product-strip.component.mjs +7 -3
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +19 -7
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +19 -7
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts +3 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts.map +1 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts +3 -1
- package/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.d.ts.map +1 -1
- package/lib/internal/product-strip/product-strip.component.d.ts +3 -1
- package/lib/internal/product-strip/product-strip.component.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -380,6 +380,7 @@ Standalone-first apps don't need this: import the components/directive directly.
|
|
|
380
380
|
| `showProducts` | `boolean` | `true` | Render the product strip below the options whenever there are products to show; see [Product strip](#product-strip). `false` renders no strip. |
|
|
381
381
|
| `productsLayout` | `"row" \| "list"` | `"row"` | How the strip lays its cards out: a horizontally scrolling row, or the same cards stacked as full-width rows; see [Product strip](#product-strip). |
|
|
382
382
|
| `productImageFallback` | `"image" \| "initial"` | `"image"` | Fallback for a missing or blank product image URL, or an image load error. `"image"` shows the placeholder pictogram; `"initial"` shows the title initial. A working image still takes priority. See [Product strip](#product-strip). |
|
|
383
|
+
| `showProductVendor` | `boolean` | `true` | `false` leaves the `vendor` line off product cards, for titles that already name the brand. |
|
|
383
384
|
| `products` | `ProductsConfig` | — | Custom source for the product strip; see [Your own product search](#your-own-product-search-products). Bind a stable reference (a component field, not an inline object literal). Omit it and the strip shows the items the `/suggest` response reports. |
|
|
384
385
|
| `onProductAddToCart` | `(product: Product) => void \| PromiseLike<unknown>` | — | When bound, every card that isn't sold out shows an add-to-cart button; pressing it calls this instead of emitting `(productSelect)`. Return a promise to show progress. An input rather than an output because its result drives the button. See [Product strip](#product-strip). |
|
|
385
386
|
| `resetOnSubmit` | `boolean` | `true` | Clear the editor and start a new session after `(submitted)` emits. Set `false` to keep the query in place (e.g. when the handler navigates away) and call `reset()` yourself. |
|
|
@@ -598,7 +599,8 @@ The dropdown component for Tier 2:
|
|
|
598
599
|
| `controller` | `AIAutocompleteController` | — | The shared controller. |
|
|
599
600
|
| `showPills` | `boolean` | `true` | Whether to render pills above the options grid. |
|
|
600
601
|
| `mode` | `"light" \| "dark" \| "auto"` | — | Color mode for a **standalone** dropdown — self-scopes the SDK tokens so no `.magicx-aia` wrapper is needed. `"auto"` follows `prefers-color-scheme`. Leave unset when nested inside a `.magicx-aia` ancestor (e.g. Tier 1). |
|
|
601
|
-
| `productImageFallback` | `"image" \| "initial"` | `"image"` |
|
|
602
|
+
| `productImageFallback` | `"image" \| "initial"` | `"image"` | Same as the `<ai-autocomplete>` input. |
|
|
603
|
+
| `showProductVendor` | `boolean` | `true` | Same as the `<ai-autocomplete>` input. |
|
|
602
604
|
| `className` | `string` | — | Extra CSS class applied to the dropdown root. |
|
|
603
605
|
|
|
604
606
|
Placement (`optionsPosition`) is read from the controller's options via `dropdown$` — set it once on the controller, not on the dropdown. The [product strip](#product-strip) comes from there too: the dropdown renders the server's items by default, or the cards of a `products` config set on the controller. All actions (option selection, hover, pill clicks, product activation) are forwarded to the controller — no outputs to wire.
|
package/REFERENCE.md
CHANGED
|
@@ -53,6 +53,13 @@ default); `--aia-product-list-media-size` (44px) sizes the thumbnail and
|
|
|
53
53
|
is the horizontal strip. Changing the binding re-lays the strip out at once, and
|
|
54
54
|
`<ai-autocomplete-dropdown>` takes the same input in Tier 2.
|
|
55
55
|
|
|
56
|
+
**Vendor line.** A product with a `vendor` shows it as a line above the
|
|
57
|
+
title. Bind `[showProductVendor]="false"` to leave that line off every card,
|
|
58
|
+
for a catalog whose titles already start with the brand. The card's other
|
|
59
|
+
lines are unchanged, and so is a product without a `vendor`. Changing the
|
|
60
|
+
binding applies to the cards on screen at once, and
|
|
61
|
+
`<ai-autocomplete-dropdown>` takes the same input in Tier 2.
|
|
62
|
+
|
|
56
63
|
**Product image fallback.** A product's image takes priority when its
|
|
57
64
|
`imageUrl` loads successfully. A missing or blank URL, or an image load error,
|
|
58
65
|
uses `productImageFallback`: `"image"` (the default) shows the existing
|