@salla.sa/twilight-components 1.0.19 → 1.0.20

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 (92) hide show
  1. package/dist/{esm → twilight-components}/Helper-d07ebbc7.js +0 -0
  2. package/dist/twilight-components/app-globals-0f993ce5.js +3 -0
  3. package/dist/twilight-components/css-shim-a64b8820.js +4 -0
  4. package/dist/twilight-components/dom-d08ba8aa.js +73 -0
  5. package/dist/twilight-components/index-799f93d3.js +3010 -0
  6. package/dist/twilight-components/index-9c087700.js +3010 -0
  7. package/dist/twilight-components/index.esm.js +4 -1
  8. package/dist/{esm → twilight-components}/salla-branches.entry.js +1 -1
  9. package/dist/twilight-components/salla-button.entry.js +75 -0
  10. package/dist/{esm → twilight-components}/salla-localization.entry.js +1 -1
  11. package/dist/{esm/salla-login-38586400.js → twilight-components/salla-login-57b18c2c.js} +1 -1
  12. package/dist/{cjs/salla-login-008cc893.js → twilight-components/salla-login-663f8d42.js} +13 -15
  13. package/dist/twilight-components/salla-login.entry.js +3 -0
  14. package/dist/twilight-components/salla-modal.entry.js +113 -0
  15. package/dist/twilight-components/salla-offer.entry.js +75 -0
  16. package/dist/{esm → twilight-components}/salla-product-availability.entry.js +1 -1
  17. package/dist/{esm → twilight-components}/salla-rating.entry.js +30 -69
  18. package/dist/{esm/salla-search-ca856aab.js → twilight-components/salla-search-25757808.js} +1 -1
  19. package/dist/{cjs/salla-search-c7aad59a.js → twilight-components/salla-search-30fec1e8.js} +15 -17
  20. package/dist/twilight-components/salla-search.entry.js +3 -0
  21. package/dist/{esm/salla-button_5.entry.js → twilight-components/salla-tel-input.entry.js} +33 -294
  22. package/dist/twilight-components/salla-verify.entry.js +114 -0
  23. package/dist/twilight-components/shadow-css-bc14d9fd.js +389 -0
  24. package/dist/twilight-components/twilight-components.css +3 -1
  25. package/dist/twilight-components/twilight-components.esm.js +125 -1
  26. package/dist/types/components/salla-offer/offer-schema.d.ts +47 -0
  27. package/dist/types/components/salla-offer/salla-offer.d.ts +13 -48
  28. package/dist/types/components/salla-rating/order-feedback-response.d.ts +62 -0
  29. package/dist/types/components/salla-rating/salla-rating.d.ts +15 -18
  30. package/dist/types/components.d.ts +2 -10
  31. package/package.json +1 -1
  32. package/dist/cjs/Helper-fcea994c.js +0 -23
  33. package/dist/cjs/index-4b8b3ffe.js +0 -1696
  34. package/dist/cjs/index.cjs.js +0 -13
  35. package/dist/cjs/loader.cjs.js +0 -21
  36. package/dist/cjs/salla-branches.cjs.entry.js +0 -92
  37. package/dist/cjs/salla-button_5.cjs.entry.js +0 -1686
  38. package/dist/cjs/salla-localization.cjs.entry.js +0 -82
  39. package/dist/cjs/salla-offer.cjs.entry.js +0 -50
  40. package/dist/cjs/salla-product-availability.cjs.entry.js +0 -75
  41. package/dist/cjs/salla-rating.cjs.entry.js +0 -300
  42. package/dist/cjs/salla-search.cjs.entry.js +0 -11
  43. package/dist/cjs/twilight-components.cjs.js +0 -19
  44. package/dist/collection/Helpers/Helper.js +0 -19
  45. package/dist/collection/collection-manifest.json +0 -22
  46. package/dist/collection/components/generate-summary.js +0 -35
  47. package/dist/collection/components/salla-branches/salla-branches.css +0 -12
  48. package/dist/collection/components/salla-branches/salla-branches.js +0 -233
  49. package/dist/collection/components/salla-button/salla-button.css +0 -3
  50. package/dist/collection/components/salla-button/salla-button.js +0 -246
  51. package/dist/collection/components/salla-localization/salla-localization.js +0 -208
  52. package/dist/collection/components/salla-login/salla-login.css +0 -3
  53. package/dist/collection/components/salla-login/salla-login.js +0 -378
  54. package/dist/collection/components/salla-modal/salla-modal.js +0 -459
  55. package/dist/collection/components/salla-offer/salla-offer.js +0 -81
  56. package/dist/collection/components/salla-product-availability/salla-product-availability.js +0 -331
  57. package/dist/collection/components/salla-rating/salla-rating.css +0 -7
  58. package/dist/collection/components/salla-rating/salla-rating.js +0 -483
  59. package/dist/collection/components/salla-search/salla-search.js +0 -132
  60. package/dist/collection/components/salla-tel-input/salla-tel-input.js +0 -14
  61. package/dist/collection/components/salla-verify/salla-verify.js +0 -273
  62. package/dist/collection/index.js +0 -2
  63. package/dist/collection/interfaces/colors.js +0 -1
  64. package/dist/collection/interfaces/index.js +0 -2
  65. package/dist/collection/interfaces/ratio.js +0 -1
  66. package/dist/collection/plugins/tailwind-theme/generator.js +0 -62
  67. package/dist/collection/plugins/tailwind-theme/index.js +0 -26
  68. package/dist/esm/index-092659c7.js +0 -1668
  69. package/dist/esm/index.js +0 -4
  70. package/dist/esm/loader.js +0 -17
  71. package/dist/esm/polyfills/core-js.js +0 -11
  72. package/dist/esm/polyfills/css-shim.js +0 -1
  73. package/dist/esm/polyfills/dom.js +0 -79
  74. package/dist/esm/polyfills/es5-html-element.js +0 -1
  75. package/dist/esm/polyfills/index.js +0 -34
  76. package/dist/esm/polyfills/system.js +0 -6
  77. package/dist/esm/salla-offer.entry.js +0 -46
  78. package/dist/esm/salla-search.entry.js +0 -3
  79. package/dist/esm/twilight-components.js +0 -17
  80. package/dist/index.cjs.js +0 -1
  81. package/dist/index.js +0 -1
  82. package/dist/twilight-components/p-03d0ec44.entry.js +0 -1
  83. package/dist/twilight-components/p-13a55257.entry.js +0 -1
  84. package/dist/twilight-components/p-160062c6.js +0 -1
  85. package/dist/twilight-components/p-47f17d3b.js +0 -1
  86. package/dist/twilight-components/p-5307c7b5.entry.js +0 -1
  87. package/dist/twilight-components/p-6a1f43c6.entry.js +0 -1
  88. package/dist/twilight-components/p-7088e517.entry.js +0 -1
  89. package/dist/twilight-components/p-924e3c88.js +0 -1
  90. package/dist/twilight-components/p-e8965b01.js +0 -1
  91. package/dist/twilight-components/p-ecb1b6cc.entry.js +0 -1
  92. package/dist/twilight-components/p-f11b401a.entry.js +0 -1
