@salla.sa/twilight-components 1.0.21 → 1.0.22

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 (95) 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-c438bb35.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-45173394.js +85 -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 +3 -0
  24. package/dist/collection/components/salla-login/salla-login.js +380 -0
  25. package/dist/collection/components/salla-modal/salla-modal.js +477 -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 +24 -0
  33. package/dist/collection/components/salla-search/salla-search.js +143 -0
  34. package/dist/collection/components/salla-tel-input/salla-tel-input.js +121 -0
  35. package/dist/collection/components/salla-verify/salla-verify.js +280 -0
  36. package/dist/collection/index.js +2 -0
  37. package/dist/collection/interfaces/colors.js +1 -0
  38. package/dist/collection/interfaces/index.js +2 -0
  39. package/dist/collection/interfaces/ratio.js +1 -0
  40. package/dist/collection/plugins/tailwind-theme/generator.js +62 -0
  41. package/dist/collection/plugins/tailwind-theme/index.js +26 -0
  42. package/dist/{twilight-components → esm}/Helper-d07ebbc7.js +0 -0
  43. package/dist/esm/index-a1bf769d.js +1625 -0
  44. package/dist/esm/index.js +4 -0
  45. package/dist/esm/loader.js +17 -0
  46. package/dist/esm/polyfills/core-js.js +11 -0
  47. package/dist/esm/polyfills/css-shim.js +1 -0
  48. package/dist/esm/polyfills/dom.js +79 -0
  49. package/dist/esm/polyfills/es5-html-element.js +1 -0
  50. package/dist/esm/polyfills/index.js +34 -0
  51. package/dist/esm/polyfills/system.js +6 -0
  52. package/dist/{twilight-components → esm}/salla-branches.entry.js +2 -2
  53. package/dist/{twilight-components/salla-tel-input.entry.js → esm/salla-button_5.entry.js} +337 -35
  54. package/dist/{twilight-components → esm}/salla-localization.entry.js +1 -1
  55. package/dist/{twilight-components/salla-login-57b18c2c.js → esm/salla-login-dd957742.js} +26 -23
  56. package/dist/{twilight-components → esm}/salla-offer.entry.js +1 -1
  57. package/dist/{twilight-components → esm}/salla-product-availability.entry.js +1 -1
  58. package/dist/{twilight-components → esm}/salla-rating.entry.js +71 -108
  59. package/dist/{twilight-components/salla-search-30fec1e8.js → esm/salla-search-5e691ebb.js} +15 -11
  60. package/dist/esm/salla-search.entry.js +3 -0
  61. package/dist/esm/twilight-components.js +17 -0
  62. package/dist/index.cjs.js +1 -0
  63. package/dist/index.js +1 -0
  64. package/dist/twilight-components/index.esm.js +1 -4
  65. package/dist/twilight-components/p-1a6d8171.entry.js +1 -0
  66. package/dist/twilight-components/p-1deb8111.entry.js +1 -0
  67. package/dist/twilight-components/p-3a4d963e.js +1 -0
  68. package/dist/twilight-components/p-47f17d3b.js +1 -0
  69. package/dist/twilight-components/p-5b2eb87d.entry.js +1 -0
  70. package/dist/twilight-components/p-6a5be894.js +1 -0
  71. package/dist/twilight-components/p-7fbdf746.entry.js +1 -0
  72. package/dist/twilight-components/p-7fe5d346.entry.js +1 -0
  73. package/dist/twilight-components/p-81a61f4e.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/twilight-components.css +1 -3
  77. package/dist/twilight-components/twilight-components.esm.js +1 -125
  78. package/dist/types/components/salla-login/salla-login.d.ts +3 -3
  79. package/dist/types/components/salla-modal/salla-modal.d.ts +1 -0
  80. package/dist/types/components/salla-rating/salla-rating.d.ts +6 -23
  81. package/dist/types/components/salla-search/salla-search.d.ts +1 -1
  82. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +14 -0
  83. package/dist/types/components/salla-verify/salla-verify.d.ts +3 -1
  84. package/dist/types/components.d.ts +12 -35
  85. package/package.json +1 -1
  86. package/dist/twilight-components/app-globals-0f993ce5.js +0 -3
  87. package/dist/twilight-components/css-shim-a64b8820.js +0 -4
  88. package/dist/twilight-components/dom-d08ba8aa.js +0 -73
  89. package/dist/twilight-components/index-9c087700.js +0 -3010
  90. package/dist/twilight-components/salla-button.entry.js +0 -75
  91. package/dist/twilight-components/salla-login.entry.js +0 -3
  92. package/dist/twilight-components/salla-modal.entry.js +0 -113
  93. package/dist/twilight-components/salla-search.entry.js +0 -3
  94. package/dist/twilight-components/salla-verify.entry.js +0 -114
  95. package/dist/twilight-components/shadow-css-bc14d9fd.js +0 -389
