@salla.sa/twilight-components 1.0.21 → 1.0.23

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.
Files changed (98) hide show
  1. package/dist/cjs/Helper-fcea994c.js +23 -0
  2. package/dist/cjs/index-714023c8.js +1653 -0
  3. package/dist/cjs/index.cjs.js +13 -0
  4. package/dist/cjs/loader.cjs.js +21 -0
  5. package/dist/cjs/salla-branches.cjs.entry.js +92 -0
  6. package/dist/cjs/salla-button_5.cjs.entry.js +1727 -0
  7. package/dist/cjs/salla-localization.cjs.entry.js +82 -0
  8. package/dist/cjs/salla-login-6229ec94.js +128 -0
  9. package/dist/cjs/salla-offer.cjs.entry.js +79 -0
  10. package/dist/cjs/salla-product-availability.cjs.entry.js +75 -0
  11. package/dist/cjs/salla-rating.cjs.entry.js +195 -0
  12. package/dist/cjs/salla-search-eb0112c0.js +78 -0
  13. package/dist/cjs/salla-search.cjs.entry.js +11 -0
  14. package/dist/cjs/twilight-components.cjs.js +19 -0
  15. package/dist/collection/Helpers/Helper.js +19 -0
  16. package/dist/collection/collection-manifest.json +22 -0
  17. package/dist/collection/components/generate-summary.js +35 -0
  18. package/dist/collection/components/salla-branches/salla-branches.css +12 -0
  19. package/dist/collection/components/salla-branches/salla-branches.js +233 -0
  20. package/dist/collection/components/salla-button/salla-button.css +3 -0
  21. package/dist/collection/components/salla-button/salla-button.js +246 -0
  22. package/dist/collection/components/salla-localization/salla-localization.js +208 -0
  23. package/dist/collection/components/salla-login/salla-login.css +16 -0
  24. package/dist/collection/components/salla-login/salla-login.js +380 -0
  25. package/dist/collection/components/salla-modal/salla-modal.js +478 -0
  26. package/dist/collection/components/salla-offer/offer-schema.js +1 -0
  27. package/dist/collection/components/salla-offer/salla-offer.js +110 -0
  28. package/dist/collection/components/salla-product-availability/salla-product-availability.js +331 -0
  29. package/dist/collection/components/salla-rating/order-feedback-response.js +1 -0
  30. package/dist/collection/components/salla-rating/salla-rating.css +7 -0
  31. package/dist/collection/components/salla-rating/salla-rating.js +277 -0
  32. package/dist/collection/components/salla-search/salla-search.css +25 -0
  33. package/dist/collection/components/salla-search/salla-search.js +100 -0
  34. package/dist/collection/components/salla-search/search-response.js +1 -0
  35. package/dist/collection/components/salla-tel-input/salla-tel-input.js +121 -0
  36. package/dist/collection/components/salla-verify/salla-verify.js +280 -0
  37. package/dist/collection/index.js +2 -0
  38. package/dist/collection/interfaces/colors.js +1 -0
  39. package/dist/collection/interfaces/index.js +2 -0
  40. package/dist/collection/interfaces/ratio.js +1 -0
  41. package/dist/collection/plugins/tailwind-theme/generator.js +62 -0
  42. package/dist/collection/plugins/tailwind-theme/index.js +26 -0
  43. package/dist/{twilight-components → esm}/Helper-d07ebbc7.js +0 -0
  44. package/dist/esm/index-a1bf769d.js +1625 -0
  45. package/dist/esm/index.js +4 -0
  46. package/dist/esm/loader.js +17 -0
  47. package/dist/esm/polyfills/core-js.js +11 -0
  48. package/dist/esm/polyfills/css-shim.js +1 -0
  49. package/dist/esm/polyfills/dom.js +79 -0
  50. package/dist/esm/polyfills/es5-html-element.js +1 -0
  51. package/dist/esm/polyfills/index.js +34 -0
  52. package/dist/esm/polyfills/system.js +6 -0
  53. package/dist/{twilight-components → esm}/salla-branches.entry.js +2 -2
  54. package/dist/{twilight-components/salla-tel-input.entry.js → esm/salla-button_5.entry.js} +337 -35
  55. package/dist/{twilight-components → esm}/salla-localization.entry.js +1 -1
  56. package/dist/{twilight-components/salla-login-57b18c2c.js → esm/salla-login-c368f5b3.js} +27 -24
  57. package/dist/{twilight-components → esm}/salla-offer.entry.js +1 -1
  58. package/dist/{twilight-components → esm}/salla-product-availability.entry.js +1 -1
  59. package/dist/{twilight-components → esm}/salla-rating.entry.js +71 -108
  60. package/dist/esm/salla-search-57bd45eb.js +76 -0
  61. package/dist/esm/salla-search.entry.js +3 -0
  62. package/dist/esm/twilight-components.js +17 -0
  63. package/dist/index.cjs.js +1 -0
  64. package/dist/index.js +1 -0
  65. package/dist/twilight-components/index.esm.js +1 -4
  66. package/dist/twilight-components/p-1a6d8171.entry.js +1 -0
  67. package/dist/twilight-components/p-47f17d3b.js +1 -0
  68. package/dist/twilight-components/p-47f3d098.entry.js +1 -0
  69. package/dist/twilight-components/p-48931f49.entry.js +1 -0
  70. package/dist/twilight-components/p-4d329f0d.js +1 -0
  71. package/dist/twilight-components/p-6a5be894.js +1 -0
  72. package/dist/twilight-components/p-7fbdf746.entry.js +1 -0
  73. package/dist/twilight-components/p-7fe5d346.entry.js +1 -0
  74. package/dist/twilight-components/p-ce991664.entry.js +1 -0
  75. package/dist/twilight-components/p-da73fc9b.entry.js +1 -0
  76. package/dist/twilight-components/p-e7edc889.js +1 -0
  77. package/dist/twilight-components/twilight-components.css +1 -3
  78. package/dist/twilight-components/twilight-components.esm.js +1 -125
  79. package/dist/types/components/salla-login/salla-login.d.ts +3 -3
  80. package/dist/types/components/salla-modal/salla-modal.d.ts +1 -0
  81. package/dist/types/components/salla-rating/salla-rating.d.ts +6 -23
  82. package/dist/types/components/salla-search/salla-search.d.ts +3 -8
  83. package/dist/types/components/salla-search/search-response.d.ts +18 -0
  84. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +14 -0
  85. package/dist/types/components/salla-verify/salla-verify.d.ts +3 -1
  86. package/dist/types/components.d.ts +12 -51
  87. package/package.json +1 -1
  88. package/dist/twilight-components/app-globals-0f993ce5.js +0 -3
  89. package/dist/twilight-components/css-shim-a64b8820.js +0 -4
  90. package/dist/twilight-components/dom-d08ba8aa.js +0 -73
  91. package/dist/twilight-components/index-9c087700.js +0 -3010
  92. package/dist/twilight-components/salla-button.entry.js +0 -75
  93. package/dist/twilight-components/salla-login.entry.js +0 -3
  94. package/dist/twilight-components/salla-modal.entry.js +0 -113
  95. package/dist/twilight-components/salla-search-30fec1e8.js +0 -79
  96. package/dist/twilight-components/salla-search.entry.js +0 -3
  97. package/dist/twilight-components/salla-verify.entry.js +0 -114
  98. package/dist/twilight-components/shadow-css-bc14d9fd.js +0 -389