@@ -1 +1,4 @@
1
- export{S as SallaLogin}from"./p-160062c6.js";export{S as SallaSearch}from"./p-924e3c88.js";import"./p-e8965b01.js";import"./p-47f17d3b.js";
1
+ export { S as SallaLogin } from './salla-login-57b18c2c.js';
2
+ export { S as SallaSearch } from './salla-search-30fec1e8.js';
3
+ import './index-9c087700.js';
4
+ import './Helper-d07ebbc7.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-9c087700.js';
2
2
 
3
3
  const sallaBranchesCss = ":host{display:block}";
4
4
 
@@ -0,0 +1,75 @@
1
+ import { r as registerInstance, h, e as Host, g as getElement } from './index-9c087700.js';
2
+ import { H as Helper } from './Helper-d07ebbc7.js';
3
+
4
+ const sallaButtonCss = ":host{display:block}";
5
+
6
+ const SallaButton = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.btnStyle = 'primary';
10
+ this.loading = false;
11
+ this.disabled = false;
12
+ this.loaderPosition = 'before';
13
+ this.wide = false;
14
+ this.hostAttributes = {};
15
+ //============= Initiate Button Attributes =============//
16
+ for (let i = 0; i < this.host.attributes.length; i++) {
17
+ this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
18
+ }
19
+ this.hostAttributes.type = this.hostAttributes.type || 'button';
20
+ this.hostAttributes.class += ' s-button-btn btn--has-loading'
21
+ + ' s-button-' + this.btnStyle
22
+ + (this.wide ? ' s-button-wide ' : '')
23
+ + ' loader-' + this.loaderPosition
24
+ + (this.loaderPosition == 'before' ? ' s-button-loader-after' : '');
25
+ delete this.hostAttributes['btn-style'];
26
+ delete this.hostAttributes['id'];
27
+ if (this.wide) {
28
+ this.host.classList.add('s-button-wide');
29
+ }
30
+ }
31
+ async load() {
32
+ if (this.loaderPosition == 'center')
33
+ this.text.classList.add('s-button-hide');
34
+ this.host.setAttribute('loading', '');
35
+ return this.host;
36
+ }
37
+ async stop() {
38
+ this.host.removeAttribute('loading');
39
+ return this.host;
40
+ }
41
+ async disable() {
42
+ this.host.setAttribute('disabled', '');
43
+ }
44
+ async enable() {
45
+ this.host.removeAttribute('disabled');
46
+ }
47
+ handleVisible(newKind, oldKind) {
48
+ //todo::use united styles
49
+ this.btn.classList.remove('btn-' + oldKind);
50
+ this.btn.classList.add('btn-' + newKind);
51
+ }
52
+ handleLoading(newVal) {
53
+ //todo::use united styles
54
+ Helper.toggleElement(this.btn, 'btn--is-loading', 'btn--no-loading', () => newVal);
55
+ }
56
+ render() {
57
+ return (
58
+ //TODO:: use HOST then fake button behaviours
59
+ h(Host, { class: "s-button-host-tag" }, h("button", Object.assign({ ref: btn => this.btn = btn, disabled: this.disabled }, this.hostAttributes), h("span", { class: "s-button-text", ref: el => this.text = el }, h("slot", null)), this.loading ? h("span", { class: {
60
+ //todo::use united styles
61
+ 's-button-loader': true,
62
+ 's-button-loader-start': this.loaderPosition === 'start',
63
+ 's-button-loader-end': this.loaderPosition === 'end',
64
+ 's-button-loader-center': this.loaderPosition === 'center',
65
+ } }) : '')));
66
+ }
67
+ get host() { return getElement(this); }
68
+ static get watchers() { return {
69
+ "btnStyle": ["handleVisible"],
70
+ "loading": ["handleLoading"]
71
+ }; }
72
+ };
73
+ SallaButton.style = sallaButtonCss;
74
+
75
+ export { SallaButton as salla_button };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-9c087700.js';
2
2
  import { H as Helper } from './Helper-d07ebbc7.js';
3
3
 
