@salla.sa/twilight-components 1.0.100 → 1.0.104
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-3771e52a.js → index-b4140db0.js} +18 -11
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/salla-add-product-button_6.cjs.entry.js +40 -32
- package/dist/cjs/salla-branches.cjs.entry.js +9 -5
- package/dist/cjs/salla-conditional-fields.cjs.entry.js +4 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +5 -4
- package/dist/cjs/salla-login-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -1
- package/dist/cjs/salla-quantity-input.cjs.entry.js +2 -2
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-stars.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/twilight-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +13 -28
- package/dist/collection/components/salla-branches/salla-branches.css +0 -3
- package/dist/collection/components/salla-branches/salla-branches.js +9 -5
- package/dist/collection/components/salla-button/salla-button.css +0 -3
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +3 -1
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.css +0 -3
- package/dist/collection/components/salla-installment/salla-installment.css +0 -3
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.css +2 -5
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +3 -2
- package/dist/collection/components/salla-login-modal/salla-login-modal.css +0 -3
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +1 -1
- package/dist/collection/components/salla-modal/salla-modal.css +0 -3
- package/dist/collection/components/salla-modal/salla-modal.js +12 -11
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.css +0 -3
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -0
- package/dist/collection/components/salla-product-availability/salla-product-availability.css +0 -3
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +18 -13
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.css +0 -3
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +0 -3
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +0 -3
- package/dist/collection/components/salla-search/salla-search.css +0 -3
- package/dist/collection/components/salla-tel-input/salla-tel-input.css +2 -5
- package/dist/collection/components/salla-verify/salla-verify.css +0 -3
- package/dist/components/index.d.ts +17 -5
- package/dist/components/index.js +17 -0
- package/dist/components/salla-add-product-button.js +14 -12
- package/dist/components/salla-branches.js +8 -4
- package/dist/components/salla-conditional-fields.js +3 -1
- package/dist/components/salla-localization-modal.js +4 -3
- package/dist/components/salla-login-modal.js +1 -1
- package/dist/components/salla-modal2.js +6 -6
- package/dist/components/salla-offer-modal.js +1 -0
- package/dist/components/salla-product-availability2.js +17 -12
- package/dist/components/salla-quantity-input.js +1 -1
- package/dist/components/salla-tel-input2.js +3 -3
- package/dist/esm/{index-ee729716.js → index-20b84fd0.js} +18 -11
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/salla-add-product-button_6.entry.js +40 -32
- package/dist/esm/salla-branches.entry.js +9 -5
- package/dist/esm/salla-conditional-fields.entry.js +4 -2
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +5 -4
- package/dist/esm/salla-login-modal.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +2 -1
- package/dist/esm/salla-quantity-input.entry.js +2 -2
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-rating-stars.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/twilight-components.js +3 -3
- package/dist/twilight-components/{p-f0f7a51b.entry.js → p-15fac4f2.entry.js} +1 -1
- package/dist/twilight-components/p-27d01075.entry.js +4 -0
- package/dist/twilight-components/{p-a268e672.entry.js → p-30e63760.entry.js} +1 -1
- package/dist/twilight-components/{p-9a75d4ec.entry.js → p-5ee94c9e.entry.js} +1 -1
- package/dist/twilight-components/{p-3f90fa16.entry.js → p-799da239.entry.js} +1 -1
- package/dist/twilight-components/p-9ff78dd1.entry.js +4 -0
- package/dist/twilight-components/p-c1952856.entry.js +4 -0
- package/dist/twilight-components/p-c2bef5f2.js +5 -0
- package/dist/twilight-components/p-cf143464.entry.js +4 -0
- package/dist/twilight-components/{p-714ff288.entry.js → p-d3778858.entry.js} +1 -1
- package/dist/twilight-components/p-ebd2e045.entry.js +4 -0
- package/dist/twilight-components/{p-058ae0f8.entry.js → p-ec0a2892.entry.js} +1 -1
- package/dist/twilight-components/{p-5c1d4ef9.entry.js → p-fab65162.entry.js} +1 -1
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +1 -2
- package/dist/types/components.d.ts +16 -12
- package/example/dist/translations.js +1 -1
- package/example/index.html +172 -150
- package/package.json +9 -13
- package/dist/twilight-components/p-00c61851.entry.js +0 -4
- package/dist/twilight-components/p-27530b47.entry.js +0 -4
- package/dist/twilight-components/p-77af5fef.entry.js +0 -4
- package/dist/twilight-components/p-d566f357.js +0 -4
- package/dist/twilight-components/p-df7417e4.entry.js +0 -4
- package/dist/twilight-components/p-e97c00e1.entry.js +0 -4
- package/example/.DS_Store +0 -0
- package/example/.gitignore +0 -2
- package/example/dist/.DS_Store +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-b4140db0.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
10
|
|
|
11
11
|
const sallaLoginModalCss = "";
|
|
@@ -187,7 +187,7 @@ const SallaLoginModal = class {
|
|
|
187
187
|
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 ?
|
|
188
188
|
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 ?
|
|
189
189
|
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText)
|
|
190
|
-
: '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-
|
|
190
|
+
: '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, 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("div", null, 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" })))));
|
|
191
191
|
}
|
|
192
192
|
get host() { return index.getElement(this); }
|
|
193
193
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-b4140db0.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
10
|
|
|
11
11
|
const sallaOfferModalCss = "";
|
|
@@ -57,6 +57,7 @@ const SallaOfferModal = class {
|
|
|
57
57
|
return this.modal.open();
|
|
58
58
|
}
|
|
59
59
|
rememberMe(event) {
|
|
60
|
+
console.log("🚀 ~ file: salla-offer-modal.tsx ~ line 75 ~ SallaOfferModal ~ rememberMe ~ rememberMe", event);
|
|
60
61
|
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
61
62
|
}
|
|
62
63
|
//todo:: pass event then use sallaButton from it
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-b4140db0.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
10
|
|
|
11
11
|
const sallaQuantityInputCss = "";
|
|
@@ -75,7 +75,7 @@ const SallaQuantityInput = class {
|
|
|
75
75
|
return this.host;
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
|
-
return (index.h(index.Host, { class: "s-quantity-input s-quantity-input-container" }, index.h("button", { onClick: () => this.increase(), class: "s-quantity-input-button", type: "button" }, !this.hasIncrementSlot ? index.h("i", { class: "sicon-add" }) : '', index.h("slot", { name: "increment-button" })), index.h("input", Object.assign({ class: "s-quantity-input-input" }, this.getInputAttributes(), { ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", value: this.quantity })), index.h("button", { class: "s-quantity-input-button", onClick: () => this.decrease(), type: "button" }, !this.hasDecrementSlot ? index.h("i", { class: "sicon-minus" }) : '', index.h("slot", { name: "decrement-button" }))));
|
|
78
|
+
return (index.h(index.Host, { class: "s-quantity-input s-quantity-input-container" }, index.h("button", { onClick: () => this.increase(), class: "s-quantity-input-increase-button", type: "button" }, !this.hasIncrementSlot ? index.h("i", { class: "sicon-add" }) : '', index.h("slot", { name: "increment-button" })), index.h("input", Object.assign({ class: "s-quantity-input-input" }, this.getInputAttributes(), { ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", value: this.quantity })), index.h("button", { class: "s-quantity-input-decrease-button", onClick: () => this.decrease(), type: "button" }, !this.hasDecrementSlot ? index.h("i", { class: "sicon-minus" }) : '', index.h("slot", { name: "decrement-button" }))));
|
|
79
79
|
}
|
|
80
80
|
get host() { return index.getElement(this); }
|
|
81
81
|
static get watchers() { return {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const index = require('./index-
|
|
8
|
+
const index = require('./index-b4140db0.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
10
|
|
|
11
11
|
const sallaVerifyCss = "salla-verify{display:block}";
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
const index = require('./index-
|
|
6
|
+
const index = require('./index-b4140db0.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v2.
|
|
9
|
+
Stencil Client Patch Browser v2.17.1 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
const patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('twilight-components.cjs.js', document.baseURI).href));
|
|
@@ -18,5 +18,5 @@ const patchBrowser = () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(options => {
|
|
21
|
-
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"]
|
|
21
|
+
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[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"]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32],"typing":[32],"debounce":[32],"search_term":[32]}],[0,"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]}],[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-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]}],[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"],"modalTitle":[32],"open":[64],"close":[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],"open":[64]},[[8,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}]]],["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],"open":[64],"close":[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],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify.cjs",[[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"title":[32],"resendAfter":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
|
|
22
22
|
});
|
|
@@ -11,10 +11,6 @@ export class SallaAddProductButton {
|
|
|
11
11
|
this.donatingAmount = 0;
|
|
12
12
|
this.productStatus = 'sale';
|
|
13
13
|
this.productType = 'product';
|
|
14
|
-
/**
|
|
15
|
-
* Is the button currently disabled
|
|
16
|
-
*/
|
|
17
|
-
this.disabled = false;
|
|
18
14
|
}
|
|
19
15
|
getLabel() {
|
|
20
16
|
if (this.productStatus === 'sale') {
|
|
@@ -37,13 +33,20 @@ export class SallaAddProductButton {
|
|
|
37
33
|
* but its work only when the id is the only value is passed via the object
|
|
38
34
|
* so we will filter the object entities to remove null and zero values in case we don't want the normal add item action
|
|
39
35
|
*/
|
|
40
|
-
|
|
36
|
+
const data = Object.entries({
|
|
41
37
|
id: this.productId,
|
|
42
38
|
donating_amount: this.donatingAmount,
|
|
43
39
|
quantity: this.quantity
|
|
44
|
-
}).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {})
|
|
45
|
-
|
|
46
|
-
.
|
|
40
|
+
}).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
|
|
41
|
+
return salla.cart.quickAdd(data)
|
|
42
|
+
.then((response) => {
|
|
43
|
+
console.log("🚀 ~ file: salla-add-product-button.tsx ~ line 67 ~ SallaAddProductButton ~ .then ~ response", response);
|
|
44
|
+
return this.success.emit(response);
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
console.log("🚀 ~ file: salla-add-product-button.tsx ~ line 70 ~ SallaAddProductButton ~ addProductToCart ~ error", error);
|
|
48
|
+
return this.failed.emit(error);
|
|
49
|
+
});
|
|
47
50
|
}
|
|
48
51
|
getBtnAttributes() {
|
|
49
52
|
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
@@ -60,12 +63,12 @@ export class SallaAddProductButton {
|
|
|
60
63
|
return (h(Host, null, this.productStatus === 'out-and-notify' && this.channels ?
|
|
61
64
|
h("salla-product-availability", Object.assign({}, this.getBtnAttributes()),
|
|
62
65
|
h("slot", null)) :
|
|
63
|
-
h("salla-button", Object.assign({ ref:
|
|
66
|
+
h("salla-button", Object.assign({ ref: el => this.btn = el, onClick: event => this.addProductToCart(event), type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', color: this.productStatus === 'sale' ? 'primary' : 'light', "loader-position": "center" }, this.getBtnAttributes(), { disabled: this.productStatus !== 'sale' }),
|
|
64
67
|
h("slot", null))));
|
|
65
68
|
}
|
|
66
69
|
componentDidRender() {
|
|
67
70
|
//if label not passed, get label
|
|
68
|
-
this.hasLabel || salla.
|
|
71
|
+
this.hasLabel || salla.event.on('languages::translations.loaded', () => this.btn.setText(this.getLabel() || 'اضافة للسلة'));
|
|
69
72
|
}
|
|
70
73
|
static get is() { return "salla-add-product-button"; }
|
|
71
74
|
static get originalStyleUrls() { return {
|
|
@@ -181,24 +184,6 @@ export class SallaAddProductButton {
|
|
|
181
184
|
"attribute": "product-type",
|
|
182
185
|
"reflect": true,
|
|
183
186
|
"defaultValue": "'product'"
|
|
184
|
-
},
|
|
185
|
-
"disabled": {
|
|
186
|
-
"type": "boolean",
|
|
187
|
-
"mutable": false,
|
|
188
|
-
"complexType": {
|
|
189
|
-
"original": "boolean",
|
|
190
|
-
"resolved": "boolean",
|
|
191
|
-
"references": {}
|
|
192
|
-
},
|
|
193
|
-
"required": false,
|
|
194
|
-
"optional": false,
|
|
195
|
-
"docs": {
|
|
196
|
-
"tags": [],
|
|
197
|
-
"text": "Is the button currently disabled"
|
|
198
|
-
},
|
|
199
|
-
"attribute": "disabled",
|
|
200
|
-
"reflect": true,
|
|
201
|
-
"defaultValue": "false"
|
|
202
187
|
}
|
|
203
188
|
}; }
|
|
204
189
|
static get events() { return [{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Component, h, Prop, Method, State, Element } from "@stencil/core";
|
|
5
5
|
export class SallaBranches {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.open =
|
|
7
|
+
this.open = true;
|
|
8
8
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
9
9
|
this.displayAs = 'default'; //todo:: change it to boolean, isPopup default false
|
|
10
10
|
this.browseProductsFrom = 'all'; //todo:: get better name
|
|
@@ -38,10 +38,12 @@ export class SallaBranches {
|
|
|
38
38
|
}
|
|
39
39
|
//todo:: add description for all @methods
|
|
40
40
|
async show() {
|
|
41
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
return (_a = this.modal) === null || _a === void 0 ? void 0 : _a.open();
|
|
42
43
|
}
|
|
43
44
|
async hide() {
|
|
44
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
return (_a = this.modal) === null || _a === void 0 ? void 0 : _a.close();
|
|
45
47
|
}
|
|
46
48
|
handelChange(event) {
|
|
47
49
|
this.selected = event.target.value;
|
|
@@ -57,7 +59,9 @@ export class SallaBranches {
|
|
|
57
59
|
}, 300);
|
|
58
60
|
}
|
|
59
61
|
render() {
|
|
60
|
-
return (h("salla-modal", { icon: "sicon-store-alt", "modal-title": "\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636", "sub-title": "\u0623\u0646\u062A \u0627\u0644\u0622\u0646 \u062A\u062A\u0635\u0641\u062D \u0627\u0644\u0645\u062A\u062C\u0631 \u0645\u0646", "sub-title-first": true,
|
|
62
|
+
return (h("salla-modal", { icon: "sicon-store-alt", "modal-title": "\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636", "sub-title": "\u0623\u0646\u062A \u0627\u0644\u0622\u0646 \u062A\u062A\u0635\u0641\u062D \u0627\u0644\u0645\u062A\u062C\u0631 \u0645\u0646", "sub-title-first": true,
|
|
63
|
+
// is-closable={!this.isOpenedBefore && this.displayAs == 'popup' ? 'false' : 'true'}
|
|
64
|
+
ref: (modal) => this.modal = modal, width: "sm", id: "s-branches-modal", class: "s-hidden" },
|
|
61
65
|
h("h4", { class: "s-branches-title" }, this.formTitle()),
|
|
62
66
|
this.branches.length <= 5 ?
|
|
63
67
|
h("div", { class: "s-branches-space-v" }, this.branches.map((branch) => h("div", { class: "s-branches-input-wrap" },
|
|
@@ -165,7 +169,7 @@ export class SallaBranches {
|
|
|
165
169
|
"tags": [],
|
|
166
170
|
"text": ""
|
|
167
171
|
},
|
|
168
|
-
"defaultValue": "[\n {id: 1, name: '\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 2, name: '\u0641\u0631\u0639 \u062C\u062F\u0629', open: false, available: false, limited: false, tag: '\u063A\u064A\u0631 \u0645\u062A\u0648\u0641\u0631'},\n {id: 3, name: '\u0641\u0631\u0639 \u0645\u0643\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 4, name: '\u0641\u0631\u0639 \u0627\u0644\u0645\u062F\u064A\u0646\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 5, name: '\u0641\u0631\u0639 \u062C\u0627\u0632\u0627\u0646', open: true, available: true, limited: true, tag: '\u0627\u0644\u0643\u0645\u064A\u0629 \u0645\u062D\u062F\u0648\u062F\u0629'}\n ]"
|
|
172
|
+
"defaultValue": "[\n { id: 1, name: '\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 2, name: '\u0641\u0631\u0639 \u062C\u062F\u0629', open: false, available: false, limited: false, tag: '\u063A\u064A\u0631 \u0645\u062A\u0648\u0641\u0631' },\n { id: 3, name: '\u0641\u0631\u0639 \u0645\u0643\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 4, name: '\u0641\u0631\u0639 \u0627\u0644\u0645\u062F\u064A\u0646\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 5, name: '\u0641\u0631\u0639 \u062C\u0627\u0632\u0627\u0646', open: true, available: true, limited: true, tag: '\u0627\u0644\u0643\u0645\u064A\u0629 \u0645\u062D\u062F\u0648\u062F\u0629' }\n ]"
|
|
169
173
|
},
|
|
170
174
|
"current": {
|
|
171
175
|
"type": "number",
|
|
@@ -9,6 +9,7 @@ import { Component, Element, Host, Listen, h } from '@stencil/core';
|
|
|
9
9
|
export class SallaConditionalFields {
|
|
10
10
|
changeHandler(event) {
|
|
11
11
|
var _a;
|
|
12
|
+
console.log("🚀 ~ file: salla-conditional-fields.tsx ~ line 17 ~ SallaConditionalFields ~ changeHandler ~ changeHandler", event);
|
|
12
13
|
salla.log('Received the change event: ', event);
|
|
13
14
|
if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {
|
|
14
15
|
salla.log('Ignore the change because is not support input: ' + (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.tagName) || 'N/A'));
|
|
@@ -17,7 +18,7 @@ export class SallaConditionalFields {
|
|
|
17
18
|
// to extract the option id from the input name, the supported names are name[*] and name[*][]
|
|
18
19
|
let optionId = event.target.name.replace('[]', '');
|
|
19
20
|
let isMultiple = event.target.getAttribute('type') === 'checkbox';
|
|
20
|
-
salla.log('Trying to find all the element with
|
|
21
|
+
salla.log('Trying to find all the element with condition:', `[data-show-when^="${optionId}"]`);
|
|
21
22
|
this.host.querySelectorAll(`[data-show-when^="${optionId}"]`)
|
|
22
23
|
.forEach((field) => {
|
|
23
24
|
let isEqual = !(field === null || field === void 0 ? void 0 : field.dataset.showWhen.includes('!='));
|
|
@@ -66,6 +67,7 @@ export class SallaConditionalFields {
|
|
|
66
67
|
var _a;
|
|
67
68
|
// @ts-ignore
|
|
68
69
|
let optionName = (_a = field === null || field === void 0 ? void 0 : field.dataset) === null || _a === void 0 ? void 0 : _a.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();
|
|
70
|
+
console.log("🚀 ~ file: salla-conditional-fields.tsx ~ line 83 ~ SallaConditionalFields ~ this.host.querySelectorAll ~ optionName", optionName);
|
|
69
71
|
if (!optionName) {
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Global flags style [imported from Int-tel-input]
|
|
3
|
-
*/
|
|
4
|
-
/*
|
|
5
2
|
* Salla Localization Component: Languages & Currencies popup modal
|
|
6
3
|
* You can use these classes to target the elements in the component.
|
|
7
4
|
*/
|
|
@@ -1067,7 +1064,7 @@
|
|
|
1067
1064
|
.iti__flag {
|
|
1068
1065
|
height: 15px;
|
|
1069
1066
|
box-shadow: 0px 0px 1px 0px #888;
|
|
1070
|
-
background-image: url("https://
|
|
1067
|
+
background-image: url("https://cdn.salla.network/images/flags.png");
|
|
1071
1068
|
background-repeat: no-repeat;
|
|
1072
1069
|
background-color: #f5f7f9;
|
|
1073
1070
|
background-position: 20px 0;
|
|
@@ -1075,7 +1072,7 @@
|
|
|
1075
1072
|
|
|
1076
1073
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
1077
1074
|
.iti__flag {
|
|
1078
|
-
background-image: url("https://
|
|
1075
|
+
background-image: url("https://cdn.salla.network/images/flags@2x.png");
|
|
1079
1076
|
}
|
|
1080
1077
|
}
|
|
1081
1078
|
.iti__flag.iti__np {
|
|
@@ -41,7 +41,8 @@ export class SallaLocalizationModal {
|
|
|
41
41
|
* open the component
|
|
42
42
|
*/
|
|
43
43
|
async open() {
|
|
44
|
-
|
|
44
|
+
console.log("🚀 ~ file: salla-localization-modal.tsx ~ line 59 ~ SallaLocalizationModal ~ open ~ this.modal", this.modal);
|
|
45
|
+
return await this.modal.open()
|
|
45
46
|
.then(() => this.getLanguages())
|
|
46
47
|
.then(() => this.getCurrencies())
|
|
47
48
|
.then(() => this.isLoading = false);
|
|
@@ -98,7 +99,7 @@ export class SallaLocalizationModal {
|
|
|
98
99
|
.replace(/\{name\}/g, lang.name)
|
|
99
100
|
.replace(/\{code\}/g, lang.code)
|
|
100
101
|
.replace(/\{country_code\}/g, lang.country_code) }))) :
|
|
101
|
-
h("select", { class: "s-localization-modal-select", name: "
|
|
102
|
+
h("select", { class: "s-localization-modal-select", name: "language", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language == lang.code }, lang.name)))))
|
|
102
103
|
: '',
|
|
103
104
|
this.currencies.length > 1 ?
|
|
104
105
|
h("div", { class: "s-localization-modal-section" },
|
|
@@ -220,7 +220,7 @@ export class SallaLoginModal {
|
|
|
220
220
|
: '',
|
|
221
221
|
h("slot", { name: "after-login-email" })) : '',
|
|
222
222
|
h("salla-verify", { display: "inline", ref: tab => this.verifyTab = tab, autoReload: false },
|
|
223
|
-
h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-
|
|
223
|
+
h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back sicon-arrow-right", slot: "after-footer", href: "#" })),
|
|
224
224
|
h("div", { ref: tab => this.registrationTab = tab },
|
|
225
225
|
h("slot", { name: "before-registration" }),
|
|
226
226
|
h("div", null,
|
|
@@ -8,7 +8,7 @@ import Helper from "../../Helpers/Helper";
|
|
|
8
8
|
*/
|
|
9
9
|
export class SallaModal {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.isClosable = true; //todo::rename unclude
|
|
11
|
+
this.isClosable = true; //todo::rename unclude. Suggestion => persistent
|
|
12
12
|
/**
|
|
13
13
|
* The size of the modal
|
|
14
14
|
*/
|
|
@@ -138,16 +138,17 @@ export class SallaModal {
|
|
|
138
138
|
h("button", { class: "s-modal-close", onClick: () => this.closeModal(), type: "button" },
|
|
139
139
|
h("span", { class: "sicon-cancel" }))
|
|
140
140
|
: '',
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
h("div", { class:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
h("div", { class: "s-modal-header-inner" },
|
|
142
|
+
this.iconStyle || this.icon
|
|
143
|
+
? h("div", { class: this.iconBlockClasses() },
|
|
144
|
+
h("i", { class: this.iconClasses() }))
|
|
145
|
+
: this.imageIcon ? h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '',
|
|
146
|
+
h("div", { class: "s-modal-header-content" },
|
|
147
|
+
h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }),
|
|
148
|
+
h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
|
|
149
|
+
// : ''
|
|
150
|
+
,
|
|
151
|
+
"// : ''"),
|
|
151
152
|
h("slot", null),
|
|
152
153
|
h("slot", { name: "footer" })
|
|
153
154
|
]))));
|
|
@@ -54,6 +54,7 @@ export class SallaOfferModal {
|
|
|
54
54
|
return this.modal.open();
|
|
55
55
|
}
|
|
56
56
|
rememberMe(event) {
|
|
57
|
+
console.log("🚀 ~ file: salla-offer-modal.tsx ~ line 75 ~ SallaOfferModal ~ rememberMe ~ rememberMe", event);
|
|
57
58
|
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
58
59
|
}
|
|
59
60
|
//todo:: pass event then use sallaButton from it
|
package/dist/collection/components/salla-product-availability/salla-product-availability.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Global flags style [imported from Int-tel-input]
|
|
3
|
-
*/
|
|
4
|
-
/*
|
|
5
2
|
* Salla Product Availability Component: popup modal to notify user if the product is available,
|
|
6
3
|
* used in the product single page if the product isn't available.
|
|
7
4
|
* You can use these classes to target the elements in the component.
|
|
@@ -17,6 +17,7 @@ export class SallaProductAvailability {
|
|
|
17
17
|
this.isSubscribed = false;
|
|
18
18
|
// @Method()
|
|
19
19
|
this.submit = async () => {
|
|
20
|
+
console.log("🚀 ~ file: salla-product-availability.tsx ~ line 74 ~ SallaProductAvailability ~ submit= ~ submit");
|
|
20
21
|
if (this.isUser) {
|
|
21
22
|
return salla.api.product.availabilitySubscribe(this.productId)
|
|
22
23
|
.then(() => this.isSubscribed = true);
|
|
@@ -72,21 +73,25 @@ export class SallaProductAvailability {
|
|
|
72
73
|
this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
|
|
73
74
|
}
|
|
74
75
|
channelsWatcher(newValue) {
|
|
75
|
-
this.channels_ = newValue.split(',');
|
|
76
|
+
this.channels_ = !!newValue ? newValue.split(',') : [];
|
|
76
77
|
}
|
|
77
78
|
async validateform() {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
try {
|
|
80
|
+
if (this.channels_.includes('email')) {
|
|
81
|
+
const isEmailValid = Helper.isValidEmail(this.email.value);
|
|
82
|
+
if (isEmailValid)
|
|
83
|
+
return;
|
|
84
|
+
!isEmailValid && this.validateField(this.email, this.emailErrorMsg);
|
|
85
|
+
}
|
|
86
|
+
if (this.channels_.includes('sms')) {
|
|
87
|
+
const isPhoneValid = await this.mobileInput.isValid();
|
|
88
|
+
if (isPhoneValid)
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
83
91
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (isPhoneValid)
|
|
87
|
-
return;
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw ('Please insert required fields');
|
|
88
94
|
}
|
|
89
|
-
throw ('Please insert required fields');
|
|
90
95
|
}
|
|
91
96
|
validateField(field, errorMsg) {
|
|
92
97
|
field.classList.add('s-has-error');
|
|
@@ -116,8 +121,8 @@ export class SallaProductAvailability {
|
|
|
116
121
|
h("salla-tel-input", { ref: el => this.mobileInput = el, onKeyDown: e => this.typing(e, this.submit) })
|
|
117
122
|
] : ''),
|
|
118
123
|
h("div", { slot: "footer", class: "s-product-availability-footer" },
|
|
119
|
-
h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.close(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')),
|
|
120
|
-
h("salla-button", { "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
|
|
124
|
+
h("salla-button", { class: "modal-cancel-btn", width: "wide", color: "light", fill: "outline", onClick: () => this.modal.close(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')),
|
|
125
|
+
h("salla-button", { class: "submit-btn", "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
|
|
121
126
|
}
|
|
122
127
|
static get is() { return "salla-product-availability"; }
|
|
123
128
|
static get originalStyleUrls() { return {
|
|
@@ -68,11 +68,11 @@ export class SallaQuantityInput {
|
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
70
70
|
return (h(Host, { class: "s-quantity-input s-quantity-input-container" },
|
|
71
|
-
h("button", { onClick: () => this.increase(), class: "s-quantity-input-button", type: "button" },
|
|
71
|
+
h("button", { onClick: () => this.increase(), class: "s-quantity-input-increase-button", type: "button" },
|
|
72
72
|
!this.hasIncrementSlot ? h("i", { class: "sicon-add" }) : '',
|
|
73
73
|
h("slot", { name: "increment-button" })),
|
|
74
74
|
h("input", Object.assign({ class: "s-quantity-input-input" }, this.getInputAttributes(), { ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", value: this.quantity })),
|
|
75
|
-
h("button", { class: "s-quantity-input-button", onClick: () => this.decrease(), type: "button" },
|
|
75
|
+
h("button", { class: "s-quantity-input-decrease-button", onClick: () => this.decrease(), type: "button" },
|
|
76
76
|
!this.hasDecrementSlot ? h("i", { class: "sicon-minus" }) : '',
|
|
77
77
|
h("slot", { name: "decrement-button" }))));
|
|
78
78
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
/*
|
|
3
|
-
* Global flags style [imported from Int-tel-input]
|
|
4
|
-
*/
|
|
5
|
-
/*
|
|
6
3
|
* Salla Tel Input Component: used to get the telephone input, in login and register steps and also in user profile.
|
|
7
4
|
*/
|
|
8
5
|
/*
|
|
@@ -1287,7 +1284,7 @@
|
|
|
1287
1284
|
.iti__flag {
|
|
1288
1285
|
height: 15px;
|
|
1289
1286
|
box-shadow: 0px 0px 1px 0px #888;
|
|
1290
|
-
background-image: url("https://
|
|
1287
|
+
background-image: url("https://cdn.salla.network/images/flags.png");
|
|
1291
1288
|
background-repeat: no-repeat;
|
|
1292
1289
|
background-color: #f5f7f9;
|
|
1293
1290
|
background-position: 20px 0;
|
|
@@ -1295,7 +1292,7 @@
|
|
|
1295
1292
|
|
|
1296
1293
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
1297
1294
|
.iti__flag {
|
|
1298
|
-
background-image: url("https://
|
|
1295
|
+
background-image: url("https://cdn.salla.network/images/flags@2x.png");
|
|
1299
1296
|
}
|
|
1300
1297
|
}
|
|
1301
1298
|
.iti__flag.iti__np {
|