@salla.sa/twilight-components 1.0.12 → 1.0.14
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/{esm → twilight-components}/Helper-81ac9a8c.js +0 -0
- package/dist/twilight-components/app-globals-0f993ce5.js +3 -0
- package/dist/twilight-components/css-shim-a64b8820.js +4 -0
- package/dist/twilight-components/dom-d08ba8aa.js +73 -0
- package/dist/twilight-components/index-8cf58712.js +3010 -0
- package/dist/twilight-components/index.esm.js +3 -1
- package/dist/twilight-components/multi-warehouse.entry.js +89 -0
- package/dist/twilight-components/salla-button.entry.js +73 -0
- package/dist/{esm → twilight-components}/salla-localization.entry.js +8 -7
- package/dist/{esm/salla-login-0e85b2d8.js → twilight-components/salla-login-97e0a9ab.js} +1 -1
- package/dist/twilight-components/salla-login.entry.js +2 -0
- package/dist/twilight-components/salla-modal.entry.js +85 -0
- package/dist/{esm → twilight-components}/salla-product-availability.entry.js +12 -15
- package/dist/{esm → twilight-components}/salla-rating.entry.js +17 -17
- package/dist/{esm/salla-search-615b8f94.js → twilight-components/salla-search-df1c9b54.js} +1 -1
- package/dist/twilight-components/salla-search.entry.js +2 -0
- package/dist/{esm → twilight-components}/salla-verify.entry.js +1 -1
- package/dist/twilight-components/shadow-css-bc14d9fd.js +389 -0
- package/dist/twilight-components/twilight-components.css +3 -0
- package/dist/twilight-components/twilight-components.esm.js +125 -1
- package/dist/types/components/salla-button/salla-button.d.ts +1 -0
- package/dist/types/components/salla-localization/salla-localization.d.ts +2 -2
- package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +4 -3
- package/dist/types/components.d.ts +14 -10
- package/package.json +1 -1
- package/dist/cjs/Helper-8852feaa.js +0 -23
- package/dist/cjs/index-23da2c6b.js +0 -1601
- package/dist/cjs/index.cjs.js +0 -12
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/multi-warehouse_4.cjs.entry.js +0 -242
- package/dist/cjs/salla-localization.cjs.entry.js +0 -76
- package/dist/cjs/salla-login-476fb312.js +0 -14
- package/dist/cjs/salla-product-availability.cjs.entry.js +0 -78
- package/dist/cjs/salla-rating.cjs.entry.js +0 -299
- package/dist/cjs/salla-search-f9e00be9.js +0 -97
- package/dist/cjs/salla-search.cjs.entry.js +0 -10
- package/dist/cjs/salla-verify.cjs.entry.js +0 -96
- package/dist/cjs/twilight-components.cjs.js +0 -19
- package/dist/collection/Helpers/Helper.js +0 -19
- package/dist/collection/collection-manifest.json +0 -20
- package/dist/collection/components/generate-summary.js +0 -35
- package/dist/collection/components/multi-warehouse/multi-warehouse.css +0 -13
- package/dist/collection/components/multi-warehouse/multi-warehouse.js +0 -238
- package/dist/collection/components/salla-button/salla-button.css +0 -3
- package/dist/collection/components/salla-button/salla-button.js +0 -219
- package/dist/collection/components/salla-localization/salla-localization.js +0 -201
- package/dist/collection/components/salla-login/salla-login.js +0 -31
- package/dist/collection/components/salla-modal/salla-modal.js +0 -316
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +0 -316
- package/dist/collection/components/salla-rating/salla-rating.css +0 -3
- package/dist/collection/components/salla-rating/salla-rating.js +0 -484
- package/dist/collection/components/salla-search/salla-search.js +0 -155
- package/dist/collection/components/salla-verify/salla-verify.js +0 -99
- package/dist/collection/index.js +0 -2
- package/dist/collection/interfaces/colors.js +0 -1
- package/dist/collection/interfaces/index.js +0 -2
- package/dist/collection/interfaces/ratio.js +0 -1
- package/dist/collection/plugins/tailwind-theme/generator.js +0 -53
- package/dist/collection/plugins/tailwind-theme/index.js +0 -26
- package/dist/esm/index-643344dc.js +0 -1573
- package/dist/esm/index.js +0 -3
- package/dist/esm/loader.js +0 -17
- package/dist/esm/multi-warehouse_4.entry.js +0 -235
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/salla-search.entry.js +0 -2
- package/dist/esm/twilight-components.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/twilight-components/p-2b8a5fa4.entry.js +0 -1
- package/dist/twilight-components/p-36c87e2e.js +0 -1
- package/dist/twilight-components/p-4e37a6cb.entry.js +0 -1
- package/dist/twilight-components/p-751643d8.entry.js +0 -1
- package/dist/twilight-components/p-8a2410e6.js +0 -1
- package/dist/twilight-components/p-94b18718.entry.js +0 -1
- package/dist/twilight-components/p-9bc28e0c.js +0 -1
- package/dist/twilight-components/p-bb503365.entry.js +0 -1
- package/dist/twilight-components/p-d1ef2268.js +0 -1
- package/dist/twilight-components/p-d34bbfc4.entry.js +0 -1
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Component, Element, h } from '@stencil/core';
|
|
2
|
-
import Helper from "../../Helpers/Helper";
|
|
3
|
-
export class SallaVerify {
|
|
4
|
-
constructor() {
|
|
5
|
-
Helper.setHost(this.host);
|
|
6
|
-
salla.event.on('profile::verify.mobile', data => this.show(data));
|
|
7
|
-
}
|
|
8
|
-
show({ international_mobile: mobile, _country_iso2: country_code }) {
|
|
9
|
-
this.mobile = mobile;
|
|
10
|
-
this.country_code = country_code;
|
|
11
|
-
this.resendTimer();
|
|
12
|
-
this.otpInputs = document.querySelectorAll('.s-verify-input');
|
|
13
|
-
this.otpInputs[0].focus();
|
|
14
|
-
Helper.onKeyUp('.s-verify-input', event => {
|
|
15
|
-
var _a, _b, _c, _d;
|
|
16
|
-
let key = event.keyCode || event.charCode;
|
|
17
|
-
salla.helpers.digitsOnly(event.target);
|
|
18
|
-
if (event.target.value) {
|
|
19
|
-
(_a = event.target.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
|
|
20
|
-
(_b = event.target.nextElementSibling) === null || _b === void 0 ? void 0 : _b.select();
|
|
21
|
-
}
|
|
22
|
-
else if ([8, 46].includes(key)) {
|
|
23
|
-
(_c = event.target.previousElementSibling) === null || _c === void 0 ? void 0 : _c.focus();
|
|
24
|
-
(_d = event.target.previousElementSibling) === null || _d === void 0 ? void 0 : _d.select();
|
|
25
|
-
}
|
|
26
|
-
this.toggleOTPSubmit();
|
|
27
|
-
});
|
|
28
|
-
Helper.on('paste', '.s-verify-input', event => {
|
|
29
|
-
let text = event.clipboardData.getData('text').toArabicDigits().replace(/[^0-9.]/g, '').replace('..', '.');
|
|
30
|
-
this.otpInputs.forEach((input, i) => input.value = text[i] || '');
|
|
31
|
-
this.toggleOTPSubmit();
|
|
32
|
-
setTimeout(() => this.otpInputs[3].focus(), 100);
|
|
33
|
-
});
|
|
34
|
-
return this.modal.show();
|
|
35
|
-
}
|
|
36
|
-
toggleOTPSubmit() {
|
|
37
|
-
let otp = [];
|
|
38
|
-
this.otpInputs.forEach(input => input.value && otp.push(input.value));
|
|
39
|
-
this.code.value = otp.join('');
|
|
40
|
-
if (otp.length === 4) {
|
|
41
|
-
this.btn.removeAttribute('disabled');
|
|
42
|
-
this.btn.click();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.btn.setAttribute('disabled', '');
|
|
46
|
-
}
|
|
47
|
-
resendTimer() {
|
|
48
|
-
Helper.showElement(this.resendMessage).hideElement(this.resend);
|
|
49
|
-
let resendAfter = 30;
|
|
50
|
-
let timerId = setInterval(() => {
|
|
51
|
-
if (resendAfter === -1) {
|
|
52
|
-
clearTimeout(timerId);
|
|
53
|
-
Helper.hideElement(this.resendMessage).showElement(this.resend);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.timer.innerHTML = `${resendAfter >= 10 ? resendAfter : '0' + resendAfter} : 00`;
|
|
57
|
-
resendAfter--;
|
|
58
|
-
}
|
|
59
|
-
}, 1000);
|
|
60
|
-
}
|
|
61
|
-
submit() {
|
|
62
|
-
return this.btn.load()
|
|
63
|
-
.then(() => this.btn.disable())
|
|
64
|
-
.then(() => salla.document.api.request('profile/verify-mobile', {
|
|
65
|
-
mobile: this.mobile,
|
|
66
|
-
country_code: this.country_code,
|
|
67
|
-
code: this.code.value
|
|
68
|
-
})).then(() => this.btn.stop() && this.btn.disable())
|
|
69
|
-
.then(() => this.modal.hide())
|
|
70
|
-
.then(() => window.location.reload())
|
|
71
|
-
.catch(() => this.btn.stop() && this.btn.enable());
|
|
72
|
-
}
|
|
73
|
-
resendCode() {
|
|
74
|
-
return this.btn.stop()
|
|
75
|
-
.then(() => this.btn.disable())
|
|
76
|
-
.then(() => {
|
|
77
|
-
this.otpInputs.forEach(input => input.value = '');
|
|
78
|
-
this.otpInputs[0].focus();
|
|
79
|
-
})
|
|
80
|
-
.then(() => salla.api.auth.resend({ phone: this.mobile, country_code: this.country_code }))
|
|
81
|
-
.then(() => this.resendTimer())
|
|
82
|
-
.catch(() => this.resendTimer());
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
return (h("salla-modal", { id: "s-verify", ref: modal => this.modal = modal, title: salla.lang.get('pages.profile.verify_title') },
|
|
86
|
-
h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }),
|
|
87
|
-
h("label", { class: "s-verify-label" }, salla.lang.get('pages.profile.verify_placeholder')),
|
|
88
|
-
h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }),
|
|
89
|
-
h("div", { class: "s-verify-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => h("input", { type: "text", maxlength: "1", class: "s-verify-input", required: true }))),
|
|
90
|
-
h("div", { slot: "footer", class: "s-verify-footer" },
|
|
91
|
-
h("salla-button", { class: "s-verify-submit", disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')),
|
|
92
|
-
h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el },
|
|
93
|
-
salla.lang.get('blocks.header.resend_after'),
|
|
94
|
-
h("b", { class: "s-verify-timer", ref: el => this.timer = el })),
|
|
95
|
-
h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit')))));
|
|
96
|
-
}
|
|
97
|
-
static get is() { return "salla-verify"; }
|
|
98
|
-
static get elementRef() { return "host"; }
|
|
99
|
-
}
|
package/dist/collection/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var fs = require('fs');
|
|
2
|
-
var path = require('path');
|
|
3
|
-
var _ = require('lodash');
|
|
4
|
-
var components = {};
|
|
5
|
-
let componentsPath=path.resolve(__dirname,'../../components');
|
|
6
|
-
fs.readdirSync(componentsPath, {withFileTypes: true})
|
|
7
|
-
.filter(parent => parent.isDirectory())
|
|
8
|
-
.forEach(directory => {
|
|
9
|
-
try {
|
|
10
|
-
components[directory.name.replace('salla-','')] = require(path.resolve(componentsPath , directory.name, 'utilities.json'));
|
|
11
|
-
} catch (e) {
|
|
12
|
-
// ignore
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
var utilities = {};
|
|
16
|
-
|
|
17
|
-
for (const [keyComponent, value] of Object.entries(components)) {
|
|
18
|
-
console.log('> Processing ' + keyComponent + ' ...');
|
|
19
|
-
_.forEach(value, function(value, keyUtility) {
|
|
20
|
-
keyUtility = '.s-' + keyComponent + '-' + keyUtility;
|
|
21
|
-
utilities[keyUtility] = {[`@apply ${value}`]: {}};
|
|
22
|
-
});
|
|
23
|
-
console.log('✓ Processed ' + keyComponent + '');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// write the utilities for the plugin
|
|
27
|
-
console.log('> Write utilities ...');
|
|
28
|
-
fs.writeFileSync(
|
|
29
|
-
path.resolve(__dirname, 'utilities.json'),
|
|
30
|
-
JSON.stringify(utilities),
|
|
31
|
-
function(err) {
|
|
32
|
-
if (err) {
|
|
33
|
-
return console.log(err);
|
|
34
|
-
}
|
|
35
|
-
console.log('The file was saved!');
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// write the save list css
|
|
41
|
-
console.log('> Write safe-list-css ...');
|
|
42
|
-
fs.writeFileSync(
|
|
43
|
-
path.resolve(__dirname, 'safe-list-css.txt'),
|
|
44
|
-
Object.keys(utilities).map((name) => name.replace('.','')).join('\n'),
|
|
45
|
-
function(err) {
|
|
46
|
-
if (err) {
|
|
47
|
-
return console.log(err);
|
|
48
|
-
}
|
|
49
|
-
console.log('The file was saved!');
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
console.log('✓ Done ...');
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = require('tailwindcss/plugin').withOptions(() => {
|
|
2
|
-
return function({addUtilities}) {
|
|
3
|
-
addUtilities({
|
|
4
|
-
// TODO :: find if there are used and defined them here if its.
|
|
5
|
-
'.anime-item': {},
|
|
6
|
-
'.text-md': {},
|
|
7
|
-
'.items-top': {},
|
|
8
|
-
'.error': {},
|
|
9
|
-
'.search-box': {},
|
|
10
|
-
'.spinner-loader-wrap': {}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// todo :: move it to global
|
|
14
|
-
addUtilities({
|
|
15
|
-
'.spinner-loader': {
|
|
16
|
-
'border-right-color': 'var(--main-color) !important',
|
|
17
|
-
'&.reverse': {
|
|
18
|
-
'border-right-color': '#9f7171 !important',
|
|
19
|
-
'background-color': '#f98181'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
addUtilities(require('./utilities.json'));
|
|
25
|
-
};
|
|
26
|
-
});
|