4
4
  const SallaLocalization = class {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-9c087700.js';
2
2
  import { H as Helper } from './Helper-d07ebbc7.js';
3
3
 
4
4
  const sallaLoginCss = "salla-verify{display:block}";
@@ -1,13 +1,11 @@
1
- 'use strict';
2
-
3
- const index = require('./index-4b8b3ffe.js');
4
- const Helper = require('./Helper-fcea994c.js');
1
+ import { r as registerInstance, h, g as getElement } from './index-799f93d3.js';
2
+ import { H as Helper } from './Helper-d07ebbc7.js';
5
3
 
6
4
  const sallaLoginCss = "salla-verify{display:block}";
7
5
 
8
6
  const SallaLogin = class {
9
7
  constructor(hostRef) {
10
- index.registerInstance(this, hostRef);
8
+ registerInstance(this, hostRef);
11
9
  this.regType = 'sms';
12
10
  this.isLoginByMail = true;
13
11
  this.loginTypeTitle = salla.lang.get('blocks.header.select_login_way');
@@ -53,8 +51,8 @@ const SallaLogin = class {
53
51
  return this.modal.show();
54
52
  }
55
53
  showTab(tab) {
56
- [this.tab1, this.tab2, this.tab3, this.tab4, this.tab5].map(el => Helper.Helper.toggleElement(el, 'visible', 'hidden', () => el == tab));
57
- setTimeout(() => { [this.tab1, this.tab2, this.tab3, this.tab4, this.tab5].map(el => Helper.Helper.toggleElement(el, 's-login-active', 's-login-unactive', () => el == tab)); }, 200);
54
+ [this.tab1, this.tab2, this.tab3, this.tab4, this.tab5].map(el => Helper.toggleElement(el, 'visible', 'hidden', () => el == tab));
55
+ 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);
58
56
  setTimeout(() => { this.host.querySelector('.s-login-wrapper').setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'); });
59
57
  if ([this.tab2, this.tab3].includes(tab)) {
60
58
  this.regType = tab === this.tab2 ? 'sms' : 'email';
@@ -62,13 +60,13 @@ const SallaLogin = class {
62
60
  let isRegistrationTab = tab == this.tab5;
63
61
  this.modal.setTitle(isRegistrationTab ? salla.lang.get('common.titles.registration') : this.title);
64
62
  if (!isRegistrationTab) {
65
- Helper.Helper.toggleElement(this.regMobileBlock, 's-hidden', 's-block', () => this.regType === 'sms')
63
+ Helper.toggleElement(this.regMobileBlock, 's-hidden', 's-block', () => this.regType === 'sms')
66
64
  .toggleElement(this.regEmailBlock, 's-hidden', 's-block', () => this.regType === 'email');
67
65
  }
68
66
  return this;
69
67
  }
70
68
  loginByEmail() {
71
- if (!Helper.Helper.isValidEmail(this.email.value)) {
69
+ if (!Helper.isValidEmail(this.email.value)) {
72
70
  this.email.classList.add('s-has-error');
73
71
  this.email.nextElementSibling['innerText'] = '* ' + salla.lang.get('common.elements.email_is_valid');
74
72
  return;
@@ -113,13 +111,13 @@ const SallaLogin = class {
113
111
  }));
114
112
  }
115
113
  render() {
116
- return (index.h("salla-modal", { id: "salla-login", title: this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("div", { class: "s-login-wrapper" }, this.isLoginByMail ?
117
- index.h("div", { class: "s-login-tab", ref: tab => this.tab1 = tab }, index.h("p", { class: "s-login-sub-title" }, this.loginTypeTitle), index.h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab2) }, index.h("i", { class: "s-login-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-main-btn-text" }, this.smsLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })), index.h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab3) }, index.h("i", { class: "s-login-main-btn-icon sicon-mail" }), index.h("span", { class: "s-login-main-btn-text" }, this.emailLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })))
118
- : '', index.h("div", { class: "s-login-tab", ref: tab => this.tab2 = tab }, index.h("label", { class: "s-login-label" }, this.mobileLabel), index.h("salla-tel-input", null), index.h("input", { onChange: () => this.loginBySMS(), type: "tel", ref: el => this.mobile = el, onInput: this.typing, placeholder: "5xx xxx xxx", class: "s-login-input tel-input s-ltr" }), index.h("span", { class: "s-login-error-message" }), index.h("salla-button", { wide: true, onClick: () => this.loginBySMS() }, this.enterText), this.isLoginByMail ? index.h("a", { href: "#", onClick: () => this.showTab(this.tab3), class: "s-login-link" }, this.byEmailText) : ''), this.isLoginByMail ?
119
- index.h("div", { class: "s-login-tab", ref: tab => this.tab3 = tab }, index.h("label", { class: "s-login-label" }, this.emailLabel), index.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" }), index.h("span", { class: "s-login-error-message" }), index.h("salla-button", { wide: true, onClick: () => this.loginByEmail() }, this.enterText), index.h("a", { href: "#", onClick: () => this.showTab(this.tab2), class: "s-login-link" }, this.bySMSText)) : '', index.h("salla-verify", { "without-modal": true, ref: tab => this.tab4 = tab, autoReload: false, "back-text": this.backText }), index.h("div", { ref: tab => this.tab5 = tab }, index.h("label", { class: "s-login-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-input", ref: el => this.firstName = el, placeholder: salla.lang.get('pages.profile.first_name') }), index.h("label", { class: "s-login-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-input", ref: el => this.lastName = el, placeholder: salla.lang.get('pages.profile.last_name') }), index.h("div", { ref: el => this.regMobileBlock = el }, index.h("label", { class: "s-login-label" }, this.mobileLabel), index.h("input", { type: "tel", ref: el => this.regMobile = el, onInput: this.typing, placeholder: "5xx xxx xxx", class: "s-login-input s-ltr" }), index.h("span", { class: "s-login-error-message" })), index.h("div", { ref: el => this.regEmailBlock = el }, index.h("label", { class: "s-login-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onInput: this.typing, placeholder: "your@email.com", class: "s-login-input s-ltr" }), index.h("span", { class: "s-login-error-message" })), index.h("salla-button", { wide: true, onClick: () => this.newUser() }, salla.lang.get('blocks.header.register'))))));
114
+ return (h("salla-modal", { id: "salla-login", title: this.title, ref: modal => this.modal = modal, width: "xs" }, h("div", { class: "s-login-wrapper" }, this.isLoginByMail ?
115
+ h("div", { class: "s-login-tab", ref: tab => this.tab1 = tab }, h("p", { class: "s-login-sub-title" }, this.loginTypeTitle), h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab2) }, h("i", { class: "s-login-main-btn-icon sicon-phone" }), h("span", { class: "s-login-main-btn-text" }, this.smsLabel), h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })), h("a", { href: "#", class: "s-login-main-btn", onClick: () => this.showTab(this.tab3) }, h("i", { class: "s-login-main-btn-icon sicon-mail" }), h("span", { class: "s-login-main-btn-text" }, this.emailLabel), h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })))
116
+ : '', h("div", { class: "s-login-tab", ref: tab => this.tab2 = tab }, h("label", { class: "s-login-label" }, this.mobileLabel), h("salla-tel-input", null), h("input", { onChange: () => this.loginBySMS(), type: "tel", ref: el => this.mobile = el, onInput: this.typing, placeholder: "5xx xxx xxx", class: "s-login-input tel-input s-ltr" }), h("span", { class: "s-login-error-message" }), h("salla-button", { wide: true, onClick: () => this.loginBySMS() }, this.enterText), this.isLoginByMail ? h("a", { href: "#", onClick: () => this.showTab(this.tab3), class: "s-login-link" }, this.byEmailText) : ''), this.isLoginByMail ?
117
+ h("div", { class: "s-login-tab", ref: tab => this.tab3 = tab }, h("label", { class: "s-login-label" }, this.emailLabel), 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" }), h("span", { class: "s-login-error-message" }), h("salla-button", { wide: true, onClick: () => this.loginByEmail() }, this.enterText), h("a", { href: "#", onClick: () => this.showTab(this.tab2), class: "s-login-link" }, this.bySMSText)) : '', h("salla-verify", { "without-modal": true, ref: tab => this.tab4 = tab, autoReload: false, "back-text": this.backText }), h("div", { ref: tab => this.tab5 = tab }, h("label", { class: "s-login-label" }, salla.lang.get('blocks.header.your_name')), h("input", { type: "text", class: "s-login-input", ref: el => this.firstName = el, placeholder: salla.lang.get('pages.profile.first_name') }), h("label", { class: "s-login-label" }, salla.lang.get('pages.profile.last_name')), h("input", { type: "text", class: "s-login-input", ref: el => this.lastName = el, placeholder: salla.lang.get('pages.profile.last_name') }), h("div", { ref: el => this.regMobileBlock = el }, h("label", { class: "s-login-label" }, this.mobileLabel), h("input", { type: "tel", ref: el => this.regMobile = el, onInput: this.typing, placeholder: "5xx xxx xxx", class: "s-login-input s-ltr" }), h("span", { class: "s-login-error-message" })), h("div", { ref: el => this.regEmailBlock = el }, h("label", { class: "s-login-label" }, this.emailLabel), h("input", { type: "email", ref: el => this.regEmail = el, onInput: this.typing, placeholder: "your@email.com", class: "s-login-input s-ltr" }), h("span", { class: "s-login-error-message" })), h("salla-button", { wide: true, onClick: () => this.newUser() }, salla.lang.get('blocks.header.register'))))));
120
118
  }
