vviinn-widgets 2.164.1 → 2.164.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.
@@ -14,7 +14,7 @@ function fromString(s) {
14
14
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
15
15
  }
16
16
 
17
- const version = "2.164.1";
17
+ const version = "2.164.3";
18
18
 
19
19
  exports.campaignTypeNames = campaignTypeNames;
20
20
  exports.fold = fold;
@@ -8,7 +8,7 @@ const customizedSlots = require('./customized-slots-09407c18.js');
8
8
  const index$2 = require('./index-c53c869d.js');
9
9
  const index$1 = require('./index-1953bc5b.js');
10
10
  const Rectangle = require('./Rectangle-baf86229.js');
11
- const _package = require('./package-d363dcad.js');
11
+ const _package = require('./package-f5d2b67e.js');
12
12
  const resources = require('./resources-9a669f8f.js');
13
13
  const index$3 = require('./index-8829b0f1.js');
14
14
  const constants$1 = require('./constants-0a36f053.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1a40d6c9.js');
6
6
  const search_store = require('./search.store-a0492e39.js');
7
- const _package = require('./package-d363dcad.js');
7
+ const _package = require('./package-f5d2b67e.js');
8
8
  const index$1 = require('./index-c53c869d.js');
9
9
  const constants = require('./constants-5598c49b.js');
10
10
  const Rectangle = require('./Rectangle-baf86229.js');
@@ -2139,6 +2139,10 @@ const VviinnVprWidget = class {
2139
2139
  this.recommendationsLoading = loading;
2140
2140
  (_a = this.setRecommendationsLoading) === null || _a === void 0 ? void 0 : _a.call(this, loading);
2141
2141
  };
2142
+ this.showNoResultText = () => !this.recommendationsLoading &&
2143
+ (this.recommendations.length === 0 ||
2144
+ (this.recommendations.length < this.setItemsAmount && this.isSetMode) ||
2145
+ this.hasErrorOnLoad);
2142
2146
  this.productCardEventDataToEventBody = (eventData) => {
2143
2147
  const { productRank, productId, campaignTypeId, discount } = eventData, rest = __rest(eventData, ["productRank", "productId", "campaignTypeId", "discount"]);
2144
2148
  return Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
@@ -2368,6 +2372,7 @@ const VviinnVprWidget = class {
2368
2372
  this.setLoading(false);
2369
2373
  }, (data) => {
2370
2374
  this.handleRecommendationsSuccess(data);
2375
+ this.vviinnRecommendationsLoaded.emit();
2371
2376
  this.setLoading(false);
2372
2377
  }));
2373
2378
  }
