@salla.sa/twilight-components 1.0.7 → 1.0.8

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 (36) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/multi-warehouse_3.cjs.entry.js +7 -1
  3. package/dist/cjs/order-rating.cjs.entry.js +37 -12
  4. package/dist/cjs/salla-button.cjs.entry.js +4 -3
  5. package/dist/cjs/salla-localization.cjs.entry.js +12 -9
  6. package/dist/cjs/salla-verify.cjs.entry.js +94 -0
  7. package/dist/cjs/twilight-components.cjs.js +1 -1
  8. package/dist/collection/collection-manifest.json +2 -1
  9. package/dist/collection/components/order-rating/order-rating.js +47 -14
  10. package/dist/collection/components/salla-button/salla-button.js +22 -3
  11. package/dist/collection/components/salla-localization/salla-localization.js +12 -9
  12. package/dist/collection/components/salla-modal/salla-modal.js +29 -1
  13. package/dist/collection/components/salla-verify/salla-verify.js +97 -0
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/multi-warehouse_3.entry.js +7 -1
  16. package/dist/esm/order-rating.entry.js +37 -12
  17. package/dist/esm/salla-button.entry.js +4 -3
  18. package/dist/esm/salla-localization.entry.js +12 -9
  19. package/dist/esm/salla-verify.entry.js +90 -0
  20. package/dist/esm/twilight-components.js +1 -1
  21. package/dist/twilight-components/p-653bb9a8.entry.js +1 -0
  22. package/dist/twilight-components/p-a2395c9d.entry.js +1 -0
  23. package/dist/twilight-components/p-bd10d8d5.entry.js +1 -0
  24. package/dist/twilight-components/{p-b490f9e0.entry.js → p-ea986bca.entry.js} +1 -1
  25. package/dist/twilight-components/p-f4340bd9.entry.js +1 -0
  26. package/dist/twilight-components/twilight-components.esm.js +1 -1
  27. package/dist/types/components/order-rating/order-rating.d.ts +4 -0
  28. package/dist/types/components/salla-button/salla-button.d.ts +1 -0
  29. package/dist/types/components/salla-localization/salla-localization.d.ts +4 -0
  30. package/dist/types/components/salla-modal/salla-modal.d.ts +2 -0
  31. package/dist/types/components/salla-verify/salla-verify.d.ts +19 -0
  32. package/dist/types/components.d.ts +16 -0
  33. package/package.json +1 -1
  34. package/dist/twilight-components/p-4cc11ee2.entry.js +0 -1
  35. package/dist/twilight-components/p-60f0446f.entry.js +0 -1
  36. package/dist/twilight-components/p-b72e6cfa.entry.js +0 -1
@@ -0,0 +1,97 @@
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;
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
+ }
21
+ else if ([8, 46].includes(key)) {
22
+ (_b = event.target.previousElementSibling) === null || _b === void 0 ? void 0 : _b.focus();
23
+ }
24
+ this.toggleOTPSubmit();
25
+ });
26
+ Helper.on('paste', '.s-verify-input', event => {
27
+ let text = event.clipboardData.getData('text').toArabicDigits().replace(/[^0-9.]/g, '').replace('..', '.');
28
+ this.otpInputs.forEach((input, i) => input.value = text[i] || '');
29
+ this.toggleOTPSubmit();
30
+ setTimeout(() => this.otpInputs[3].focus(), 100);
31
+ });
32
+ return this.modal.show();
33
+ }
34
+ toggleOTPSubmit() {
35
+ let otp = [];
36
+ this.otpInputs.forEach(input => input.value && otp.push(input.value));
37
+ this.code.value = otp.join('');
38
+ if (otp.length === 4) {
39
+ this.btn.removeAttribute('disabled');
40
+ this.btn.click();
41
+ return;
42
+ }
43
+ this.btn.setAttribute('disabled', '');
44
+ }
45
+ resendTimer() {
46
+ Helper.showElement(this.resendMessage).hideElement(this.resend);
47
+ let resendAfter = 30;
48
+ let timerId = setInterval(() => {
49
+ if (resendAfter === -1) {
50
+ clearTimeout(timerId);
51
+ Helper.hideElement(this.resendMessage).showElement(this.resend);
52
+ }
53
+ else {
54
+ this.timer.innerHTML = `${resendAfter >= 10 ? resendAfter : '0' + resendAfter} : 00`;
55
+ resendAfter--;
56
+ }
57
+ }, 1000);
58
+ }
59
+ submit() {
60
+ return this.btn.load()
61
+ .then(() => this.btn.disable())
62
+ .then(() => salla.document.api.request('profile/verify-mobile', {
63
+ mobile: this.mobile,
64
+ country_code: this.country_code,
65
+ code: this.code.value
66
+ })).then(() => this.btn.stop() && this.btn.disable())
67
+ .then(() => this.modal.hide())
68
+ .then(() => window.location.reload())
69
+ .catch(() => this.btn.stop() && this.btn.enable());
70
+ }
71
+ resendCode() {
72
+ return this.btn.stop()
73
+ .then(() => this.btn.disable())
74
+ .then(() => {
75
+ this.otpInputs.forEach(input => input.value = '');
76
+ this.otpInputs[0].focus();
77
+ })
78
+ .then(() => salla.api.auth.resend({ phone: this.mobile, country_code: this.country_code }))
79
+ .then(() => this.resendTimer())
80
+ .catch(() => this.resendTimer());
81
+ }
82
+ render() {
83
+ return (h("salla-modal", { id: "s-verify", ref: modal => this.modal = modal, title: salla.lang.get('pages.profile.verify_title') },
84
+ h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }),
85
+ h("label", { class: "s-verify-label" }, salla.lang.get('pages.profile.verify_placeholder')),
86
+ h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }),
87
+ 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 }))),
88
+ h("div", { slot: "footer", class: "s-verify-footer" },
89
+ h("salla-button", { class: "s-verify-submit", disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')),
90
+ h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el },
91
+ salla.lang.get('blocks.header.resend_after'),
92
+ h("b", { class: "s-verify-timer", ref: el => this.timer = el })),
93
+ h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit')))));
94
+ }
95
+ static get is() { return "salla-verify"; }
96
+ static get elementRef() { return "host"; }
97
+ }
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["salla-localization",[[4,"salla-localization",{"show":[64],"hide":[64]}]]],["order-rating",[[0,"order-rating",{"order":[8]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]],["salla-button",[[4,"salla-button",{"kind":[513],"loading":[516],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["multi-warehouse_3",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[1,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64]}]]]], options);
13
+ return bootstrapLazy([["salla-localization",[[4,"salla-localization",{"show":[64],"hide":[64]}]]],["salla-verify",[[0,"salla-verify"]]],["order-rating",[[0,"order-rating",{"order":[8]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]],["salla-button",[[4,"salla-button",{"kind":[513],"loading":[516],"disabled":[516],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["multi-warehouse_3",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[1,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64],"setTitle":[64]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -93,6 +93,8 @@ const SallaModal = class {
93
93
  this.icon = 'sicon-cancel';
94
94
  salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
95
95
  salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
96
+ this.title = this.host.title;
97
+ this.host.removeAttribute('title');
96
98
  }
97
99
  handleVisible(newValue) {
98
100
  if (!newValue) {
@@ -112,6 +114,10 @@ const SallaModal = class {
112
114
  this.host.removeAttribute('visible');
113
115
  return this.host;
114
116
  }
117
+ async setTitle(title) {
118
+ this.title = title;
119
+ return this.host;
120
+ }
115
121
  toggleModal(isOpen) {
116
122
  Helper.toggleElement(this.host.querySelector('.s-modal-overlay'), 'ease-out duration-300 opacity-100', 'opacity-0', () => isOpen)
117
123
  .toggleElement(this.host.querySelector('.s-modal-body'), 'ease-out duration-300 opacity-100 translate-y-0 sm:scale-100', //add these classes
@@ -138,7 +144,7 @@ const SallaModal = class {
138
144
  's-modal-text-error': this.error,
139
145
  's-modal-text-success': this.success
140
146
  } }))
141
- : '', h("div", { class: "s-modal-title", innerHTML: this.host.title }), h("p", { class: "s-modal-sub-title", innerHTML: this.subTitle }))), h("slot", null), h("slot", { name: "footer" })))));
147
+ : '', h("div", { class: "s-modal-title", innerHTML: this.title }), h("p", { class: "s-modal-sub-title", innerHTML: this.subTitle }))), h("slot", null), h("slot", { name: "footer" })))));
142
148
  }