121
- get host() { return index.getElement(this); }
119
+ get host() { return getElement(this); }
122
120
  };
123
121
  SallaLogin.style = sallaLoginCss;
124
122
 
125
- exports.SallaLogin = SallaLogin;
123
+ export { SallaLogin as S };
@@ -0,0 +1,3 @@
1
+ export { S as salla_login } from './salla-login-57b18c2c.js';
2
+ import './index-9c087700.js';
3
+ import './Helper-d07ebbc7.js';
@@ -0,0 +1,113 @@
1
+ import { r as registerInstance, f as createEvent, h, e as Host, g as getElement } from './index-9c087700.js';
2
+ import { H as Helper } from './Helper-d07ebbc7.js';
3
+
4
+ const SallaModal = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ this.modalOpened = createEvent(this, "modalOpened", 7);
8
+ this.modalClosed = createEvent(this, "modalClosed", 7);
9
+ var _a;
10
+ //todo:: unite three colors (error, success, primary) in one prop
11
+ this.error = false;
12
+ this.success = false;
13
+ this.primary = false;
14
+ this.isClosable = true;
15
+ this.width = 'md';
16
+ this.visible = false;
17
+ this.isLoading = false;
18
+ this.subTitleFirst = false;
19
+ this.subTitle = '';
20
+ this.icon = '';
21
+ this.imageIcon = '';
22
+ Helper.setHost(this.host);
23
+ salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
24
+ salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
25
+ this.title = this.host.title;
26
+ this.host.removeAttribute('title');
27
+ (_a = Helper.getElement('[slot=body]')) === null || _a === void 0 ? void 0 : _a.classList.add('s-modal-body', 's-modal-' + this.width);
28
+ }
29
+ handleVisible(newValue) {
30
+ if (!newValue) {
31
+ this.toggleModal(false);
32
+ this.modalClosed.emit();
33
+ return;
34
+ }
35
+ this.host.classList.remove('hidden');
36
+ setTimeout(() => this.toggleModal(true)); //small amont of time to running toggle After adding hidden
37
+ this.modalOpened.emit();
38
+ }
39
+ async show() {
40
+ this.host.setAttribute('visible', '');
41
+ return this.host;
42
+ }
43
+ async hide() {
44
+ this.host.removeAttribute('visible');
45
+ return this.host;
46
+ }
47
+ async setTitle(title) {
48
+ this.title = title;
49
+ return this.host;
50
+ }
51
+ async loading() {
52
+ this.isLoading = true;
53
+ return this.host;
54
+ }
55
+ async stopLoading() {
56
+ this.isLoading = false;
57
+ return this.host;
58
+ }
59
+ toggleModal(isOpen) {
60
+ Helper
61
+ // .toggleElement(this.host.querySelector('.s-modal-body'), 's-modal-entering', 's-modal-leaving', () => isOpen)
62
+ .toggleElement(this.host.querySelector('[slot=body]') || this.host, 's-modal-entering', 's-modal-leaving', () => isOpen)
63
+ .toggleElement(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
64
+ //todo:: use united class names
65
+ .toggleElement(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
66
+ if (!isOpen) {
67
+ setTimeout(() => this.host.classList.add('hidden'), 350);
68
+ }
69
+ }
70
+ closeModal() {
71
+ if (!this.isClosable) {
72
+ return;
73
+ }
74
+ this.host.removeAttribute('visible');
75
+ }
76
+ //todo:: pref for each modal
77
+ render() {
78
+ this.host.id = this.host.id || 'salla-modal';
79
+ return (
80
+ //todo:: use suitable class name instead of hidden
81
+ h(Host, { class: 's-modal-container hidden', "aria-modal": "true", role: "dialog" }, h("div", { class: "s-modal-wrapper" }, h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }), h("span", { class: "s-modal-spacer" }, "\u200B"), h("slot", { name: "body" }, h("div", { class: 's-modal-body ' + 's-modal-' + this.width, slot: "body" }, this.isLoading
82
+ ? h("span", null, "Loading...")
83
+ : [h("div", { class: { 's-modal-header': true, 's-modal-is-center': this.icon != '' || this.imageIcon != '' } }, this.isClosable ?
84
+ //todo:: remove cursor-pointer
85
+ h("button", { class: "s-modal-close cursor-pointer", onClick: () => this.closeModal(), type: "button" }, h("span", { class: "sicon-cancel" }))
86
+ : '', this.error || this.success || this.icon
87
+ ? h("div", { class: {
88
+ 's-modal-icon': true,
89
+ 's-modal-bg-error': this.error,
90
+ 's-modal-bg-success': this.success,
91
+ 's-modal-bg-normal': !this.error && !this.success,
92
+ 's-modal-bg-primary': this.primary
93
+ } }, h("i", { class: {
94
+ [this.icon]: true,
95
+ 's-modal-text-error': this.error,
96
+ 's-modal-text-success': this.success,
97
+ } }))
98
+ : this.imageIcon ?
99
+ h("img", { class: "s-modal-header-img", src: this.imageIcon })
100
+ : '', this.title || this.subTitle ?
101
+ h("div", { class: "s-modal-header-content" }, h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.title }), h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle }))
102
+ : ''),
103
+ h("slot", null),
104
+ h("slot", { name: "footer" })
105
+ ])))));
106
+ }
107
+ get host() { return getElement(this); }
108
+ static get watchers() { return {
109
+ "visible": ["handleVisible"]
110
+ }; }
111
+ };
112
+
113
+ export { SallaModal as salla_modal };
@@ -0,0 +1,75 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-9c087700.js';
2
+ import { H as Helper } from './Helper-d07ebbc7.js';
3
+
4
+ const SallaOffer = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ var _a, _b, _c;
8
+ this.offer = null;
9
+ Helper.setHost(this.host);
10
+ this.headerSlot = ((_a = Helper.getElement('[slot="header"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<b class="s-offer-title">{name}</b><h3 class="s-offer-subtitle">{message}</h3>';
11
+ this.categorySlot = ((_b = Helper.getElement('[slot="category"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || '<i class="s-offer-badge-icon sicon-tag"></i><span class="s-offer-badge-text">{name}</span>';
12
+ this.productSlot = ((_c = Helper.getElement('[slot="product"]')) === null || _c === void 0 ? void 0 : _c.innerHTML) || this.defaultProductSlot();
13
+ salla.offer.event.onExisted(data => {
14
+ //TODO:: use the best, should we hide the offer by product Id or Offer id🤔
15
+ if (salla.localStore.get('remember-offer-' + data.offer.offer_id)) {
16
+ salla.log('User selected to don\'t show this offer again.');
17
+ return;
18
+ }
19
+ this.show(data.product_id);
20
+ });
21
+ }
22
+ async show(productId) {
23
+ return this.modal.show()
24
+ .then(() => salla.api.offer.details(productId))
25
+ //TODO:: make sure there is only one offer
26
+ .then(response => this.offer = response.data[0]);
27
+ }
28
+ rememberMe(event) {
29
+ salla.localStore.set('remember-offer-' + this.offer.id, event.target.checked);
30
+ }
31
+ addItem() {
32
+ // this here, is sallaButton
33
+ this['load']();
34
+ return salla.cart.api
35
+ .quickAdd(this['dataset'].id)
36
+ .finally(() => this['stop']());
37
+ }
38
+ defaultProductSlot() {
39
+ return '<a href={url} class="s-offer-product-image"><img class="s-offer-product-img" src="{image}" /></a>' +
40
+ '<div class="s-offer-product-info">' +
41
+ ' <a href={url} class="s-offer-product-name">{name}</a>' +
42
+ ' <div class="s-offer-product-price">{price}</div>' +
43
+ '</div>';
44
+ }
45
+ render() {
46
+ var _a, _b;
47
+ return h("salla-modal", { ref: modal => this.modal = modal, "is-loading": this.offer === null }, this.offer !== null
48
+ ? [h("div", { class: "s-offer-header", innerHTML: this.headerSlot
49
+ .replace(/\{name\}/g, this.offer.name)
50
+ .replace(/\{message\}/g, this.offer.message) }),
51
+ h("div", { class: "s-offer-body" }, ((_a = this.offer.get.categories) === null || _a === void 0 ? void 0 : _a.length) > 0
52
+ ? this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-badge", innerHTML: this.categorySlot
53
+ .replace(/\{name\}/g, category.name)
54
+ .replace(/\{url\}/g, category.urls.customer) }))
55
+ : (_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.map(product => h("div", { class: "s-offer-product", id: 'product_' + product.id, innerHTML: this.productSlot
56
+ .replace(/\{name\}/g, product.name)
57
+ .replace(/\{url\}/g, product.url)
58
+ .replace(/\{image\}/g, product.thumbnail)
59
+ .replace(/\{price\}/g, product.has_special_price
60
+ ? salla.money(product.sale_price) + '<span class="s-offer-product-old-price">' + salla.money(product.regular_price) + '</span>'
61
+ : salla.money(product.price)) }, h("salla-button", { "btn-style": 'outline-primary', "data-id": product.id, onClick: this.addItem }, salla.lang.get('pages.cart.add_to_cart'))))),
62
+ h("div", { class: "s-offer-footer", slot: "footer" }, this.offer.expiry_date ?
63
+ h("p", { class: "s-offer-expiry" }, salla.lang.get('pages.products.offer_expires_in'), " ", this.offer.expiry_date)
64
+ : '', h("label", { class: "s-offer-remember-label" }, h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-remember-input" }), "\u00A0 ", salla.lang.get('common.remember_my_choice'))),
65
+ ] : '');
66
+ }
67
+ componentDidRender() {
68
+ //todo:: know from where there is hidden attributes to the doms🤔
69
+ //todo:: add animation
70
+ this.modal.querySelectorAll('[hidden]').forEach(el => el.removeAttribute('hidden'));
71
+ }
72
+ get host() { return getElement(this); }
73
+ };
74
+
75
+ export { SallaOffer as salla_offer };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, e as Host, g as getElement } from './index-9c087700.js';
2
2
  import { H as Helper } from './Helper-d07ebbc7.js';
3
3
 
4
4
  const SallaProductAvailability = class {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, e as Host, g as getElement } from './index-9c087700.js';
2
2
  import { H as Helper } from './Helper-d07ebbc7.js';
3
3
 
4
4
  const sallaRatingCss = ":host{display:block}.unicode{unicode-bidi:plaintext}";
@@ -6,87 +6,41 @@ const sallaRatingCss = ":host{display:block}.unicode{unicode-bidi:plaintext}";
6
6
  const SallaRating = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
- this.order = {
10
- shipping: { id: 5622 },
11
- products: [
12
- {
13
- "title": "ميكروفون عالى الجودة",
14
- "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",
15
- "price": "‏10,978.00 ر.س",
16
- "qty": "‏2",
17
- "totalBefore": "‏1120 ر.س",
18
- "discount": "-5%",
19
- "total": "‏1064 ر.س",
20
- "id": "2314513454",
21
- "getOptimusRouteKey": "7351233357"
22
- },
23
- {
24
- "title": "ميكروفون عالى الجودة",
25
- "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",
26
- "price": "‏10,978.00 ر.س",
27
- "qty": "‏2",
28
- "totalBefore": "‏1120 ر.س",
29
- "discount": "-5%",
30
- "total": "‏1064 ر.س",
31
- "id": "2314513454",
32
- "getOptimusRouteKey": "7351233357"
33
- },
34
- {
35
- "title": "ساعة ذكية بنظام اندرويد",
36
- "image": "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/T4kTqYNuPAZmPMLw1bx92RnjVMZyFszVXOUZQsFJ.jpg",
37
- "price": "‏10,978.00 ر.س",
38
- "qty": "‏2",
39
- "totalBefore": "‏1120 ر.س",
40
- "discount": "-5%",
41
- "total": "‏1064 ر.س",
42
- "id": "679822376",
43
- "getOptimusRouteKey": "73233357"
44
- }
45
- ],
46
- storeLogo: "https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/X3NKcY7nhaFQlR7kBBHvfDpMY48cerunKrmDA1gi.png",
47
- shippingLogo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScPt4R6KaKDldrXb-9pUljFwL3m6A72BhN6p1qZJKprwC6VbCWC_8ASZgiJAoL_l7DepM&usqp=CAU"
48
- };
49
9
  /**
50
10
  * Set to true to display store rating step
51
- */
11
+ */
52
12
  this.isStoreRating = false;
53
13
  /**
54
14
  * Set to true to display products rating step
55
- */
15
+ */
56
16
  this.isProductsRating = false;
57
17
  /**
58
18
  * Set to true to display shipping rating step
59
- */
19
+ */
60
20
  this.isShippingRating = false;
61
21
  this.ratingChain = Promise.resolve();
62
22
  this.stepsCount = 0;
63
23
  Helper.setHost(this.host);
24
+ salla.event.on('rating::show', () => this.show());
64
25
  }
65
26
  async show() {
66
- return this.modal.show();
27
+ return this.modal.show()
28
+ .then(() => salla.feedback.api.order(salla.get('page.id')))
29
+ .then(res => this.order = res.data)
30
+ .then(() => this.modal.setTitle(salla.lang.get('pages.rating.rate_order') + ' <span class="unicode">(#' + this.order.id + ')</span>'))
31
+ .then(() => this.modal.stopLoading())
32
+ .then(() => this.stepsCount = [this.order.testimonials_enabled, this.order.products_enabled, this.order.shipping_enabled].filter(enabled => enabled).length)
33
+ .then(() => setTimeout(() => this.initiateRating(), 100));
67
34
  }
68
35
  async hide() {
69
36
  return this.modal.hide();
70
37
  }
71
- componentWillLoad() {
72
- this.stepsCount = [this.isStoreRating, this.isProductsRating, this.isShippingRating].filter(item => item).length;
73
- // this.getData();
74
- }
75
- componentDidRender() {
76
- this.show();
77
- this.initiateRating();
78
- }
79
38
  initiateRating() {
80
39
  this.handleWizard();
81
40
  this.handleSubmitRating();
82
41
  this.starsRating();
83
42
  this.highlightSelectedStars();
84
43
  }
85
- // getdata
86
- // private getData() {
87
- // salla.api.order.endpointsMethods.details = 'get'
88
- // salla.order.api.details(salla.config.page.id).then(data => console.log(''));
89
- // }
90
44
  // handle wizard
91
45
  handleWizard() {
92
46
  let index = 0, steps = this.host.querySelectorAll(".s-rating-step"), dots = this.host.querySelectorAll(".s-rating-step-dot"), nextBtnText = this.host.querySelector('#next-btn .s-button-text');
@@ -139,7 +93,7 @@ const SallaRating = class {
139
93
  clearInterval(timeToClose);
140
94
  }
141
95
  }, 1000);
142
- // Hide steps and show thanks msg
96
+ // Hide steps and show thanks msg
143
97
  Helper.toggle('.s-rating-step', 's-rating-hidden', 's-rating-active', () => true);
144
98
  this.host.querySelector('.s-rating-footer').classList.add('s-rating-unvisiable');
145
99
  Helper.toggleElement(thankYouView, 's-rating-unactive', 's-rating-hidden', () => true);
@@ -147,7 +101,7 @@ const SallaRating = class {
147
101
  this.setModalHeight(thankYouView);
148
102
  }));
