@salla.sa/twilight-components 1.0.53 → 1.0.55
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/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-button.cjs.entry.js +43 -27
- package/dist/cjs/{salla-login-modal-54cc2e83.js → salla-login-modal-d0fb6180.js} +5 -5
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -4
- package/dist/cjs/salla-tel-input.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify-modal.cjs.entry.js +6 -6
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/components/salla-button/salla-button.css +42 -10
- package/dist/collection/components/salla-button/salla-button.js +125 -51
- package/dist/collection/components/salla-login-modal/salla-login-modal.css +5 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +5 -5
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +3 -4
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +2 -2
- package/dist/collection/components/salla-verify-modal/salla-verify-modal.css +4 -0
- package/dist/collection/components/salla-verify-modal/salla-verify-modal.js +5 -5
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button.entry.js +43 -27
- package/dist/esm/{salla-login-modal-473768a6.js → salla-login-modal-63f03766.js} +5 -5
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +3 -4
- package/dist/esm/salla-tel-input.entry.js +2 -2
- package/dist/esm/salla-verify-modal.entry.js +6 -6
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/index.esm.js +1 -1
- package/dist/twilight-components/p-05574321.entry.js +1 -0
- package/dist/twilight-components/p-635c08a7.entry.js +1 -0
- package/dist/twilight-components/p-646fbb7f.entry.js +1 -0
- package/dist/twilight-components/{p-105af48d.entry.js → p-79ab1ed9.entry.js} +1 -1
- package/dist/twilight-components/{p-10ea748b.js → p-88dce1e4.js} +1 -1
- package/dist/twilight-components/p-a26e2e12.entry.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +22 -11
- package/dist/types/components.d.ts +40 -16
- package/package.json +1 -1
- package/dist/twilight-components/p-17ebe444.entry.js +0 -1
- package/dist/twilight-components/p-669a9b08.entry.js +0 -1
- package/dist/twilight-components/p-78b10bac.entry.js +0 -1
- package/dist/twilight-components/p-f0f51a3c.entry.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const sallaLoginModal = require('./salla-login-modal-
|
|
5
|
+
const sallaLoginModal = require('./salla-login-modal-d0fb6180.js');
|
|
6
6
|
const sallaSearch = require('./salla-search-f76c6d61.js');
|
|
7
7
|
require('./index-0b5b5867.js');
|
|
8
8
|
require('./Helper-98cc9f18.js');
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"
|
|
17
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"buttonType":[513,"button-type"],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"title":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"show":[64],"showOffer":[64]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -4,23 +4,32 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
6
|
|
|
7
|
-
const sallaButtonCss = "salla-button{pointer-events:none}salla-button[type=submit]{-webkit-appearance:none}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-text{opacity:0}.s-button-wrap .s-button-
|
|
7
|
+
const sallaButtonCss = "salla-button{pointer-events:none}salla-button[type=submit]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-right:40px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:40px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";
|
|
8
8
|
|
|
9
9
|
const SallaButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
+
this.hostAttributes = {};
|
|
13
|
+
/**
|
|
14
|
+
* Button Type
|
|
15
|
+
*/
|
|
16
|
+
this.buttonType = 'btn';
|
|
17
|
+
/**
|
|
18
|
+
* Button Color
|
|
19
|
+
*/
|
|
20
|
+
this.color = 'primary';
|
|
12
21
|
/**
|
|
13
|
-
* Button
|
|
22
|
+
* Button Fill
|
|
14
23
|
*/
|
|
15
|
-
this.
|
|
24
|
+
this.fill = 'solid';
|
|
16
25
|
/**
|
|
17
|
-
*
|
|
26
|
+
* Button Size
|
|
18
27
|
*/
|
|
19
|
-
this.
|
|
28
|
+
this.size = 'medium';
|
|
20
29
|
/**
|
|
21
|
-
*
|
|
30
|
+
* Button Width
|
|
22
31
|
*/
|
|
23
|
-
this.
|
|
32
|
+
this.width = 'normal';
|
|
24
33
|
/**
|
|
25
34
|
* Is the button currently loading
|
|
26
35
|
*/
|
|
@@ -37,18 +46,6 @@ const SallaButton = class {
|
|
|
37
46
|
* Is the button wide
|
|
38
47
|
*/
|
|
39
48
|
this.wide = false;
|
|
40
|
-
this.hostAttributes = {};
|
|
41
|
-
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
42
|
-
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
43
|
-
}
|
|
44
|
-
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
45
|
-
this.hostAttributes.class +=
|
|
46
|
-
(this.icon ? ' s-button-icon s-button-loader-center' : ' s-button-btn ' + 's-button-loader-' + this.loaderPosition)
|
|
47
|
-
+ (this.wide ? ' s-button-wide ' : '')
|
|
48
|
-
+ (this.disabled ? ' s-button-disabled ' : ' s-button-' + this.btnStyle)
|
|
49
|
-
+ (this.miniIcon ? ' s-button-mini-icon ' : '');
|
|
50
|
-
delete this.hostAttributes['btn-style'];
|
|
51
|
-
delete this.hostAttributes['id'];
|
|
52
49
|
if (this.wide) {
|
|
53
50
|
this.host.classList.add('s-button-wide');
|
|
54
51
|
}
|
|
@@ -84,27 +81,46 @@ const SallaButton = class {
|
|
|
84
81
|
*/
|
|
85
82
|
async disable() {
|
|
86
83
|
this.host.setAttribute('disabled', '');
|
|
84
|
+
return this.host;
|
|
87
85
|
}
|
|
88
86
|
/**
|
|
89
87
|
* Remove `disabled` attribute
|
|
90
88
|
*/
|
|
91
89
|
async enable() {
|
|
92
90
|
this.host.removeAttribute('disabled');
|
|
91
|
+
return this.host;
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
getBtnAttributes() {
|
|
94
|
+
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
95
|
+
if (!['type', 'color', 'fill', 'size', 'width', 'id', 'loading'].includes(this.host.attributes[i].name)) {
|
|
96
|
+
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
100
|
+
this.hostAttributes.class +=
|
|
101
|
+
' s-button-element s-button-' + this.buttonType
|
|
102
|
+
+ ' s-button-' + (this.fill == "none" ? 'fill-none' : this.fill)
|
|
103
|
+
+ (this.size != "medium" ? ' s-button-' + this.size : '')
|
|
104
|
+
+ (this.width != "normal" ? ' s-button-' + this.width : '')
|
|
105
|
+
+ (this.buttonType == "link" ? ' s-button-' + this.color + '-link' : '')
|
|
106
|
+
+ (this.buttonType != "link" && this.fill != 'outline' ? ' s-button-' + this.color : '')
|
|
107
|
+
+ (this.fill == 'outline' ? ' s-button-' + this.color + '-outline' : '')
|
|
108
|
+
+ (this.disabled ? ' s-button-disabled ' : '')
|
|
109
|
+
+ (this.buttonType == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
|
|
110
|
+
return this.hostAttributes;
|
|
98
111
|
}
|
|
112
|
+
// @Watch('btnStyle')
|
|
113
|
+
// handleVisible(newKind: string, oldKind: string) {
|
|
114
|
+
// //todo::use united styles
|
|
115
|
+
// this.btn.classList.remove('btn-' + oldKind);
|
|
116
|
+
// this.btn.classList.add('btn-' + newKind);
|
|
117
|
+
// }
|
|
99
118
|
render() {
|
|
100
119
|
return (
|
|
101
120
|
//TODO:: use HOST then fake button behaviours
|
|
102
|
-
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({
|
|
121
|
+
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : '')));
|
|
103
122
|
}
|
|
104
123
|
get host() { return index.getElement(this); }
|
|
105
|
-
static get watchers() { return {
|
|
106
|
-
"btnStyle": ["handleVisible"]
|
|
107
|
-
}; }
|
|
108
124
|
};
|
|
109
125
|
SallaButton.style = sallaButtonCss;
|
|
110
126
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const index = require('./index-0b5b5867.js');
|
|
4
4
|
const Helper = require('./Helper-98cc9f18.js');
|
|
5
5
|
|
|
6
|
-
const sallaLoginModalCss = "";
|
|
6
|
+
const sallaLoginModalCss = "[dir=ltr] #salla-login .s-login-modal-main-btn .arrow{display:inline-block;transform:scale(-1)}";
|
|
7
7
|
|
|
8
8
|
const SallaLoginModal = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -190,12 +190,12 @@ const SallaLoginModal = class {
|
|
|
190
190
|
}
|
|
191
191
|
render() {
|
|
192
192
|
return (index.h("salla-modal", { id: "salla-login", icon: "sicon-user", title: this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("div", { class: "s-login-modal-wrapper" }, this.isEmailAllowed && this.isMobileAllowed ?
|
|
193
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, this.loginTypeTitle), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.smsLabel), index.h("i", { class: "
|
|
193
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, this.loginTypeTitle), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.smsLabel), index.h("i", { class: "sicon-keyboard_arrow_left arrow" })), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-mail" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.emailLabel), index.h("i", { class: "sicon-keyboard_arrow_left arrow" })), index.h("slot", { name: "after-login-type" }))
|
|
194
194
|
: '', this.isMobileAllowed ?
|
|
195
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center',
|
|
195
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter')), this.isEmailAllowed ?
|
|
196
196
|
index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, this.byEmailText) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
|
|
197
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center',
|
|
198
|
-
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText) : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("label", { class: "s-login-modal-label" }, this.firstNameLabel), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("label", { class: "s-login-modal-label" }, this.lastNameLabel), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center',
|
|
197
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter')), this.isMobileAllowed ?
|
|
198
|
+
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText) : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("label", { class: "s-login-modal-label" }, this.firstNameLabel), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("label", { class: "s-login-modal-label" }, this.lastNameLabel), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
|
|
199
199
|
}
|
|
200
200
|
get host() { return index.getElement(this); }
|
|
201
201
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const sallaLoginModal = require('./salla-login-modal-
|
|
5
|
+
const sallaLoginModal = require('./salla-login-modal-d0fb6180.js');
|
|
6
6
|
require('./index-0b5b5867.js');
|
|
7
7
|
require('./Helper-98cc9f18.js');
|
|
8
8
|
|
|
@@ -21,13 +21,12 @@ const SallaOfferModal = class {
|
|
|
21
21
|
});
|
|
22
22
|
this.categorySlot = ((_a = Helper.Helper.getElement('[slot="category"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<i class="s-offer-modal-badge-icon sicon-tag"></i><span class="s-offer-modal-badge-text">{name}</span>';
|
|
23
23
|
this.productSlot = ((_b = Helper.Helper.getElement('[slot="product"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || this.defaultProductSlot();
|
|
24
|
-
salla.offer.event.onExisted(
|
|
25
|
-
|
|
26
|
-
if (salla.storage.get('remember-offer-' + data.offer.offer_id)) {
|
|
24
|
+
salla.offer.event.onExisted(offer => {
|
|
25
|
+
if (salla.storage.get('remember-offer-' + offer.id)) {
|
|
27
26
|
salla.log('User selected to don\'t show this offer again.');
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
this.show(
|
|
29
|
+
this.show(offer.product_id);
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
@@ -1438,7 +1438,7 @@ const SallaTelInput = class {
|
|
|
1438
1438
|
return false;
|
|
1439
1439
|
}
|
|
1440
1440
|
initTelInput() {
|
|
1441
|
-
salla.helpers.
|
|
1441
|
+
salla.helpers.inputDigitsOnly(this.phoneInput);
|
|
1442
1442
|
this.iti = intlTelInput(this.phoneInput, {
|
|
1443
1443
|
initialCountry: this.countryCode || 'sa',
|
|
1444
1444
|
preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'sy', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],
|
|
@@ -1456,7 +1456,7 @@ const SallaTelInput = class {
|
|
|
1456
1456
|
this.phoneInput.addEventListener('blur', () => this.isValid());
|
|
1457
1457
|
// on keyup / change flag: reset
|
|
1458
1458
|
this.phoneInput.addEventListener('input', e => {
|
|
1459
|
-
salla.helpers.
|
|
1459
|
+
salla.helpers.inputDigitsOnly(e.target);
|
|
1460
1460
|
this.reset();
|
|
1461
1461
|
});
|
|
1462
1462
|
}
|
|
@@ -5,12 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
6
|
const Helper = require('./Helper-98cc9f18.js');
|
|
7
7
|
|
|
8
|
-
const sallaVerifyModalCss = "salla-verify-modal{display:block}";
|
|
8
|
+
const sallaVerifyModalCss = "salla-verify-modal{display:block}[dir=ltr] #s-verify-modal .s-verify-modal-back{transform:scale(-1)}";
|
|
9
9
|
|
|
10
10
|
const SallaVerifyModal = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.verified = index.createEvent(this, "verified", 7);
|
|
14
|
+
// Helper.setHost(this.host);
|
|
14
15
|
this.initiated = false;
|
|
15
16
|
/**
|
|
16
17
|
* Verifying method
|
|
@@ -20,7 +21,6 @@ const SallaVerifyModal = class {
|
|
|
20
21
|
* should auto reloading the page after success verification
|
|
21
22
|
*/
|
|
22
23
|
this.autoReload = true;
|
|
23
|
-
Helper.Helper.setHost(this.host);
|
|
24
24
|
if (this.withoutModal) {
|
|
25
25
|
this.modal = { show: () => '', hide: () => '' };
|
|
26
26
|
}
|
|
@@ -53,7 +53,7 @@ const SallaVerifyModal = class {
|
|
|
53
53
|
this.resendTimer();
|
|
54
54
|
this.otpInputs = this.host.querySelectorAll('.s-verify-modal-input');
|
|
55
55
|
if (!this.initiated) {
|
|
56
|
-
Helper.Helper.on('input', '.s-verify-modal-input', e => salla.helpers.
|
|
56
|
+
Helper.Helper.on('input', '.s-verify-modal-input', e => salla.helpers.inputDigitsOnly(e.target));
|
|
57
57
|
Helper.Helper.onKeyUp('.s-verify-modal-input', event => {
|
|
58
58
|
var _a, _b, _c, _d;
|
|
59
59
|
let key = event.keyCode || event.charCode;
|
|
@@ -68,7 +68,7 @@ const SallaVerifyModal = class {
|
|
|
68
68
|
this.toggleOTPSubmit();
|
|
69
69
|
});
|
|
70
70
|
Helper.Helper.on('paste', '.s-verify-modal-input', event => {
|
|
71
|
-
let text = event.clipboardData.getData('text')
|
|
71
|
+
let text = salla.helpers.number(event.clipboardData.getData('text')).replace(/[^0-9.]/g, '').replace('..', '.');
|
|
72
72
|
this.otpInputs.forEach((input, i) => input.value = text[i] || '');
|
|
73
73
|
this.toggleOTPSubmit();
|
|
74
74
|
setTimeout(() => this.otpInputs[3].focus(), 100);
|
|
@@ -135,11 +135,11 @@ const SallaVerifyModal = class {
|
|
|
135
135
|
.catch(() => this.btn.stop() && this.btn.enable() && this.reset());
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
return this.withoutModal ? this.myBody() :
|
|
138
|
+
return this.withoutModal ? index.h(index.Host, null, this.myBody()) :
|
|
139
139
|
index.h("salla-modal", { icon: "sicon-android-phone", width: "xs", id: "s-verify-modal", ref: modal => this.modal = modal, title: this.title }, this.myBody());
|
|
140
140
|
}
|
|
141
141
|
myBody() {
|
|
142
|
-
return (index.h(
|
|
142
|
+
return (index.h("div", { id: "s-verify-modal" }, index.h("div", { class: "s-verify-modal-message", innerHTML: salla.lang.get('pages.profile.verify_message') }), index.h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }), index.h("div", { class: "s-verify-modal-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => index.h("input", { type: "text", maxlength: "1", class: "s-verify-modal-input", required: true }))), index.h("div", { slot: "footer", class: "s-verify-modal-footer" }, index.h("salla-button", { class: "s-verify-modal-submit", "loader-position": 'center', disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')), index.h("p", { class: "s-verify-modal-resend-message", ref: el => this.resendMessage = el }, salla.lang.get('blocks.header.resend_after'), index.h("b", { class: "s-verify-modal-timer", ref: el => this.timer = el })), index.h("a", { href: "#", class: "s-verify-modal-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit'))), index.h("slot", { name: "after-footer" })));
|
|
143
143
|
}
|
|
144
144
|
get host() { return index.getElement(this); }
|
|
145
145
|
};
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"
|
|
18
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"buttonType":[513,"button-type"],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"title":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"show":[64],"showOffer":[64]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
|
|
19
19
|
});
|
|
@@ -17,19 +17,56 @@ salla-button {
|
|
|
17
17
|
salla-button[type=submit] {
|
|
18
18
|
-webkit-appearance: none;
|
|
19
19
|
}
|
|
20
|
+
salla-button[width=wide] {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
20
23
|
|
|
21
24
|
.s-button-wrap[loading] {
|
|
22
25
|
pointer-events: none;
|
|
23
26
|
}
|
|
24
|
-
.s-button-wrap[loading] .s-button-
|
|
27
|
+
.s-button-wrap[loading] .s-button-element {
|
|
28
|
+
pointer-events: none !important;
|
|
29
|
+
}
|
|
30
|
+
.s-button-wrap[loading] .s-button-loader-center .s-button-text {
|
|
25
31
|
opacity: 0;
|
|
26
32
|
}
|
|
27
|
-
.s-button-wrap .s-button-
|
|
33
|
+
.s-button-wrap .s-button-element[loading] {
|
|
34
|
+
pointer-events: none !important;
|
|
35
|
+
}
|
|
36
|
+
.s-button-wrap .s-button-element:not(:disabled) {
|
|
28
37
|
pointer-events: auto;
|
|
29
38
|
}
|
|
39
|
+
.s-button-wrap .s-button-solid .s-button-loader:before {
|
|
40
|
+
border-color: #fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2);
|
|
41
|
+
}
|
|
42
|
+
.s-button-wrap .s-button-outline {
|
|
43
|
+
border: 1px solid currentColor;
|
|
44
|
+
}
|
|
45
|
+
.s-button-wrap .s-button-outline:hover {
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
.s-button-wrap .s-button-outline .s-button-loader:before {
|
|
49
|
+
border-top-color: currentColor;
|
|
50
|
+
border-left-color: currentColor;
|
|
51
|
+
}
|
|
52
|
+
.s-button-wrap .s-button-icon.s-button-large {
|
|
53
|
+
width: 56px;
|
|
54
|
+
height: 56px;
|
|
55
|
+
}
|
|
56
|
+
.s-button-wrap .s-button-icon.s-button-small {
|
|
57
|
+
width: 24px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
}
|
|
60
|
+
.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before {
|
|
61
|
+
width: 0.85rem;
|
|
62
|
+
height: 0.85rem;
|
|
63
|
+
}
|
|
30
64
|
.s-button-wrap .s-button-loader-after .s-button-load {
|
|
31
65
|
flex-direction: row;
|
|
32
66
|
}
|
|
67
|
+
.s-button-wrap .s-button-loader-start.s-button-element {
|
|
68
|
+
padding-right: 40px;
|
|
69
|
+
}
|
|
33
70
|
.s-button-wrap .s-button-loader-start .s-button-loader {
|
|
34
71
|
position: absolute;
|
|
35
72
|
right: 8px;
|
|
@@ -38,6 +75,9 @@ salla-button[type=submit] {
|
|
|
38
75
|
left: 8px;
|
|
39
76
|
right: auto;
|
|
40
77
|
}
|
|
78
|
+
.s-button-wrap .s-button-loader-end.s-button-element {
|
|
79
|
+
padding-left: 40px;
|
|
80
|
+
}
|
|
41
81
|
.s-button-wrap .s-button-loader-end .s-button-loader {
|
|
42
82
|
position: absolute;
|
|
43
83
|
left: 8px;
|
|
@@ -52,12 +92,4 @@ salla-button[type=submit] {
|
|
|
52
92
|
left: 50%;
|
|
53
93
|
transform: translateY(-50%) translateX(-50%);
|
|
54
94
|
margin: 0 !important;
|
|
55
|
-
}
|
|
56
|
-
.s-button-wrap .s-button-mini-icon .s-button-loader:before {
|
|
57
|
-
width: 0.85rem;
|
|
58
|
-
height: 0.85rem;
|
|
59
|
-
}
|
|
60
|
-
.s-button-wrap .s-button-danger .s-button-loader::before, .s-button-wrap .s-button-outline-danger .s-button-loader::before {
|
|
61
|
-
border-top-color: #f87171;
|
|
62
|
-
border-left-color: #f87171;
|
|
63
95
|
}
|