vviinn-widgets 2.0.0 → 2.2.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/dist/cjs/Handler-d1a8a86a.js +329 -0
- package/dist/cjs/{app-globals-de6924b5.js → app-globals-d0251be8.js} +1 -1
- package/dist/cjs/cropper-handler.cjs.entry.js +27 -0
- package/dist/cjs/customized-slots-14b77e4a.js +53 -0
- package/dist/cjs/{cropper-handler_28.cjs.entry.js → highlight-box_22.cjs.entry.js} +48 -437
- package/dist/{esm/Array-e81cf4a3.js → cjs/imageSearch.store-d9ed1a5b.js} +10009 -3391
- package/dist/cjs/{index-7adce49f.js → index-141137b2.js} +14 -362
- package/dist/cjs/{index-8a276115.js → index-a5e15a0c.js} +7 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/vviinn-carousel_5.cjs.entry.js +1232 -0
- package/dist/cjs/vviinn-error.cjs.entry.js +19 -0
- package/dist/cjs/vviinn-preloader.cjs.entry.js +26 -0
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +43 -0
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +97 -0
- package/dist/cjs/vviinn-widgets.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +22 -18
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +78 -68
- package/dist/collection/components/vviinn-icons/index.js +4 -0
- package/dist/collection/components/vviinn-product-card/render-helpers.js +4 -4
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +5 -6
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +26 -5
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +238 -0
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +200 -0
- package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +18 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +35 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +149 -0
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +148 -28
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +31 -8
- package/dist/esm/Handler-639a4cb3.js +308 -0
- package/dist/esm/{app-globals-0a626970.js → app-globals-b6113170.js} +1 -1
- package/dist/esm/cropper-handler.entry.js +23 -0
- package/dist/esm/customized-slots-a952fb80.js +50 -0
- package/dist/esm/{cropper-handler_28.entry.js → highlight-box_22.entry.js} +21 -404
- package/dist/{cjs/Array-cce2fde8.js → esm/imageSearch.store-4ca31230.js} +8705 -2137
- package/dist/esm/{index-e77e65ae.js → index-017f18de.js} +6 -2
- package/dist/esm/{index-0ccfcee5.js → index-3e85e294.js} +14 -362
- package/dist/esm/loader.js +3 -3
- package/dist/esm/vviinn-carousel_5.entry.js +1224 -0
- package/dist/esm/vviinn-error.entry.js +15 -0
- package/dist/esm/vviinn-preloader.entry.js +22 -0
- package/dist/esm/vviinn-vps-button.entry.js +39 -0
- package/dist/esm/vviinn-vps-widget.entry.js +93 -0
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/campaign/Campaign.d.ts +1 -1
- package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +13 -7
- package/dist/types/components/vviinn-icons/index.d.ts +2 -0
- package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -2
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +25 -0
- package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +7 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +14 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +36 -8
- package/dist/types/components.d.ts +62 -10
- package/dist/vviinn-widgets/p-0ed1ef7e.entry.js +1 -0
- package/dist/vviinn-widgets/{p-6c4fd1db.js → p-16e49514.js} +1 -1
- package/dist/vviinn-widgets/p-3da18d7f.js +1 -0
- package/dist/vviinn-widgets/p-62a1b042.entry.js +1 -0
- package/dist/vviinn-widgets/p-68900093.entry.js +1 -0
- package/dist/vviinn-widgets/p-6c4c240d.entry.js +1 -0
- package/dist/vviinn-widgets/p-95e53d99.entry.js +1 -0
- package/dist/vviinn-widgets/p-9fee20e7.entry.js +1 -0
- package/dist/vviinn-widgets/p-d7894eaf.js +1 -0
- package/dist/vviinn-widgets/p-db0be4cd.js +1 -0
- package/dist/vviinn-widgets/p-eb15116d.entry.js +1 -0
- package/dist/vviinn-widgets/{p-489aee23.js → p-f00fddbb.js} +1 -1
- package/dist/vviinn-widgets/p-f582db5c.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +3 -1
- package/www/build/p-0ed1ef7e.entry.js +1 -0
- package/www/build/{p-6c4fd1db.js → p-16e49514.js} +1 -1
- package/www/build/p-1cc0cdfd.js +1 -0
- package/www/build/p-3da18d7f.js +1 -0
- package/www/build/p-62a1b042.entry.js +1 -0
- package/www/build/p-68900093.entry.js +1 -0
- package/www/build/p-6c4c240d.entry.js +1 -0
- package/www/build/p-95e53d99.entry.js +1 -0
- package/www/build/p-9fee20e7.entry.js +1 -0
- package/www/build/p-a67898be.css +1 -0
- package/www/build/p-d7894eaf.js +1 -0
- package/www/build/p-db0be4cd.js +1 -0
- package/www/build/p-eb15116d.entry.js +1 -0
- package/www/build/{p-489aee23.js → p-f00fddbb.js} +1 -1
- package/www/build/p-f582db5c.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +177 -8
- package/dist/cjs/imageSearch.store-39fce56c.js +0 -6926
- package/dist/cjs/vviinn-carousel.cjs.entry.js +0 -222
- package/dist/cjs/vviinn-vpr-widget.cjs.entry.js +0 -106
- package/dist/esm/imageSearch.store-b887ff78.js +0 -6893
- package/dist/esm/vviinn-carousel.entry.js +0 -218
- package/dist/esm/vviinn-vpr-widget.entry.js +0 -102
- package/dist/vviinn-widgets/p-2bf74c28.js +0 -1
- package/dist/vviinn-widgets/p-3063e23a.js +0 -1
- package/dist/vviinn-widgets/p-9145c82e.entry.js +0 -1
- package/dist/vviinn-widgets/p-ddcac3f8.js +0 -1
- package/dist/vviinn-widgets/p-f05da9f1.entry.js +0 -1
- package/dist/vviinn-widgets/p-f12f823d.entry.js +0 -1
- package/www/build/p-2bf74c28.js +0 -1
- package/www/build/p-3063e23a.js +0 -1
- package/www/build/p-9145c82e.entry.js +0 -1
- package/www/build/p-cbae3071.js +0 -125
- package/www/build/p-ddcac3f8.js +0 -1
- package/www/build/p-e0153ae2.css +0 -6
- package/www/build/p-f05da9f1.entry.js +0 -1
- package/www/build/p-f12f823d.entry.js +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-141137b2.js');
|
|
6
|
+
|
|
7
|
+
const vviinnErrorCss = ":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";
|
|
8
|
+
|
|
9
|
+
let VviinnError = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (index.h(index.Host, null, index.h("slot", { name: "icon" }), index.h("slot", { name: "title" }), index.h("slot", { name: "text" }), index.h("slot", { name: "action" })));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
VviinnError.style = vviinnErrorCss;
|
|
18
|
+
|
|
19
|
+
exports.vviinn_error = VviinnError;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-141137b2.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-d9ed1a5b.js');
|
|
7
|
+
require('./Handler-d1a8a86a.js');
|
|
8
|
+
|
|
9
|
+
const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
|
|
10
|
+
|
|
11
|
+
let VviinnPreloader = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
}
|
|
15
|
+
isActive() {
|
|
16
|
+
return (imageSearch_store.imageSearchState.loading || imageSearch_store.imageSearchState.objectDetectionInProgress);
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (index.h(index.Host, { class: {
|
|
20
|
+
active: this.isActive(),
|
|
21
|
+
} }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
VviinnPreloader.style = vviinnPreloaderCss;
|
|
25
|
+
|
|
26
|
+
exports.vviinn_preloader = VviinnPreloader;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-141137b2.js');
|
|
6
|
+
const index$1 = require('./index-a5e15a0c.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-14b77e4a.js');
|
|
8
|
+
|
|
9
|
+
const vviinnVpsButtonCss = "";
|
|
10
|
+
|
|
11
|
+
let VviinnVpsButton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.globalSlotsChanged = index.createEvent(this, "globalSlotsChanged", 7);
|
|
15
|
+
/** Currency sign will shown after price */
|
|
16
|
+
this.currencySign = "€";
|
|
17
|
+
/** Locale for currency formatting */
|
|
18
|
+
this.locale = "de-DE";
|
|
19
|
+
this.pressed = false;
|
|
20
|
+
}
|
|
21
|
+
handleModalClosed() {
|
|
22
|
+
this.pressed = false;
|
|
23
|
+
}
|
|
24
|
+
componentDidLoad() {
|
|
25
|
+
const slots = this.el.querySelectorAll("[slot]");
|
|
26
|
+
this.globalSlotsChanged.emit(Array.from(slots));
|
|
27
|
+
}
|
|
28
|
+
handleKeyDown(ev) {
|
|
29
|
+
if (ev.code !== "Enter" && ev.code !== "Space")
|
|
30
|
+
return;
|
|
31
|
+
this.pressed = true;
|
|
32
|
+
}
|
|
33
|
+
handleClick() {
|
|
34
|
+
this.pressed = true;
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return (index.h(index.Host, { tabindex: "0", role: "button", pressed: this.pressed, onClick: () => this.handleClick(), onKeyDown: (ev) => this.handleKeyDown(ev) }, index.h("slot", null, index.h(index$1.CameraIcon, null)), index.h(customizedSlots.SlotSkeleton, null), index.h("vviinn-vps-widget", { active: this.pressed, "currency-sign": "\u20AC", token: this.token, locale: this.locale, apiPath: this.apiPath, exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card" })));
|
|
38
|
+
}
|
|
39
|
+
get el() { return index.getElement(this); }
|
|
40
|
+
};
|
|
41
|
+
VviinnVpsButton.style = vviinnVpsButtonCss;
|
|
42
|
+
|
|
43
|
+
exports.vviinn_vps_button = VviinnVpsButton;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-141137b2.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-d9ed1a5b.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-14b77e4a.js');
|
|
8
|
+
require('./Handler-d1a8a86a.js');
|
|
9
|
+
|
|
10
|
+
const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";
|
|
11
|
+
|
|
12
|
+
let VviinnVpsWidget = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
/** When true modal window with widget will be shown */
|
|
16
|
+
this.active = false;
|
|
17
|
+
/** Currency sign will shown after price */
|
|
18
|
+
this.currencySign = "€";
|
|
19
|
+
/** Locale for currency formatting */
|
|
20
|
+
this.locale = "de-DE";
|
|
21
|
+
this.slidePosition = 0;
|
|
22
|
+
this.width = 0;
|
|
23
|
+
this.wrongImageFormat = false;
|
|
24
|
+
}
|
|
25
|
+
activeWatcher(value) {
|
|
26
|
+
if (value) {
|
|
27
|
+
this.overflow = document.body.style.overflow;
|
|
28
|
+
document.body.style.overflow = "hidden";
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
document.body.style.overflow = this.overflow;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
customizedSlots.slotChangeListener(this, this.el);
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
imageSearch_store.state$1.apiPath = this.apiPath;
|
|
39
|
+
imageSearch_store.state$1.currencySign = this.currencySign;
|
|
40
|
+
imageSearch_store.state$1.locale = this.locale;
|
|
41
|
+
imageSearch_store.imageSearchState.token = this.token;
|
|
42
|
+
}
|
|
43
|
+
handleImageSelection() {
|
|
44
|
+
this.slidePosition = 1;
|
|
45
|
+
const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
|
|
46
|
+
const overlay = root.shadowRoot.querySelector("vviinn-overlay");
|
|
47
|
+
const modal = overlay.querySelector("vviinn-modal");
|
|
48
|
+
const modalBody = modal.shadowRoot.querySelector(".body");
|
|
49
|
+
modalBody.scrollTop = 0;
|
|
50
|
+
}
|
|
51
|
+
resetState() {
|
|
52
|
+
this.resetScroll("onboarding-block");
|
|
53
|
+
this.slidePosition = 0;
|
|
54
|
+
imageSearch_store.imageSearchState.image = imageSearch_store.Option.none;
|
|
55
|
+
imageSearch_store.imageSearchState.imageUrl = imageSearch_store.Option.none;
|
|
56
|
+
imageSearch_store.imageSearchState.imageBounds = imageSearch_store.Option.none;
|
|
57
|
+
imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.none;
|
|
58
|
+
imageSearch_store.imageSearchState.results = [];
|
|
59
|
+
imageSearch_store.imageSearchState.filters = [];
|
|
60
|
+
imageSearch_store.imageSearchState.detectedObjects = [];
|
|
61
|
+
imageSearch_store.imageSearchState.activeIonLink = undefined;
|
|
62
|
+
imageSearch_store.imageSearchState.rectangleSearchForm = undefined;
|
|
63
|
+
this.resetScroll("results-block");
|
|
64
|
+
}
|
|
65
|
+
haveErrors() {
|
|
66
|
+
return this.wrongImageFormat || imageSearch_store.imageSearchState.serverError;
|
|
67
|
+
}
|
|
68
|
+
resetScroll(elementId, behavior = "auto") {
|
|
69
|
+
const element = this.el.shadowRoot.getElementById(elementId);
|
|
70
|
+
element.scroll({ top: 0, left: 0, behavior });
|
|
71
|
+
}
|
|
72
|
+
handleModalClose() {
|
|
73
|
+
this.active = false;
|
|
74
|
+
this.resetState();
|
|
75
|
+
const elementsToReset = ["onboarding-block", "results-block"];
|
|
76
|
+
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (index.h(index.Host, null, index.h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: { "start-page": true } }, index.h("div", { class: {
|
|
80
|
+
error: this.haveErrors(),
|
|
81
|
+
"start-page_block": true,
|
|
82
|
+
} }, index.h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), index.h("vviinn-server-error", { class: { hidden: !imageSearch_store.imageSearchState.serverError }, onActionClick: () => (imageSearch_store.imageSearchState.serverError = false) }), index.h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), index.h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, index.h("span", { slot: "upload-button-text", class: "upload-button-content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), index.h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), index.h("slot", { name: "vviinn-image-upload-button-text" }, index.h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), index.h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), index.h("div", { id: "onboarding-block", class: "start-page_block" }, index.h("div", { class: "onboarding-wrapper" }, index.h("vviinn-onboarding", null), index.h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), index.h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, index.h("div", { class: "image-wrapper" }, index.h("vviinn-image-view", null), index.h("div", { class: "filters-wrapper" }, index.h("div", { class: "filters" }, imageSearch_store.imageSearchState.filters.map((filter) => (index.h("search-filters", { filter: filter })))))), index.h("div", { id: "results-block", class: "products-wrapper" }, index.h("div", { class: { "nothing-found": true, hidden: imageSearch_store.imageSearchState.results.length > 0 } }, index.h("vviinn-empty-results", null), index.h("vviinn-onboarding", null)), index.h("div", { class: {
|
|
83
|
+
hidden: imageSearch_store.imageSearchState.results.length <= 0,
|
|
84
|
+
products: true,
|
|
85
|
+
} }, imageSearch_store.imageSearchState.results.map((p) => {
|
|
86
|
+
var _a;
|
|
87
|
+
return (index.h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
|
|
88
|
+
}))))))));
|
|
89
|
+
}
|
|
90
|
+
get el() { return index.getElement(this); }
|
|
91
|
+
static get watchers() { return {
|
|
92
|
+
"active": ["activeWatcher"]
|
|
93
|
+
}; }
|
|
94
|
+
};
|
|
95
|
+
VviinnVpsWidget.style = vviinnVpsWidgetCss;
|
|
96
|
+
|
|
97
|
+
exports.vviinn_vps_widget = VviinnVpsWidget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
3
|
+
const index = require('./index-141137b2.js');
|
|
4
|
+
const appGlobals = require('./app-globals-d0251be8.js');
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["
|
|
20
|
+
return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-carousel_5.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}],[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"state":[32]},[[16,"click","bodyClickListener"]]],[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"imageLoaded":[32]}]]],["highlight-box_22.cjs",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}]]],["vviinn-vps-widget.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]]], options);
|
|
21
21
|
});
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"./components/vviinn-slider/vviinn-slider.js",
|
|
28
28
|
"./components/vviinn-slider/vviinn-slide/vviinn-slide.js",
|
|
29
29
|
"./components/vviinn-teaser/vviinn-teaser.js",
|
|
30
|
+
"./components/vviinn-vpr-button/vviinn-vpr-button.js",
|
|
31
|
+
"./components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js",
|
|
30
32
|
"./components/vviinn-vpr-widget/vviinn-vpr-vidget.js",
|
|
31
33
|
"./components/vviinn-vps-button/vviinn-vps-button.js",
|
|
32
34
|
"./components/vviinn-vps-widget/vviinn-vps-widget.js"
|
|
@@ -35,22 +35,21 @@
|
|
|
35
35
|
height: 10px;
|
|
36
36
|
background: #E0E0E0;
|
|
37
37
|
border-radius: 50%;
|
|
38
|
+
cursor: pointer;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.bullet.active {
|
|
41
42
|
background: #161616;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
overflow: hidden;
|
|
45
|
+
.content:not(.show-scrollbar),
|
|
46
|
+
.content.grid {
|
|
47
|
+
scrollbar-color: #fff0 #fff0;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
50
|
+
.content:not(.show-scrollbar)::-webkit-scrollbar,
|
|
51
|
+
.content.grid::-webkit-scrollbar {
|
|
52
|
+
opacity: 0;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
.content {
|
|
@@ -62,6 +61,7 @@
|
|
|
62
61
|
overflow-y: hidden;
|
|
63
62
|
overflow-x: auto;
|
|
64
63
|
flex-grow: 1;
|
|
64
|
+
padding-bottom: 16px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.content.left > * {
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
scroll-snap-align: end;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
:host(.
|
|
75
|
+
:host(.continuity) button {
|
|
76
76
|
border-radius: 2px;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
:host(.
|
|
79
|
+
:host(.grid) button {
|
|
80
80
|
border-radius: 50%;
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -112,15 +112,9 @@ button.prev svg {
|
|
|
112
112
|
|
|
113
113
|
.items-group {
|
|
114
114
|
display: grid;
|
|
115
|
-
min-width: 100%;
|
|
116
|
-
grid-template-columns: repeat(auto-fit, minmax(var(--vviinn-carousel-image-width, --vviinn-carousel-image-width-system), 1fr));
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-items: center;
|
|
119
115
|
grid-gap: 16px;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.items-group.incomplete {
|
|
123
|
-
grid-template-columns: repeat(auto-fit, minmax(var(--vviinn-carousel-image-width, --vviinn-carousel-image-width-system), 1fr));
|
|
116
|
+
grid-template-columns: repeat(var(--vviinn-carousel-columns-internal), 1fr);
|
|
117
|
+
min-width: 100%;
|
|
124
118
|
}
|
|
125
119
|
|
|
126
120
|
vviinn-product-card::part(price-container) {
|
|
@@ -132,3 +126,13 @@ vviinn-product-card::part(price-container) {
|
|
|
132
126
|
:host(.classic) vviinn-product-card::part(type) {
|
|
133
127
|
text-align: center;
|
|
134
128
|
}
|
|
129
|
+
|
|
130
|
+
@media(max-width: 480px) {
|
|
131
|
+
:host(.modern) button {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.items-group {
|
|
136
|
+
grid-template-columns: repeat(2, 1fr);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -5,16 +5,15 @@ const COLUMNS_NUMBER_CSS_VAR = "--vviinn-carousel-columns-internal";
|
|
|
5
5
|
const CAROUSEL_WIDTH_CSS_VAR = "--vviinn-carousel-content-width";
|
|
6
6
|
const CAROUSEL_IMAGE_WIDTH_CSS_VAR = "--vviinn-carousel-image-width";
|
|
7
7
|
const CONTENT_GROUP_CSS_CLASS = "items-group";
|
|
8
|
-
const INCOMPLETE_GROUP_CSS_CLASS = "incomplete";
|
|
9
8
|
export class VviinnCarousel {
|
|
10
9
|
constructor() {
|
|
11
10
|
this.moveDirection = "right";
|
|
12
11
|
this.contentGroups = [];
|
|
13
12
|
this.activeContentGroup = 0;
|
|
14
|
-
this.mode = "
|
|
13
|
+
this.mode = "continuity";
|
|
15
14
|
this.imageWidth = 140;
|
|
16
15
|
this.showScroll = true;
|
|
17
|
-
this.
|
|
16
|
+
this.recommendations = [];
|
|
18
17
|
this.columns = 0;
|
|
19
18
|
this.resizeObserver = new ResizeObserver(() => this.handleResize());
|
|
20
19
|
this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
|
|
@@ -25,19 +24,22 @@ export class VviinnCarousel {
|
|
|
25
24
|
disconnectedCallback() {
|
|
26
25
|
this.resizeObserver.disconnect();
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
componentDidLoad() {
|
|
29
28
|
this.setWidth();
|
|
30
29
|
this.processScrollbarWidth();
|
|
31
30
|
this.columns = this.getColumnsNumber();
|
|
32
|
-
const slot = this.el.querySelector("
|
|
31
|
+
const slot = this.el.querySelector(".content");
|
|
33
32
|
this.mutationObserver.observe(slot, { subtree: true, childList: true });
|
|
33
|
+
this.resizeObserver.observe(this.getHostParent());
|
|
34
34
|
}
|
|
35
35
|
getItemWidthFromDocument() {
|
|
36
36
|
return parseInt(getComputedStyle(document.body).getPropertyValue(CAROUSEL_IMAGE_WIDTH_CSS_VAR));
|
|
37
37
|
}
|
|
38
38
|
setItemWidth() {
|
|
39
39
|
const widthInDocument = this.getItemWidthFromDocument();
|
|
40
|
-
const itemWidth = isNaN(widthInDocument)
|
|
40
|
+
const itemWidth = isNaN(widthInDocument)
|
|
41
|
+
? this.imageWidth
|
|
42
|
+
: widthInDocument;
|
|
41
43
|
this.el.style.setProperty(CAROUSEL_IMAGE_WIDTH_CSS_VAR, `${itemWidth}px`);
|
|
42
44
|
}
|
|
43
45
|
getContentClassMap() {
|
|
@@ -45,6 +47,7 @@ export class VviinnCarousel {
|
|
|
45
47
|
content: true,
|
|
46
48
|
[this.moveDirection]: true,
|
|
47
49
|
[this.mode]: true,
|
|
50
|
+
"show-scrollbar": this.showScroll
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
53
|
handleResize() {
|
|
@@ -53,7 +56,6 @@ export class VviinnCarousel {
|
|
|
53
56
|
this.setItemWidth();
|
|
54
57
|
const newColumns = this.getColumnsNumber();
|
|
55
58
|
if (newColumns !== this.columns) {
|
|
56
|
-
this.renderContent();
|
|
57
59
|
this.columns = newColumns;
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -62,8 +64,12 @@ export class VviinnCarousel {
|
|
|
62
64
|
const sum = contentWidths.reduce((acc, val) => acc + val, 0);
|
|
63
65
|
return sum / contentWidths.length;
|
|
64
66
|
}
|
|
67
|
+
getHostParent() {
|
|
68
|
+
const parent = this.el.parentNode;
|
|
69
|
+
return parent.host.parentElement;
|
|
70
|
+
}
|
|
65
71
|
setWidth() {
|
|
66
|
-
const parent = this.
|
|
72
|
+
const parent = this.getHostParent();
|
|
67
73
|
if (!parent)
|
|
68
74
|
return;
|
|
69
75
|
const parentStyles = getComputedStyle(parent);
|
|
@@ -73,48 +79,13 @@ export class VviinnCarousel {
|
|
|
73
79
|
parseInt(parentStyles["padding-left"]));
|
|
74
80
|
this.el.style.setProperty(CAROUSEL_WIDTH_CSS_VAR, `${width}px`);
|
|
75
81
|
}
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
this.content = content;
|
|
81
|
-
this.renderContent();
|
|
82
|
-
this.setWidth();
|
|
83
|
-
this.resizeObserver.observe(this.el.offsetParent);
|
|
84
|
-
this.mutationObserver.disconnect();
|
|
85
|
-
}
|
|
82
|
+
getParent() {
|
|
83
|
+
const parentNode = this.el.parentNode;
|
|
84
|
+
const host = parentNode.host;
|
|
85
|
+
return host.parentElement;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
? chunksOf(this.getColumnsNumber())(this.content)
|
|
90
|
-
: this.content.reduce((fragment, element) => {
|
|
91
|
-
fragment.append(element);
|
|
92
|
-
return fragment;
|
|
93
|
-
}, new DocumentFragment());
|
|
94
|
-
this.mode === "classic" ? this.renderGroup(c) : this.renderLine(c);
|
|
95
|
-
}
|
|
96
|
-
renderGroup(content) {
|
|
97
|
-
const columnsNumber = this.getColumnsNumber();
|
|
98
|
-
const groups = content.map((el) => {
|
|
99
|
-
const container = document.createElement("div");
|
|
100
|
-
const groupClassNames = el.length < columnsNumber
|
|
101
|
-
? [CONTENT_GROUP_CSS_CLASS, INCOMPLETE_GROUP_CSS_CLASS]
|
|
102
|
-
: [CONTENT_GROUP_CSS_CLASS];
|
|
103
|
-
container.classList.add(...groupClassNames);
|
|
104
|
-
return el.reduce((acc, el) => {
|
|
105
|
-
acc.append(el);
|
|
106
|
-
return acc;
|
|
107
|
-
}, container);
|
|
108
|
-
});
|
|
109
|
-
const combinedElements = groups.reduce((fragment, element) => {
|
|
110
|
-
fragment.append(element);
|
|
111
|
-
return fragment;
|
|
112
|
-
}, new DocumentFragment());
|
|
113
|
-
this.appendToContent(combinedElements);
|
|
114
|
-
this.contentGroups = this.getContentGroups();
|
|
115
|
-
}
|
|
116
|
-
renderLine(item) {
|
|
117
|
-
this.appendToContent(item);
|
|
87
|
+
cloneSlottedContent() {
|
|
88
|
+
this.setWidth();
|
|
118
89
|
}
|
|
119
90
|
getActiveGroupIndex() {
|
|
120
91
|
var _a, _b;
|
|
@@ -143,11 +114,6 @@ export class VviinnCarousel {
|
|
|
143
114
|
getContentGroups() {
|
|
144
115
|
return Array.from(this.el.querySelectorAll(`.${CONTENT_GROUP_CSS_CLASS}`));
|
|
145
116
|
}
|
|
146
|
-
appendToContent(content) {
|
|
147
|
-
const contentNode = this.getContentNode();
|
|
148
|
-
contentNode.innerHTML = "";
|
|
149
|
-
contentNode.append(content);
|
|
150
|
-
}
|
|
151
117
|
showNext() {
|
|
152
118
|
this.moveDirection = "right";
|
|
153
119
|
const contentContainer = this.getContentNode();
|
|
@@ -188,10 +154,10 @@ export class VviinnCarousel {
|
|
|
188
154
|
this.activeContentGroup = this.getActiveGroupIndex();
|
|
189
155
|
}
|
|
190
156
|
showBullets() {
|
|
191
|
-
return this.mode === "
|
|
157
|
+
return this.mode === "grid" && this.showScroll;
|
|
192
158
|
}
|
|
193
159
|
showScrollbar() {
|
|
194
|
-
return this.mode === "
|
|
160
|
+
return this.mode === "continuity" && this.showScroll;
|
|
195
161
|
}
|
|
196
162
|
getClassMap() {
|
|
197
163
|
return {
|
|
@@ -199,22 +165,45 @@ export class VviinnCarousel {
|
|
|
199
165
|
"show-scrollbar": this.showScrollbar(),
|
|
200
166
|
};
|
|
201
167
|
}
|
|
168
|
+
renderRecommendation(recommendation) {
|
|
169
|
+
return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity" }));
|
|
170
|
+
}
|
|
171
|
+
renderRecommendationGroup(elements) {
|
|
172
|
+
return h("div", { class: CONTENT_GROUP_CSS_CLASS }, elements);
|
|
173
|
+
}
|
|
174
|
+
renderRecommendationGroups(elements) {
|
|
175
|
+
return elements.map((el) => this.renderRecommendationGroup(el));
|
|
176
|
+
}
|
|
177
|
+
renderRecommendations() {
|
|
178
|
+
return this.mode === "grid"
|
|
179
|
+
? this.renderGrid()
|
|
180
|
+
: this.renderRecommendationsElements();
|
|
181
|
+
}
|
|
182
|
+
renderRecommendationsElements() {
|
|
183
|
+
return this.recommendations.map((r) => this.renderRecommendation(r));
|
|
184
|
+
}
|
|
185
|
+
renderGrid() {
|
|
186
|
+
const recommendations = this.renderRecommendationsElements();
|
|
187
|
+
const grouppedContent = chunksOf(this.getColumnsNumber())(recommendations);
|
|
188
|
+
return this.renderRecommendationGroups(grouppedContent);
|
|
189
|
+
}
|
|
190
|
+
renderBullets() {
|
|
191
|
+
const numberOfBullets = Math.ceil(this.recommendations.length / this.getColumnsNumber());
|
|
192
|
+
const bulletsArray = Array.from(Array(numberOfBullets).keys());
|
|
193
|
+
return bulletsArray.map((index) => (h("div", { class: {
|
|
194
|
+
bullet: true,
|
|
195
|
+
active: this.activeContentGroup === index,
|
|
196
|
+
}, onClick: () => this.scroll(index) })));
|
|
197
|
+
}
|
|
202
198
|
render() {
|
|
203
199
|
return (h(Host, { class: this.getClassMap() },
|
|
204
|
-
h("div", { class:
|
|
200
|
+
h("div", { class: Object.assign({ body: true }, this.getClassMap()) },
|
|
205
201
|
h("button", { class: "prev", onClick: () => this.showPrev() },
|
|
206
202
|
h(ChevronIcon, null)),
|
|
207
|
-
h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }),
|
|
203
|
+
h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()),
|
|
208
204
|
h("button", { class: "next", onClick: () => this.showNext() },
|
|
209
205
|
h(ChevronIcon, null))),
|
|
210
|
-
this.showBullets() ? (h("div", { class: "bullets" }, this.
|
|
211
|
-
.map((_, i) => i)
|
|
212
|
-
.map((i) => (h("div", { class: {
|
|
213
|
-
bullet: true,
|
|
214
|
-
active: this.activeContentGroup === i,
|
|
215
|
-
}, onClick: () => this.scroll(i) }))))) : (""),
|
|
216
|
-
h("div", { id: "slot" },
|
|
217
|
-
h("slot", null))));
|
|
206
|
+
this.showBullets() ? (h("div", { class: "bullets" }, this.renderBullets())) : ("")));
|
|
218
207
|
}
|
|
219
208
|
static get is() { return "vviinn-carousel"; }
|
|
220
209
|
static get originalStyleUrls() { return {
|
|
@@ -229,7 +218,7 @@ export class VviinnCarousel {
|
|
|
229
218
|
"mutable": false,
|
|
230
219
|
"complexType": {
|
|
231
220
|
"original": "CarouselMode",
|
|
232
|
-
"resolved": "\"
|
|
221
|
+
"resolved": "\"continuity\" | \"grid\"",
|
|
233
222
|
"references": {
|
|
234
223
|
"CarouselMode": {
|
|
235
224
|
"location": "local"
|
|
@@ -244,7 +233,7 @@ export class VviinnCarousel {
|
|
|
244
233
|
},
|
|
245
234
|
"attribute": "mode",
|
|
246
235
|
"reflect": false,
|
|
247
|
-
"defaultValue": "\"
|
|
236
|
+
"defaultValue": "\"continuity\""
|
|
248
237
|
},
|
|
249
238
|
"imageWidth": {
|
|
250
239
|
"type": "number",
|
|
@@ -281,6 +270,27 @@ export class VviinnCarousel {
|
|
|
281
270
|
"attribute": "show-scroll",
|
|
282
271
|
"reflect": false,
|
|
283
272
|
"defaultValue": "true"
|
|
273
|
+
},
|
|
274
|
+
"recommendations": {
|
|
275
|
+
"type": "unknown",
|
|
276
|
+
"mutable": false,
|
|
277
|
+
"complexType": {
|
|
278
|
+
"original": "Recommendation[]",
|
|
279
|
+
"resolved": "{ groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original?: string; thumbnail?: string; }; price?: { actual?: number; sale?: number; }; }[]",
|
|
280
|
+
"references": {
|
|
281
|
+
"Recommendation": {
|
|
282
|
+
"location": "import",
|
|
283
|
+
"path": "../../recommendation/recommendation"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"required": false,
|
|
288
|
+
"optional": false,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": ""
|
|
292
|
+
},
|
|
293
|
+
"defaultValue": "[]"
|
|
284
294
|
}
|
|
285
295
|
}; }
|
|
286
296
|
static get states() { return {
|
|
@@ -24,3 +24,7 @@ export const LoaderIcon = () => (h("svg", { width: "100%", height: "100%", xmlns
|
|
|
24
24
|
h("path", { fill: "#fff", d: "M23,14a9,9,0,1,1-9-9V2A12,12,0,1,0,26,14Z" })));
|
|
25
25
|
export const ChevronIcon = () => (h("svg", { width: "9", height: "16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
26
26
|
h("path", { d: "m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z", fill: "#525252" })));
|
|
27
|
+
export const VisualSearchIcon = () => (h("svg", { width: "22", height: "22", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
+
h("path", { d: "M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z" })));
|
|
29
|
+
export const CrossIcon = () => (h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
30
|
+
h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#161616" })));
|
|
@@ -26,7 +26,7 @@ export const Price = (props) => {
|
|
|
26
26
|
h("span", { class: "price-outdated", part: "price-outdated" }, priceEl),
|
|
27
27
|
]) : (h("span", { class: "price-regular", part: "price-regular" }, priceEl))));
|
|
28
28
|
};
|
|
29
|
-
export const Image = (props) => (h("picture", null,
|
|
30
|
-
h("img", { loading: "lazy", part: "image", class: "image", width: props.width, height: props.height, src: processWidth(props.src, props.width), alt: props.title })));
|
|
31
|
-
export const ResponsiveImage = (props) => (h("picture", null,
|
|
32
|
-
h("img", { loading: "lazy", part: "image", class: "image responsive", src: processWidth(props.src, props.width), alt: props.title })));
|
|
29
|
+
export const Image = (props, onLoadEnd = () => undefined) => (h("picture", null,
|
|
30
|
+
h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image", width: props.width, height: props.height, src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
|
|
31
|
+
export const ResponsiveImage = (props, onLoadEnd = () => undefined) => (h("picture", null,
|
|
32
|
+
h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image responsive", src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
|
|
@@ -41,9 +41,6 @@
|
|
|
41
41
|
-o-object-fit: contain;
|
|
42
42
|
object-fit: contain;
|
|
43
43
|
text-align: center;
|
|
44
|
-
max-width: -webkit-min-content;
|
|
45
|
-
max-width: -moz-min-content;
|
|
46
|
-
max-width: min-content;
|
|
47
44
|
box-sizing: border-box;
|
|
48
45
|
}
|
|
49
46
|
|
|
@@ -69,17 +66,19 @@ img.responsive {
|
|
|
69
66
|
line-height: 24px;
|
|
70
67
|
margin-bottom: 8px;
|
|
71
68
|
overflow: hidden;
|
|
72
|
-
max-width: -webkit-min-content;
|
|
73
|
-
max-width: -moz-min-content;
|
|
74
|
-
max-width: min-content;
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
.deeplink {
|
|
78
72
|
text-decoration: none;
|
|
79
73
|
}
|
|
80
74
|
|
|
75
|
+
.image-link {
|
|
76
|
+
display: contents;
|
|
77
|
+
}
|
|
78
|
+
|
|
81
79
|
picture {
|
|
82
80
|
position: relative;
|
|
81
|
+
width: 100%;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
:host(.dimmed) picture::before {
|