149
103
  }
150
- // handle star rating
104
+ // handle star rating
151
105
  starsRating() {
152
106
  let selectedClasses = ['selected'];
153
107
  // Listen for form submissions
@@ -269,25 +223,32 @@ const SallaRating = class {
269
223
  throw new Error(errorMsg);
270
224
  }
271
225
  }
272
- // render
273
- render() {
274
- return (h(Host, null, h("salla-modal", { class: "hidden", "modal-width": "w-[800px]", ref: modal => this.modal = modal, title: salla.lang.get('pages.rating.rate_order') + ' <span class="unicode">(#' + this.orderId + ')</span>' }, h("div", { class: "s-rating-wrapper " }, this.isStoreRating && this.renderStoreRating(), this.isProductsRating && this.renderProductsRating(), this.isShippingRating && this.renderShippingRating(), this.renderThanksView()), h("div", { class: "s-rating-footer" }, h("button", { id: "prev-btn", class: "s-rating-btn s-rating-unvisiable" }, salla.lang.get('pages.order.rating_prev')), this.stepsCount > 1 ?
275
- h("ul", { class: "s-rating-dots" }, [0, 1, 2].slice(0, this.stepsCount).map(index => h("li", { class: `${index == 0 ? 's-rating-bg-primary' : 's-rating-bg-gray'} s-rating-step-dot` }))) : '', h("salla-button", { id: "next-btn", ref: nextBtn => this.nextBtn = nextBtn }, "\u0627\u0644\u062A\u0627\u0644\u064A")))));
276
- }
277
226
  renderStoreRating() {
278
- return (h("section", { class: "s-rating-step", "data-type": "store", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.store') }, h("div", { class: "rating-outer-form s-rating-step-wrap", "data-stars-error": salla.lang.get('pages.rating.rate_store_stars') }, h("input", { type: "hidden", name: "order_id", value: this.orderId }), h("input", { type: "hidden", name: "type", value: "store" }), h("div", { class: "s-rating-rounded-icon" }, h("img", { src: this.order.storeLogo, alt: "store name", class: "s-rating-store-logo" })), h("h2", { class: "s-rating-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-stars-company" }, " ", this.getStarsRating('large')), h("textarea", { id: "storeReview", name: "comment", class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-validation-msg" }))));
227
+ return (h("section", { class: "s-rating-step", "data-type": "store", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.store') }, h("div", { class: "rating-outer-form s-rating-step-wrap", "data-stars-error": salla.lang.get('pages.rating.rate_store_stars') }, h("input", { type: "hidden", name: "order_id", value: this.order.id }), h("input", { type: "hidden", name: "type", value: "store" }), h("div", { class: "s-rating-rounded-icon" }, h("img", { src: salla.get('store.logo'), alt: "store name", class: "s-rating-store-logo" })), h("h2", { class: "s-rating-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-stars-company" }, " ", this.getStarsRating('large')), h("textarea", { id: "storeReview", name: "comment", class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-validation-msg" }))));
279
228
  }
280
229
  renderShippingRating() {
281
- return (h("section", { class: "s-rating-step", "data-type": "shipping", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.shipping') }, h("div", { class: "rating-outer-form s-rating-step-wrap", "data-stars-error": salla.lang.get('pages.rating.rate_shipping_stars') }, h("input", { type: "hidden", name: "order_id", value: this.orderId }), h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.id }), h("input", { type: "hidden", name: "type", value: "shipping" }), h("div", { class: "s-rating-rounded-icon" }, h("img", { src: this.order.shippingLogo, alt: "company name", class: "s-rating-shipping-logo" })), h("h2", { class: "s-rating-title" }, " ", salla.lang.get('pages.rating.rate_shipping'), " \u0627\u0631\u0627\u0645\u0643\u0633"), h("div", { class: "s-rating-stars-company" }, " ", this.getStarsRating('large')), h("textarea", { id: "shippingReview", name: "comment", class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-validation-msg" }))));
230
+ return (h("section", { class: "s-rating-step", "data-type": "shipping", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.shipping') }, h("div", { class: "rating-outer-form s-rating-step-wrap", "data-stars-error": salla.lang.get('pages.rating.rate_shipping_stars') }, h("input", { type: "hidden", name: "order_id", value: this.order.id }), h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), h("input", { type: "hidden", name: "type", value: "shipping" }), h("div", { class: "s-rating-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, alt: "company name", class: "s-rating-shipping-logo" })), h("h2", { class: "s-rating-title" }, " ", salla.lang.get('pages.rating.rate_shipping') + ' ' + this.order.shipping.company.name), h("div", { class: "s-rating-stars-company" }, " ", this.getStarsRating('large')), h("textarea", { id: "shippingReview", name: "comment", class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-validation-msg" }))));
282
231
  }
283
232
  renderProductsRating() {
284
- return (h("section", { class: "s-rating-step", "data-type": "product", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.products') }, this.order.products.map((item, index) => h("div", { class: "rating-outer-form s-rating-product", "data-stars-error": salla.lang.get('pages.order.rate_product_stars') }, h("img", { src: item.image, alt: item.title, class: "s-rating-product-img" }), h("div", { class: "s-rating-product-details" }, h("h3", { class: "s-rating-product-title" }, " ", item.title), h("div", { class: "s-rating-stars-product" }, " ", this.getStarsRating('small')), h("input", { type: "hidden", name: "order_id", value: this.orderId }), h("input", { type: "hidden", name: `products[${index}][product_id]`, value: item.getOptimusRouteKey }), h("input", { type: "hidden", name: "type", value: "products" }), h("textarea", { "data-product-id": item.id, name: `products[${index}][comment]`, id: `productReview_${item.id}`, class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_product_rate') }), h("small", { class: "s-rating-validation-msg" }))))));
233
+ return (h("section", { class: "s-rating-step", "data-type": "product", "data-step-name": salla.lang.get('pages.rating.rate') + ' ' + salla.lang.get('pages.rating.products') }, this.order.products.map((item, index) => h("div", { class: "rating-outer-form s-rating-product", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-product-img" }), h("div", { class: "s-rating-product-details" }, h("h3", { class: "s-rating-product-title" }, " ", item.product.name), h("div", { class: "s-rating-stars-product" }, " ", this.getStarsRating('small')), h("input", { type: "hidden", name: "order_id", value: this.order.id }), h("input", { type: "hidden", name: `products[${index}][product_id]`, value: item.product.id }), h("input", { type: "hidden", name: "type", value: "products" }), h("textarea", { "data-product-id": item.product.id, name: `products[${index}][comment]`, id: `productReview_${item.product.id}`, class: "s-rating-comment", placeholder: salla.lang.get('pages.rating.write_product_rate') }), h("small", { class: "s-rating-validation-msg" }))))));
285
234
  }
286
235
  renderThanksView() {
287
236
  return (h("div", { class: "s-rating-thanks s-rating-hidden" }, h("span", { class: "s-rating-thanks-icon sicon-check-circle2" }), h("h3", { class: "s-rating-thanks-title" }, salla.lang.get('pages.rating.thanks')), h("div", { class: "s-rating-thanks-msg", innerHTML: this.thanksMsg }), h("a", { href: "#!", onClick: () => this.hide(), class: "s-rating-thanks-btn" }, "\u0639\u0648\u062F\u0629 \u0625\u0644\u064A \u062A\u0641\u0627\u0635\u064A\u0644 \u0627\u0644\u0637\u0644\u0628"), h("time", { class: "s-rating-thanks-time" })));
288
237
  }
289
238
  getStarsRating(size) {
290
- return (h("form", { class: "s-rating-stars-element" }, h("input", { type: "hidden", class: "rating_hidden_input", name: "rating", value: "" }), [1, 2, 3, 4, 5].map((star) => h("button", { type: "submit", class: `s-rating-btn-star s-rating-btn-star-` + size, "data-star": star }, h("i", { class: "sicon-star2" })))));
239
+ return (h("form", { class: "s-rating-stars-element" }, h("input", { type: "hidden", class: "rating_hidden_input", name: "rating", value: "" }), [1, 2, 3, 4, 5].map(star => h("button", { type: "submit", class: `s-rating-btn-star s-rating-btn-star-` + size, "data-star": star }, h("i", { class: "sicon-star2" })))));
240
+ }
241
+ // render
242
+ render() {
243
+ return (h(Host, null, h("salla-modal", { isLoading: true, width: "md", ref: modal => this.modal = modal }, this.order
244
+ ? [h("div", { class: "s-rating-wrapper " }, this.order.testimonials_enabled && this.renderStoreRating(), this.order.products_enabled && this.renderProductsRating(), this.order.shipping_enabled && this.renderShippingRating(), this.renderThanksView()),
245
+ h("div", { class: "s-rating-footer" }, h("button", { id: "prev-btn", class: "s-rating-btn s-rating-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ?
246
+ h("ul", { class: "s-rating-dots" }, [0, 1, 2].slice(0, this.stepsCount).map(index => h("li", { class: `${index == 0 ? 's-rating-bg-primary' : 's-rating-bg-gray'} s-rating-step-dot` }))) : '', h("salla-button", { id: "next-btn", ref: nextBtn => this.nextBtn = nextBtn }, "\u0627\u0644\u062A\u0627\u0644\u064A")),]
247
+ : '')));
248
+ }
249
+ componentDidRender() {
250
+ //todo:: know from where there is hidden attributes to the doms🤔
251
+ this.modal.querySelectorAll('[hidden]').forEach(el => el.removeAttribute('hidden'));
291
252
  }
292
253
  get host() { return getElement(this); }
293
254
  };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-092659c7.js';
1
+ import { r as registerInstance, h, e as Host, g as getElement } from './index-799f93d3.js';
2
2
  import { H as Helper } from './Helper-d07ebbc7.js';
3
3
 
4
4
  const SallaSearch = class {