@salla.sa/twilight-components 2.9.38 → 2.9.40
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/README.md +37 -14
- package/dist/{components/salla-swiper2.js → cjs/core-c7a9fb22.js} +17 -84
- package/dist/cjs/index-1d2b3370.js +6 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{salla-button_32.cjs.entry.js → salla-button_33.cjs.entry.js} +2186 -5132
- package/dist/cjs/salla-swiper.cjs.entry.js +62 -0
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +2 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +9 -100
- package/dist/collection/components/salla-scopes/salla-scopes.js +34 -24
- package/dist/collection/components/salla-slider/salla-slider.css +173 -0
- package/dist/collection/components/salla-slider/salla-slider.js +986 -0
- package/dist/collection/global/app-dev.js +1 -1
- package/dist/components/arrow-left.js +11 -0
- package/dist/components/core.js +4959 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/salla-gifting.js +6 -5
- package/dist/components/salla-loyalty.js +4 -4
- package/dist/components/salla-offer-modal.js +23 -104
- package/dist/components/salla-scopes.js +25 -12
- package/dist/components/salla-slider.d.ts +11 -0
- package/dist/components/salla-slider.js +9 -0
- package/dist/components/salla-slider2.js +2036 -0
- package/dist/components/salla-swiper.js +84 -1
- package/dist/esm/core-572aabd0.js +4973 -0
- package/dist/esm/index-f1d446ac.js +6 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{salla-button_32.entry.js → salla-button_33.entry.js} +2025 -4972
- package/dist/esm/salla-swiper.entry.js +58 -0
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/core-572aabd0.js +4 -0
- package/dist/esm-es5/index-f1d446ac.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-button_33.entry.js +34 -0
- package/dist/esm-es5/salla-swiper.entry.js +4 -0
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-00e66d1a.system.js +4 -0
- package/dist/twilight/p-684a004a.system.entry.js +4 -0
- package/dist/twilight/p-6ed7d3a2.js +4 -0
- package/dist/twilight/p-6f94dcce.entry.js +22 -0
- package/dist/twilight/p-79eae6ae.system.entry.js +34 -0
- package/dist/twilight/p-b9c3815f.system.js +1 -1
- package/dist/twilight/p-e8c3c209.entry.js +4 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +0 -1
- package/dist/types/components/salla-scopes/salla-scopes.d.ts +1 -0
- package/dist/types/components/salla-slider/salla-slider.d.ts +149 -0
- package/dist/types/components.d.ts +146 -0
- package/package.json +4 -4
- package/dist/cjs/salla-scopes.cjs.entry.js +0 -167
- package/dist/cjs/search-b487cc49.js +0 -13
- package/dist/esm/salla-scopes.entry.js +0 -163
- package/dist/esm/search-19ea3313.js +0 -11
- package/dist/esm-es5/salla-button_32.entry.js +0 -34
- package/dist/esm-es5/salla-scopes.entry.js +0 -4
- package/dist/esm-es5/search-19ea3313.js +0 -4
- package/dist/twilight/p-475ef754.js +0 -4
- package/dist/twilight/p-6d34d337.entry.js +0 -4
- package/dist/twilight/p-9c0c939c.system.entry.js +0 -4
- package/dist/twilight/p-9cbb0f31.entry.js +0 -22
- package/dist/twilight/p-ce00c95d.system.entry.js +0 -34
- package/dist/twilight/p-fd444b25.system.js +0 -4
|
@@ -28,6 +28,7 @@ export { SallaSearch as SallaSearch } from '../types/components/salla-search/sal
|
|
|
28
28
|
export { SallaSelect as SallaSelect } from '../types/components/salla-select/salla-select';
|
|
29
29
|
export { SallaSheet as SallaSheet } from '../types/components/salla-sheet/salla-sheet';
|
|
30
30
|
export { SallaSkeleton as SallaSkeleton } from '../types/components/salla-skeleton/salla-skeleton';
|
|
31
|
+
export { SallaSwiper as SallaSlider } from '../types/components/salla-slider/salla-slider';
|
|
31
32
|
export { SallaSocialShare as SallaSocialShare } from '../types/components/salla-social-share/salla-social-share';
|
|
32
33
|
export { SallaSwiper as SallaSwiper } from '../types/components/salla-swiper/salla-swiper';
|
|
33
34
|
export { SallaTabContent as SallaTabContent } from '../types/components/salla-tabs/salla-tab-content';
|
package/dist/components/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { SallaSearch, defineCustomElement as defineCustomElementSallaSearch } fr
|
|
|
32
32
|
export { SallaSelect, defineCustomElement as defineCustomElementSallaSelect } from './salla-select.js';
|
|
33
33
|
export { SallaSheet, defineCustomElement as defineCustomElementSallaSheet } from './salla-sheet.js';
|
|
34
34
|
export { SallaSkeleton, defineCustomElement as defineCustomElementSallaSkeleton } from './salla-skeleton.js';
|
|
35
|
+
export { SallaSlider, defineCustomElement as defineCustomElementSallaSlider } from './salla-slider.js';
|
|
35
36
|
export { SallaSocialShare, defineCustomElement as defineCustomElementSallaSocialShare } from './salla-social-share.js';
|
|
36
37
|
export { SallaSwiper, defineCustomElement as defineCustomElementSallaSwiper } from './salla-swiper.js';
|
|
37
38
|
export { SallaTabContent, defineCustomElement as defineCustomElementSallaTabContent } from './salla-tab-content.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { a as anime } from './anime.es.js';
|
|
6
6
|
import { A as ArrowRightIcon } from './arrow-right.js';
|
|
7
|
-
import {
|
|
7
|
+
import { A as ArrowLeftIcon } from './arrow-left.js';
|
|
8
8
|
import { C as Cancel } from './cancel.js';
|
|
9
9
|
import { d as defineCustomElement$b } from './salla-button2.js';
|
|
10
10
|
import { d as defineCustomElement$a } from './salla-datetime-picker2.js';
|
|
@@ -14,6 +14,7 @@ import { d as defineCustomElement$7 } from './salla-loading2.js';
|
|
|
14
14
|
import { d as defineCustomElement$6 } from './salla-modal2.js';
|
|
15
15
|
import { d as defineCustomElement$5 } from './salla-placeholder2.js';
|
|
16
16
|
import { d as defineCustomElement$4 } from './salla-skeleton2.js';
|
|
17
|
+
import { d as defineCustomElement$3 } from './salla-slider2.js';
|
|
17
18
|
import { d as defineCustomElement$2 } from './salla-tel-input2.js';
|
|
18
19
|
|
|
19
20
|
const Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
@@ -371,9 +372,9 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
371
372
|
[
|
|
372
373
|
h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
|
|
373
374
|
h("div", { class: "s-gifting-steps-wrapper steps-wrapper" }, h("div", { class: "s-gifting-step-one gift-step-1" }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), h("div", { class: "s-gifting-modal-uploader anime-item" }, h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
|
|
374
|
-
h("salla-
|
|
375
|
+
h("salla-slider", { type: "carousel" }, h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
|
|
375
376
|
: ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText" }, h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage), h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
|
|
376
|
-
_b.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2" }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses() }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon :
|
|
377
|
+
_b.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2" }, h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), h("div", { class: "anime-item opacity-0" }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses() }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon : ArrowLeftIcon, onClick: () => this.goToStep1() }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
377
378
|
], h("slot", { name: "footer" })))
|
|
378
379
|
];
|
|
379
380
|
}
|
|
@@ -439,7 +440,7 @@ function defineCustomElement$1() {
|
|
|
439
440
|
if (typeof customElements === "undefined") {
|
|
440
441
|
return;
|
|
441
442
|
}
|
|
442
|
-
const components = ["salla-gifting", "salla-button", "salla-datetime-picker", "salla-file-upload", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-
|
|
443
|
+
const components = ["salla-gifting", "salla-button", "salla-datetime-picker", "salla-file-upload", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-slider", "salla-tel-input"];
|
|
443
444
|
components.forEach(tagName => { switch (tagName) {
|
|
444
445
|
case "salla-gifting":
|
|
445
446
|
if (!customElements.get(tagName)) {
|
|
@@ -486,7 +487,7 @@ function defineCustomElement$1() {
|
|
|
486
487
|
defineCustomElement$4();
|
|
487
488
|
}
|
|
488
489
|
break;
|
|
489
|
-
case "salla-
|
|
490
|
+
case "salla-slider":
|
|
490
491
|
if (!customElements.get(tagName)) {
|
|
491
492
|
defineCustomElement$3();
|
|
492
493
|
}
|
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$9 } from './salla-loading2.js';
|
|
|
10
10
|
import { d as defineCustomElement$8 } from './salla-modal2.js';
|
|
11
11
|
import { d as defineCustomElement$7 } from './salla-placeholder2.js';
|
|
12
12
|
import { d as defineCustomElement$6 } from './salla-skeleton2.js';
|
|
13
|
-
import { d as defineCustomElement$5 } from './salla-
|
|
13
|
+
import { d as defineCustomElement$5 } from './salla-slider2.js';
|
|
14
14
|
import { d as defineCustomElement$4 } from './salla-tab-content2.js';
|
|
15
15
|
import { d as defineCustomElement$3 } from './salla-tab-header2.js';
|
|
16
16
|
import { d as defineCustomElement$2 } from './salla-tabs2.js';
|
|
@@ -230,7 +230,7 @@ const SallaLoyalty$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
230
230
|
h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("div", { slot: "loading" }, h("div", { class: "s-loyalty-skeleton" }, h("salla-list-tile", { class: "s-loyalty-header" }, h("div", { slot: "icon", class: "s-loyalty-header-icon" }, h("salla-skeleton", { type: "circle", height: '6rem', width: '6rem' })), h("div", { slot: "title", class: "s-loyalty-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-loyalty-skeleton-cards" }, [...Array(3)].map(() => h("div", { class: "s-loyalty-prize-item" }, h("salla-skeleton", { height: '9rem' }), h("div", { class: "s-loyalty-prize-item-title" }, h("salla-skeleton", { height: '15px', width: '75%' })), h("div", { class: "s-loyalty-prize-item-subtitle" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-loyalty-prize-item-points" }, h("salla-skeleton", { height: '15px', width: '100px' }), h("div", { class: "s-loyalty-prize-item-check" }, h("salla-skeleton", { height: '1rem', width: '1rem', type: 'circle' })))))))), !this.hasError && !!this.loyaltyProgram ?
|
|
231
231
|
[
|
|
232
232
|
h("salla-list-tile", { id: 's-loyalty-header', class: "s-loyalty-header" }, h("div", { slot: "icon", class: "s-loyalty-header-icon", innerHTML: GiftImg }), h("div", { slot: "title", class: "s-loyalty-header-title" }, this.loyaltyProgram.prize_promotion_title), h("div", { slot: "subtitle", class: "s-loyalty-header-subtitle" }, this.loyaltyProgram.prize_promotion_description)),
|
|
233
|
-
h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => h("salla-tab-header", { slot: "header", name: prize.title }, h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize) => h("salla-tab-content", { slot: "content", name: prize.title }, h("salla-
|
|
233
|
+
h("salla-tabs", null, this.loyaltyProgram.prizes.map((prize) => h("salla-tab-header", { slot: "header", name: prize.title }, h("span", null, prize.title))), this.loyaltyProgram.prizes.map((prize) => h("salla-tab-content", { slot: "content", name: prize.title }, h("salla-slider", { class: "s-loyalty-slider", type: "carousel" }, h("div", { slot: 'items' }, prize.items.map((item) => this.prizeItem(item))))))),
|
|
234
234
|
h("salla-button", { disabled: !this.selectedItem, width: "wide", class: "s-loyalty-program-redeem-btn", onClick: () => this.openConfirmation() }, salla.lang.get('pages.loyalty_program.exchange_points')),
|
|
235
235
|
]
|
|
236
236
|
: h("salla-placeholder", { class: "s-loyalty-placeholder", alignment: "center" }, !!this.errorMessage ? h("span", { slot: "description" }, this.errorMessage) : '')),
|
|
@@ -265,7 +265,7 @@ function defineCustomElement$1() {
|
|
|
265
265
|
if (typeof customElements === "undefined") {
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
const components = ["salla-loyalty", "salla-button", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-
|
|
268
|
+
const components = ["salla-loyalty", "salla-button", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-slider", "salla-tab-content", "salla-tab-header", "salla-tabs"];
|
|
269
269
|
components.forEach(tagName => { switch (tagName) {
|
|
270
270
|
case "salla-loyalty":
|
|
271
271
|
if (!customElements.get(tagName)) {
|
|
@@ -302,7 +302,7 @@ function defineCustomElement$1() {
|
|
|
302
302
|
defineCustomElement$6();
|
|
303
303
|
}
|
|
304
304
|
break;
|
|
305
|
-
case "salla-
|
|
305
|
+
case "salla-slider":
|
|
306
306
|
if (!customElements.get(tagName)) {
|
|
307
307
|
defineCustomElement$5();
|
|
308
308
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
|
-
import {
|
|
6
|
-
import { d as defineCustomElement$6 } from './salla-
|
|
7
|
-
import { d as defineCustomElement$5 } from './salla-
|
|
8
|
-
import { d as defineCustomElement$4 } from './salla-
|
|
9
|
-
import { d as defineCustomElement$3 } from './salla-
|
|
10
|
-
import { d as defineCustomElement$2 } from './salla-
|
|
5
|
+
import { d as defineCustomElement$7 } from './salla-button2.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './salla-loading2.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './salla-modal2.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './salla-placeholder2.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './salla-skeleton2.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './salla-slider2.js';
|
|
11
11
|
|
|
12
12
|
const SpecialDiscountIcon = `<!-- Generated by IcoMoon.io -->
|
|
13
13
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
@@ -16,13 +16,6 @@ const SpecialDiscountIcon = `<!-- Generated by IcoMoon.io -->
|
|
|
16
16
|
</svg>
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
|
-
const KeyboardArrowLeftIcon = `<!-- Generated by IcoMoon.io -->
|
|
20
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
21
|
-
<title>keyboard_arrow_left</title>
|
|
22
|
-
<path d="M20.563 22.104l-1.875 1.875-8-8 8-8 1.875 1.875-6.125 6.125z"></path>
|
|
23
|
-
</svg>
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
19
|
const Tag = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27
20
|
<title>tag</title>
|
|
28
21
|
<path d="M28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>
|
|
@@ -98,9 +91,9 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
98
91
|
salla.api.withoutNotifier(() => salla.cart.quickAdd(this.productID, qty)).then(() => this.modal.close());
|
|
99
92
|
}
|
|
100
93
|
getOfferContent() {
|
|
101
|
-
var _a, _b, _c, _d;
|
|
94
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
102
95
|
if ((_a = this.offer.get.products) === null || _a === void 0 ? void 0 : _a.length) {
|
|
103
|
-
return h("
|
|
96
|
+
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_c = this.offer.get.products) === null || _c === void 0 ? void 0 : _c.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, (_d = this.offer.get.products) === null || _d === void 0 ? void 0 : _d.map(product => h("div", { class: {
|
|
104
97
|
"s-offer-modal-product": true,
|
|
105
98
|
"s-offer-modal-slider-item": true,
|
|
106
99
|
"s-offer-modal-not-available": !product.is_available
|
|
@@ -110,16 +103,16 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
110
103
|
.replace(/\{image\}/g, product.thumbnail)
|
|
111
104
|
.replace(/\{price\}/g, product.has_special_price
|
|
112
105
|
? salla.money(product.price) + '<span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
|
|
113
|
-
: salla.money(product.price)) }, h("div", { class: "s-offer-modal-btn-wrap" }, h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ? salla.lang.get('pages.cart.add_to_cart') : salla.lang.get('pages.products.out_of_stock'))))))
|
|
106
|
+
: salla.money(product.price)) }, h("div", { class: "s-offer-modal-btn-wrap" }, h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ? salla.lang.get('pages.cart.add_to_cart') : salla.lang.get('pages.products.out_of_stock')))))));
|
|
114
107
|
}
|
|
115
|
-
else if ((
|
|
116
|
-
return h("
|
|
108
|
+
else if ((_e = this.offer.get.categories) === null || _e === void 0 ? void 0 : _e.length) {
|
|
109
|
+
return h("salla-slider", { type: "carousel", class: { "s-offer-modal-slider-centered": ((_f = this.offer.get.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2, "s-offer-modal-slider": true }, "show-controls": ((_g = this.offer.get.categories) === null || _g === void 0 ? void 0 : _g.length) <= 2 ? 'false' : 'true' }, h("div", { slot: 'items' }, this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item", innerHTML: this.categorySlot
|
|
117
110
|
.replace(/\{tagIcon\}/g, Tag)
|
|
118
111
|
.replace(/\{name\}/g, category.name)
|
|
119
|
-
.replace(/\{url\}/g, category.urls.customer) })))
|
|
112
|
+
.replace(/\{url\}/g, category.urls.customer) }))));
|
|
120
113
|
}
|
|
121
114
|
else if (this.offer.get.discounts_table) {
|
|
122
|
-
return h("div", { class: "s-offer-modal-discount-table" }, h("table", null, h("tbody", null, (
|
|
115
|
+
return h("div", { class: "s-offer-modal-discount-table" }, h("table", null, h("tbody", null, (_h = this.offer.get.discounts_table) === null || _h === void 0 ? void 0 : _h.map(discount => h("tr", null, h("td", null, discount.text), h("td", { class: "s-offer-modal-discount-table-cell" }, h("salla-button", { fill: "outline", shape: "btn", color: "primary", size: "medium", width: "normal", onClick: () => this.addToCart(discount.quantity) }, this.addToCartLabel)))))));
|
|
123
116
|
}
|
|
124
117
|
}
|
|
125
118
|
//todo:: pass event then use sallaButton from it
|
|
@@ -145,85 +138,6 @@ const SallaOfferModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
145
138
|
] :
|
|
146
139
|
h("salla-placeholder", { class: "s-loyalty-placeholder", alignment: "center" }, !!this.errorMessage ? h("span", { slot: "description" }, this.errorMessage) : ''));
|
|
147
140
|
}
|
|
148
|
-
componentDidRender() {
|
|
149
|
-
// Sooo mini Slider
|
|
150
|
-
var _a, _b, _c, _d, _e, _f;
|
|
151
|
-
if (this.offer && (((_a = this.offer.get.products) === null || _a === void 0 ? void 0 : _a.length) || ((_b = this.offer.get.categories) === null || _b === void 0 ? void 0 : _b.length)) && window.screen.width > 639) {
|
|
152
|
-
let sliderWrap = this.modal.querySelector('.s-offer-modal-scrolled-slider-wrap'), slider = this.modal.querySelector('.s-offer-modal-scrolled-slider'), navButtons = this.modal.querySelectorAll('.s-offer-modal-nav-btn'), nexBtn = this.modal.querySelector('.s-offer-modal-next-btn'), prevBtn = this.modal.querySelector('.s-offer-modal-prev-btn'), items = this.modal.querySelectorAll('.s-offer-modal-slider-item'), sliderNavMargin = 20, // space before displaying the next/prev btns.
|
|
153
|
-
current = 0, // current slide
|
|
154
|
-
slidesToScroll = 3, itemsLength = items.length, isDown = false, startX, scrollLeft;
|
|
155
|
-
slider.addEventListener('mousedown', (e) => {
|
|
156
|
-
isDown = true;
|
|
157
|
-
slider.classList.add('scrolling');
|
|
158
|
-
startX = e.pageX - slider.offsetLeft;
|
|
159
|
-
scrollLeft = slider.scrollLeft;
|
|
160
|
-
});
|
|
161
|
-
slider.addEventListener('mouseleave', () => {
|
|
162
|
-
isDown = false;
|
|
163
|
-
slider.classList.remove('scrolling');
|
|
164
|
-
items.forEach(item => {
|
|
165
|
-
item.querySelector('a').removeAttribute('disabled');
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
slider.addEventListener('mouseup', () => {
|
|
169
|
-
isDown = false;
|
|
170
|
-
slider.classList.remove('scrolling');
|
|
171
|
-
items.forEach(item => {
|
|
172
|
-
item.querySelector('a').removeAttribute('disabled');
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
slider.addEventListener('mousemove', (e) => {
|
|
176
|
-
if (!isDown)
|
|
177
|
-
return;
|
|
178
|
-
e.preventDefault();
|
|
179
|
-
const x = e.pageX - slider.offsetLeft;
|
|
180
|
-
const walk = (x - startX) * 2;
|
|
181
|
-
slider.scrollLeft = scrollLeft - walk;
|
|
182
|
-
items.forEach(item => {
|
|
183
|
-
item.querySelector('a').setAttribute('disabled', 'true');
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
console.log('items[0]:', items[0]);
|
|
187
|
-
let itemSize = items[0].offsetWidth, sliderSize = itemsLength * itemSize, sliderWrapperSize = sliderWrap.offsetWidth, sliderInvisibleSize = sliderSize - sliderWrapperSize, isRTL = document.body.classList.contains('rtl') ? true : false;
|
|
188
|
-
if (sliderInvisibleSize > sliderNavMargin)
|
|
189
|
-
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
190
|
-
if (((_d = (_c = this.offer.get) === null || _c === void 0 ? void 0 : _c.products) === null || _d === void 0 ? void 0 : _d.length) <= 2 || ((_f = (_e = this.offer.get) === null || _e === void 0 ? void 0 : _e.categories) === null || _f === void 0 ? void 0 : _f.length) <= 2)
|
|
191
|
-
slider.classList.add('s-offer-modal-slider-centered');
|
|
192
|
-
window.onresize = function () {
|
|
193
|
-
sliderWrapperSize = sliderWrap.offsetWidth;
|
|
194
|
-
sliderInvisibleSize = sliderSize - sliderWrapperSize;
|
|
195
|
-
};
|
|
196
|
-
slider.addEventListener('scroll', function () {
|
|
197
|
-
let sliderPosition = Math.abs(slider.scrollLeft);
|
|
198
|
-
let sliderEndOffset = sliderInvisibleSize - sliderNavMargin;
|
|
199
|
-
// show & hide the navigation btns depending on scroll position
|
|
200
|
-
if (sliderPosition <= sliderNavMargin) {
|
|
201
|
-
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
202
|
-
prevBtn.classList.remove('s-offer-modal-btn-is-active');
|
|
203
|
-
}
|
|
204
|
-
else if (sliderPosition < sliderEndOffset) {
|
|
205
|
-
// show both btns in the middle
|
|
206
|
-
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
207
|
-
prevBtn.classList.add('s-offer-modal-btn-is-active');
|
|
208
|
-
}
|
|
209
|
-
else if (sliderPosition >= sliderEndOffset) {
|
|
210
|
-
nexBtn.classList.remove('s-offer-modal-btn-is-active');
|
|
211
|
-
prevBtn.classList.add('s-offer-modal-btn-is-active');
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
// Navigation
|
|
215
|
-
navButtons.forEach(btn => {
|
|
216
|
-
btn.addEventListener('click', function () {
|
|
217
|
-
btn.classList.contains('s-offer-modal-next-btn') ? current++ : current--;
|
|
218
|
-
slider.scrollTo({
|
|
219
|
-
top: 0,
|
|
220
|
-
left: itemSize * slidesToScroll * current * (isRTL ? -1 : 1),
|
|
221
|
-
behavior: 'smooth'
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
141
|
get host() { return this; }
|
|
228
142
|
static get style() { return sallaOfferModalCss; }
|
|
229
143
|
}, [0, "salla-offer-modal", {
|
|
@@ -242,7 +156,7 @@ function defineCustomElement$1() {
|
|
|
242
156
|
if (typeof customElements === "undefined") {
|
|
243
157
|
return;
|
|
244
158
|
}
|
|
245
|
-
const components = ["salla-offer-modal", "salla-button", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton"];
|
|
159
|
+
const components = ["salla-offer-modal", "salla-button", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-slider"];
|
|
246
160
|
components.forEach(tagName => { switch (tagName) {
|
|
247
161
|
case "salla-offer-modal":
|
|
248
162
|
if (!customElements.get(tagName)) {
|
|
@@ -251,25 +165,30 @@ function defineCustomElement$1() {
|
|
|
251
165
|
break;
|
|
252
166
|
case "salla-button":
|
|
253
167
|
if (!customElements.get(tagName)) {
|
|
254
|
-
defineCustomElement$
|
|
168
|
+
defineCustomElement$7();
|
|
255
169
|
}
|
|
256
170
|
break;
|
|
257
171
|
case "salla-loading":
|
|
258
172
|
if (!customElements.get(tagName)) {
|
|
259
|
-
defineCustomElement$
|
|
173
|
+
defineCustomElement$6();
|
|
260
174
|
}
|
|
261
175
|
break;
|
|
262
176
|
case "salla-modal":
|
|
263
177
|
if (!customElements.get(tagName)) {
|
|
264
|
-
defineCustomElement$
|
|
178
|
+
defineCustomElement$5();
|
|
265
179
|
}
|
|
266
180
|
break;
|
|
267
181
|
case "salla-placeholder":
|
|
268
182
|
if (!customElements.get(tagName)) {
|
|
269
|
-
defineCustomElement$
|
|
183
|
+
defineCustomElement$4();
|
|
270
184
|
}
|
|
271
185
|
break;
|
|
272
186
|
case "salla-skeleton":
|
|
187
|
+
if (!customElements.get(tagName)) {
|
|
188
|
+
defineCustomElement$3();
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
case "salla-slider":
|
|
273
192
|
if (!customElements.get(tagName)) {
|
|
274
193
|
defineCustomElement$2();
|
|
275
194
|
}
|
|
@@ -35,6 +35,7 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
35
35
|
this.originalScopesList = [];
|
|
36
36
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
37
37
|
this.hasError = false;
|
|
38
|
+
this.loading = false;
|
|
38
39
|
/**
|
|
39
40
|
* Optionally open the modal or enforce the pop-up to the viewer
|
|
40
41
|
*/
|
|
@@ -69,6 +70,7 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
69
70
|
* Opens the scope modal.
|
|
70
71
|
*/
|
|
71
72
|
async open(mode = ModeType.DEFAULT, product_id = null) {
|
|
73
|
+
this.loading = true;
|
|
72
74
|
this.setScopeValues([]);
|
|
73
75
|
if (typeof mode !== 'undefined' && [ModeType.AVAILABILITY, ModeType.DEFAULT].includes(mode)) {
|
|
74
76
|
this.mode = mode;
|
|
@@ -89,7 +91,10 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
89
91
|
console.log(e);
|
|
90
92
|
this.hasError = true;
|
|
91
93
|
})
|
|
92
|
-
.finally(() =>
|
|
94
|
+
.finally(() => {
|
|
95
|
+
this.modal.stopLoading();
|
|
96
|
+
this.loading = false;
|
|
97
|
+
});
|
|
93
98
|
}
|
|
94
99
|
/**
|
|
95
100
|
* Submit form to change exsiting scope.
|
|
@@ -116,13 +121,13 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
116
121
|
setScopeValues(value) {
|
|
117
122
|
this.scopes = value;
|
|
118
123
|
this.originalScopesList = value;
|
|
119
|
-
if (value.length == 1) {
|
|
124
|
+
if ((value === null || value === void 0 ? void 0 : value.length) == 1) {
|
|
120
125
|
this.current_scope = value[0];
|
|
121
126
|
this.selected_scope = value[0];
|
|
122
127
|
}
|
|
123
128
|
else {
|
|
124
|
-
this.current_scope = value.find(scope => scope.selected);
|
|
125
|
-
this.selected_scope = value.find(scope => scope.selected);
|
|
129
|
+
this.current_scope = value === null || value === void 0 ? void 0 : value.find(scope => scope.selected);
|
|
130
|
+
this.selected_scope = value === null || value === void 0 ? void 0 : value.find(scope => scope.selected);
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
133
|
handleSearchFieldTyping(e) {
|
|
@@ -135,16 +140,19 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
135
140
|
}
|
|
136
141
|
}
|
|
137
142
|
handleScopeSelection(event) {
|
|
138
|
-
|
|
143
|
+
var _a;
|
|
144
|
+
this.current_scope = (_a = this.scopes) === null || _a === void 0 ? void 0 : _a.find(scope => scope.id == event.target.value);
|
|
139
145
|
}
|
|
140
146
|
placeholderContent() {
|
|
141
147
|
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, salla.lang.get("blocks.scope.branch_looking_for_not_found")), h("span", { slot: "description" }, salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")));
|
|
142
148
|
}
|
|
143
149
|
defaultContent() {
|
|
144
|
-
|
|
150
|
+
var _a;
|
|
151
|
+
return [h("div", { class: "s-scopes-container s-scrollbar" }, (_a = this.scopes) === null || _a === void 0 ? void 0 : _a.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.name))))), this.footerContent()];
|
|
145
152
|
}
|
|
146
153
|
availabilityContent() {
|
|
147
|
-
|
|
154
|
+
var _a;
|
|
155
|
+
return h("div", { class: "s-scopes-container" }, (_a = this.scopes) === null || _a === void 0 ? void 0 : _a.map((scope) => {
|
|
148
156
|
var _a, _b, _c, _d, _e, _f;
|
|
149
157
|
return h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.mode === ModeType.DEFAULT } }, h("span", null, scope.name)), h("h2", { style: { 'color': (_b = (_a = scope) === null || _a === void 0 ? void 0 : _a.availability) === null || _b === void 0 ? void 0 : _b.color }, class: `s-scopes-${(_d = (_c = scope) === null || _c === void 0 ? void 0 : _c.availability) === null || _d === void 0 ? void 0 : _d.key}` }, (_f = (_e = scope) === null || _e === void 0 ? void 0 : _e.availability) === null || _f === void 0 ? void 0 : _f.label));
|
|
150
158
|
}));
|
|
@@ -153,11 +161,15 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
153
161
|
return h("div", { class: "s-scopes-footer" }, h("slot", { name: "footer" }, h("salla-button", { ref: btn => this.changeBtn = btn, disabled: !this.current_scope, onClick: () => this.handleSubmit(), class: "s-scopes-submit", "loader-position": "center", width: "wide" }, salla.lang.get('common.elements.confirm'))));
|
|
154
162
|
}
|
|
155
163
|
render() {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
: "",
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
var _a, _b, _c, _d;
|
|
165
|
+
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 }, this.loading ?
|
|
166
|
+
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%' }))))
|
|
167
|
+
:
|
|
168
|
+
[h("salla-list-tile", { class: ((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.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" }, !!((_b = this.originalScopesList) === null || _b === void 0 ? void 0 : _b.length) && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), ((_c = this.originalScopesList) === null || _c === void 0 ? void 0 : _c.length) > this.searchDisplayLimit ?
|
|
169
|
+
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') }))
|
|
170
|
+
: "", this.hasError || ((_d = this.scopes) === null || _d === void 0 ? void 0 : _d.length) < 2 ?
|
|
171
|
+
this.placeholderContent()
|
|
172
|
+
: this.mode === ModeType.DEFAULT ? this.defaultContent() : this.availabilityContent())])));
|
|
161
173
|
}
|
|
162
174
|
componentDidLoad() {
|
|
163
175
|
if (!this.isOpenedBefore && this.selection == 'mandatory') {
|
|
@@ -176,6 +188,7 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
176
188
|
"selected_scope": [32],
|
|
177
189
|
"isOpenedBefore": [32],
|
|
178
190
|
"hasError": [32],
|
|
191
|
+
"loading": [32],
|
|
179
192
|
"close": [64],
|
|
180
193
|
"open": [64],
|
|
181
194
|
"handleSubmit": [64]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SallaSlider extends Components.SallaSlider, HTMLElement {}
|
|
4
|
+
export const SallaSlider: {
|
|
5
|
+
prototype: SallaSlider;
|
|
6
|
+
new (): SallaSlider;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|