@@ -0,0 +1,143 @@
1
+ import { Component, h, Prop, State, Element, Listen } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ export class SallaSearch {
4
+ constructor() {
5
+ var _a;
6
+ this.results = [];
7
+ /**
8
+ * Override search placeholder.
9
+ */
10
+ this.placeholder = salla.lang.get('blocks.header.search_placeholder');
11
+ /**
12
+ * Override no results error message.
13
+ */
14
+ this.noResultsText = salla.lang.get('common.elements.no_options');
15
+ Helper.setHost(this.host);
16
+ this.productSlot = ((_a = Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
17
+ }
18
+ onModalOpen() {
19
+ this.modal.querySelector('.s-search-input').focus();
20
+ }
21
+ onModalClose() {
22
+ this.modal.querySelector('.s-search-input').value = '';
23
+ this.results = [];
24
+ this.afterSearching();
25
+ }
26
+ getDefaultProductSlot() {
27
+ return '<div class="s-search-product-image-container">' +
28
+ ' <img class="s-search-product-image" src="{image}" alt="{name}"/>' +
29
+ '</div>' +
30
+ '<div class="s-search-product-details">' +
31
+ ' <div class="s-search-product-name">{name}</div> <div class="s-search-product-price">{price}</div>' +
32
+ '</div>';
33
+ }
34
+ //todo:: reset data when closing
35
+ search(e) {
36
+ Helper.hideElement(this.noResults);
37
+ if (e.target.value.length === 0) {
38
+ this.results = [];
39
+ this.afterSearching();
40
+ return;
41
+ }
42
+ if (e.target.value.length <= 2) {
43
+ return;
44
+ }
45
+ //run loading spinner or stop it
46
+ Helper.toggleElement(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => true);
47
+ salla.search.api.search(e.target.value)
48
+ .then(response => this.results = response.results)
49
+ .catch(err => err !== 'Query Same As Previous!' ? this.results = [] : null)
50
+ .finally(() => this.afterSearching(/*isEmpty*/ false));
51
+ }
52
+ afterSearching(isEmpty = true) {
53
+ this.noResults.style.display = isEmpty || this.results.length > 0 ? 'none' : 'block';
54
+ Helper.toggleElement(this.container, 's-search-container-open', 'no-results', () => this.results.length)
55
+ .toggleElement(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => false); //stop searching anime
56
+ salla.search.api.previousQuery = ''; //avoid having error 'Query Same As Previous' after reopen modal;
57
+ }
58
+ render() {
59
+ var _a;
60
+ return (h("salla-modal", { position: "top", id: "s-search-modal", ref: modal => this.modal = modal },
61
+ h("div", { class: "s-search-container", ref: container => this.container = container },
62
+ h("input", { class: "s-search-input", type: "text", placeholder: this.placeholder, onInput: e => this.search(e) }),
63
+ h("span", { class: "s-search-icon" },
64
+ h("i", { class: "sicon-search", ref: el => this.searchIcon = el })),
65
+ h("div", { class: "s-search-results" }, (_a = this.results) === null || _a === void 0 ? void 0 :
66
+ _a.map(item => {
67
+ var _a;
68
+ return h("a", { href: item.url, class: "s-search-product", innerHTML: this.productSlot
69
+ .replace(/\{name\}/g, item.title)
70
+ .replace(/\{price\}/g, (_a = item.price) === null || _a === void 0 ? void 0 : _a.after) //todo:: get discounted price too
71
+ .replace(/\{image\}/g, item.thumb) });
72
+ }),
73
+ h("p", { ref: el => this.noResults = el, class: "s-search-no-results" }, this.noResultsText)))));
74
+ }
75
+ /**
76
+ * Run it one time after load
77
+ */
78
+ componentDidLoad() {
79
+ this.afterSearching();
80
+ }
81
+ static get is() { return "salla-search"; }
82
+ static get originalStyleUrls() { return {
83
+ "$": ["salla-search.scss"]
84
+ }; }
85
+ static get styleUrls() { return {
86
+ "$": ["salla-search.css"]
87
+ }; }
88
+ static get properties() { return {
89
+ "placeholder": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "string",
94
+ "resolved": "string",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": false,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Override search placeholder."
102
+ },
103
+ "attribute": "placeholder",
104
+ "reflect": false,
105
+ "defaultValue": "salla.lang.get('blocks.header.search_placeholder')"
106
+ },
107
+ "noResultsText": {
108
+ "type": "string",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "string",
112
+ "resolved": "string",
113
+ "references": {}
114
+ },
115
+ "required": false,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Override no results error message."
120
+ },
121
+ "attribute": "no-results-text",
122
+ "reflect": false,
123
+ "defaultValue": "salla.lang.get('common.elements.no_options')"
124
+ }
125
+ }; }
126
+ static get states() { return {
127
+ "results": {}
128
+ }; }
129
+ static get elementRef() { return "host"; }
130
+ static get listeners() { return [{
131
+ "name": "modalOpened",
132
+ "method": "onModalOpen",
133
+ "target": undefined,
134
+ "capture": false,
135
+ "passive": false
136
+ }, {
137
+ "name": "modalClosed",
138
+ "method": "onModalClose",
139
+ "target": undefined,
140
+ "capture": false,
141
+ "passive": false
142
+ }]; }
143
+ }
@@ -0,0 +1,121 @@
1
+ import { Element, Component, Host, h, Prop, Method } from '@stencil/core';
2
+ import TelInput from "intl-tel-input";
3
+ import Helper from "../../Helpers/Helper";
4
+ export class SallaTelInput {
5
+ constructor() {
6
+ this.countryCode = "SA";
7
+ this.countryKey = "+966";
8
+ Helper.setHost(this.host);
9
+ }
10
+ async getValues() {
11
+ this.phone = this.phoneInput.value;
12
+ this.countryCode = this.countryCodeInput.value;
13
+ this.countryKey = this.countryKeyInput.value;
14
+ return { phone: this.phoneInput.value, countryCode: this.countryCodeInput.value, countryKey: this.countryKeyInput.value };
15
+ }
16
+ initTelInput() {
17
+ salla.document.event.onKeyup('.tel-input', event => salla.helpers.digitsOnly(event.target));
18
+ document.querySelectorAll('.tel-input').forEach((intlInput) => {
19
+ salla.helpers.digitsOnly(intlInput);
20
+ let iti = TelInput(intlInput, {
21
+ initialCountry: intlInput.dataset.code || 'sa',
22
+ preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'sy', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],
23
+ formatOnDisplay: false,
24
+ separateDialCode: true,
25
+ autoPlaceholder: 'aggressive',
26
+ utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/utils.min.js',
27
+ });
28
+ intlInput.addEventListener("countrychange", () => {
29
+ let data = iti.getSelectedCountryData();
30
+ this.host.querySelectorAll('.country_code').forEach((input) => input.value = data.iso2.toUpperCase());
31
+ this.host.querySelectorAll('.country_key').forEach((input) => {
32
+ input.value = ('+' + data.dialCode).replace('++', '+');
33
+ });
34
+ });
35
+ });
36
+ }
37
+ render() {
38
+ return (h(Host, null,
39
+ h("input", { type: "tel", name: "mobile", "data-code": this.countryCode, value: this.phone, ref: el => this.phoneInput = el, class: "s-tel-input-control tel-input s-ltr" }),
40
+ h("input", { type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" }),
41
+ h("input", { type: "hidden", name: "country_key", value: this.countryKey, ref: el => this.countryKeyInput = el, class: "country_key" })));
42
+ }
43
+ componentDidRender() {
44
+ this.initTelInput();
45
+ }
46
+ static get is() { return "salla-tel-input"; }
47
+ static get properties() { return {
48
+ "phone": {
49
+ "type": "string",
50
+ "mutable": true,
51
+ "complexType": {
52
+ "original": "string",
53
+ "resolved": "string",
54
+ "references": {}
55
+ },
56
+ "required": false,
57
+ "optional": false,
58
+ "docs": {
59
+ "tags": [],
60
+ "text": ""
61
+ },
62
+ "attribute": "phone",
63
+ "reflect": false
64
+ },
65
+ "countryCode": {
66
+ "type": "string",
67
+ "mutable": true,
68
+ "complexType": {
69
+ "original": "string",
70
+ "resolved": "string",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": ""
78
+ },
79
+ "attribute": "country-code",
80
+ "reflect": false,
81
+ "defaultValue": "\"SA\""
82
+ },
83
+ "countryKey": {
84
+ "type": "string",
85
+ "mutable": true,
86
+ "complexType": {
87
+ "original": "string",
88
+ "resolved": "string",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": ""
96
+ },
97
+ "attribute": "country-key",
98
+ "reflect": false,
99
+ "defaultValue": "\"+966\""
100
+ }
101
+ }; }
102
+ static get methods() { return {
103
+ "getValues": {
104
+ "complexType": {
105
+ "signature": "() => Promise<{ phone: string; countryCode: string; countryKey: string; }>",
106
+ "parameters": [],
107
+ "references": {
108
+ "Promise": {
109
+ "location": "global"
110
+ }
111
+ },
112
+ "return": "Promise<{ phone: string; countryCode: string; countryKey: string; }>"
113
+ },
114
+ "docs": {
115
+ "text": "",
116
+ "tags": []
117
+ }
118
+ }
119
+ }; }
120
+ static get elementRef() { return "host"; }
121
+ }
@@ -0,0 +1,280 @@
1
+ import { Component, Element, Event, h, Method, Prop } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ export class SallaVerify {
4
+ constructor() {
5
+ this.url = 'profile/verify-mobile';
6
+ this.by = 'sms';
7
+ this.autoReload = true;
8
+ Helper.setHost(this.host);
9
+ if (this.withoutModal) {
10
+ this.modal = { show: () => '', hide: () => '' };
11
+ }
12
+ else {
13
+ salla.event.on('profile::verify.mobile', data => this.show(data));
14
+ }
15
+ }
16
+ async getCode() {
17
+ return this.code.value;
18
+ }
19
+ componentDidLoad() {
20
+ Helper.on('input', '.s-verify-input', e => salla.helpers.digitsOnly(e.target));
21
+ Helper.onKeyUp('.s-verify-input', event => {
22
+ var _a, _b, _c, _d;
23
+ let key = event.keyCode || event.charCode;
24
+ if (event.target.value) {
25
+ (_a = event.target.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
26
+ (_b = event.target.nextElementSibling) === null || _b === void 0 ? void 0 : _b.select();
27
+ }
28
+ else if ([8, 46].includes(key)) {
29
+ (_c = event.target.previousElementSibling) === null || _c === void 0 ? void 0 : _c.focus();
30
+ (_d = event.target.previousElementSibling) === null || _d === void 0 ? void 0 : _d.select();
31
+ }
32
+ this.toggleOTPSubmit();
33
+ });
34
+ Helper.on('paste', '.s-verify-input', event => {
35
+ let text = event.clipboardData.getData('text').toArabicDigits().replace(/[^0-9.]/g, '').replace('..', '.');
36
+ this.otpInputs.forEach((input, i) => input.value = text[i] || '');
37
+ this.toggleOTPSubmit();
38
+ setTimeout(() => this.otpInputs[3].focus(), 100);
39
+ });
40
+ return this.modal.show();
41
+ }
42
+ async show(data) {
43
+ this.data = data;
44
+ this.resendTimer();
45
+ this.otpInputs = document.querySelectorAll('.s-verify-input');
46
+ this.reset();
47
+ }
48
+ toggleOTPSubmit() {
49
+ let otp = [];
50
+ this.otpInputs.forEach(input => input.value && otp.push(input.value));
51
+ this.code.value = otp.join('');
52
+ if (otp.length === 4) {
53
+ this.btn.removeAttribute('disabled');
54
+ this.btn.click();
55
+ return;
56
+ }
57
+ this.btn.setAttribute('disabled', '');
58
+ }
59
+ reset() {
60
+ this.otpInputs.forEach((input) => input.value = '');
61
+ this.code.value = '';
62
+ this.otpInputs[0].focus();
63
+ }
64
+ resendTimer() {
65
+ Helper.showElement(this.resendMessage).hideElement(this.resend);
66
+ let resendAfter = 30;
67
+ let timerId = setInterval(() => {
68
+ if (resendAfter === -1) {
69
+ clearTimeout(timerId);
70
+ Helper.hideElement(this.resendMessage).showElement(this.resend);
71
+ }
72
+ else {
73
+ this.timer.innerHTML = `${resendAfter >= 10 ? resendAfter : '0' + resendAfter} : 00`;
74
+ resendAfter--;
75
+ }
76
+ }, 1000);
77
+ }
78
+ resendCode() {
79
+ return this.btn.stop()
80
+ .then(() => this.btn.disable())
81
+ .then(() => {
82
+ this.otpInputs.forEach(input => input.value = '');
83
+ this.otpInputs[0].focus();
84
+ })
85
+ .then(() => salla.api.auth.resend(Object.assign({ resend_by: this.by }, this.data)))
86
+ .then(() => this.resendTimer())
87
+ .catch(() => this.resendTimer());
88
+ }
89
+ submit() {
90
+ return this.btn.load()
91
+ .then(() => this.btn.disable())
92
+ .then(() => salla.document.api.request(this.url, Object.assign({ code: this.code.value }, this.data)))
93
+ .then(response => this.verified.emit(response))
94
+ .then(() => this.btn.stop() && this.btn.disable())
95
+ .then(() => this.modal.hide())
96
+ .then(() => this.autoReload && window.location.reload())
97
+ .catch(() => this.btn.stop() && this.btn.enable() && this.reset());
98
+ }
99
+ render() {
100
+ return this.withoutModal ? this.myBody() :
101
+ h("salla-modal", { id: "s-verify", ref: modal => this.modal = modal, title: salla.lang.get('pages.profile.verify_title') }, this.myBody());
102
+ }
103
+ myBody() {
104
+ return [
105
+ h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }),
106
+ // <label class="s-verify-label">{salla.lang.get('pages.profile.verify_placeholder')}</label>,
107
+ h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }),
108
+ 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 }))),
109
+ h("div", { slot: "footer", class: "s-verify-footer" },
110
+ h("salla-button", { class: "s-verify-submit", disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')),
111
+ h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el },
112
+ salla.lang.get('blocks.header.resend_after'),
113
+ h("b", { class: "s-verify-timer", ref: el => this.timer = el })),
114
+ h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit')),
115
+ this.backText ?
116
+ h("a", { href: "#", class: "s-verify-resend", onClick: () => this.backClicked.emit() }, this.backText)
117
+ : '')
118
+ ];
119
+ }
120
+ static get is() { return "salla-verify"; }
121
+ static get properties() { return {
122
+ "withoutModal": {
123
+ "type": "boolean",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "boolean",
127
+ "resolved": "boolean",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "Should render component without modal"
135
+ },
136
+ "attribute": "without-modal",
137
+ "reflect": false
138
+ },
139
+ "url": {
140
+ "type": "string",
141
+ "mutable": false,
142
+ "complexType": {
143
+ "original": "string",
144
+ "resolved": "string",
145
+ "references": {}
146
+ },
147
+ "required": false,
148
+ "optional": false,
149
+ "docs": {
150
+ "tags": [],
151
+ "text": ""
152
+ },
153
+ "attribute": "url",
154
+ "reflect": false,
155
+ "defaultValue": "'profile/verify-mobile'"
156
+ },
157
+ "by": {
158
+ "type": "string",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "string",
162
+ "resolved": "string",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": false,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": ""
170
+ },
171
+ "attribute": "by",
172
+ "reflect": false,
173
+ "defaultValue": "'sms'"
174
+ },
175
+ "backText": {
176
+ "type": "string",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "string",
180
+ "resolved": "string",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": ""
188
+ },
189
+ "attribute": "back-text",
190
+ "reflect": false
191
+ },
192
+ "autoReload": {
193
+ "type": "boolean",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "boolean",
197
+ "resolved": "boolean",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": ""
205
+ },
206
+ "attribute": "auto-reload",
207
+ "reflect": false,
208
+ "defaultValue": "true"
209
+ }
210
+ }; }
211
+ static get events() { return [{
212
+ "method": "verified",
213
+ "name": "verified",
214
+ "bubbles": true,
215
+ "cancelable": true,
216
+ "composed": true,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": ""
220
+ },
221
+ "complexType": {
222
+ "original": "any",
223
+ "resolved": "any",
224
+ "references": {}
225
+ }
226
+ }, {
227
+ "method": "backClicked",
228
+ "name": "backClicked",
229
+ "bubbles": true,
230
+ "cancelable": true,
231
+ "composed": true,
232
+ "docs": {
233
+ "tags": [],
234
+ "text": ""
235
+ },
236
+ "complexType": {
237
+ "original": "any",
238
+ "resolved": "any",
239
+ "references": {}
240
+ }
241
+ }]; }
242
+ static get methods() { return {
243
+ "getCode": {
244
+ "complexType": {
245
+ "signature": "() => Promise<string>",
246
+ "parameters": [],
247
+ "references": {
248
+ "Promise": {
249
+ "location": "global"
250
+ }
251
+ },
252
+ "return": "Promise<string>"
253
+ },
254
+ "docs": {
255
+ "text": "",
256
+ "tags": []
257
+ }
258
+ },
259
+ "show": {
260
+ "complexType": {
261
+ "signature": "(data: any) => Promise<void>",
262
+ "parameters": [{
263
+ "tags": [],
264
+ "text": ""
265
+ }],
266
+ "references": {
267
+ "Promise": {
268
+ "location": "global"
269
+ }
270
+ },
271
+ "return": "Promise<void>"
272
+ },
273
+ "docs": {
274
+ "text": "",
275
+ "tags": []
276
+ }
277
+ }
278
+ }; }
279
+ static get elementRef() { return "host"; }
280
+ }
@@ -0,0 +1,2 @@
1
+ export * from './components/salla-login/salla-login';
2
+ export * from './components/salla-search/salla-search';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './colors';
2
+ export * from './ratio';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,62 @@
1
+ var fs = require('fs');
2
+ var path = require('path');
3
+ var _ = require('lodash');
4
+ var components = {};
5
+ var componentsPath = path.resolve(__dirname, '../../components');
6
+
7
+ //==================== Global Salla Components Styles ====================//
8
+ var utilities = {
9
+ '.s-has-error': {'@apply !border-red-500 !text-red-500': {}},
10
+ '.s-ltr' : {direction: 'ltr'},
11
+ '.s-input' : {'@apply appearance-none form-input': {}},
12
+ '.s-hidden' : {'@apply hidden': {}},
13
+ '.s-block' : {'@apply block': {}},
14
+ };
15
+
16
+ fs.readdirSync(componentsPath, {withFileTypes: true})
17
+ .filter(parent => parent.isDirectory())
18
+ .forEach(directory => {
19
+ try {
20
+ components[directory.name.replace('salla-', '')] = require(path.resolve(componentsPath, directory.name, 'utilities.json'));
21
+ } catch (e) {
22
+ // ignore
23
+ }
24
+ });
25
+
26
+ for (const [keyComponent, value] of Object.entries(components)) {
27
+ console.log('> Processing ' + keyComponent + ' ...');
28
+ _.forEach(value, function (value, keyUtility) {
29
+ keyUtility = '.s-' + keyComponent + '-' + keyUtility;
30
+ utilities[keyUtility] = {[`@apply ${value}`]: {}};
31
+ });
32
+ console.log('✓ Processed ' + keyComponent + '');
33
+ }
34
+
35
+ // write the utilities for the plugin
36
+ console.log('> Write utilities ...');
37
+ fs.writeFileSync(
38
+ path.resolve(__dirname, 'utilities.json'),
39
+ JSON.stringify(utilities),
40
+ function (err) {
41
+ if (err) {
42
+ return console.log(err);
43
+ }
44
+ console.log('The file was saved!');
45
+ }
46
+ );
47
+
48
+
49
+ // write the save list css
50
+ console.log('> Write safe-list-css ...');
51
+ fs.writeFileSync(
52
+ path.resolve(__dirname, 'safe-list-css.txt'),
53
+ Object.keys(utilities).map((name) => name.replace('.', '')).join('\n'),
54
+ function (err) {
55
+ if (err) {
56
+ return console.log(err);
57
+ }
58
+ console.log('The file was saved!');
59
+ }
60
+ );
61
+
62
+ console.log('✓ Done ...');
@@ -0,0 +1,26 @@
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(--color-main) !important',
17
+ '&.reverse': {
18
+ 'border-right-color': '#9f7171 !important',
19
+ 'background-color' : '#f98181'
20
+ }
21
+ }
22
+ });
23
+
24
+ addUtilities(require('./utilities.json'));
25
+ };
26
+ });