143
149
  get host() { return getElement(this); }
144
150
  static get watchers() { return {
@@ -58,37 +58,62 @@ const OrderRating = class {
58
58
  isShippingRating: true,
59
59
  }
60
60
  };
61
+ this.ratingChain = Promise.resolve();
62
+ this.wizardInex = 0;
63
+ }
64
+ componentDidRender() {
65
+ this.initiateRating();
61
66
  }
62
67
  render() {
63
- return (h(Host, null, this.order.settings.isProductsRating && this.renderProductsRating(), this.order.settings.isStoreRating && this.renderStoreRating(), this.order.settings.isShippingRating && this.renderShippingRating()));
68
+ return (h(Host, null, h("div", { class: "pannel__body" }, this.order.settings.isStoreRating && this.renderStoreRating(), this.order.settings.isProductsRating && this.renderProductsRating(), this.order.settings.isShippingRating && this.renderShippingRating()), h("div", { class: "pannel__footer relative flex justify-between items-center" }, h("button", { id: "prev-btn", class: "font-bold text-sm text-primary hidden" }, "\u0627\u0644\u0633\u0627\u0628\u0642"), h("ul", { class: "flex justify-center text-center space-s-1.5 py-8 flex-1" }, h("li", { class: "cursor-pointer w-2.5 h-2.5 bg-primary rounded-full transition-colors duration-300" }), h("li", { class: "cursor-pointer w-2.5 h-2.5 bg-gray-200 rounded-full transition-colors duration-300" }), h("li", { class: "cursor-pointer w-2.5 h-2.5 bg-gray-200 rounded-full transition-colors duration-300" })), h("button", { id: "next-btn", class: "btn btn-primary h-10 px-8 flex-none" }, "\u0627\u0644\u062A\u0627\u0644\u064A"))));
64
69
  }