@@ -2427,11 +2432,7 @@ const VviinnVprWidget = class {
2427
2432
  "show-in-widget": this.showInWidget,
2428
2433
  }, "aria-hidden": "false" }, index.h(index.Fragment, null, this.renderExternalCSS(), customizedSlots.SlotSkeleton("discovery"), (this.isSetMode || ((_a = this.blockTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0) && (index.h("div", { class: "widget-header" }, index.h("div", null, index.h("h2", { part: "recommendations-title" }, index.h("slot", { name: "vviinn-recommendations-title" }, this.isSetMode
2429
2434
  ? Rectangle.instance.t("setMode.widgetTitle")
2430
- : this.blockTitle || Rectangle.instance.t("discoveryWidgetTitle"))), this.isSetMode && (index.h("h3", { part: "recommendations-subtitle" }, index.h("slot", { name: "vviinn-recommendations-subtitle" }, Rectangle.instance.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (index.h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, index.h("slot", { name: "vviinn-update-button-icon" }, index.h(UpdateIcon, null)), index.h("slot", { name: "vviinn-update-button-text" }, index.h("span", null, Rectangle.instance.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (index.h("div", { class: "filters-header " }, this.showFilters && (index.h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (index.h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), (this.recommendations.length === 0 ||
2431
- (this.recommendations.length < this.setItemsAmount &&
2432
- this.isSetMode) ||
2433
- this.hasErrorOnLoad) &&
2434
- !this.recommendationsLoading && (index.h("div", { class: "no-result-text" }, this.noResultText.length
2435
+ : this.blockTitle || Rectangle.instance.t("discoveryWidgetTitle"))), this.isSetMode && (index.h("h3", { part: "recommendations-subtitle" }, index.h("slot", { name: "vviinn-recommendations-subtitle" }, Rectangle.instance.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (index.h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, index.h("slot", { name: "vviinn-update-button-icon" }, index.h(UpdateIcon, null)), index.h("slot", { name: "vviinn-update-button-text" }, index.h("span", null, Rectangle.instance.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (index.h("div", { class: "filters-header " }, this.showFilters && (index.h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (index.h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), this.showNoResultText() && (index.h("div", { class: "no-result-text" }, this.noResultText.length
2435
2436
  ? this.noResultText
2436
2437
  : Rectangle.instance.t("noResultText"))))));
2437
2438
  }
@@ -7,7 +7,7 @@ const search_store = require('./search.store-a0492e39.js');
7
7
  const Rectangle = require('./Rectangle-baf86229.js');
8
8
  const WarningIcon = require('./WarningIcon-db443b71.js');
9
9
  const customizedSlots = require('./customized-slots-09407c18.js');
10
- const _package = require('./package-d363dcad.js');
10
+ const _package = require('./package-f5d2b67e.js');
11
11
  const index$1 = require('./index-8829b0f1.js');
12
12
  const constants = require('./constants-5598c49b.js');
13
13
 
@@ -40,6 +40,10 @@ export class VviinnVprWidget {
40
40
  this.recommendationsLoading = loading;
41
41
  (_a = this.setRecommendationsLoading) === null || _a === void 0 ? void 0 : _a.call(this, loading);
42
42
  };
43
+ this.showNoResultText = () => !this.recommendationsLoading &&
44
+ (this.recommendations.length === 0 ||
45
+ (this.recommendations.length < this.setItemsAmount && this.isSetMode) ||
46
+ this.hasErrorOnLoad);
43
47
  this.productCardEventDataToEventBody = (eventData) => {
44
48
  const { productRank, productId, campaignTypeId, discount } = eventData, rest = __rest(eventData, ["productRank", "productId", "campaignTypeId", "discount"]);
45
49
  return Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
@@ -269,6 +273,7 @@ export class VviinnVprWidget {
269
273
  this.setLoading(false);
270
274
  }, (data) => {
271
275
  this.handleRecommendationsSuccess(data);
276
+ this.vviinnRecommendationsLoaded.emit();
272
277
  this.setLoading(false);
273
278
  }));
274
279
  }
@@ -328,11 +333,7 @@ export class VviinnVprWidget {
328
333
  "show-in-widget": this.showInWidget,
329
334
  }, "aria-hidden": "false" }, h(Fragment, null, this.renderExternalCSS(), SlotSkeleton("discovery"), (this.isSetMode || ((_a = this.blockTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0) && (h("div", { class: "widget-header" }, h("div", null, h("h2", { part: "recommendations-title" }, h("slot", { name: "vviinn-recommendations-title" }, this.isSetMode
330
335
  ? i18next.t("setMode.widgetTitle")
331
- : this.blockTitle || i18next.t("discoveryWidgetTitle"))), this.isSetMode && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, i18next.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, i18next.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (h("div", { class: "filters-header " }, this.showFilters && (h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), (this.recommendations.length === 0 ||
332
- (this.recommendations.length < this.setItemsAmount &&
333
- this.isSetMode) ||
334
- this.hasErrorOnLoad) &&
335
- !this.recommendationsLoading && (h("div", { class: "no-result-text" }, this.noResultText.length
336
+ : this.blockTitle || i18next.t("discoveryWidgetTitle"))), this.isSetMode && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, i18next.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, i18next.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (h("div", { class: "filters-header " }, this.showFilters && (h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), this.showNoResultText() && (h("div", { class: "no-result-text" }, this.noResultText.length
336
337
  ? this.noResultText
337
338
  : i18next.t("noResultText"))))));
338
339
  }
@@ -12,6 +12,6 @@ function fromString(s) {
12
12
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
13
13
  }
14
14
 
15
- const version = "2.164.1";
15
+ const version = "2.164.3";
16
16
 
17
17
  export { fold as a, campaignTypeNames as c, fromString as f, version as v };
@@ -4,7 +4,7 @@ import { s as slotChangeListener, p as productCardSlotNames, v as vprIconSlotNam
4
4
  import { P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, e as createWidgetEvent, j as createFilterEvent, v as v4, c as createAddToBasketEvent, d as createAddToWishlistEvent, f as createResultEventByType, h as createProductEventByType, g as getCustomLabels, k as createImageSearchEvent } from './index-e4a52727.js';
5
5
  import { s as setLocalStorageItems, g as getLocalStorageItems, c as cleanLocalStorage } from './index-52ea1bdf.js';
6
6
  import { f as fromImage, i as instance } from './Rectangle-abec127b.js';
7
- import { c as campaignTypeNames, v as version } from './package-e4e9c3ed.js';
7
+ import { c as campaignTypeNames, v as version } from './package-719714a3.js';
8
8
  import { r as resources } from './resources-4651fe88.js';
9
9
  import { b as productCardsGridPart, a as productCardParts, m as modalParts, f as filtersParts, c as extendedFiltersParts, s as searchBarParts, d as searchWidgetFilterParts, g as searchWidgetButtonParts } from './index-955afdff.js';
10
10
  import { f as findSlotElements, g as getSlotNames, D as DEFAULT_EXAMPLE_IMAGE } from './constants-c2f6bdfe.js';
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, F as Fragment, H as Host, g as getElement } from './index-057b9128.js';
2
2
  import { h as has, t as tuple, a as addIfNotEmpty, _ as _function, b as _Array, g as globalState, u as useSearchStore, O as Option, S as Semigroup, E as Either, s as searchState, p as pipe, c as chainW, m as makeRequest, f as fromEither, d as getApiPath, e as createInitPostRequest, A as Apply, i as updateGlobalState, j as trackEvent, T as TaskEither } from './search.store-e2fcd9a6.js';
3
- import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-e4e9c3ed.js';
3
+ import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-719714a3.js';
4
4
  import { C as CAROUSEL_IMAGE_WIDTH_CSS_VAR, S as SET_MODE_IMAGE_WIDTH_CSS_VAR, a as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, b as CONTENT_GROUP_CSS_CLASS, g as getCustomLabels, P as PlusIcon, v as v4, c as createAddToBasketEvent, d as createAddToWishlistEvent, e as createWidgetEvent, f as createResultEventByType, h as createProductEventByType, i as getRecommendationsBody } from './index-e4a52727.js';
5
5
  import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-c02c4b27.js';
6
6
  import { i as instance, a as isClickedInRectBound } from './Rectangle-abec127b.js';
@@ -2135,6 +2135,10 @@ const VviinnVprWidget = class {
2135
2135
  this.recommendationsLoading = loading;
2136
2136
  (_a = this.setRecommendationsLoading) === null || _a === void 0 ? void 0 : _a.call(this, loading);
2137
2137
  };
2138
+ this.showNoResultText = () => !this.recommendationsLoading &&
2139
+ (this.recommendations.length === 0 ||
2140
+ (this.recommendations.length < this.setItemsAmount && this.isSetMode) ||
2141
+ this.hasErrorOnLoad);
2138
2142
  this.productCardEventDataToEventBody = (eventData) => {
2139
2143
  const { productRank, productId, campaignTypeId, discount } = eventData, rest = __rest(eventData, ["productRank", "productId", "campaignTypeId", "discount"]);
2140
2144
  return Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
@@ -2364,6 +2368,7 @@ const VviinnVprWidget = class {
2364
2368
  this.setLoading(false);
2365
2369
  }, (data) => {
2366
2370
  this.handleRecommendationsSuccess(data);
2371
+ this.vviinnRecommendationsLoaded.emit();
2367
2372
  this.setLoading(false);
2368
2373
  }));
2369
2374
  }
@@ -2423,11 +2428,7 @@ const VviinnVprWidget = class {
2423
2428
  "show-in-widget": this.showInWidget,
2424
2429
  }, "aria-hidden": "false" }, h(Fragment, null, this.renderExternalCSS(), SlotSkeleton("discovery"), (this.isSetMode || ((_a = this.blockTitle) === null || _a === void 0 ? void 0 : _a.length) !== 0) && (h("div", { class: "widget-header" }, h("div", null, h("h2", { part: "recommendations-title" }, h("slot", { name: "vviinn-recommendations-title" }, this.isSetMode
2425
2430
  ? instance.t("setMode.widgetTitle")
2426
- : this.blockTitle || instance.t("discoveryWidgetTitle"))), this.isSetMode && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, instance.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, instance.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (h("div", { class: "filters-header " }, this.showFilters && (h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), (this.recommendations.length === 0 ||
2427
- (this.recommendations.length < this.setItemsAmount &&
2428
- this.isSetMode) ||
2429
- this.hasErrorOnLoad) &&
2430
- !this.recommendationsLoading && (h("div", { class: "no-result-text" }, this.noResultText.length
2431
+ : this.blockTitle || instance.t("discoveryWidgetTitle"))), this.isSetMode && (h("h3", { part: "recommendations-subtitle" }, h("slot", { name: "vviinn-recommendations-subtitle" }, instance.t("setMode.widgetSubtitle"))))), this.isSetMode && this.updateButtonLocation !== "onItem" ? (h("button", { class: "update-button", part: "update-button-top", onClick: () => (this.updatingAllCards = true) }, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, null)), h("slot", { name: "vviinn-update-button-text" }, h("span", null, instance.t("setMode.updateButtonText"))))) : null)), (this.showFilters || this.showExtendedFilters) && (h("div", { class: "filters-header " }, this.showFilters && (h("vviinn-filters", { filters: this.dynamicFilters })), this.showExtendedFilters && (h("vviinn-extended-filters", { filters: this.dynamicFilters })))), this.useCarousel ? this.renderCarousel() : this.renderResults(), this.showNoResultText() && (h("div", { class: "no-result-text" }, this.noResultText.length
2431
2432
  ? this.noResultText
2432
2433
  : instance.t("noResultText"))))));
2433
2434
  }
@@ -3,7 +3,7 @@ import { _ as _function, O as Option, D as detectedObjectEq, s as searchState, a
3
3
  import { s as scaleWithSized, c as center, i as instance } from './Rectangle-abec127b.js';
4
4
  import { W as WarningIcon } from './WarningIcon-7896b328.js';
5
5
  import { s as slotChangeListener } from './customized-slots-f8cebd42.js';
6
- import { c as campaignTypeNames, v as version } from './package-e4e9c3ed.js';
6
+ import { c as campaignTypeNames, v as version } from './package-719714a3.js';
7
7
  import { m as modalParts } from './index-955afdff.js';
8
8
  import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-c02c4b27.js';
9
9
 
@@ -191,6 +191,7 @@ export declare class VviinnVprWidget implements ComponentInterface {
191
191
  private requestDynamicFilters;
192
192
  uiSessionId: string;
193
193
  private setLoading;
194
+ private showNoResultText;
194
195
  private getBasicEventData;
195
196
  private handleOpenLink;
196
197
  private findProductById;