@salla.sa/twilight-components 1.6.2 → 1.6.4
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/loader.cjs.js +1 -1
- package/dist/cjs/salla-button_27.cjs.entry.js +27879 -0
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +26 -0
- package/dist/cjs/salla-scopes.cjs.entry.js +9 -6
- package/dist/cjs/salla-select.cjs.entry.js +159 -0
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/assets/svg/caret-down.svg +0 -1
- package/dist/collection/assets/svg/images.svg +0 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/salla-datetime-picker/interfaces.js +4 -0
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.css +13 -0
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1374 -0
- package/dist/collection/components/salla-file-upload/interfaces.js +42 -0
- package/dist/collection/components/salla-file-upload/salla-file-upload.css +219 -0
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +1435 -0
- package/dist/collection/components/salla-gifting/gift-schema.js +4 -0
- package/dist/collection/components/salla-gifting/intefaces.js +4 -0
- package/dist/collection/components/salla-gifting/salla-gifting.css +20 -0
- package/dist/collection/components/salla-gifting/salla-gifting.js +564 -0
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +23 -13
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +46 -28
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.css +3 -0
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +69 -0
- package/dist/collection/components/salla-loyalty/salla-loyalty.css +0 -4
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +29 -16
- package/dist/collection/components/salla-modal/salla-modal.css +6 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +37 -13
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +23 -8
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +87 -64
- package/dist/collection/components/salla-scopes/salla-scopes.js +11 -7
- package/dist/collection/components/salla-search/salla-search.js +1 -1
- package/dist/collection/components/salla-select/salla-select.css +86 -0
- package/dist/collection/components/salla-select/salla-select.js +610 -0
- package/dist/collection/components/salla-tel-input/interfaces.js +4 -0
- package/dist/collection/components/salla-tel-input/salla-tel-input.css +1 -2
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +32 -3
- package/dist/collection/components/salla-verify/salla-verify.js +1 -1
- package/dist/collection/global/app.js +15 -12
- package/dist/components/_commonjsHelpers.js +24 -0
- package/dist/{esm/salla-social-share.entry.js → components/anime.es.js} +1 -132
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +5 -0
- package/dist/components/salla-datetime-picker.d.ts +11 -0
- package/dist/components/salla-datetime-picker.js +9 -0
- package/dist/components/salla-datetime-picker2.js +2876 -0
- package/dist/components/salla-file-upload.d.ts +11 -0
- package/dist/components/salla-file-upload.js +9 -0
- package/dist/components/salla-file-upload2.js +14623 -0
- package/dist/components/salla-gifting.d.ts +11 -0
- package/dist/components/salla-gifting.js +499 -0
- package/dist/components/salla-localization-modal.js +31 -16
- package/dist/components/salla-login-modal.js +35 -19
- package/dist/components/salla-loyalty-prize-item.d.ts +11 -0
- package/dist/components/salla-loyalty-prize-item.js +42 -0
- package/dist/components/salla-loyalty.js +28 -17
- package/dist/components/salla-modal2.js +1 -1
- package/dist/components/salla-offer-modal.js +42 -12
- package/dist/components/salla-product-size-guide.js +21 -6
- package/dist/components/salla-rating-modal.js +47 -19
- package/dist/components/salla-scopes.js +10 -6
- package/dist/components/salla-search.js +1 -1
- package/dist/components/salla-select.d.ts +11 -0
- package/dist/components/salla-select.js +199 -0
- package/dist/components/salla-social-share.js +1 -1308
- package/dist/components/salla-swiper2.js +9 -9
- package/dist/components/salla-tel-input2.js +15 -18
- package/dist/components/salla-verify2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button_27.entry.js +27849 -0
- package/dist/esm/salla-loyalty-prize-item.entry.js +22 -0
- package/dist/esm/salla-scopes.entry.js +9 -6
- package/dist/esm/salla-select.entry.js +155 -0
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/p-49125b6a.entry.js +4 -0
- package/dist/twilight-components/p-9a25753c.entry.js +4 -0
- package/dist/twilight-components/p-b7b9439d.entry.js +22 -0
- package/dist/twilight-components/p-df1eb1e5.entry.js +4 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-datetime-picker/interfaces.d.ts +8 -0
- package/dist/types/components/salla-datetime-picker/salla-datetime-picker.d.ts +250 -0
- package/dist/types/components/salla-file-upload/interfaces.d.ts +766 -0
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +267 -0
- package/dist/types/components/salla-gifting/gift-schema.d.ts +20 -0
- package/dist/types/components/salla-gifting/intefaces.d.ts +18 -0
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +98 -0
- package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +3 -2
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +13 -3
- package/dist/types/components/salla-loyalty/salla-loyalty-prize-item.d.ts +8 -0
- package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +2 -0
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +3 -1
- package/dist/types/components/salla-product-size-guide/salla-product-size-guide.d.ts +4 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +3 -2
- package/dist/types/components/salla-scopes/salla-scopes.d.ts +1 -0
- package/dist/types/components/salla-select/salla-select.d.ts +110 -0
- package/dist/types/components/salla-tel-input/interfaces.d.ts +4 -0
- package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +3 -0
- package/dist/types/components.d.ts +1253 -10
- package/package.json +9 -3
- package/dist/cjs/Helper-8ae6a805.js +0 -28
- package/dist/cjs/arrow-right-3d137e4c.js +0 -13
- package/dist/cjs/cancel-ae668d91.js +0 -13
- package/dist/cjs/check-circle2-1aac98d1.js +0 -13
- package/dist/cjs/mail-2db058ee.js +0 -13
- package/dist/cjs/salla-button_10.cjs.entry.js +0 -2584
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +0 -93
- package/dist/cjs/salla-list-tile_2.cjs.entry.js +0 -80
- package/dist/cjs/salla-loyalty.cjs.entry.js +0 -229
- package/dist/cjs/salla-product-availability.cjs.entry.js +0 -128
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +0 -52
- package/dist/cjs/salla-quantity-input.cjs.entry.js +0 -101
- package/dist/cjs/salla-rating-modal.cjs.entry.js +0 -169
- package/dist/cjs/salla-rating-stars.cjs.entry.js +0 -83
- package/dist/cjs/salla-social-share.cjs.entry.js +0 -1447
- package/dist/cjs/salla-swiper.cjs.entry.js +0 -5023
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +0 -159
- package/dist/cjs/star2-8288e6e1.js +0 -13
- package/dist/esm/Helper-e1d414a5.js +0 -26
- package/dist/esm/arrow-right-1c3e04f2.js +0 -11
- package/dist/esm/cancel-41a92070.js +0 -11
- package/dist/esm/check-circle2-f6e5f685.js +0 -11
- package/dist/esm/mail-9d5204c6.js +0 -11
- package/dist/esm/salla-button_10.entry.js +0 -2571
- package/dist/esm/salla-infinite-scroll.entry.js +0 -89
- package/dist/esm/salla-list-tile_2.entry.js +0 -75
- package/dist/esm/salla-loyalty.entry.js +0 -225
- package/dist/esm/salla-product-availability.entry.js +0 -124
- package/dist/esm/salla-product-size-guide.entry.js +0 -48
- package/dist/esm/salla-quantity-input.entry.js +0 -97
- package/dist/esm/salla-rating-modal.entry.js +0 -165
- package/dist/esm/salla-rating-stars.entry.js +0 -79
- package/dist/esm/salla-swiper.entry.js +0 -5019
- package/dist/esm/salla-tab-content_3.entry.js +0 -153
- package/dist/esm/star2-b134fc74.js +0 -11
- package/dist/twilight-components/p-0d498694.entry.js +0 -4
- package/dist/twilight-components/p-14f0ff17.entry.js +0 -4
- package/dist/twilight-components/p-335abbbb.entry.js +0 -4
- package/dist/twilight-components/p-4cafb11b.entry.js +0 -4
- package/dist/twilight-components/p-5e63e308.entry.js +0 -4
- package/dist/twilight-components/p-5fb32395.entry.js +0 -4
- package/dist/twilight-components/p-648e74e5.entry.js +0 -4
- package/dist/twilight-components/p-6a3adf55.entry.js +0 -4
- package/dist/twilight-components/p-6da4bb74.entry.js +0 -4
- package/dist/twilight-components/p-897b2018.js +0 -4
- package/dist/twilight-components/p-93708e1e.js +0 -4
- package/dist/twilight-components/p-9d236cf4.entry.js +0 -4
- package/dist/twilight-components/p-9d2ca9c8.js +0 -4
- package/dist/twilight-components/p-af7d5660.js +0 -4
- package/dist/twilight-components/p-bdbd2386.entry.js +0 -4
- package/dist/twilight-components/p-cac3db69.entry.js +0 -4
- package/dist/twilight-components/p-d914a212.js +0 -4
- package/dist/twilight-components/p-dace8e6d.js +0 -4
- package/dist/twilight-components/p-f9253fda.entry.js +0 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-4e30ffd0.js';
|
|
5
|
+
|
|
6
|
+
const sallaLoyaltyPrizeItemCss = "salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";
|
|
7
|
+
|
|
8
|
+
const SallaLoyaltyPrizeItem = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.prizeItemSelected = createEvent(this, "prizeItemSelected", 7);
|
|
12
|
+
}
|
|
13
|
+
onPrizeItemClick() {
|
|
14
|
+
this.prizeItemSelected.emit(this.item);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return (h(Host, null, h("div", { onClick: this.onPrizeItemClick.bind(this) }, h("img", { class: "s-loyalty-prize-item-image", src: this.item.image, alt: this.item.name }), h("div", { class: "s-loyalty-prize-item-title" }, this.item.name), h("div", { class: "s-loyalty-prize-item-subtitle" }, this.item.description), h("div", { class: "s-loyalty-prize-item-points" }, this.item.cost_points, " Points"))));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
SallaLoyaltyPrizeItem.style = sallaLoyaltyPrizeItemCss;
|
|
21
|
+
|
|
22
|
+
export { SallaLoyaltyPrizeItem as salla_loyalty_prize_item };
|
|
@@ -27,6 +27,7 @@ const SallaScopees = class {
|
|
|
27
27
|
this.scopes = [];
|
|
28
28
|
this.originalScopesList = [];
|
|
29
29
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
30
|
+
this.hasError = false;
|
|
30
31
|
/**
|
|
31
32
|
* Optionally open the modal or enforce the pop-up to the viewer
|
|
32
33
|
*/
|
|
@@ -68,9 +69,8 @@ const SallaScopees = class {
|
|
|
68
69
|
else {
|
|
69
70
|
this.mode = ModeType.DEFAULT;
|
|
70
71
|
}
|
|
71
|
-
this.modal.loading();
|
|
72
72
|
this.modal.open();
|
|
73
|
-
return await (mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
73
|
+
return await salla.api.withoutNotifier((mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
74
74
|
.then((resp) => {
|
|
75
75
|
if (mode == ModeType.AVAILABILITY) {
|
|
76
76
|
this.setScopeValues(resp.data);
|
|
@@ -78,10 +78,13 @@ const SallaScopees = class {
|
|
|
78
78
|
else {
|
|
79
79
|
this.setScopeValues(resp.data.scopes);
|
|
80
80
|
}
|
|
81
|
-
}).catch(e =>
|
|
81
|
+
}).catch(e => {
|
|
82
|
+
console.log(e);
|
|
83
|
+
this.hasError = true;
|
|
84
|
+
})
|
|
82
85
|
.finally(() => {
|
|
83
86
|
this.modal.stopLoading();
|
|
84
|
-
});
|
|
87
|
+
}));
|
|
85
88
|
}
|
|
86
89
|
/**
|
|
87
90
|
* Submit form to change exsiting scope.
|
|
@@ -146,8 +149,8 @@ const SallaScopees = class {
|
|
|
146
149
|
}
|
|
147
150
|
render() {
|
|
148
151
|
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: true, "has-skeleton": true }, h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' })))), h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList.length > this.searchDisplayLimit ?
|
|
149
|
-
h("div", { class: "s-scopes-search-wrapper" }, h("div", { class: "s-scopes-search-icon", innerHTML: Search }), h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder: salla.lang.get('blocks.scope.searching_for_a_branch') }))
|
|
150
|
-
: "", this.scopes.length < 2 ?
|
|
152
|
+
h("div", { class: "s-scopes-search-wrapper" }, h("div", { class: "s-scopes-search-icon", innerHTML: Search }), h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), enterkeyhint: "search", placeholder: salla.lang.get('blocks.scope.searching_for_a_branch') }))
|
|
153
|
+
: "", this.hasError || this.scopes.length < 2 ?
|
|
151
154
|
this.placeholderContent()
|
|
152
155
|
: this.mode === ModeType.DEFAULT ? this.defaultContent() : this.availabilityContent()))));
|
|
153
156
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h, H as Host } from './index-4e30ffd0.js';
|
|
5
|
+
|
|
6
|
+
const sallaSelectCss = ".s-select-label{display:block;margin-bottom:0.5rem;color:#111827;font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-select-underline{display:block;padding-left:0;padding-right:0;padding-top:0.625rem;padding-bottom:0.625rem;background-color:transparent;color:#6B7280;font-size:0.875rem;line-height:1.25rem;width:100%;border-width:0;border-bottom-width:2px;border-color:#E5E7EB;appearance:none}.s-select-outlined{display:block;padding:0.625rem;padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;background-color:#F9FAFB;color:#111827;font-size:0.875rem;line-height:1.25rem;width:100%;border-radius:0.5rem;border-width:1px;border-color:#D1D5DB}.s-select-x-large{height:5rem}.s-select-large{height:4rem}.s-select-normal{height:3rem}.s-select-small{height:3rem}.s-select-x-small{height:2.5rem}.s-select-field{padding-top:0.25rem;padding-bottom:0.25rem;padding-right:0.5rem;padding-left:0.5rem;margin:0;font-size:1.125rem;line-height:1.75rem;font-weight:400;line-height:1.75rem;width:100%;border-radius:0.375rem;border-color:#9CA3AF;box-shadow:none}.s-select-hint{margin-top:0.25rem;color:#374151;font-size:0.875rem;line-height:1.25rem;line-height:1.25rem}";
|
|
7
|
+
|
|
8
|
+
const SallaSelect = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
/**
|
|
12
|
+
* Sets label
|
|
13
|
+
*/
|
|
14
|
+
this.label = undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Can be an array of objects or array of strings.
|
|
17
|
+
* When using objects, will look for a text, value and disabled keys.
|
|
18
|
+
*/
|
|
19
|
+
this.items = [];
|
|
20
|
+
/**
|
|
21
|
+
* Set property of items’s text value
|
|
22
|
+
*/
|
|
23
|
+
this.itemText = "text";
|
|
24
|
+
/**
|
|
25
|
+
* Set property of items’s value - must be primitive.
|
|
26
|
+
* Dot notation is supported.
|
|
27
|
+
*/
|
|
28
|
+
this.itemValue = "value";
|
|
29
|
+
/**
|
|
30
|
+
* Set property of items’s disabled value
|
|
31
|
+
*/
|
|
32
|
+
this.itemDisabled = 'disabled';
|
|
33
|
+
/**
|
|
34
|
+
* Sizing options
|
|
35
|
+
*/
|
|
36
|
+
this.size = 'normal';
|
|
37
|
+
/**
|
|
38
|
+
* The selected value
|
|
39
|
+
*/
|
|
40
|
+
this.value = undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Enable autofocus
|
|
43
|
+
*/
|
|
44
|
+
this.autofocus = false;
|
|
45
|
+
/**
|
|
46
|
+
* Add input clear functionality, default icon is `sicon-cancel`
|
|
47
|
+
*/
|
|
48
|
+
this.clearable = false;
|
|
49
|
+
/**
|
|
50
|
+
* Applied when using clearable and the input is dirty
|
|
51
|
+
*/
|
|
52
|
+
this.clearIcon = 'sicon-cancel';
|
|
53
|
+
/**
|
|
54
|
+
* Applies specified color to the control.
|
|
55
|
+
*/
|
|
56
|
+
this.color = 'primary';
|
|
57
|
+
/**
|
|
58
|
+
* Remove elevation or box shadow.
|
|
59
|
+
*/
|
|
60
|
+
this.flat = undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Disable the input
|
|
63
|
+
*/
|
|
64
|
+
this.disabled = false;
|
|
65
|
+
/**
|
|
66
|
+
* Displays linear progress bar.
|
|
67
|
+
*/
|
|
68
|
+
this.loading = false;
|
|
69
|
+
/**
|
|
70
|
+
* Specifies which color is applied to the progress bar.
|
|
71
|
+
*/
|
|
72
|
+
this.loadingColor = 'primary';
|
|
73
|
+
/**
|
|
74
|
+
* Hint text
|
|
75
|
+
*/
|
|
76
|
+
this.hint = undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Forces hint to always be visible.
|
|
79
|
+
*/
|
|
80
|
+
this.persistHint = false;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the input’s placeholder text.
|
|
83
|
+
*/
|
|
84
|
+
this.placeholder = undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Enable multiple item selection
|
|
87
|
+
*/
|
|
88
|
+
this.multiple = false;
|
|
89
|
+
/**
|
|
90
|
+
* Enable multiple item selection
|
|
91
|
+
*/
|
|
92
|
+
this.autocomplete = false;
|
|
93
|
+
/**
|
|
94
|
+
* Enable multiple item selection
|
|
95
|
+
*/
|
|
96
|
+
this.required = false;
|
|
97
|
+
/**
|
|
98
|
+
* Changes display of selections to chips
|
|
99
|
+
*/
|
|
100
|
+
this.chips = false;
|
|
101
|
+
/**
|
|
102
|
+
* Define appearance of the component
|
|
103
|
+
*/
|
|
104
|
+
this.shape = 'outlined';
|
|
105
|
+
/**
|
|
106
|
+
* Changes the selection behavior to return the object directly
|
|
107
|
+
* rather than the value specified with item-value
|
|
108
|
+
*/
|
|
109
|
+
this.returnObject = false;
|
|
110
|
+
/**
|
|
111
|
+
* Hides hint if any
|
|
112
|
+
*/
|
|
113
|
+
this.hideDetail = false;
|
|
114
|
+
}
|
|
115
|
+
selectClass() {
|
|
116
|
+
return `s-select-field s-select-${this.shape} ${this.color} ${this.size}`;
|
|
117
|
+
}
|
|
118
|
+
onSelectedItemChange(event) {
|
|
119
|
+
let selectedIndex = event.target.selectedIndex;
|
|
120
|
+
if (selectedIndex < 0) {
|
|
121
|
+
this.value = undefined;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let selectedItem = this.items[!!this.placeholder ? selectedIndex - 1 : selectedIndex];
|
|
125
|
+
this.value = this.returnObject ? selectedItem : selectedItem[this.itemValue];
|
|
126
|
+
console.log("🚀 ~ file: salla-select.tsx ~ line 153 ~ SallaSelect ~ onSelectedItemChange ~ this.value", this.value);
|
|
127
|
+
}
|
|
128
|
+
generateHint() {
|
|
129
|
+
if (!this.persistHint && !this.value) {
|
|
130
|
+
return "";
|
|
131
|
+
}
|
|
132
|
+
return h("div", { class: "s-select-hint" }, this.hint);
|
|
133
|
+
}
|
|
134
|
+
checkForSelected(item) {
|
|
135
|
+
if (this.returnObject && !!this.value) {
|
|
136
|
+
return item[this.itemValue] = this.value[this.itemValue];
|
|
137
|
+
}
|
|
138
|
+
return item[this.itemValue] == this.value;
|
|
139
|
+
}
|
|
140
|
+
render() {
|
|
141
|
+
return (h(Host, null, !!this.label ?
|
|
142
|
+
h("label", { htmlFor: "s-select", class: "s-select-label" }, this.label)
|
|
143
|
+
: "", h("select", { multiple: this.multiple, autocomplete: this.autocomplete ? 'on' : 'off', disabled: this.disabled, autoFocus: this.autofocus, id: "s-select", class: this.selectClass(), onChange: this.onSelectedItemChange.bind(this) }, !!this.placeholder ?
|
|
144
|
+
h("option", { selected: !this.value }, this.placeholder)
|
|
145
|
+
: "", this.items.map((item) =>
|
|
146
|
+
// item instanceof Object ?
|
|
147
|
+
h("option", { label: item[this.itemText], value: item[this.itemValue], selected: this.checkForSelected(item), disabled: item[this.itemDisabled] })
|
|
148
|
+
// :
|
|
149
|
+
// <option label={item} value={item} selected={item == this.value} disabled={item == this.itemDisabled}></option>
|
|
150
|
+
)), h("div", { class: { "s-hidden": this.hideDetail } }, this.generateHint())));
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
SallaSelect.style = sallaSelectCss;
|
|
154
|
+
|
|
155
|
+
export { SallaSelect as salla_select };
|
|
@@ -16,5 +16,5 @@ const patchBrowser = () => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
|
-
return bootstrapLazy([["salla-button_10",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"translationLoaded":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"translationLoaded":[32],"open":[64],"showOffer":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[0,"salla-tel-input",{"phone":[1025],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}]]],["salla-loyalty",[[4,"salla-loyalty",{"prizePoints":[8,"prize-points"],"customerPoints":[2,"customer-points"],"prizeTitle":[1,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}]]],["salla-product-size-guide",[[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"open":[64],"close":[64]}]]],["salla-scopes",[[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"close":[64],"open":[64],"handleSubmit":[64]}]]],["salla-add-product-button",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"]}]]],["salla-rating-modal",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"translationLoaded":[32],"open":[64],"close":[64]}]]],["salla-social-share",[[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[16],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"open":[64]}]]],["salla-conditional-fields",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-product-availability",[[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}]]],["salla-swiper",[[4,"salla-swiper",{"loop":[4],"speed":[2],"itemPerView":[8,"item-per-view"],"spaceBetweenItems":[2,"space-between-items"],"currentIndex":[32],"isLastSlideItem":[32],"isFirstSlideItem":[32]}]]],["salla-rating-stars",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]],["salla-list-tile_2",[[4,"salla-list-tile",{"href":[1],"target":[1]}],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}]]],["salla-tab-content_3",[[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]]]]], options);
|
|
19
|
+
return bootstrapLazy(JSON.parse("[[\"salla-button_27\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"step1Elems\":[32],\"step2Elems\":[32],\"stepsWrapper\":[32],\"imageCover\":[32],\"textSelect\":[32],\"customTextArea\":[32],\"calendarFormGroup\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[8,\"prize-points\"],\"customerPoints\":[2,\"customer-points\"],\"prizeTitle\":[1,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[16],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"open\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[4,\"salla-quantity-input\",{\"quantity\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[0,\"salla-datetime-picker\",{\"value\":[1025],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"onChange\":[16],\"onClose\":[16],\"onDayCreate\":[16],\"onDestroy\":[16],\"onKeyDown\":[16],\"onMonthChange\":[16],\"onOpen\":[16],\"onParseConfig\":[16],\"onReady\":[16],\"onValueUpdate\":[16],\"onYearChange\":[16],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[0,\"salla-file-upload\",{\"required\":[4],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"serverConfig\":[1,\"server-config\"],\"instantUpload\":[4,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1,\"label-idle\"],\"labelInvalidField\":[1,\"label-invalid-field\"],\"labelFileWaitingForSize\":[1,\"label-file-waiting-for-size\"],\"labelFileSizeNotAvailable\":[1,\"label-file-size-not-available\"],\"labelFileLoading\":[1,\"label-file-loading\"],\"labelFileLoadError\":[1,\"label-file-load-error\"],\"labelFileProcessing\":[1,\"label-file-processing\"],\"labelFileProcessingComplete\":[1,\"label-file-processing-complete\"],\"labelFileProcessingAborted\":[1,\"label-file-processing-aborted\"],\"labelFileProcessingError\":[1,\"label-file-processing-error\"],\"labelFileProcessingRevertError\":[1,\"label-file-processing-revert-error\"],\"labelFileRemoveError\":[1,\"label-file-remove-error\"],\"labelTapToCancel\":[1,\"label-tap-to-cancel\"],\"labelTapToRetry\":[1,\"label-tap-to-retry\"],\"labelTapToUndo\":[1,\"label-tap-to-undo\"],\"labelButtonRemoveItem\":[1,\"label-button-remove-item\"],\"labelButtonAbortItemLoad\":[1,\"label-button-abort-item-load\"],\"labelButtonRetryItemLoad\":[1,\"label-button-retry-item-load\"],\"labelButtonAbortItemProcessing\":[1,\"label-button-abort-item-processing\"],\"labelButtonUndoItemProcessing\":[1,\"label-button-undo-item-processing\"],\"labelButtonRetryItemProcessing\":[1,\"label-button-retry-item-processing\"],\"labelButtonProcessItem\":[1,\"label-button-process-item\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"pond\":[32],\"files\":[32],\"appendFile\":[64]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2]}],[4,\"salla-swiper\",{\"loop\":[4],\"speed\":[2],\"itemPerView\":[8,\"item-per-view\"],\"spaceBetweenItems\":[2,\"space-between-items\"],\"currentIndex\":[32],\"isLastSlideItem\":[32],\"isFirstSlideItem\":[32]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[0,\"salla-tel-input\",{\"phone\":[1025],\"name\":[1],\"countryCode\":[1025,\"country-code\"],\"mobileRequired\":[32],\"countryCodeLabel\":[32],\"mobileLabel\":[32],\"tooShort\":[32],\"tooLong\":[32],\"invalidCountryCode\":[32],\"invalidNumber\":[32],\"errorMap\":[32],\"getValues\":[64],\"isValid\":[64]}],[4,\"salla-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]}],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}]]],[\"salla-scopes\",[[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}]]],[\"salla-add-product-button\",[[4,\"salla-add-product-button\",{\"channels\":[513],\"quantity\":[514],\"donatingAmount\":[514,\"donating-amount\"],\"productId\":[520,\"product-id\"],\"productStatus\":[513,\"product-status\"],\"productType\":[513,\"product-type\"]}]]],[\"salla-conditional-fields\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-installment\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32]}]]],[\"salla-loyalty-prize-item\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-select\",[[0,\"salla-select\",{\"label\":[1],\"items\":[16],\"itemText\":[1,\"item-text\"],\"itemValue\":[1,\"item-value\"],\"itemDisabled\":[1,\"item-disabled\"],\"size\":[1],\"value\":[1032],\"autofocus\":[4],\"clearable\":[4],\"clearIcon\":[1,\"clear-icon\"],\"color\":[1],\"flat\":[4],\"disabled\":[4],\"loading\":[4],\"loadingColor\":[1,\"loading-color\"],\"hint\":[1],\"persistHint\":[4,\"persist-hint\"],\"placeholder\":[1],\"multiple\":[4],\"autocomplete\":[4],\"required\":[4],\"chips\":[4],\"shape\":[1],\"returnObject\":[4,\"return-object\"],\"hideDetail\":[4,\"hide-detail\"]}]]]]"), options);
|
|
20
20
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,c as i,h as s,H as l}from"./p-1503d976.js";const e=class{constructor(s){t(this,s),this.prizeItemSelected=i(this,"prizeItemSelected",7)}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return s(l,null,s("div",{onClick:this.onPrizeItemClick.bind(this)},s("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),s("div",{class:"s-loyalty-prize-item-title"},this.item.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),s("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};e.style="salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{e as salla_loyalty_prize_item}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as s,h as e,H as t}from"./p-1503d976.js";import{S as l}from"./p-475ef754.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const a=class{constructor(e){s(this,e),this.translationLoaded=!1,this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.hasError=!1,this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{var s;return(null===(s=this.originalScopesList)||void 0===s?void 0:s.length)<2?"":this.mode===i.DEFAULT?salla.lang.get("blocks.scope.shopping_from_another_branch"):salla.lang.get("blocks.scope.search_for_availability_in_other_branches")},salla.event.on("scopes::open",(({mode:s=null,product_id:e=null})=>{this.open(s,e)})),salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}async close(){var s;return await(null===(s=this.modal)||void 0===s?void 0:s.close())}async open(s=i.DEFAULT,e=null){return this.setScopeValues([]),this.mode=void 0!==s&&[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.modal.open(),await salla.api.withoutNotifier((s==i.AVAILABILITY?salla.scope.getProductAvailability(e):salla.scope.get()).then((e=>{this.setScopeValues(s==i.AVAILABILITY?e.data:e.data.scopes)})).catch((s=>{console.log(s),this.hasError=!0})).finally((()=>{this.modal.stopLoading()})))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id});var s=new URL(window.location.href);s.searchParams.set("scope",this.current_scope.id),window.location.href=s.toString(),window.location.replace(s.toString())})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s.length?(this.current_scope=s[0],this.selected_scope=s[0]):(this.current_scope=s.find((s=>s.selected)),this.selected_scope=s.find((s=>s.selected)))}handleSearchFieldTyping(s){let e=s.target.value.toLocaleLowerCase();this.scopes=e?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(e))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes.find((e=>e.id==s.target.value))}placeholderContent(){return e("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},e("span",{slot:"title"},salla.lang.get("blocks.scope.branch_looking_for_not_found")),e("span",{slot:"description"},salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")))}defaultContent(){return[e("div",{class:"s-scopes-container s-scrollbar"},this.scopes.map((s=>e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),e("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},e("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return e("div",{class:"s-scopes-container"},this.scopes.map((s=>{var t,l,a,o,h,c;return e("div",{class:"s-scopes-input-wrap","data-selection":this.selection},e("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},e("span",null,s.name)),e("h2",{style:{color:null===(l=null===(t=s)||void 0===t?void 0:t.availability)||void 0===l?void 0:l.color},class:`s-scopes-${null===(o=null===(a=s)||void 0===a?void 0:a.availability)||void 0===o?void 0:o.key}`},null===(c=null===(h=s)||void 0===h?void 0:h.availability)||void 0===c?void 0:c.label))})))}footerContent(){return e("div",{class:"s-scopes-footer"},e("slot",{name:"footer"},e("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},salla.lang.get("common.elements.confirm"))))}render(){return e(t,null,e("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:!0,"has-skeleton":!0},e("div",{slot:"loading"},e("div",{class:"s-scopes-skeleton"},e("salla-list-tile",{class:"s-scopes-header"},e("div",{slot:"icon",class:"s-scopes-header-icon"},e("salla-skeleton",{type:"circle"})),e("div",{slot:"title",class:"s-scopes-header-title mb-5"},e("salla-skeleton",{height:"15px",width:"50%"})),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},e("salla-skeleton",{height:"10px"}),e("salla-skeleton",{height:"10px",width:"75%"}))),e("div",{class:"s-scopes-skeleton-search"},e("salla-skeleton",{height:"10px",width:"50%"}),e("salla-skeleton",{height:"30px",width:"100%"})),e("div",{class:"s-scopes-skeleton-scopes"},e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"}),e("salla-skeleton",{height:"10px",width:"30%"}),e("salla-skeleton",{height:"10px",width:"25%"})),e("div",{class:"s-scopes-skeleton-btn"},e("salla-skeleton",{height:"40px",width:"100%"})))),e("salla-list-tile",{class:this.originalScopesList.length?"s-scopes-header block":"s-hidden"},e("div",{slot:"icon",class:"s-scopes-header-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>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),e("div",{slot:"title",class:"s-scopes-header-title"},salla.lang.get("blocks.scope.you_are_browse_store_from")),e("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),e("div",{class:"s-scopes-wrap"},!!this.originalScopesList.length&&e("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList.length>this.searchDisplayLimit?e("div",{class:"s-scopes-search-wrapper"},e("div",{class:"s-scopes-search-icon",innerHTML:l}),e("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),enterkeyhint:"search",placeholder:salla.lang.get("blocks.scope.searching_for_a_branch")})):"",this.hasError||this.scopes.length<2?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};a.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";export{a as salla_scopes}
|