65
70
  renderProductsRating() {
66
- return (h("section", { class: "rating-section products-section", "data-type": "product" }, h("div", { class: "bg-white mb-5 p-5 rounded-md overflow-hidden mb-10" }, this.order.products.map((item, index) => {
71
+ return (h("section", { class: "step rating-section products-section hidden", "data-type": "product" }, h("div", { class: "bg-white mb-5 p-5 rounded-md overflow-hidden mb-10" }, this.order.products.map((item, index) => {
67
72
  var _a;
68
73
  return h("div", { class: "rating-outer-form", "data-stars-error": `يرجى تقييم (${item.title}) بواسطة النجمات` }, h("div", { class: "product-item mb-4" }, h("div", { class: "mb-5" }, h("div", { class: "flex space-s-5 mb-8" }, h("img", { src: item.image, alt: item.title, class: "w-18 h-14 object-cover rounded-md" }), h("div", { class: "flex-1" }, h("h3", { class: "section-title leading-5 mb-1.5 md:text-base" }, " ", item.title), h("div", { class: "rw-product-entry__rate" }, h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element rate-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-xsm my-0" })), h("input", { type: "hidden", name: "order_id", value: (_a = this.order) === null || _a === void 0 ? void 0 : _a.order_id }), 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: "comment form-input h-20 product-review", placeholder: `اضف رأيك عن المنتج (${item.title})` }), h("small", { class: "text-red-400 validation-message" })))))));
69
74
  }))));
70
75
  }
71
76
  renderStoreRating() {
72
- return (h("section", { class: "rating-section bg-white my-10 p-5 rounded-md mb-5", "data-type": "store" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0627\u0644\u0645\u062A\u062C\u0631 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "type", value: "store" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u0643\u064A\u0641 \u0643\u0627\u0646\u062A \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0627\u0644\u0645\u062A\u062C\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u0631\u0629"), h("div", { class: "mb-2" }, h("textarea", { id: "storeReview", name: "comment", class: "form-input comment h-20", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0627\u0644\u0645\u062A\u062C\u0631.." })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element rate-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
77
+ return (h("section", { class: "step rating-section bg-white my-10 p-5 rounded-md mb-5 active", "data-type": "store" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0627\u0644\u0645\u062A\u062C\u0631 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "type", value: "store" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u0643\u064A\u0641 \u0643\u0627\u0646\u062A \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0627\u0644\u0645\u062A\u062C\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u0631\u0629"), h("div", { class: "mb-2" }, h("textarea", { id: "storeReview", name: "comment", class: "form-input comment h-20", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0627\u0644\u0645\u062A\u062C\u0631.." })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element rate-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
73
78
  }
74
79
  renderShippingRating() {
75
- return (h("section", { class: "rating-section bg-white my-10 p-5 rounded-md mb-5", "data-type": "shipping" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.id }), h("input", { type: "hidden", name: "type", value: "shipping" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u062E\u0628\u0631\u0646\u0627 \u0639\u0646 \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646"), h("div", { class: "mb-2" }, h("textarea", { id: "shippingReview", name: "comment", class: "form-input comment h-20 mb-2", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646" })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element ratFeedbackPresentere-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
80
+ return (h("section", { class: "step rating-section bg-white my-10 p-5 rounded-md mb-5 hidden", "data-type": "shipping" }, h("div", { class: "rating-outer-form", "data-stars-error": "\u064A\u0631\u062C\u0649 \u062A\u0642\u064A\u064A\u0645 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0646\u062C\u0645\u0627\u062A" }, h("input", { type: "hidden", name: "order_id", value: this.order.order_id }), h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.id }), h("input", { type: "hidden", name: "type", value: "shipping" }), h("h2", { class: "section-title text-lg font-bold mb-5" }, "\u062E\u0628\u0631\u0646\u0627 \u0639\u0646 \u062A\u062C\u0631\u0628\u062A\u0643 \u0645\u0639 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646"), h("div", { class: "mb-2" }, h("textarea", { id: "shippingReview", name: "comment", class: "form-input comment h-20 mb-2", placeholder: "\u0627\u0636\u0641 \u0631\u0623\u064A\u0643 \u0639\u0646 \u0634\u0631\u0643\u0629 \u0627\u0644\u0634\u062D\u0646" })), h("div", { class: "rating-wrap flex items-center space-s-4" }, h("form", { class: "rate-element ratFeedbackPresentere-element--has-label" }, this.getStarsRating()), h("p", { class: "rate-label fix-align font-sm center mb-0" })), h("small", { class: "text-red-400 validation-message" }))));
76
81
  }
77
82
  getStarsRating() {
78
83
  return (h("div", { class: "mb-1" }, h("input", { type: "hidden", class: "rating_hidden_input", name: "rating", value: "" }), this.stars.map((star) => h("button", { type: "submit", class: "btn btn--transparent px-1 text-lg text-gray-400 btn--star", "data-star": star, "data-text": this.order.ratingMessage[`${star}`] }, h("i", { class: "sicon-star2" })))));
79
84
  }
80
- //========================= Start Rating Logic =========================//
81
85
  initiateRating() {
82
86
  this.highlightSelectedStars();
83
87
  this.starsRating();
88
+ this.handleWizard();
84
89
  //show submitRating Button Only When there is a comment field
85
- Helper.app.toggle('#submitRating', 'btn', 'hidden', () => Helper.app.element('#shippingReview,#storeReview,.product-review'));
86
- this.ratingChain = Promise.resolve();
87
- Helper.app.onClick('#submitRating', () => this.sendRating().then(() => window.location.reload()));
90
+ // Helper.toggle('#submitRating', 'btn', 'hidden', () => Helper.element('#shippingReview,#storeReview,.product-review'))
91
+ // this.ratingChain = Promise.resolve();
92
+ // Helper.onClick('#submitRating', () => this.sendRating().then(() => window.location.reload()));
93
+ salla.event.on('submit::order-rating', () => this.sendRating().then(() => window.location.reload()));
94
+ }
95
+ handleWizard() {
96
+ let steps = document.querySelectorAll(".step"), stepsCount = document.querySelectorAll(".step").length;
97
+ Helper.onClick("#prev-btn", () => {
98
+ this.wizardInex > 0 && this.wizardInex--;
99
+ this.showActiveStep(steps);
100
+ this.wizardInex == 0 && Helper.toggle('#prev-btn', 'hidden', 'block', () => true);
101
+ });
102
+ Helper.onClick("#next-btn", () => {
103
+ this.ratingValidation();
104
+ this.wizardInex == stepsCount - 1 && salla.event.dispatch("submit::order-rating");
105
+ this.wizardInex < stepsCount - 1 && this.wizardInex++;
106
+ this.showActiveStep(steps);
107
+ Helper.toggle('#prev-btn', 'block', 'hidden', () => true);
108
+ });
109
+ }
110
+ showActiveStep(steps) {
111
+ Helper.toggle('.step', 'hidden', 'active', () => true);
112
+ Helper.toggleElement(steps[this.wizardInex], 'active', 'hidden', () => true);
88
113
  }
89
114
  sendRating() {
90
- this.ratingValidation();
91
- Helper.app.all('.rating-section', ratingSection => {
115
+ // this.ratingValidation()
116
+ Helper.all('.rating-section', ratingSection => {
92
117
  let type = ratingSection.dataset.type;
93
118
  let formsData = [];
94
119
  ratingSection.querySelectorAll('.rating-outer-form')
@@ -118,7 +143,7 @@ const OrderRating = class {
118
143
  }
119
144
  ratingValidation() {
120
145
  let errorMsg = '';
121
- document.querySelectorAll('.rating-section')
146
+ document.querySelectorAll('.rating-section.active')
122
147
  .forEach((ratingSection) => {
123
148
  ratingSection.querySelectorAll('.rating-outer-form')
124
149
  .forEach((rating) => {
@@ -159,7 +184,7 @@ const OrderRating = class {
159
184
  // for hovered star ---
160
185
  highlightSelectedStars() {
161
186
  let hover = ['hovered', 'text-theme-yellow'];
162
- Helper.app.all('.rate-element', el => {
187
+ Helper.all('.rate-element', el => {
163
188
  let starElements = el.querySelectorAll('.btn--star');
164
189
  // remove hovered state from stars ---
165
190
  el.addEventListener('mouseout', () => el.querySelectorAll('.btn--star').forEach(star => star.classList.remove(...hover)));
@@ -8,6 +8,7 @@ const SallaButton = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.kind = 'primary';
10
10
  this.loading = false;
11
+ this.disabled = false;
11
12
  this.hostAttributes = {};
12
13
  for (let i = 0; i < this.host.attributes.length; i++) {
13
14
  this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
@@ -26,10 +27,10 @@ const SallaButton = class {
26
27
  return this.host;
27
28
  }
28
29
  async disable() {
29
- this.btn.setAttribute('disabled', '');
30
+ this.host.setAttribute('disabled', '');
30
31
  }
31
32
  async enable() {
32
- this.btn.removeAttribute('disabled');
33
+ this.host.removeAttribute('disabled');
33
34
  }
34
35
  handleVisible(newKind, oldKind) {
35
36
  this.btn.classList.remove('btn-' + oldKind);
@@ -39,7 +40,7 @@ const SallaButton = class {
39
40
  Helper.toggleElement(this.btn, 'btn--is-loading', 'btn--no-loading', () => newVal);
40
41
  }
41
42
  render() {
42
- return (h("button", Object.assign({ ref: el => this.btn = el }, this.hostAttributes), h("slot", null), this.loading ? h("span", { class: "loader loader--small s-button-loader" }) : ''));
43
+ return (h("button", Object.assign({ ref: btn => this.btn = btn, disabled: this.disabled }, this.hostAttributes), h("slot", null), this.loading ? h("span", { class: "loader loader--small s-button-loader" }) : ''));
43
44
  }
44
45
  get host() { return getElement(this); }
45
46
  static get watchers() { return {
@@ -7,6 +7,12 @@ const SallaLocalization = class {
7
7
  Helper.setHost(this.host);
8
8
  salla.event.on('localization::show', () => this.show());
9
9
  }
10
+ setCurrentLanguage(language) {
11
+ this.language = language;
12
+ }
13
+ setCurrentCurrency(currency) {
14
+ this.currency = currency;
15
+ }
10
16
  async show() {
11
17
  return this.modal.show();
12
18
  }
@@ -17,16 +23,13 @@ const SallaLocalization = class {
17
23
  let url;
18
24
  this.btn.load()
19
25
  .then(() => {
20
- let code = Helper.val('[name=currency]:checked');
21
- if (code !== salla.config.currency.code) {
26
+ if (this.currency && this.currency.code !== salla.config.currency.code) {
22
27
  url = window.location.href;
23
- return salla.currency.api.change(code);
28
+ return salla.currency.api.change(this.currency.code);
24
29
  }
25
- //binding
26
30
  }).then(() => {
27
- let language = Helper.val('[name=lang]:checked');
28
- if (language !== salla.config.language.code) {
29
- url = salla.config.languages.filter(lang => lang.code === language)[0].url;
31
+ if (this.language && this.language.code !== salla.config.language.code) {
32
+ url = this.language.url;
30
33
  }
31
34
  }).then(() => this.btn.stop())
32
35
  .then(() => this.hide())
@@ -34,9 +37,9 @@ const SallaLocalization = class {
34
37
  }
35
38
  render() {
36
39
  return (h("salla-modal", { id: "salla-localization", class: "hidden", ref: modal => this.modal = modal }, h("slot", { name: "header" }, h("div", { slot: "header" })), h("div", { class: "s-localization-inner" }, salla.config.languages
37
- ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.language')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_language')), h("div", { class: "s-localization-section-inner" }, salla.config.languages.map(lang => h("div", { class: "flex items-center" }, h("input", { id: 'lang-' + lang.code.toLowerCase(), class: "s-localization-input", name: "lang", checked: salla.config.language.code == lang.code, type: "radio", value: lang.code }), h("label", { htmlFor: 'lang-' + lang.code.toLowerCase(), class: "s-localization-label" }, h("span", null, lang.name), h("div", { class: 's-localization-flag flag iti__flag iti__' + lang.country_code })))))))
40
+ ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.language')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_language')), h("div", { class: "s-localization-section-inner" }, salla.config.languages.map(lang => h("div", { class: "flex items-center" }, h("input", { class: "s-localization-input", checked: salla.config.language.code == lang.code, onChange: () => this.setCurrentLanguage(lang), id: 'lang-' + lang.code.toLowerCase(), name: "language", type: "radio", value: lang.code }), h("label", { htmlFor: 'lang-' + lang.code.toLowerCase(), class: "s-localization-label" }, h("span", null, lang.name), h("div", { class: 's-localization-flag flag iti__flag iti__' + lang.country_code })))))))
38
41
  : '', salla.config.currencies
39
- ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.currency')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_currency')), h("div", { class: "s-localization-section-inner" }, salla.config.currencies.map(currency => h("div", { class: "s-localization-item" }, h("input", { class: "s-localization-input", checked: salla.config.currency.code == currency.code, id: 'currency-' + currency.code, name: "currency", type: "radio", value: currency.code }), h("label", { class: "s-localization-label", htmlFor: 'currency-' + currency.code }, h("span", null, currency.name), h("small", { class: "s-localization-currency" }, currency.code)))))))
42
+ ? h("div", { class: "s-localization-section" }, h("label", { class: "s-localization-title" }, salla.lang.get('common.titles.currency')), h("fieldset", { class: "s-localization-fieldset" }, h("legend", { class: "sr-only" }, salla.lang.get('blocks.header.change_currency')), h("div", { class: "s-localization-section-inner" }, salla.config.currencies.map(currency => h("div", { class: "s-localization-item" }, h("input", { class: "s-localization-input", checked: salla.config.currency.code == currency.code, onChange: () => this.setCurrentCurrency(currency), id: 'currency-' + currency.code, name: "currency", type: "radio", value: currency.code }), h("label", { class: "s-localization-label", htmlFor: 'currency-' + currency.code }, h("span", null, currency.name), h("small", { class: "s-localization-currency" }, currency.code)))))))
40
43
  : ''), h("p", { slot: "footer" }, h("slot", { name: "footer" }, h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.submit(), class: "w-full" }, salla.lang.get('common.elements.ok'))))));
41
44
  }
42
45
  get host() { return getElement(this); }
@@ -0,0 +1,90 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-643344dc.js';
2
+ import { H as Helper } from './Helper-23b2de40.js';
3
+
4
+ const SallaVerify = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ Helper.setHost(this.host);
8
+ salla.event.on('profile::verify.mobile', data => this.show(data));
9
+ }
10
+ show({ international_mobile: mobile, _country_iso2: country_code }) {
11
+ this.mobile = mobile;
12
+ this.country_code = country_code;
13
+ this.resendTimer();
14
+ this.otpInputs = document.querySelectorAll('.s-verify-input');
15
+ this.otpInputs[0].focus();
16
+ Helper.onKeyUp('.s-verify-input', event => {
17
+ var _a, _b;
18
+ let key = event.keyCode || event.charCode;
19
+ salla.helpers.digitsOnly(event.target);
20
+ if (event.target.value) {
21
+ (_a = event.target.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
22
+ }
23
+ else if ([8, 46].includes(key)) {
24
+ (_b = event.target.previousElementSibling) === null || _b === void 0 ? void 0 : _b.focus();
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') }, h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }), h("label", { class: "s-verify-label" }, salla.lang.get('pages.profile.verify_placeholder')), h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }), 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 }))), h("div", { slot: "footer", class: "s-verify-footer" }, h("salla-button", { class: "s-verify-submit", disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')), h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el }, salla.lang.get('blocks.header.resend_after'), h("b", { class: "s-verify-timer", ref: el => this.timer = el })), h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit')))));
86
+ }
87
+ get host() { return getElement(this); }
88
+ };
89
+
90
+ export { SallaVerify as salla_verify };
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["salla-localization",[[4,"salla-localization",{"show":[64],"hide":[64]}]]],["order-rating",[[0,"order-rating",{"order":[8]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]],["salla-button",[[4,"salla-button",{"kind":[513],"loading":[516],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["multi-warehouse_3",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[1,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64]}]]]], options);
16
+ return bootstrapLazy([["salla-localization",[[4,"salla-localization",{"show":[64],"hide":[64]}]]],["salla-verify",[[0,"salla-verify"]]],["order-rating",[[0,"order-rating",{"order":[8]}]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]],["salla-button",[[4,"salla-button",{"kind":[513],"loading":[516],"disabled":[516],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["multi-warehouse_3",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}],[0,"salla-login"],[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[1,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64],"setTitle":[64]}]]]], options);
17
17
  });
@@ -0,0 +1 @@
1
+ import{r as t,h as s,g as i}from"./p-d1ef2268.js";import{H as n}from"./p-520446eb.js";const a=class{constructor(s){t(this,s),this.kind="primary",this.loading=!1,this.disabled=!1,this.hostAttributes={};for(let t=0;t<this.host.attributes.length;t++)this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value;this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class=(this.hostAttributes.class||"")+" s-button-btn btn--has-loading btn-"+this.kind,delete this.hostAttributes.kind,delete this.hostAttributes.id}async load(){return this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),this.host}async disable(){this.host.setAttribute("disabled","")}async enable(){this.host.removeAttribute("disabled")}handleVisible(t,s){this.btn.classList.remove("btn-"+s),this.btn.classList.add("btn-"+t)}handleLoading(t){n.toggleElement(this.btn,"btn--is-loading","btn--no-loading",(()=>t))}render(){return s("button",Object.assign({ref:t=>this.btn=t,disabled:this.disabled},this.hostAttributes),s("slot",null),this.loading?s("span",{class:"loader loader--small s-button-loader"}):"")}get host(){return i(this)}static get watchers(){return{kind:["handleVisible"],loading:["handleLoading"]}}};a.style=":host{display:block}";export{a as salla_button}
@@ -0,0 +1 @@
1
+ import{r as s,h as e,g as i}from"./p-d1ef2268.js";import{H as t}from"./p-520446eb.js";const r=class{constructor(e){s(this,e),t.setHost(this.host),salla.event.on("profile::verify.mobile",(s=>this.show(s)))}show({international_mobile:s,_country_iso2:e}){return this.mobile=s,this.country_code=e,this.resendTimer(),this.otpInputs=document.querySelectorAll(".s-verify-input"),this.otpInputs[0].focus(),t.onKeyUp(".s-verify-input",(s=>{var e,i;let t=s.keyCode||s.charCode;salla.helpers.digitsOnly(s.target),s.target.value?null===(e=s.target.nextElementSibling)||void 0===e||e.focus():[8,46].includes(t)&&(null===(i=s.target.previousElementSibling)||void 0===i||i.focus()),this.toggleOTPSubmit()})),t.on("paste",".s-verify-input",(s=>{let e=s.clipboardData.getData("text").toArabicDigits().replace(/[^0-9.]/g,"").replace("..",".");this.otpInputs.forEach(((s,i)=>s.value=e[i]||"")),this.toggleOTPSubmit(),setTimeout((()=>this.otpInputs[3].focus()),100)})),this.modal.show()}toggleOTPSubmit(){let s=[];if(this.otpInputs.forEach((e=>e.value&&s.push(e.value))),this.code.value=s.join(""),4===s.length)return this.btn.removeAttribute("disabled"),void this.btn.click();this.btn.setAttribute("disabled","")}resendTimer(){t.showElement(this.resendMessage).hideElement(this.resend);let s=30,e=setInterval((()=>{-1===s?(clearTimeout(e),t.hideElement(this.resendMessage).showElement(this.resend)):(this.timer.innerHTML=`${s>=10?s:"0"+s} : 00`,s--)}),1e3)}submit(){return this.btn.load().then((()=>this.btn.disable())).then((()=>salla.document.api.request("profile/verify-mobile",{mobile:this.mobile,country_code:this.country_code,code:this.code.value}))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.hide())).then((()=>window.location.reload())).catch((()=>this.btn.stop()&&this.btn.enable()))}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend({phone:this.mobile,country_code:this.country_code}))).then((()=>this.resendTimer())).catch((()=>this.resendTimer()))}render(){return e("salla-modal",{id:"s-verify",ref:s=>this.modal=s,title:salla.lang.get("pages.profile.verify_title")},e("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),e("label",{class:"s-verify-label"},salla.lang.get("pages.profile.verify_placeholder")),e("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:s=>this.code=s}),e("div",{class:"s-verify-codes",dir:"ltr"},[1,2,3,4].map((()=>e("input",{type:"text",maxlength:"1",class:"s-verify-input",required:!0})))),e("div",{slot:"footer",class:"s-verify-footer"},e("salla-button",{class:"s-verify-submit",disabled:!0,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),e("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),e("b",{class:"s-verify-timer",ref:s=>this.timer=s})),e("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))))}get host(){return i(this)}};export{r as salla_verify}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s}from"./p-d1ef2268.js";import{H as a}from"./p-520446eb.js";const i=class{constructor(e){t(this,e),this.stars=[1,2,3,4,5],this.order={shipping:{id:5622},order_id:"179794",products:[{title:"ميكروفون عالى الجودة",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/pMdEEyMVpZFj4L1Hrdm2g48AuiSx0TrKULBiOnPo.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"2314513454",getOptimusRouteKey:"7351233357"},{title:"وحدة تحكم لمشغل العاب",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/NOa4kHvOkd1hBWHk3JIgAo1602oVACfuWGFz3vXv.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"9842833",getOptimusRouteKey:"735152357"},{title:"ساعة ذكية بنظام اندرويد",image:"https://salla-dev.s3.eu-central-1.amazonaws.com/Mvyk/T4kTqYNuPAZmPMLw1bx92RnjVMZyFszVXOUZQsFJ.jpg",price:"‏10,978.00 ر.س",qty:"‏2",totalBefore:"‏1120 ر.س",discount:"-5%",total:"‏1064 ر.س",id:"679822376",getOptimusRouteKey:"73233357"}],ratingMessage:{1:"غير راضي <span class='emoji mx-1'>😒</span>",2:"لم يعجبني <span class='emoji mx-1'>😌</span>",3:"معقول <span class='emoji mx-1'>🙄</span>",4:"أعجبني <span class='emoji mx-1'>👍</span>",5:"أعجبني جداً <span class='emoji mx-1'>🤩</span>"},settings:{isProductsRating:!0,isStoreRating:!0,isShippingRating:!0}},this.ratingChain=Promise.resolve(),this.wizardInex=0}componentDidRender(){this.initiateRating()}render(){return e(s,null,e("div",{class:"pannel__body"},this.order.settings.isStoreRating&&this.renderStoreRating(),this.order.settings.isProductsRating&&this.renderProductsRating(),this.order.settings.isShippingRating&&this.renderShippingRating()),e("div",{class:"pannel__footer relative flex justify-between items-center"},e("button",{id:"prev-btn",class:"font-bold text-sm text-primary hidden"},"السابق"),e("ul",{class:"flex justify-center text-center space-s-1.5 py-8 flex-1"},e("li",{class:"cursor-pointer w-2.5 h-2.5 bg-primary rounded-full transition-colors duration-300"}),e("li",{class:"cursor-pointer w-2.5 h-2.5 bg-gray-200 rounded-full transition-colors duration-300"}),e("li",{class:"cursor-pointer w-2.5 h-2.5 bg-gray-200 rounded-full transition-colors duration-300"})),e("button",{id:"next-btn",class:"btn btn-primary h-10 px-8 flex-none"},"التالي")))}renderProductsRating(){return e("section",{class:"step rating-section products-section hidden","data-type":"product"},e("div",{class:"bg-white mb-5 p-5 rounded-md overflow-hidden mb-10"},this.order.products.map(((t,s)=>{var a;return e("div",{class:"rating-outer-form","data-stars-error":`يرجى تقييم (${t.title}) بواسطة النجمات`},e("div",{class:"product-item mb-4"},e("div",{class:"mb-5"},e("div",{class:"flex space-s-5 mb-8"},e("img",{src:t.image,alt:t.title,class:"w-18 h-14 object-cover rounded-md"}),e("div",{class:"flex-1"},e("h3",{class:"section-title leading-5 mb-1.5 md:text-base"}," ",t.title),e("div",{class:"rw-product-entry__rate"},e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-xsm my-0"})),e("input",{type:"hidden",name:"order_id",value:null===(a=this.order)||void 0===a?void 0:a.order_id}),e("input",{type:"hidden",name:`products[${s}][product_id]`,value:t.getOptimusRouteKey}),e("input",{type:"hidden",name:"type",value:"products"}),e("textarea",{"data-product-id":t.id,name:`products[${s}][comment]`,id:`productReview_${t.id}`,class:"comment form-input h-20 product-review",placeholder:`اضف رأيك عن المنتج (${t.title})`}),e("small",{class:"text-red-400 validation-message"})))))))}))))}renderStoreRating(){return e("section",{class:"step rating-section bg-white my-10 p-5 rounded-md mb-5 active","data-type":"store"},e("div",{class:"rating-outer-form","data-stars-error":"يرجى تقييم المتجر بواسطة النجمات"},e("input",{type:"hidden",name:"order_id",value:this.order.order_id}),e("input",{type:"hidden",name:"type",value:"store"}),e("h2",{class:"section-title text-lg font-bold mb-5"},"كيف كانت تجربتك مع المتجر هذه المرة"),e("div",{class:"mb-2"},e("textarea",{id:"storeReview",name:"comment",class:"form-input comment h-20",placeholder:"اضف رأيك عن المتجر.."})),e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element rate-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-sm center mb-0"})),e("small",{class:"text-red-400 validation-message"})))}renderShippingRating(){return e("section",{class:"step rating-section bg-white my-10 p-5 rounded-md mb-5 hidden","data-type":"shipping"},e("div",{class:"rating-outer-form","data-stars-error":"يرجى تقييم شركة الشحن بواسطة النجمات"},e("input",{type:"hidden",name:"order_id",value:this.order.order_id}),e("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.id}),e("input",{type:"hidden",name:"type",value:"shipping"}),e("h2",{class:"section-title text-lg font-bold mb-5"},"خبرنا عن تجربتك مع شركة الشحن"),e("div",{class:"mb-2"},e("textarea",{id:"shippingReview",name:"comment",class:"form-input comment h-20 mb-2",placeholder:"اضف رأيك عن شركة الشحن"})),e("div",{class:"rating-wrap flex items-center space-s-4"},e("form",{class:"rate-element ratFeedbackPresentere-element--has-label"},this.getStarsRating()),e("p",{class:"rate-label fix-align font-sm center mb-0"})),e("small",{class:"text-red-400 validation-message"})))}getStarsRating(){return e("div",{class:"mb-1"},e("input",{type:"hidden",class:"rating_hidden_input",name:"rating",value:""}),this.stars.map((t=>e("button",{type:"submit",class:"btn btn--transparent px-1 text-lg text-gray-400 btn--star","data-star":t,"data-text":this.order.ratingMessage[`${t}`]},e("i",{class:"sicon-star2"})))))}initiateRating(){this.highlightSelectedStars(),this.starsRating(),this.handleWizard(),salla.event.on("submit::order-rating",(()=>this.sendRating().then((()=>window.location.reload()))))}handleWizard(){let t=document.querySelectorAll(".step"),e=document.querySelectorAll(".step").length;a.onClick("#prev-btn",(()=>{this.wizardInex>0&&this.wizardInex--,this.showActiveStep(t),0==this.wizardInex&&a.toggle("#prev-btn","hidden","block",(()=>!0))})),a.onClick("#next-btn",(()=>{this.ratingValidation(),this.wizardInex==e-1&&salla.event.dispatch("submit::order-rating"),this.wizardInex<e-1&&this.wizardInex++,this.showActiveStep(t),a.toggle("#prev-btn","block","hidden",(()=>!0))}))}showActiveStep(t){a.toggle(".step","hidden","active",(()=>!0)),a.toggleElement(t[this.wizardInex],"active","hidden",(()=>!0))}sendRating(){return a.all(".rating-section",(t=>{let e=t.dataset.type,s=[];t.querySelectorAll(".rating-outer-form").forEach((t=>{let a={};t.querySelectorAll("[name]").forEach((function(t){let e=salla.helpers.inputData(t.name,t.value,a);a[e.name]=e.value})),s=[],s.push(a),this.sendFeedback(e,s)}))})),this.ratingChain}sendFeedback(t,e){e&&0!=e.length&&(salla.config.canLeave=!1,this.ratingChain=salla.feedback.api[t](e[0]).then((function(){salla.config.canLeave=!0})).catch((()=>salla.config.canLeave=!0)))}ratingValidation(){let t="";if(document.querySelectorAll(".rating-section.active").forEach((e=>{e.querySelectorAll(".rating-outer-form").forEach((e=>{let s=e.querySelector(".rating_hidden_input"),a=e.querySelector(".comment"),i=e.querySelector(".section-title"),r=e.querySelector(".validation-message");if(s.value&&a.value&&a.value.length>3)return a.classList.remove("has-error"),null==i||i.classList.remove("has-error","text-red-400"),void(r.innerHTML="");a.value&&a.value.length>3?a.classList.remove("has-error"):a.classList.add("has-error"),null==i||i.classList.add("has-error","text-red-400"),t=s.value?salla.lang.get("common.errors.not_less_than_chars",{chars:4})+" "+a.getAttribute("placeholder"):e.dataset.starsError||salla.lang.get("pages.rating.rate_store_stars"),r.innerHTML=t}))})),t){let e=document.querySelectorAll(".has-error");throw e.length&&window.scrollTo({top:e[0].offsetTop-80}),new Error(t)}}highlightSelectedStars(){let t=["hovered","text-theme-yellow"];a.all(".rate-element",(e=>{let s=e.querySelectorAll(".btn--star");e.addEventListener("mouseout",(()=>e.querySelectorAll(".btn--star").forEach((e=>e.classList.remove(...t))))),s.forEach(((e,a)=>{e.addEventListener("mouseover",(()=>{if(e.classList.add(...t),a<=1)"BUTTON"===e.previousElementSibling.tagName&&e.previousElementSibling.classList.add(...t);else for(let e=0;e<a;e++)s[e].classList.add(...t)})),e.addEventListener("mouseout",(()=>{e.classList.contains(...t)&&e.classList.remove(...t)}))}))}))}starsRating(){let t=["selected","text-theme-yellow"];salla.document.event.onSubmit(".rate-element",(function(e){e.preventDefault();var s=e.target.querySelectorAll(".btn--star.hovered"),a=s[s.length-1];if(a){var i=parseInt(a.dataset.star,10);e.target.nextElementSibling.innerHTML=a.dataset.text,e.target.querySelector(".rating_hidden_input").value=i,e.target.querySelectorAll(".btn--star").forEach((function(e,s){s<i?e.classList.add(...t):e.classList.remove(...t)}));var r=e.target.querySelector('.star[aria-pressed="true"]');r&&r.removeAttribute("aria-pressed"),a.setAttribute("aria-pressed",!0)}}))}};i.style=":host{display:block}";export{i as order_rating}
@@ -1 +1 @@
1
- import{r as s,h as t,g as e,c as i,H as a}from"./p-d1ef2268.js";export{S as salla_login}from"./p-36c87e2e.js";import{H as l}from"./p-520446eb.js";let o=require("store/src/store-engine"),r=require("store/storages/sessionStorage"),n=o.createStore(r);const h=class{constructor(t){s(this,t),this.open=!1,this.isOpenedBefore=n.get("multi-warehouse-opened-before"),this.displayAs="default",this.browseProductsFrom="all",this.branches=[{id:1,name:"فرع الرياض",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:2,name:"فرع جدة",open:!1,available:!1,limited:!1,tag:"غير متوفر"},{id:3,name:"فرع مكة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:4,name:"فرع المدينة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:5,name:"فرع جازان",open:!0,available:!0,limited:!0,tag:"الكمية محدودة"}],this.current=1,this.currentBranch=s=>this.branches.filter((s=>s.id==this.current))[0][s],this.statusColor=(s=null)=>s?s.limited?"text-red-400":s.available?"text-green-500":"text-gray-400":this.currentBranch("limited")?"text-red-400":this.currentBranch("available")?"text-green-500":"text-gray-400",this.isChoiceable=()=>"all"!==this.browseProductsFrom&&"single"==this.position||"header"==this.position,this.formTitle=()=>this.isChoiceable()?"توفر المنتج في الفروع الآخرى":"التسوق من فرع آخر",salla.event.on("branches::show",(()=>this.show()))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}handelChange(s){this.selected=s.target.value}handleSubmit(){n.set("multi-warehouse-opened-before",!0),this.show(),setTimeout((()=>{this.current=this.selected}),300)}render(){return t("salla-modal",{"is-closable":this.isOpenedBefore||"popup"!=this.displayAs?"true":"false",ref:s=>this.modal=s,"modal-width":"w-116",id:"multi-warehouse-modal",class:"hidden"},t("slot",{name:"header"},t("div",{slot:"header"})),t("div",null,t("div",{class:"text-right"},t("div",{class:"flex items-center mb-8"},t("div",{class:"flex-shrink-0 sm:mb-0 me-4"},t("div",{class:"h-16 w-16 border border-gray-200 bg-white text-primary rounded-full flex justify-center items-center"},t("span",{class:"sicon-store-alt"}))),t("div",null,t("p",{class:"mt-1 text-xs text-gray-400"},"أنت الآن تتصفح المتجر من"),t("h4",{class:"text-base"},"فرع الرياض"))),t("fieldset",{class:"mt-4"},t("h4",{class:"text-sm text-gray-600 mb-6"},this.formTitle()),t("legend",{class:"sr-only"},this.formTitle()),this.branches.length<=5?t("div",{class:"space-y-5"},this.branches.map((s=>t("div",{class:"flex items-center"},t("input",{id:this.position+"_branch_"+s.id,disabled:!s.open&&this.isChoiceable(),name:"lang",type:"radio",value:s.id,onChange:s=>this.handelChange(s),class:{"me-3 focus:ring-primary h-4 w-4 text-primary border-gray-300":!0,"opacity-50":!s.open,hidden:!this.isChoiceable()},checked:this.current==s.id}),t("label",{htmlFor:this.position+"_branch_"+s.id,class:{"flex items-center justify-between text-sm font-medium text-gray-700 flex-grow":!0,"cursor-pointer":this.isChoiceable()}},t("span",{class:{"opacity-50":!s.open}},s.name),this.isChoiceable()?t("small",{class:"text-red-400"},s.open?"":"مُغلق"):t("span",{class:this.statusColor(s)},s.tag)))))):t("select",{class:"w-full h-10 transition-colors duration-300 focus:ring-transparent focus:border-primary sm:text-sm border-gray-200 rounded-md appearance-none visibility_condition px-4",onInput:s=>this.handelChange(s)},this.branches.map((s=>t("option",{value:s.id,disabled:!s.open,selected:this.selected==s.id},s.name," ",s.open?"":"- مُغلق"))))))),this.isChoiceable()?t("p",{slot:"footer"},t("slot",{name:"footer"},t("button",{type:"button",class:"mt-8 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white transition-colors hover:bg-primary-d focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary sm:col-start-2 sm:text-sm",onClick:()=>this.handleSubmit()},salla.lang.get("common.elements.ok")))):"")}componentDidRender(){}get host(){return e(this)}},d=class{constructor(t){s(this,t),this.ready=i(this,"ready",7),this.close=i(this,"close",7),this.error=!1,this.success=!1,this.isClosable=!0,this.modalWidth="w-96",this.visible=!1,this.subTitle="",this.icon="sicon-cancel",salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide()))}handleVisible(s){if(!s)return this.toggleModal(!1),void this.close.emit();this.host.classList.remove("hidden"),setTimeout((()=>this.toggleModal(!0))),this.ready.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}toggleModal(s){l.toggleElement(this.host.querySelector(".s-modal-overlay"),"ease-out duration-300 opacity-100","opacity-0",(()=>s)).toggleElement(this.host.querySelector(".s-modal-body"),"ease-out duration-300 opacity-100 translate-y-0 sm:scale-100","opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",(()=>s)).toggleElement(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}render(){return this.host.id=this.host.id||"salla-modal",t(a,{class:"s-modal-container hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-wrapper"},t("div",{class:"s-modal-overlay",onClick:()=>this.closeModal()}),t("span",{class:"s-modal-spacer"},"​"),t("div",{class:"s-modal-body "+this.modalWidth},t("slot",{name:"header"},t("div",{class:"s-modal-header"},this.isClosable?t("button",{class:"s-modal-close cursor-pointer",onClick:()=>this.closeModal(),type:"button"},t("span",{class:"sicon-cancel"})):"",this.error||this.success?t("div",{class:{"s-modal-icon":!0,"s-modal-bg-error":this.error,"s-modal-bg-success":this.success}},t("i",{class:{[this.icon]:!0,"s-modal-text-error":this.error,"s-modal-text-success":this.success}})):"",t("div",{class:"s-modal-title",innerHTML:this.host.title}),t("p",{class:"s-modal-sub-title",innerHTML:this.subTitle}))),t("slot",null),t("slot",{name:"footer"}))))}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};export{h as multi_warehouse,d as salla_modal}
1
+ import{r as s,h as t,g as e,c as i,H as a}from"./p-d1ef2268.js";export{S as salla_login}from"./p-36c87e2e.js";import{H as l}from"./p-520446eb.js";let o=require("store/src/store-engine"),r=require("store/storages/sessionStorage"),n=o.createStore(r);const h=class{constructor(t){s(this,t),this.open=!1,this.isOpenedBefore=n.get("multi-warehouse-opened-before"),this.displayAs="default",this.browseProductsFrom="all",this.branches=[{id:1,name:"فرع الرياض",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:2,name:"فرع جدة",open:!1,available:!1,limited:!1,tag:"غير متوفر"},{id:3,name:"فرع مكة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:4,name:"فرع المدينة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:5,name:"فرع جازان",open:!0,available:!0,limited:!0,tag:"الكمية محدودة"}],this.current=1,this.currentBranch=s=>this.branches.filter((s=>s.id==this.current))[0][s],this.statusColor=(s=null)=>s?s.limited?"text-red-400":s.available?"text-green-500":"text-gray-400":this.currentBranch("limited")?"text-red-400":this.currentBranch("available")?"text-green-500":"text-gray-400",this.isChoiceable=()=>"all"!==this.browseProductsFrom&&"single"==this.position||"header"==this.position,this.formTitle=()=>this.isChoiceable()?"توفر المنتج في الفروع الآخرى":"التسوق من فرع آخر",salla.event.on("branches::show",(()=>this.show()))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}handelChange(s){this.selected=s.target.value}handleSubmit(){n.set("multi-warehouse-opened-before",!0),this.show(),setTimeout((()=>{this.current=this.selected}),300)}render(){return t("salla-modal",{"is-closable":this.isOpenedBefore||"popup"!=this.displayAs?"true":"false",ref:s=>this.modal=s,"modal-width":"w-116",id:"multi-warehouse-modal",class:"hidden"},t("slot",{name:"header"},t("div",{slot:"header"})),t("div",null,t("div",{class:"text-right"},t("div",{class:"flex items-center mb-8"},t("div",{class:"flex-shrink-0 sm:mb-0 me-4"},t("div",{class:"h-16 w-16 border border-gray-200 bg-white text-primary rounded-full flex justify-center items-center"},t("span",{class:"sicon-store-alt"}))),t("div",null,t("p",{class:"mt-1 text-xs text-gray-400"},"أنت الآن تتصفح المتجر من"),t("h4",{class:"text-base"},"فرع الرياض"))),t("fieldset",{class:"mt-4"},t("h4",{class:"text-sm text-gray-600 mb-6"},this.formTitle()),t("legend",{class:"sr-only"},this.formTitle()),this.branches.length<=5?t("div",{class:"space-y-5"},this.branches.map((s=>t("div",{class:"flex items-center"},t("input",{id:this.position+"_branch_"+s.id,disabled:!s.open&&this.isChoiceable(),name:"lang",type:"radio",value:s.id,onChange:s=>this.handelChange(s),class:{"me-3 focus:ring-primary h-4 w-4 text-primary border-gray-300":!0,"opacity-50":!s.open,hidden:!this.isChoiceable()},checked:this.current==s.id}),t("label",{htmlFor:this.position+"_branch_"+s.id,class:{"flex items-center justify-between text-sm font-medium text-gray-700 flex-grow":!0,"cursor-pointer":this.isChoiceable()}},t("span",{class:{"opacity-50":!s.open}},s.name),this.isChoiceable()?t("small",{class:"text-red-400"},s.open?"":"مُغلق"):t("span",{class:this.statusColor(s)},s.tag)))))):t("select",{class:"w-full h-10 transition-colors duration-300 focus:ring-transparent focus:border-primary sm:text-sm border-gray-200 rounded-md appearance-none visibility_condition px-4",onInput:s=>this.handelChange(s)},this.branches.map((s=>t("option",{value:s.id,disabled:!s.open,selected:this.selected==s.id},s.name," ",s.open?"":"- مُغلق"))))))),this.isChoiceable()?t("p",{slot:"footer"},t("slot",{name:"footer"},t("button",{type:"button",class:"mt-8 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-primary text-base font-medium text-white transition-colors hover:bg-primary-d focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary sm:col-start-2 sm:text-sm",onClick:()=>this.handleSubmit()},salla.lang.get("common.elements.ok")))):"")}componentDidRender(){}get host(){return e(this)}},d=class{constructor(t){s(this,t),this.ready=i(this,"ready",7),this.close=i(this,"close",7),this.error=!1,this.success=!1,this.isClosable=!0,this.modalWidth="w-96",this.visible=!1,this.subTitle="",this.icon="sicon-cancel",salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide())),this.title=this.host.title,this.host.removeAttribute("title")}handleVisible(s){if(!s)return this.toggleModal(!1),void this.close.emit();this.host.classList.remove("hidden"),setTimeout((()=>this.toggleModal(!0))),this.ready.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.title=s,this.host}toggleModal(s){l.toggleElement(this.host.querySelector(".s-modal-overlay"),"ease-out duration-300 opacity-100","opacity-0",(()=>s)).toggleElement(this.host.querySelector(".s-modal-body"),"ease-out duration-300 opacity-100 translate-y-0 sm:scale-100","opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",(()=>s)).toggleElement(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}render(){return this.host.id=this.host.id||"salla-modal",t(a,{class:"s-modal-container hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-wrapper"},t("div",{class:"s-modal-overlay",onClick:()=>this.closeModal()}),t("span",{class:"s-modal-spacer"},"​"),t("div",{class:"s-modal-body "+this.modalWidth},t("slot",{name:"header"},t("div",{class:"s-modal-header"},this.isClosable?t("button",{class:"s-modal-close cursor-pointer",onClick:()=>this.closeModal(),type:"button"},t("span",{class:"sicon-cancel"})):"",this.error||this.success?t("div",{class:{"s-modal-icon":!0,"s-modal-bg-error":this.error,"s-modal-bg-success":this.success}},t("i",{class:{[this.icon]:!0,"s-modal-text-error":this.error,"s-modal-text-success":this.success}})):"",t("div",{class:"s-modal-title",innerHTML:this.title}),t("p",{class:"s-modal-sub-title",innerHTML:this.subTitle}))),t("slot",null),t("slot",{name:"footer"}))))}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};export{h as multi_warehouse,d as salla_modal}
@@ -0,0 +1 @@
1
+ import{r as l,h as a,g as s}from"./p-d1ef2268.js";import{H as i}from"./p-520446eb.js";const t=class{constructor(a){l(this,a),i.setHost(this.host),salla.event.on("localization::show",(()=>this.show()))}setCurrentLanguage(l){this.language=l}setCurrentCurrency(l){this.currency=l}async show(){return this.modal.show()}async hide(){return this.modal.hide()}submit(){let l;this.btn.load().then((()=>{if(this.currency&&this.currency.code!==salla.config.currency.code)return l=window.location.href,salla.currency.api.change(this.currency.code)})).then((()=>{this.language&&this.language.code!==salla.config.language.code&&(l=this.language.url)})).then((()=>this.btn.stop())).then((()=>this.hide())).then((()=>l&&(window.location.href=l)))}render(){return a("salla-modal",{id:"salla-localization",class:"hidden",ref:l=>this.modal=l},a("slot",{name:"header"},a("div",{slot:"header"})),a("div",{class:"s-localization-inner"},salla.config.languages?a("div",{class:"s-localization-section"},a("label",{class:"s-localization-title"},salla.lang.get("common.titles.language")),a("fieldset",{class:"s-localization-fieldset"},a("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_language")),a("div",{class:"s-localization-section-inner"},salla.config.languages.map((l=>a("div",{class:"flex items-center"},a("input",{class:"s-localization-input",checked:salla.config.language.code==l.code,onChange:()=>this.setCurrentLanguage(l),id:"lang-"+l.code.toLowerCase(),name:"language",type:"radio",value:l.code}),a("label",{htmlFor:"lang-"+l.code.toLowerCase(),class:"s-localization-label"},a("span",null,l.name),a("div",{class:"s-localization-flag flag iti__flag iti__"+l.country_code})))))))):"",salla.config.currencies?a("div",{class:"s-localization-section"},a("label",{class:"s-localization-title"},salla.lang.get("common.titles.currency")),a("fieldset",{class:"s-localization-fieldset"},a("legend",{class:"sr-only"},salla.lang.get("blocks.header.change_currency")),a("div",{class:"s-localization-section-inner"},salla.config.currencies.map((l=>a("div",{class:"s-localization-item"},a("input",{class:"s-localization-input",checked:salla.config.currency.code==l.code,onChange:()=>this.setCurrentCurrency(l),id:"currency-"+l.code,name:"currency",type:"radio",value:l.code}),a("label",{class:"s-localization-label",htmlFor:"currency-"+l.code},a("span",null,l.name),a("small",{class:"s-localization-currency"},l.code)))))))):""),a("p",{slot:"footer"},a("slot",{name:"footer"},a("salla-button",{ref:l=>this.btn=l,onClick:()=>this.submit(),class:"w-full"},salla.lang.get("common.elements.ok")))))}get host(){return s(this)}};export{t as salla_localization}
@@ -1 +1 @@
1
- import{p as e,b as s}from"./p-d1ef2268.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-4cc11ee2",[[4,"salla-localization",{show:[64],hide:[64]}]]],["p-60f0446f",[[0,"order-rating",{order:[8]}]]],["p-baeca520",[[4,"salla-search",{searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],searchTerm:[32],results:[32],fetchStatus:[32],showResult:[32],showModal:[32]}]]],["p-b72e6cfa",[[4,"salla-button",{kind:[513],loading:[516],load:[64],stop:[64],disable:[64],enable:[64]}]]],["p-b490f9e0",[[4,"multi-warehouse",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-login"],[4,"salla-modal",{error:[4],success:[4],isClosable:[1028,"is-closable"],modalWidth:[1,"modal-width"],visible:[516],subTitle:[1,"sub-title"],icon:[1],show:[64],hide:[64]}]]]],e)));
1
+ import{p as e,b as s}from"./p-d1ef2268.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-f4340bd9",[[4,"salla-localization",{show:[64],hide:[64]}]]],["p-a2395c9d",[[0,"salla-verify"]]],["p-bd10d8d5",[[0,"order-rating",{order:[8]}]]],["p-baeca520",[[4,"salla-search",{searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],searchTerm:[32],results:[32],fetchStatus:[32],showResult:[32],showModal:[32]}]]],["p-653bb9a8",[[4,"salla-button",{kind:[513],loading:[516],disabled:[516],load:[64],stop:[64],disable:[64],enable:[64]}]]],["p-ea986bca",[[4,"multi-warehouse",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-login"],[4,"salla-modal",{error:[4],success:[4],isClosable:[1028,"is-closable"],modalWidth:[1,"modal-width"],visible:[516],subTitle:[1,"sub-title"],icon:[1],show:[64],hide:[64],setTitle:[64]}]]]],e)));
@@ -2,12 +2,16 @@ export declare class OrderRating {
2
2
  stars: Number[];
3
3
  order: any;
4
4
  ratingChain: Promise<void>;
5
+ wizardInex: number;
6
+ componentDidRender(): void;
5
7
  render(): any;
6
8
  renderProductsRating(): any;
7
9
  renderStoreRating(): any;
8
10
  renderShippingRating(): any;
9
11
  getStarsRating(): any;
10
12
  initiateRating(): void;
13
+ handleWizard(): void;
14
+ showActiveStep(steps: any): void;
11
15
  sendRating(): Promise<void>;
12
16
  sendFeedback(type: any, formsData: any): void;
13
17
  ratingValidation(): void;
@@ -3,6 +3,7 @@ export declare class SallaButton {
3
3
  host: HTMLElement;
4
4
  kind: string;
5
5
  loading: boolean;
6
+ disabled: boolean;
6
7
  load(): Promise<HTMLElement>;
7
8
  stop(): Promise<HTMLElement>;
8
9
  disable(): Promise<void>;
@@ -2,7 +2,11 @@ export declare class SallaLocalization {
2
2
  constructor();
3
3
  private modal;
4
4
  private btn;
5
+ private language;
6
+ private currency;
5
7
  host: HTMLElement;
8
+ private setCurrentLanguage;
9
+ private setCurrentCurrency;
6
10
  show(): Promise<HTMLElement>;
7
11
  hide(): Promise<HTMLElement>;
8
12
  private submit;
@@ -8,12 +8,14 @@ export declare class SallaModal {
8
8
  visible: boolean;
9
9
  subTitle: string;
10
10
  icon: string;
11
+ private title;
11
12
  host: HTMLElement;
12
13
  ready: EventEmitter;
13
14
  close: EventEmitter;
14
15
  handleVisible(newValue: boolean): void;
15
16
  show(): Promise<HTMLElement>;
16
17
  hide(): Promise<HTMLElement>;
18
+ setTitle(title: any): Promise<HTMLElement>;
17
19
  private toggleModal;
18
20
  private closeModal;
19
21
  render(): any;
@@ -0,0 +1,19 @@
1
+ export declare class SallaVerify {
2
+ constructor();
3
+ host: HTMLElement;
4
+ private modal;
5
+ private code;
6
+ private btn;
7
+ private resendMessage;
8
+ private timer;
9
+ private resend;
10
+ private otpInputs;
11
+ private mobile;
12
+ private country_code;
13
+ private show;
14
+ private toggleOTPSubmit;
15
+ private resendTimer;
16
+ private submit;
17
+ private resendCode;
18
+ render(): any;
19
+ }