@salla.sa/twilight-components 2.14.339 → 2.14.341
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/salla-accordion_62.cjs.entry.js +5 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +2 -2
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +2 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +36 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-order-details-options2.js +2 -2
- package/dist/components/salla-quick-buy2.js +6 -2
- package/dist/esm/salla-accordion_62.entry.js +5 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +2 -2
- package/dist/twilight/p-99a11b63.entry.js +4 -0
- package/dist/twilight/{p-9108e972.entry.js → p-ab86d9c3.entry.js} +1 -1
- package/dist/twilight/{p-c0f8d377.entry.js → p-acc84896.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +13 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +4 -4
- package/dist/twilight/p-a3ae644b.entry.js +0 -4
|
@@ -10330,6 +10330,8 @@ const sallaQuickBuyCss = ".s-quick-buy-button .s-button-text{display:flex}apple-
|
|
|
10330
10330
|
const SallaQuickBuy = class {
|
|
10331
10331
|
constructor(hostRef) {
|
|
10332
10332
|
index.registerInstance(this, hostRef);
|
|
10333
|
+
this.validationFailed = index.createEvent(this, "validationFailed");
|
|
10334
|
+
this.requireLogin = index.createEvent(this, "requireLogin");
|
|
10333
10335
|
/**
|
|
10334
10336
|
* Button type.
|
|
10335
10337
|
*
|
|
@@ -10351,6 +10353,7 @@ const SallaQuickBuy = class {
|
|
|
10351
10353
|
}
|
|
10352
10354
|
async quickBuyHandler() {
|
|
10353
10355
|
if (salla.config.isGuest()) {
|
|
10356
|
+
this.requireLogin.emit({ productId: this.productId });
|
|
10354
10357
|
// todo (low) :: find a way to re-fire the method after success
|
|
10355
10358
|
let afterLoginEvent = "salla-quick-buy::user.logged-in";
|
|
10356
10359
|
salla.event.on(afterLoginEvent, () => this.settlePayment());
|
|
@@ -10363,6 +10366,7 @@ const SallaQuickBuy = class {
|
|
|
10363
10366
|
let optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
10364
10367
|
//make sure all the required options are selected
|
|
10365
10368
|
if (optionsElement && !await optionsElement.reportValidity()) {
|
|
10369
|
+
this.validationFailed.emit({ productId: this.productId });
|
|
10366
10370
|
return salla.error(salla.lang.get('common.messages.required_fields'));
|
|
10367
10371
|
}
|
|
10368
10372
|
//use this way to get quantity too
|
|
@@ -10509,7 +10513,7 @@ const SallaQuickBuy = class {
|
|
|
10509
10513
|
});
|
|
10510
10514
|
}
|
|
10511
10515
|
render() {
|
|
10512
|
-
return index.h(index.Host, { key: '
|
|
10516
|
+
return index.h(index.Host, { key: '326f9d1a5336de18e77a71cef8d4e0118acb8055' }, this.quickBuyButton());
|
|
10513
10517
|
}
|
|
10514
10518
|
quickBuyButton() {
|
|
10515
10519
|
return index.h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
|
|
@@ -16,7 +16,7 @@ const SallaLoyaltyPrizeItem = class {
|
|
|
16
16
|
this.prizeItemSelected.emit(this.item);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (index.h(index.Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, index.h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, index.h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), index.h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), index.h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), index.h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, "
|
|
19
|
+
return (index.h(index.Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, index.h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, index.h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), index.h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), index.h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), index.h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, " ", salla.lang.get('pages.loyalty_program.point')))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
SallaLoyaltyPrizeItem.style = sallaLoyaltyPrizeItemCss;
|
|
@@ -59,7 +59,7 @@ const SallaOrderDetailsOptions = class {
|
|
|
59
59
|
}
|
|
60
60
|
// Handle file options
|
|
61
61
|
if (option.is_file) {
|
|
62
|
-
return (index.h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" },
|
|
62
|
+
return (index.h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" }, salla.lang.get('common.elements.attachments')));
|
|
63
63
|
}
|
|
64
64
|
// Handle color picker options
|
|
65
65
|
if (option.is_color_picker) {
|
|
@@ -67,7 +67,7 @@ const SallaOrderDetailsOptions = class {
|
|
|
67
67
|
}
|
|
68
68
|
// Handle map options
|
|
69
69
|
if (option.is_map && option.latitude && option.longitude) {
|
|
70
|
-
return (index.h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, index.h("div", { slot: "button" }, index.h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) },
|
|
70
|
+
return (index.h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, index.h("div", { slot: "button" }, index.h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) }, salla.lang.get('common.elements.show_location')))));
|
|
71
71
|
}
|
|
72
72
|
// Default text value
|
|
73
73
|
return (index.h("span", { class: "s-order-details-option-default-text" }, option.display_value || option.value));
|
|
@@ -7,7 +7,7 @@ export class SallaLoyaltyPrizeItem {
|
|
|
7
7
|
this.prizeItemSelected.emit(this.item);
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, "
|
|
10
|
+
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, " ", salla.lang.get('pages.loyalty_program.point')))));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "salla-loyalty-prize-item"; }
|
|
13
13
|
static get originalStyleUrls() {
|
|
@@ -52,7 +52,7 @@ export class SallaOrderDetailsOptions {
|
|
|
52
52
|
}
|
|
53
53
|
// Handle file options
|
|
54
54
|
if (option.is_file) {
|
|
55
|
-
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" },
|
|
55
|
+
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" }, salla.lang.get('common.elements.attachments')));
|
|
56
56
|
}
|
|
57
57
|
// Handle color picker options
|
|
58
58
|
if (option.is_color_picker) {
|
|
@@ -60,7 +60,7 @@ export class SallaOrderDetailsOptions {
|
|
|
60
60
|
}
|
|
61
61
|
// Handle map options
|
|
62
62
|
if (option.is_map && option.latitude && option.longitude) {
|
|
63
|
-
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) },
|
|
63
|
+
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) }, salla.lang.get('common.elements.show_location')))));
|
|
64
64
|
}
|
|
65
65
|
// Default text value
|
|
66
66
|
return (h("span", { class: "s-order-details-option-default-text" }, option.display_value || option.value));
|
|
@@ -26,6 +26,7 @@ export class SallaQuickBuy {
|
|
|
26
26
|
}
|
|
27
27
|
async quickBuyHandler() {
|
|
28
28
|
if (salla.config.isGuest()) {
|
|
29
|
+
this.requireLogin.emit({ productId: this.productId });
|
|
29
30
|
// todo (low) :: find a way to re-fire the method after success
|
|
30
31
|
let afterLoginEvent = "salla-quick-buy::user.logged-in";
|
|
31
32
|
salla.event.on(afterLoginEvent, () => this.settlePayment());
|
|
@@ -38,6 +39,7 @@ export class SallaQuickBuy {
|
|
|
38
39
|
let optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
39
40
|
//make sure all the required options are selected
|
|
40
41
|
if (optionsElement && !await optionsElement.reportValidity()) {
|
|
42
|
+
this.validationFailed.emit({ productId: this.productId });
|
|
41
43
|
return salla.error(salla.lang.get('common.messages.required_fields'));
|
|
42
44
|
}
|
|
43
45
|
//use this way to get quantity too
|
|
@@ -184,7 +186,7 @@ export class SallaQuickBuy {
|
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
188
|
render() {
|
|
187
|
-
return h(Host, { key: '
|
|
189
|
+
return h(Host, { key: '326f9d1a5336de18e77a71cef8d4e0118acb8055' }, this.quickBuyButton());
|
|
188
190
|
}
|
|
189
191
|
quickBuyButton() {
|
|
190
192
|
return h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
|
|
@@ -399,5 +401,38 @@ export class SallaQuickBuy {
|
|
|
399
401
|
"quickBuy": {}
|
|
400
402
|
};
|
|
401
403
|
}
|
|
404
|
+
static get events() {
|
|
405
|
+
return [{
|
|
406
|
+
"method": "validationFailed",
|
|
407
|
+
"name": "validationFailed",
|
|
408
|
+
"bubbles": true,
|
|
409
|
+
"cancelable": true,
|
|
410
|
+
"composed": true,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": "Emitted when Apple Pay button is clicked but form validation fails."
|
|
414
|
+
},
|
|
415
|
+
"complexType": {
|
|
416
|
+
"original": "{ productId: string }",
|
|
417
|
+
"resolved": "{ productId: string; }",
|
|
418
|
+
"references": {}
|
|
419
|
+
}
|
|
420
|
+
}, {
|
|
421
|
+
"method": "requireLogin",
|
|
422
|
+
"name": "requireLogin",
|
|
423
|
+
"bubbles": true,
|
|
424
|
+
"cancelable": true,
|
|
425
|
+
"composed": true,
|
|
426
|
+
"docs": {
|
|
427
|
+
"tags": [],
|
|
428
|
+
"text": "Emitted when Apple Pay button is clicked but user is not logged in."
|
|
429
|
+
},
|
|
430
|
+
"complexType": {
|
|
431
|
+
"original": "{ productId: string }",
|
|
432
|
+
"resolved": "{ productId: string; }",
|
|
433
|
+
"references": {}
|
|
434
|
+
}
|
|
435
|
+
}];
|
|
436
|
+
}
|
|
402
437
|
static get elementRef() { return "host"; }
|
|
403
438
|
}
|
|
@@ -15,7 +15,7 @@ const SallaLoyaltyPrizeItem$1 = /*@__PURE__*/ proxyCustomElement(class SallaLoya
|
|
|
15
15
|
this.prizeItemSelected.emit(this.item);
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, "
|
|
18
|
+
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, " ", salla.lang.get('pages.loyalty_program.point')))));
|
|
19
19
|
}
|
|
20
20
|
static get style() { return sallaLoyaltyPrizeItemCss; }
|
|
21
21
|
}, [0, "salla-loyalty-prize-item", {
|
|
@@ -62,7 +62,7 @@ const SallaOrderDetailsOptions = /*@__PURE__*/ proxyCustomElement(class SallaOrd
|
|
|
62
62
|
}
|
|
63
63
|
// Handle file options
|
|
64
64
|
if (option.is_file) {
|
|
65
|
-
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" },
|
|
65
|
+
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" }, salla.lang.get('common.elements.attachments')));
|
|
66
66
|
}
|
|
67
67
|
// Handle color picker options
|
|
68
68
|
if (option.is_color_picker) {
|
|
@@ -70,7 +70,7 @@ const SallaOrderDetailsOptions = /*@__PURE__*/ proxyCustomElement(class SallaOrd
|
|
|
70
70
|
}
|
|
71
71
|
// Handle map options
|
|
72
72
|
if (option.is_map && option.latitude && option.longitude) {
|
|
73
|
-
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) },
|
|
73
|
+
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) }, salla.lang.get('common.elements.show_location')))));
|
|
74
74
|
}
|
|
75
75
|
// Default text value
|
|
76
76
|
return (h("span", { class: "s-order-details-option-default-text" }, option.display_value || option.value));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
4
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { a as axios } from './axios.js';
|
|
6
6
|
|
|
7
7
|
var Http = {
|
|
@@ -724,6 +724,8 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
|
|
|
724
724
|
constructor() {
|
|
725
725
|
super();
|
|
726
726
|
this.__registerHost();
|
|
727
|
+
this.validationFailed = createEvent(this, "validationFailed", 7);
|
|
728
|
+
this.requireLogin = createEvent(this, "requireLogin", 7);
|
|
727
729
|
/**
|
|
728
730
|
* Button type.
|
|
729
731
|
*
|
|
@@ -745,6 +747,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
|
|
|
745
747
|
}
|
|
746
748
|
async quickBuyHandler() {
|
|
747
749
|
if (salla.config.isGuest()) {
|
|
750
|
+
this.requireLogin.emit({ productId: this.productId });
|
|
748
751
|
// todo (low) :: find a way to re-fire the method after success
|
|
749
752
|
let afterLoginEvent = "salla-quick-buy::user.logged-in";
|
|
750
753
|
salla.event.on(afterLoginEvent, () => this.settlePayment());
|
|
@@ -757,6 +760,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
|
|
|
757
760
|
let optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
758
761
|
//make sure all the required options are selected
|
|
759
762
|
if (optionsElement && !await optionsElement.reportValidity()) {
|
|
763
|
+
this.validationFailed.emit({ productId: this.productId });
|
|
760
764
|
return salla.error(salla.lang.get('common.messages.required_fields'));
|
|
761
765
|
}
|
|
762
766
|
//use this way to get quantity too
|
|
@@ -903,7 +907,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
|
|
|
903
907
|
});
|
|
904
908
|
}
|
|
905
909
|
render() {
|
|
906
|
-
return h(Host, { key: '
|
|
910
|
+
return h(Host, { key: '326f9d1a5336de18e77a71cef8d4e0118acb8055' }, this.quickBuyButton());
|
|
907
911
|
}
|
|
908
912
|
quickBuyButton() {
|
|
909
913
|
return h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
|
|
@@ -10310,6 +10310,8 @@ const sallaQuickBuyCss = ".s-quick-buy-button .s-button-text{display:flex}apple-
|
|
|
10310
10310
|
const SallaQuickBuy = class {
|
|
10311
10311
|
constructor(hostRef) {
|
|
10312
10312
|
registerInstance(this, hostRef);
|
|
10313
|
+
this.validationFailed = createEvent(this, "validationFailed");
|
|
10314
|
+
this.requireLogin = createEvent(this, "requireLogin");
|
|
10313
10315
|
/**
|
|
10314
10316
|
* Button type.
|
|
10315
10317
|
*
|
|
@@ -10331,6 +10333,7 @@ const SallaQuickBuy = class {
|
|
|
10331
10333
|
}
|
|
10332
10334
|
async quickBuyHandler() {
|
|
10333
10335
|
if (salla.config.isGuest()) {
|
|
10336
|
+
this.requireLogin.emit({ productId: this.productId });
|
|
10334
10337
|
// todo (low) :: find a way to re-fire the method after success
|
|
10335
10338
|
let afterLoginEvent = "salla-quick-buy::user.logged-in";
|
|
10336
10339
|
salla.event.on(afterLoginEvent, () => this.settlePayment());
|
|
@@ -10343,6 +10346,7 @@ const SallaQuickBuy = class {
|
|
|
10343
10346
|
let optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
10344
10347
|
//make sure all the required options are selected
|
|
10345
10348
|
if (optionsElement && !await optionsElement.reportValidity()) {
|
|
10349
|
+
this.validationFailed.emit({ productId: this.productId });
|
|
10346
10350
|
return salla.error(salla.lang.get('common.messages.required_fields'));
|
|
10347
10351
|
}
|
|
10348
10352
|
//use this way to get quantity too
|
|
@@ -10489,7 +10493,7 @@ const SallaQuickBuy = class {
|
|
|
10489
10493
|
});
|
|
10490
10494
|
}
|
|
10491
10495
|
render() {
|
|
10492
|
-
return h(Host, { key: '
|
|
10496
|
+
return h(Host, { key: '326f9d1a5336de18e77a71cef8d4e0118acb8055' }, this.quickBuyButton());
|
|
10493
10497
|
}
|
|
10494
10498
|
quickBuyButton() {
|
|
10495
10499
|
return h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
|
|
@@ -14,7 +14,7 @@ const SallaLoyaltyPrizeItem = class {
|
|
|
14
14
|
this.prizeItemSelected.emit(this.item);
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, "
|
|
17
|
+
return (h(Host, { key: '6aad4c3c2052fc29cb04aafc307831ae92c9caf7' }, h("div", { key: 'aec0459249272685c12b451dce725857d514dcc9', onClick: this.onPrizeItemClick.bind(this) }, h("img", { key: '0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4', class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { key: '5f96c2b7b091b943044f1765d205dd4315227b56', class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { key: 'd1124db21faf13b3275064b63f54f4119ff62f54', class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { key: 'fb6ca5f5d7994721c3ab36729a1cf07b494ac91a', class: "s-loyalty-prize-item-points" }, this.item.cost_points, " ", salla.lang.get('pages.loyalty_program.point')))));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
SallaLoyaltyPrizeItem.style = sallaLoyaltyPrizeItemCss;
|
|
@@ -57,7 +57,7 @@ const SallaOrderDetailsOptions = class {
|
|
|
57
57
|
}
|
|
58
58
|
// Handle file options
|
|
59
59
|
if (option.is_file) {
|
|
60
|
-
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" },
|
|
60
|
+
return (h("a", { href: option.value, target: "_blank", class: "s-order-details-option-file-link" }, salla.lang.get('common.elements.attachments')));
|
|
61
61
|
}
|
|
62
62
|
// Handle color picker options
|
|
63
63
|
if (option.is_color_picker) {
|
|
@@ -65,7 +65,7 @@ const SallaOrderDetailsOptions = class {
|
|
|
65
65
|
}
|
|
66
66
|
// Handle map options
|
|
67
67
|
if (option.is_map && option.latitude && option.longitude) {
|
|
68
|
-
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) },
|
|
68
|
+
return (h("salla-map", { id: `location_map_${option.id}`, class: `map_${option.id}`, zoom: 15, readonly: true, lat: option.latitude, lng: option.longitude }, h("div", { slot: "button" }, h("button", { type: "button", class: "s-order-details-option-map-button", onClick: () => this.openMap(option.id) }, salla.lang.get('common.elements.show_location')))));
|
|
69
69
|
}
|
|
70
70
|
// Default text value
|
|
71
71
|
return (h("span", { class: "s-order-details-option-default-text" }, option.display_value || option.value));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as s,h as t,H as o}from"./p-CRmtzwUF.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as
|
|
4
|
+
import{r as t,c as a,h as s,H as e}from"./p-CRmtzwUF.js";const i=class{constructor(s){t(this,s),this.prizeItemSelected=a(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return s(e,{key:"6aad4c3c2052fc29cb04aafc307831ae92c9caf7"},s("div",{key:"aec0459249272685c12b451dce725857d514dcc9",onClick:this.onPrizeItemClick.bind(this)},s("img",{key:"0bd6790bdb8f8e0c2f630801b370564d2b2f0ee4",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),s("div",{key:"5f96c2b7b091b943044f1765d205dd4315227b56",class:"s-loyalty-prize-item-title"},this.item.name),s("div",{key:"d1124db21faf13b3275064b63f54f4119ff62f54",class:"s-loyalty-prize-item-subtitle"},this.item.description),s("div",{key:"fb6ca5f5d7994721c3ab36729a1cf07b494ac91a",class:"s-loyalty-prize-item-points"},this.item.cost_points," ",salla.lang.get("pages.loyalty_program.point"))))}};i.style="salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{i as salla_loyalty_prize_item}
|