@getlupa/vue 0.6.1 → 0.6.3
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/dist/lupaSearch.js +12 -6
- package/dist/lupaSearch.mjs +12 -6
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types/DocumentElement.d.ts +1 -0
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -3624,16 +3624,22 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
|
|
|
3624
3624
|
targetImage.src = placeholder.value;
|
|
3625
3625
|
}
|
|
3626
3626
|
};
|
|
3627
|
+
const imageAlt = vue.computed(() => {
|
|
3628
|
+
const alt = props.options.alt;
|
|
3629
|
+
if (alt) {
|
|
3630
|
+
return alt(props.item);
|
|
3631
|
+
}
|
|
3632
|
+
return "";
|
|
3633
|
+
});
|
|
3627
3634
|
return (_ctx, _cache) => {
|
|
3628
3635
|
var _a, _b;
|
|
3629
3636
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3630
3637
|
class: vue.normalizeClass((_a = _ctx.wrapperClass) != null ? _a : "")
|
|
3631
3638
|
}, [
|
|
3632
|
-
vue.createElementVNode("img", {
|
|
3633
|
-
class:
|
|
3634
|
-
src: finalUrl.value
|
|
3635
|
-
|
|
3636
|
-
}, null, 42, _hoisted_1$16)
|
|
3639
|
+
vue.createElementVNode("img", vue.mergeProps({
|
|
3640
|
+
class: (_b = _ctx.imageClass) != null ? _b : "",
|
|
3641
|
+
src: finalUrl.value
|
|
3642
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$16)
|
|
3637
3643
|
], 2);
|
|
3638
3644
|
};
|
|
3639
3645
|
}
|
|
@@ -16774,7 +16780,7 @@ const setupTracking = (options) => {
|
|
|
16774
16780
|
store.setTrackingOptions({ options });
|
|
16775
16781
|
};
|
|
16776
16782
|
const LupaSearch = {
|
|
16777
|
-
install: (app
|
|
16783
|
+
install: (app) => {
|
|
16778
16784
|
const pinia = createPinia();
|
|
16779
16785
|
app.use(pinia);
|
|
16780
16786
|
}
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -3622,16 +3622,22 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
3622
3622
|
targetImage.src = placeholder.value;
|
|
3623
3623
|
}
|
|
3624
3624
|
};
|
|
3625
|
+
const imageAlt = computed(() => {
|
|
3626
|
+
const alt = props.options.alt;
|
|
3627
|
+
if (alt) {
|
|
3628
|
+
return alt(props.item);
|
|
3629
|
+
}
|
|
3630
|
+
return "";
|
|
3631
|
+
});
|
|
3625
3632
|
return (_ctx, _cache) => {
|
|
3626
3633
|
var _a, _b;
|
|
3627
3634
|
return openBlock(), createElementBlock("div", {
|
|
3628
3635
|
class: normalizeClass((_a = _ctx.wrapperClass) != null ? _a : "")
|
|
3629
3636
|
}, [
|
|
3630
|
-
createElementVNode("img", {
|
|
3631
|
-
class:
|
|
3632
|
-
src: finalUrl.value
|
|
3633
|
-
|
|
3634
|
-
}, null, 42, _hoisted_1$16)
|
|
3637
|
+
createElementVNode("img", mergeProps({
|
|
3638
|
+
class: (_b = _ctx.imageClass) != null ? _b : "",
|
|
3639
|
+
src: finalUrl.value
|
|
3640
|
+
}, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$16)
|
|
3635
3641
|
], 2);
|
|
3636
3642
|
};
|
|
3637
3643
|
}
|
|
@@ -16772,7 +16778,7 @@ const setupTracking = (options) => {
|
|
|
16772
16778
|
store.setTrackingOptions({ options });
|
|
16773
16779
|
};
|
|
16774
16780
|
const LupaSearch = {
|
|
16775
|
-
install: (app
|
|
16781
|
+
install: (app) => {
|
|
16776
16782
|
const pinia = createPinia();
|
|
16777
16783
|
app.use(pinia);
|
|
16778
16784
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { QueryParams } from './types/search-results/QueryParams';
|
|
|
25
25
|
declare const initPinia: () => Pinia;
|
|
26
26
|
declare const setupTracking: (options: TrackingOptions) => void;
|
|
27
27
|
declare const LupaSearch: {
|
|
28
|
-
install: (app: any
|
|
28
|
+
install: (app: any) => void;
|
|
29
29
|
};
|
|
30
30
|
export { SearchBox, SearchResults, ProductList, Recommendations, SearchContainer, ChatContainer, DocumentElementType, SearchBoxPanelType, BadgeType, setupTracking, LupaSearch, initPinia, getInitialSearchResults };
|
|
31
31
|
export type { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, FacetStyle, Environment, RoutingBehavior, AnchorPosition, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, SortCallbackContext, ResultCallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, BadgeGenerateSeed, BadgeGenerateOptions, BadgeOptions, SearchContainerOptions, SearchContainerConfigOptions, SingleStarRatingElement, DynamicData, ProductRecommendationOptions, RecommendationABTestingOptions, SsrOptions, ChatOptions, ChatSettings, SearchBoxEventCallbacks, SearchBoxResultCallbackContext, QueryParams, SearchBoxResultsNavigateContext };
|
|
@@ -24,6 +24,7 @@ export type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
|
24
24
|
baseUrl?: string;
|
|
25
25
|
key: string;
|
|
26
26
|
customUrl?: (document: T) => string;
|
|
27
|
+
alt?: (document: T) => string;
|
|
27
28
|
};
|
|
28
29
|
export type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
29
30
|
type: DocumentElementType.TITLE;
|