@@ -0,0 +1,208 @@
1
+ import { Component, Element, h, Method, Prop } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ /**
4
+ * @slot header - The top of the modal.
5
+ * @slot footer - Replaces the bottom button.
6
+ * @slot language - Replaces language label, has replaceable props `{name}`, `{code}`, `{country_code}`.
7
+ * @slot currency - Replaces currency label, has replaceable props `{name}`, `{code}`, `{country_code}`.
8
+ */
9
+ export class SallaLocalization {
10
+ constructor() {
11
+ var _a, _b;
12
+ this.language = salla.config.get('language', {});
13
+ this.currency = salla.config.get('currency', {});
14
+ this.languagesTitle = salla.lang.get('common.titles.language');
15
+ this.currenciesTitle = salla.lang.get('common.titles.currency');
16
+ this.ok = salla.lang.get('common.elements.ok');
17
+ Helper.setHost(this.host);
18
+ salla.event.on('localization::show', () => this.show());
19
+ /**
20
+ * letting developer to insert his own slot like:
21
+ * <salla-localization>
22
+ * <div slot="language">...{name}....</div>
23
+ * <div slot="currency">...{name}....</div>
24
+ * </salla-localization>
25
+ * Because scoped templates not supported in stencil );
26
+ * we made a workaround to pass language & currency attributes, then replace names in rendering
27
+ */
28
+ this.languageSlot = ((_a = Helper.getElement('[slot="language"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<label class="s-localization-label" for="lang-{code}"><span>{name}</span><div class="s-localization-flag flag iti__flag iti__{country_code}"></div></label>';
29
+ this.currencySlot = ((_b = Helper.getElement('[slot="currency"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || '<label class="s-localization-label" for="currency-{code}"><span>{name}</span><small class="s-localization-currency">{code}</small></label>';
30
+ this.languages = Object.values(salla.config.get('languages', {}));
31
+ this.currencies = Object.values(salla.config.get('currencies', {}));
32
+ }
33
+ async show() {
34
+ return this.modal.show();
35
+ }
36
+ async hide() {
37
+ return this.modal.hide();
38
+ }
39
+ onChangeCurrency(event) {
40
+ this.currency = salla.config.get('currencies.' + event.target.value);
41
+ }
42
+ onChangeLanguage(event) {
43
+ this.language = salla.config.get('languages.' + event.target.value);
44
+ }
45
+ async submit() {
46
+ let url;
47
+ console.log('this.currency.code::::', this.currency, this.currency.code);
48
+ this.btn.load()
49
+ .then(() => this.currency.code === salla.config.get('user.currency') || ((url = window.location.href) && salla.currency.api.change(this.currency.code)))
50
+ .then(() => this.language.code === salla.config.get('user.language') || (url = this.language.url))
51
+ .then(() => this.btn.stop())
52
+ .then(() => this.hide())
53
+ .then(() => url && (window.location.href = url));
54
+ }
55
+ render() {
56
+ return (h("salla-modal", { id: "salla-localization", class: "hidden", ref: modal => this.modal = modal, "modal-width": "xs" },
57
+ h("div", { slot: "header" },
58
+ h("slot", { name: "header" })),
59
+ h("div", { class: "s-localization-inner" },
60
+ this.languages.length > 1 ?
61
+ h("div", { class: "s-localization-section" },
62
+ h("label", { class: "s-localization-title" }, this.languagesTitle),
63
+ h("div", { class: "s-localization-section-inner" }, this.languages.length < 6 ?
64
+ this.languages.map(lang => h("div", { class: "s-localization-item" },
65
+ h("input", { class: "s-localization-input", type: "radio", checked: this.language.code == lang.code, onChange: () => this.language = lang, name: "language", id: 'lang-' + lang.code.toLowerCase(), value: lang.code }),
66
+ h("div", { id: "language-slot", innerHTML: this.languageSlot
67
+ .replace(/\{name\}/g, lang.name)
68
+ .replace(/\{code\}/g, lang.code)
69
+ .replace(/\{country_code\}/g, lang.country_code) }))) :
70
+ h("select", { class: "s-branches-select", name: "currency", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language.code == lang.code }, lang.name)))))
71
+ : '',
72
+ this.currencies.length > 1 ?
73
+ h("div", { class: "s-localization-section" },
74
+ h("label", { class: "s-localization-title" }, this.currenciesTitle),
75
+ h("div", { class: "s-localization-section-inner" }, this.currencies.length < 6 ?
76
+ this.currencies.map(currency => h("div", { class: "s-localization-item" },
77
+ h("input", { class: "s-localization-input", type: "radio", name: "currency", checked: this.currency.code == currency.code, onChange: () => this.currency = currency, id: 'currency-' + currency.code, value: currency.code }),
78
+ h("div", { id: "currency-slot", innerHTML: this.currencySlot
79
+ .replace(/\{name\}/g, currency.name)
80
+ .replace(/\{code\}/g, currency.code)
81
+ .replace(/\{country_code\}/g, currency.country_code) }))) :
82
+ h("select", { class: "s-branches-select", name: "currency", onChange: e => this.onChangeCurrency(e) }, this.currencies.map(currency => h("option", { value: currency.code, selected: this.currency.code == currency.code }, currency.name)))))
83
+ : ''),
84
+ h("slot", { name: "footer" },
85
+ h("salla-button", { wide: true, ref: btn => this.btn = btn, onClick: () => this.submit() }, this.ok))));
86
+ }
87
+ /**
88
+ * to reduce dom levels we will move slot data into the parent dom
89
+ */
90
+ componentDidRender() {
91
+ this.host.querySelectorAll('#currency-slot').forEach(el => el.replaceWith(el.firstChild));
92
+ this.host.querySelectorAll('#language-slot').forEach(el => el.replaceWith(el.firstChild));
93
+ }
94
+ static get is() { return "salla-localization"; }
95
+ static get properties() { return {
96
+ "languagesTitle": {
97
+ "type": "string",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "string",
101
+ "resolved": "string",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": false,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "attribute": "languages-title",
111
+ "reflect": false,
112
+ "defaultValue": "salla.lang.get('common.titles.language')"
113
+ },
114
+ "currenciesTitle": {
115
+ "type": "string",
116
+ "mutable": false,
117
+ "complexType": {
118
+ "original": "string",
119
+ "resolved": "string",
120
+ "references": {}
121
+ },
122
+ "required": false,
123
+ "optional": false,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": ""
127
+ },
128
+ "attribute": "currencies-title",
129
+ "reflect": false,
130
+ "defaultValue": "salla.lang.get('common.titles.currency')"
131
+ },
132
+ "ok": {
133
+ "type": "string",
134
+ "mutable": false,
135
+ "complexType": {
136
+ "original": "string",
137
+ "resolved": "string",
138
+ "references": {}
139
+ },
140
+ "required": false,
141
+ "optional": false,
142
+ "docs": {
143
+ "tags": [],
144
+ "text": ""
145
+ },
146
+ "attribute": "ok",
147
+ "reflect": false,
148
+ "defaultValue": "salla.lang.get('common.elements.ok')"
149
+ }
150
+ }; }
151
+ static get methods() { return {
152
+ "show": {
153
+ "complexType": {
154
+ "signature": "() => Promise<HTMLElement>",
155
+ "parameters": [],
156
+ "references": {
157
+ "Promise": {
158
+ "location": "global"
159
+ },
160
+ "HTMLElement": {
161
+ "location": "global"
162
+ }
163
+ },
164
+ "return": "Promise<HTMLElement>"
165
+ },
166
+ "docs": {
167
+ "text": "",
168
+ "tags": []
169
+ }
170
+ },
171
+ "hide": {
172
+ "complexType": {
173
+ "signature": "() => Promise<HTMLElement>",
174
+ "parameters": [],
175
+ "references": {
176
+ "Promise": {
177
+ "location": "global"
178
+ },
179
+ "HTMLElement": {
180
+ "location": "global"
181
+ }
182
+ },
183
+ "return": "Promise<HTMLElement>"
184
+ },
185
+ "docs": {
186
+ "text": "",
187
+ "tags": []
188
+ }
189
+ },
190
+ "submit": {
191
+ "complexType": {
192
+ "signature": "() => Promise<void>",
193
+ "parameters": [],
194
+ "references": {
195
+ "Promise": {
196
+ "location": "global"
197
+ }
198
+ },
199
+ "return": "Promise<void>"
200
+ },
201
+ "docs": {
202
+ "text": "",
203
+ "tags": []
204
+ }
205
+ }
206
+ }; }
207
+ static get elementRef() { return "host"; }
208
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Initial Variables
3
+ */
4
+ /**
5
+ * Functions
6
+ */
7
+ /**
8
+ * Delivered variables
9
+ */
10
+ salla-verify {
11
+ display: block;
12
+ }
13
+
14
+ #salla-login .s-modal-body {
15
+ overflow: inherit;
16
+ }
@@ -0,0 +1,380 @@
1
+ import { Component, Element, h, Listen, Method, Prop } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ export class SallaLogin {
4
+ constructor() {
5
+ this.regType = 'phone';
6
+ this.isEmailAllowed = true;
7
+ this.loginTypeTitle = salla.lang.get('blocks.header.select_login_way');
8
+ this.loginText = salla.lang.get('blocks.header.login');
9
+ this.smsLabel = salla.lang.get('blocks.header.sms');
10
+ this.mobileLabel = salla.lang.get('common.elements.mobile');
11
+ this.emailLabel = salla.lang.get('common.elements.email');
12
+ this.enterText = salla.lang.get('blocks.header.enter');
13
+ this.bySMSText = salla.lang.get('blocks.header.login_by_sms');
14
+ this.byEmailText = salla.lang.get('blocks.header.login_by_email');
15
+ this.backText = salla.lang.get('common.elements.back');
16
+ this.title = this.host.title || salla.lang.get('blocks.header.login');
17
+ this.host.removeAttribute('title');
18
+ salla.auth.event.onVerificationFailed(() => {
19
+ //
20
+ });
21
+ }
22
+ /**
23
+ * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event
24
+ */
25
+ onVerified(event) {
26
+ if (!event.detail.case) {
27
+ console.log('verified but without case!');
28
+ return;
29
+ }
30
+ if (event.detail.case === "new_customer") {
31
+ return this.showTab(this.tab5);
32
+ }
33
+ //TODO::It looks that is this workaround🤔
34
+ if (salla.auth.event.getTypeActionOnVerified() !== 'redirect') {
35
+ return;
36
+ }
37
+ if (event.redirect_url) {
38
+ return window.location.href = event.redirect_url;
39
+ }
40
+ window.location.reload();
41
+ }
42
+ onbackClicked() {
43
+ this.regType == 'phone' ? this.showTab(this.tab2) : this.showTab(this.tab3);
44
+ }
45
+ async show() {
46
+ this.showTab(this.isEmailAllowed ? this.tab1 : this.tab2);
47
+ return this.modal.show();
48
+ }
49
+ showTab(tab) {
50
+ [this.tab1, this.tab2, this.tab3, this.tab4, this.tab5].map(el => Helper.toggleElement(el, 'visible', 'hidden', () => el == tab));
51
+ setTimeout(() => { [this.tab1, this.tab2, this.tab3, this.tab4, this.tab5].map(el => Helper.toggleElement(el, 's-login-active', 's-login-unactive', () => el == tab)); }, 200);
52
+ setTimeout(() => { this.host.querySelector('.s-login-wrapper').setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'); });
53
+ if ([this.tab2, this.tab3].includes(tab)) {
54
+ this.regType = tab === this.tab2 ? 'phone' : 'email';
55
+ }
56
+ let isRegistrationTab = tab == this.tab5;
57
+ isRegistrationTab && this.firstName.focus();
58
+ this.modal.setTitle(isRegistrationTab ? salla.lang.get('common.titles.registration') : this.title);
59
+ if (!isRegistrationTab) {
60
+ Helper.toggleElement(this.regMobileBlock, 's-hidden', 's-block', () => this.regType === 'phone')
61
+ .toggleElement(this.regEmailBlock, 's-hidden', 's-block', () => this.regType === 'email');
62
+ }
63
+ return this;
64
+ }
65
+ loginByEmail() {
66
+ if (!Helper.isValidEmail(this.email.value)) {
67
+ this.email.classList.add('s-has-error');
68
+ this.email.nextElementSibling['innerText'] = '* ' + salla.lang.get('common.elements.email_is_valid');
69
+ return;
70
+ }
71
+ this.email.nextElementSibling['innerText'] = '';
72
+ this.email.classList.remove('s-has-error');
73
+ salla.auth.api.login({ type: 'email', email: this.email.value })
74
+ .then(() => this.showTab(this.tab4))
75
+ .then(() => (this.tab4.by = 'email') && (this.tab4.url = 'auth/email/verify'))
76
+ .then(() => this.tab4.show({ email: this.email.value }));
77
+ }
78
+ async loginBySMS() {
79
+ const { phone, countryCode } = await this.loginTelInput.getValues();
80
+ if (phone.length < 6) {
81
+ this.loginTelInput.classList.add('s-has-error');
82
+ this.loginTelInput.nextElementSibling['innerText'] = '* ' + salla.lang.get('mobile_app.strings.incorrect_mobile');
83
+ return;
84
+ }
85
+ this.loginTelInput.nextElementSibling['innerText'] = '';
86
+ this.loginTelInput.classList.remove('s-has-error');
87
+ salla.auth.api.login({ type: 'mobile', phone: phone, country_code: countryCode })
88
+ .then(() => this.showTab(this.tab4))
89
+ .then(() => (this.tab4.by = 'sms') && (this.tab4.url = 'auth/mobile/verify'))
90
+ .then(() => this.tab4.show({ phone: phone, country_code: countryCode }));
91
+ }
92
+ //TODO:: if it's enter, go submit
93
+ typing({ target }) {
94
+ target.type === 'tel' && salla.helpers.digitsOnly(target);
95
+ target.classList.remove('s-has-error');
96
+ target.nextElementSibling.innerText = '';
97
+ }
98
+ async newUser() {
99
+ const { phone: regPhone, countryCode, countryKey } = await this.regTelInput.getValues();
100
+ this.tab4.getCode()
101
+ .then(code => salla.auth.api.register({
102
+ first_name: this.firstName.value,
103
+ last_name: this.lastName.value,
104
+ phone: regPhone || this.loginTelInput.phone,
105
+ email: this.regEmail.value || this.email.value,
106
+ country_code: countryCode,
107
+ country_key: countryKey,
108
+ code: code,
109
+ verified_by: this.regType,
110
+ })).then(() => window.location.reload());
111
+ }
112
+ render() {
113
+ return (h("salla-modal", { id: "salla-login", title: this.title, ref: modal => this.modal = modal, width: "xs" },
114
+ h("div", { class: "s-login-wrapper" },
115
+ this.isEmailAllowed ?
116
+ h("div", { class: "s-login-tab", ref: tab => this.tab1 = tab },
117
+ h("p", { class: "s-login-sub-title" }, this.loginTypeTitle),
118
+ h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab2) },
119
+ h("i", { class: "s-login-main-btn-icon sicon-phone" }),
120
+ h("span", { class: "s-login-main-btn-text" }, this.smsLabel),
121
+ h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })),
122
+ h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab3) },
123
+ h("i", { class: "s-login-main-btn-icon sicon-mail" }),
124
+ h("span", { class: "s-login-main-btn-text" }, this.emailLabel),
125
+ h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })))
126
+ : '',
127
+ h("div", { class: "s-login-tab", ref: tab => this.tab2 = tab },
128
+ h("label", { class: "s-login-label" }, this.mobileLabel),
129
+ h("salla-tel-input", { phone: '', ref: el => this.loginTelInput = el }),
130
+ h("span", { class: "s-login-error-message" }),
131
+ h("salla-button", { wide: true, onClick: () => this.loginBySMS() }, this.enterText),
132
+ this.isEmailAllowed ? h("a", { href: "#", onClick: () => this.showTab(this.tab3), class: "s-login-link" }, this.byEmailText) : ''),
133
+ this.isEmailAllowed ?
134
+ h("div", { class: "s-login-tab", ref: tab => this.tab3 = tab },
135
+ h("label", { class: "s-login-label" }, this.emailLabel),
136
+ h("input", { onChange: () => this.loginByEmail(), type: "email", ref: el => this.email = el, onInput: this.typing, placeholder: "your@email.com", class: "s-login-input s-ltr" }),
137
+ h("span", { class: "s-login-error-message" }),
138
+ h("salla-button", { wide: true, onClick: () => this.loginByEmail() }, this.enterText),
139
+ h("a", { href: "#", onClick: () => this.showTab(this.tab2), class: "s-login-link" }, this.bySMSText)) : '',
140
+ h("salla-verify", { "without-modal": true, ref: tab => this.tab4 = tab, autoReload: false, "back-text": this.backText }),
141
+ h("div", { ref: tab => this.tab5 = tab },
142
+ h("label", { class: "s-login-label" }, salla.lang.get('blocks.header.your_name')),
143
+ h("input", { type: "text", class: "s-login-input", ref: el => this.firstName = el, placeholder: salla.lang.get('pages.profile.first_name') }),
144
+ h("label", { class: "s-login-label" }, salla.lang.get('pages.profile.last_name')),
145
+ h("input", { type: "text", class: "s-login-input", ref: el => this.lastName = el, placeholder: salla.lang.get('pages.profile.last_name') }),
146
+ h("div", { ref: el => this.regMobileBlock = el },
147
+ h("label", { class: "s-login-label" }, this.mobileLabel),
148
+ h("salla-tel-input", { phone: '', ref: el => this.regTelInput = el }),
149
+ h("span", { class: "s-login-error-message" })),
150
+ h("div", { ref: el => this.regEmailBlock = el },
151
+ h("label", { class: "s-login-label" }, this.emailLabel),
152
+ h("input", { type: "email", ref: el => this.regEmail = el, onInput: this.typing, placeholder: "your@email.com", class: "s-login-input s-ltr" }),
153
+ h("span", { class: "s-login-error-message" })),
154
+ h("salla-button", { wide: true, onClick: () => this.newUser() }, salla.lang.get('blocks.header.register'))))));
155
+ }
156
+ static get is() { return "salla-login"; }
157
+ static get originalStyleUrls() { return {
158
+ "$": ["salla-login.scss"]
159
+ }; }
160
+ static get styleUrls() { return {
161
+ "$": ["salla-login.css"]
162
+ }; }
163
+ static get properties() { return {
164
+ "isEmailAllowed": {
165
+ "type": "boolean",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "boolean",
169
+ "resolved": "boolean",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": ""
177
+ },
178
+ "attribute": "is-email-allowed",
179
+ "reflect": false,
180
+ "defaultValue": "true"
181
+ },
182
+ "loginTypeTitle": {
183
+ "type": "string",
184
+ "mutable": false,
185
+ "complexType": {
186
+ "original": "string",
187
+ "resolved": "string",
188
+ "references": {}
189
+ },
190
+ "required": false,
191
+ "optional": false,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": ""
195
+ },
196
+ "attribute": "login-type-title",
197
+ "reflect": false,
198
+ "defaultValue": "salla.lang.get('blocks.header.select_login_way')"
199
+ },
200
+ "loginText": {
201
+ "type": "string",
202
+ "mutable": false,
203
+ "complexType": {
204
+ "original": "string",
205
+ "resolved": "string",
206
+ "references": {}
207
+ },
208
+ "required": false,
209
+ "optional": false,
210
+ "docs": {
211
+ "tags": [],
212
+ "text": ""
213
+ },
214
+ "attribute": "login-text",
215
+ "reflect": false,
216
+ "defaultValue": "salla.lang.get('blocks.header.login')"
217
+ },
218
+ "smsLabel": {
219
+ "type": "string",
220
+ "mutable": false,
221
+ "complexType": {
222
+ "original": "string",
223
+ "resolved": "string",
224
+ "references": {}
225
+ },
226
+ "required": false,
227
+ "optional": false,
228
+ "docs": {
229
+ "tags": [],
230
+ "text": ""
231
+ },
232
+ "attribute": "sms-label",
233
+ "reflect": false,
234
+ "defaultValue": "salla.lang.get('blocks.header.sms')"
235
+ },
236
+ "mobileLabel": {
237
+ "type": "string",
238
+ "mutable": false,
239
+ "complexType": {
240
+ "original": "string",
241
+ "resolved": "string",
242
+ "references": {}
243
+ },
244
+ "required": false,
245
+ "optional": false,
246
+ "docs": {
247
+ "tags": [],
248
+ "text": ""
249
+ },
250
+ "attribute": "mobile-label",
251
+ "reflect": false,
252
+ "defaultValue": "salla.lang.get('common.elements.mobile')"
253
+ },
254
+ "emailLabel": {
255
+ "type": "string",
256
+ "mutable": false,
257
+ "complexType": {
258
+ "original": "string",
259
+ "resolved": "string",
260
+ "references": {}
261
+ },
262
+ "required": false,
263
+ "optional": false,
264
+ "docs": {
265
+ "tags": [],
266
+ "text": ""
267
+ },
268
+ "attribute": "email-label",
269
+ "reflect": false,
270
+ "defaultValue": "salla.lang.get('common.elements.email')"
271
+ },
272
+ "enterText": {
273
+ "type": "string",
274
+ "mutable": false,
275
+ "complexType": {
276
+ "original": "string",
277
+ "resolved": "string",
278
+ "references": {}
279
+ },
280
+ "required": false,
281
+ "optional": false,
282
+ "docs": {
283
+ "tags": [],
284
+ "text": ""
285
+ },
286
+ "attribute": "enter-text",
287
+ "reflect": false,
288
+ "defaultValue": "salla.lang.get('blocks.header.enter')"
289
+ },
290
+ "bySMSText": {
291
+ "type": "string",
292
+ "mutable": false,
293
+ "complexType": {
294
+ "original": "string",
295
+ "resolved": "string",
296
+ "references": {}
297
+ },
298
+ "required": false,
299
+ "optional": false,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": ""
303
+ },
304
+ "attribute": "by-s-m-s-text",
305
+ "reflect": false,
306
+ "defaultValue": "salla.lang.get('blocks.header.login_by_sms')"
307
+ },
308
+ "byEmailText": {
309
+ "type": "string",
310
+ "mutable": false,
311
+ "complexType": {
312
+ "original": "string",
313
+ "resolved": "string",
314
+ "references": {}
315
+ },
316
+ "required": false,
317
+ "optional": false,
318
+ "docs": {
319
+ "tags": [],
320
+ "text": ""
321
+ },
322
+ "attribute": "by-email-text",
323
+ "reflect": false,
324
+ "defaultValue": "salla.lang.get('blocks.header.login_by_email')"
325
+ },
326
+ "backText": {
327
+ "type": "string",
328
+ "mutable": false,
329
+ "complexType": {
330
+ "original": "string",
331
+ "resolved": "string",
332
+ "references": {}
333
+ },
334
+ "required": false,
335
+ "optional": false,
336
+ "docs": {
337
+ "tags": [],
338
+ "text": ""
339
+ },
340
+ "attribute": "back-text",
341
+ "reflect": false,
342
+ "defaultValue": "salla.lang.get('common.elements.back')"
343
+ }
344
+ }; }
345
+ static get methods() { return {
346
+ "show": {
347
+ "complexType": {
348
+ "signature": "() => Promise<HTMLElement>",
349
+ "parameters": [],
350
+ "references": {
351
+ "Promise": {
352
+ "location": "global"
353
+ },
354
+ "HTMLElement": {
355
+ "location": "global"
356
+ }
357
+ },
358
+ "return": "Promise<HTMLElement>"
359
+ },
360
+ "docs": {
361
+ "text": "",
362
+ "tags": []
363
+ }
364
+ }
365
+ }; }
366
+ static get elementRef() { return "host"; }
367
+ static get listeners() { return [{
368
+ "name": "verified",
369
+ "method": "onVerified",
370
+ "target": undefined,
371
+ "capture": false,
372
+ "passive": false
373
+ }, {
374
+ "name": "backClicked",
375
+ "method": "onbackClicked",
376
+ "target": undefined,
377
+ "capture": false,
378
+ "passive": false
379
+ }]; }
380
+ }