@salla.sa/twilight-components 1.0.99 → 1.0.104

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 (129) hide show
  1. package/dist/cjs/{index-fdf99836.js → index-b4140db0.js} +26 -98
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/salla-add-product-button_6.cjs.entry.js +73 -56
  4. package/dist/cjs/salla-branches.cjs.entry.js +10 -6
  5. package/dist/cjs/salla-conditional-fields.cjs.entry.js +4 -5
  6. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-localization-modal.cjs.entry.js +6 -5
  9. package/dist/cjs/salla-login-modal.cjs.entry.js +4 -4
  10. package/dist/cjs/salla-offer-modal.cjs.entry.js +4 -3
  11. package/dist/cjs/salla-quantity-input.cjs.entry.js +3 -3
  12. package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -5
  13. package/dist/cjs/salla-rating-stars.cjs.entry.js +27 -36
  14. package/dist/cjs/{salla-verify-modal.cjs.entry.js → salla-verify.cjs.entry.js} +20 -14
  15. package/dist/cjs/twilight-components.cjs.js +3 -3
  16. package/dist/collection/collection-manifest.json +2 -3
  17. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +13 -28
  18. package/dist/collection/components/salla-branches/salla-branches.css +0 -3
  19. package/dist/collection/components/salla-branches/salla-branches.js +10 -6
  20. package/dist/collection/components/salla-button/salla-button.css +1 -88
  21. package/dist/collection/components/salla-button/salla-button.js +2 -26
  22. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +3 -7
  23. package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.css +0 -3
  24. package/dist/collection/components/salla-installment/salla-installment.css +4 -3
  25. package/dist/collection/components/salla-localization-modal/salla-localization-modal.css +2 -16
  26. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +4 -3
  27. package/dist/collection/components/salla-login-modal/salla-login-modal.css +1 -8
  28. package/dist/collection/components/salla-login-modal/salla-login-modal.js +3 -3
  29. package/dist/collection/components/salla-modal/salla-modal.css +0 -3
  30. package/dist/collection/components/salla-modal/salla-modal.js +13 -12
  31. package/dist/collection/components/salla-offer-modal/salla-offer-modal.css +1 -25
  32. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +2 -1
  33. package/dist/collection/components/salla-product-availability/salla-product-availability.css +0 -3
  34. package/dist/collection/components/salla-product-availability/salla-product-availability.js +18 -13
  35. package/dist/collection/components/salla-quantity-input/salla-quantity-input.css +4 -3
  36. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +3 -3
  37. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +1 -20
  38. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +3 -3
  39. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +3 -5
  40. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +26 -35
  41. package/dist/collection/components/salla-search/salla-search.css +1 -45
  42. package/dist/collection/components/salla-search/salla-search.js +35 -16
  43. package/dist/collection/components/salla-tel-input/salla-tel-input.css +13 -8
  44. package/dist/collection/components/{salla-verify-modal/salla-verify-modal.css → salla-verify/salla-verify.css} +1 -8
  45. package/dist/collection/components/{salla-verify-modal/salla-verify-modal.js → salla-verify/salla-verify.js} +33 -26
  46. package/dist/collection/plugins/tailwind-theme/generator.js +6 -2
  47. package/dist/collection/plugins/tailwind-theme/index.js +3 -3
  48. package/dist/components/index.d.ts +17 -5
  49. package/dist/components/index.js +17 -0
  50. package/dist/components/salla-add-product-button.js +14 -12
  51. package/dist/components/salla-branches.js +9 -5
  52. package/dist/components/salla-button2.js +3 -10
  53. package/dist/components/salla-conditional-fields.js +3 -4
  54. package/dist/components/salla-localization-modal.js +5 -4
  55. package/dist/components/salla-login-modal.js +6 -6
  56. package/dist/components/salla-modal2.js +7 -7
  57. package/dist/components/salla-offer-modal.js +3 -2
  58. package/dist/components/salla-product-availability2.js +17 -12
  59. package/dist/components/salla-quantity-input.js +2 -2
  60. package/dist/components/salla-rating-modal.js +4 -4
  61. package/dist/components/salla-rating-stars2.js +26 -35
  62. package/dist/components/salla-search.js +33 -15
  63. package/dist/components/salla-tel-input2.js +3 -3
  64. package/dist/components/{salla-sizes-table.d.ts → salla-verify.d.ts} +4 -4
  65. package/dist/components/salla-verify.js +9 -0
  66. package/dist/components/{salla-verify-modal2.js → salla-verify2.js} +24 -18
  67. package/dist/esm/{index-4ffd4317.js → index-20b84fd0.js} +26 -98
  68. package/dist/esm/loader.js +3 -3
  69. package/dist/esm/polyfills/css-shim.js +1 -1
  70. package/dist/esm/salla-add-product-button_6.entry.js +73 -56
  71. package/dist/esm/salla-branches.entry.js +10 -6
  72. package/dist/esm/salla-conditional-fields.entry.js +4 -5
  73. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  74. package/dist/esm/salla-installment.entry.js +1 -1
  75. package/dist/esm/salla-localization-modal.entry.js +6 -5
  76. package/dist/esm/salla-login-modal.entry.js +4 -4
  77. package/dist/esm/salla-offer-modal.entry.js +4 -3
  78. package/dist/esm/salla-quantity-input.entry.js +3 -3
  79. package/dist/esm/salla-rating-modal.entry.js +5 -5
  80. package/dist/esm/salla-rating-stars.entry.js +27 -36
  81. package/dist/esm/{salla-verify-modal.entry.js → salla-verify.entry.js} +20 -14
  82. package/dist/esm/twilight-components.js +3 -3
  83. package/dist/twilight-components/{p-8c69a096.entry.js → p-15fac4f2.entry.js} +1 -1
  84. package/dist/twilight-components/p-27d01075.entry.js +4 -0
  85. package/dist/twilight-components/p-30e63760.entry.js +4 -0
  86. package/dist/twilight-components/{p-edbb12b2.entry.js → p-5ee94c9e.entry.js} +1 -1
  87. package/dist/twilight-components/p-799da239.entry.js +4 -0
  88. package/dist/twilight-components/p-9ff78dd1.entry.js +4 -0
  89. package/dist/twilight-components/p-c1952856.entry.js +4 -0
  90. package/dist/twilight-components/p-c2bef5f2.js +5 -0
  91. package/dist/twilight-components/p-cf143464.entry.js +4 -0
  92. package/dist/twilight-components/p-d3778858.entry.js +4 -0
  93. package/dist/twilight-components/p-ebd2e045.entry.js +4 -0
  94. package/dist/twilight-components/p-ec0a2892.entry.js +4 -0
  95. package/dist/twilight-components/{p-56065da6.entry.js → p-fab65162.entry.js} +1 -1
  96. package/dist/twilight-components/twilight-components.esm.js +1 -1
  97. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +1 -2
  98. package/dist/types/components/salla-button/salla-button.d.ts +0 -5
  99. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +1 -0
  100. package/dist/types/components/salla-search/salla-search.d.ts +6 -1
  101. package/dist/types/components/{salla-verify-modal/salla-verify-modal.d.ts → salla-verify/salla-verify.d.ts} +3 -2
  102. package/dist/types/components.d.ts +33 -50
  103. package/example/dist/translations.js +1 -1
  104. package/example/index.html +184 -162
  105. package/example/tailwind.config.js +4 -7
  106. package/package.json +9 -13
  107. package/dist/cjs/salla-sizes-table.cjs.entry.js +0 -22
  108. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.css +0 -3
  109. package/dist/collection/components/salla-sizes-table/salla-sizes-table.css +0 -6
  110. package/dist/collection/components/salla-sizes-table/salla-sizes-table.js +0 -18
  111. package/dist/components/salla-sizes-table.js +0 -37
  112. package/dist/components/salla-verify-modal.d.ts +0 -11
  113. package/dist/components/salla-verify-modal.js +0 -9
  114. package/dist/esm/salla-sizes-table.entry.js +0 -18
  115. package/dist/twilight-components/p-1d0e664c.js +0 -4
  116. package/dist/twilight-components/p-210f5278.entry.js +0 -4
  117. package/dist/twilight-components/p-2384537d.entry.js +0 -4
  118. package/dist/twilight-components/p-2b1c3490.entry.js +0 -4
  119. package/dist/twilight-components/p-7fae6b84.entry.js +0 -4
  120. package/dist/twilight-components/p-9e05640e.entry.js +0 -4
  121. package/dist/twilight-components/p-af450175.entry.js +0 -4
  122. package/dist/twilight-components/p-d762e16f.entry.js +0 -4
  123. package/dist/twilight-components/p-d77dd260.entry.js +0 -4
  124. package/dist/twilight-components/p-e435a209.entry.js +0 -4
  125. package/dist/twilight-components/p-ecaee6a4.entry.js +0 -4
  126. package/dist/types/components/salla-sizes-table/salla-sizes-table.d.ts +0 -3
  127. package/example/.DS_Store +0 -0
  128. package/example/.gitignore +0 -2
  129. package/example/dist/.DS_Store +0 -0
@@ -4,7 +4,7 @@
4
4
  import { Component, h, Prop, Method, State, Element } from "@stencil/core";
5
5
  export class SallaBranches {
6
6
  constructor() {
7
- this.open = false;
7
+ this.open = true;
8
8
  this.isOpenedBefore = salla.storage.get("branch-choosed-before");
9
9
  this.displayAs = 'default'; //todo:: change it to boolean, isPopup default false
10
10
  this.browseProductsFrom = 'all'; //todo:: get better name
@@ -38,10 +38,12 @@ export class SallaBranches {
38
38
  }
39
39
  //todo:: add description for all @methods
40
40
  async show() {
41
- return this.modal.open();
41
+ var _a;
42
+ return (_a = this.modal) === null || _a === void 0 ? void 0 : _a.open();
42
43
  }
43
44
  async hide() {
44
- return this.modal.close();
45
+ var _a;
46
+ return (_a = this.modal) === null || _a === void 0 ? void 0 : _a.close();
45
47
  }
46
48
  handelChange(event) {
47
49
  this.selected = event.target.value;
@@ -57,7 +59,9 @@ export class SallaBranches {
57
59
  }, 300);
58
60
  }
59
61
  render() {
60
- return (h("salla-modal", { icon: "sicon-store-alt", "modal-title": "\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636", "sub-title": "\u0623\u0646\u062A \u0627\u0644\u0622\u0646 \u062A\u062A\u0635\u0641\u062D \u0627\u0644\u0645\u062A\u062C\u0631 \u0645\u0646", "sub-title-first": true, "is-closable": !this.isOpenedBefore && this.displayAs == 'popup' ? 'false' : 'true', ref: modal => this.modal = modal, width: "sm", id: "s-branches-modal", class: "s-hidden" },
62
+ return (h("salla-modal", { icon: "sicon-store-alt", "modal-title": "\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636", "sub-title": "\u0623\u0646\u062A \u0627\u0644\u0622\u0646 \u062A\u062A\u0635\u0641\u062D \u0627\u0644\u0645\u062A\u062C\u0631 \u0645\u0646", "sub-title-first": true,
63
+ // is-closable={!this.isOpenedBefore && this.displayAs == 'popup' ? 'false' : 'true'}
64
+ ref: (modal) => this.modal = modal, width: "sm", id: "s-branches-modal", class: "s-hidden" },
61
65
  h("h4", { class: "s-branches-title" }, this.formTitle()),
62
66
  this.branches.length <= 5 ?
63
67
  h("div", { class: "s-branches-space-v" }, this.branches.map((branch) => h("div", { class: "s-branches-input-wrap" },
@@ -82,7 +86,7 @@ export class SallaBranches {
82
86
  branch.open ? '' : '- مُغلق')))),
83
87
  this.isChoiceable() ?
84
88
  h("slot", { name: "footer" },
85
- h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.handleSubmit(), class: "s-branches-submit", wide: true }, salla.lang.get('common.elements.ok')))
89
+ h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.handleSubmit(), class: "s-branches-submit", width: "wide" }, salla.lang.get('common.elements.ok')))
86
90
  : ''));
87
91
  }
88
92
  componentDidRender() {
@@ -165,7 +169,7 @@ export class SallaBranches {
165
169
  "tags": [],
166
170
  "text": ""
167
171
  },
168
- "defaultValue": "[\n {id: 1, name: '\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 2, name: '\u0641\u0631\u0639 \u062C\u062F\u0629', open: false, available: false, limited: false, tag: '\u063A\u064A\u0631 \u0645\u062A\u0648\u0641\u0631'},\n {id: 3, name: '\u0641\u0631\u0639 \u0645\u0643\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 4, name: '\u0641\u0631\u0639 \u0627\u0644\u0645\u062F\u064A\u0646\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631'},\n {id: 5, name: '\u0641\u0631\u0639 \u062C\u0627\u0632\u0627\u0646', open: true, available: true, limited: true, tag: '\u0627\u0644\u0643\u0645\u064A\u0629 \u0645\u062D\u062F\u0648\u062F\u0629'}\n ]"
172
+ "defaultValue": "[\n { id: 1, name: '\u0641\u0631\u0639 \u0627\u0644\u0631\u064A\u0627\u0636', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 2, name: '\u0641\u0631\u0639 \u062C\u062F\u0629', open: false, available: false, limited: false, tag: '\u063A\u064A\u0631 \u0645\u062A\u0648\u0641\u0631' },\n { id: 3, name: '\u0641\u0631\u0639 \u0645\u0643\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 4, name: '\u0641\u0631\u0639 \u0627\u0644\u0645\u062F\u064A\u0646\u0629', open: true, available: true, limited: false, tag: '\u0645\u062A\u0648\u0641\u0631' },\n { id: 5, name: '\u0641\u0631\u0639 \u062C\u0627\u0632\u0627\u0646', open: true, available: true, limited: true, tag: '\u0627\u0644\u0643\u0645\u064A\u0629 \u0645\u062D\u062F\u0648\u062F\u0629' }\n ]"
169
173
  },
170
174
  "current": {
171
175
  "type": "number",
@@ -1,91 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Button Component: has many sizes, styles and loading state.
6
3
  * You can use these classes to target the elements in the component.
7
- */
8
- salla-button {
9
- pointer-events: none;
10
- }
11
- salla-button[type=submit], salla-button[type=button], salla-button[type=reset] {
12
- -webkit-appearance: none;
13
- }
14
- salla-button[width=wide] {
15
- width: 100%;
16
- }
17
-
18
- .s-button-wrap[loading] {
19
- pointer-events: none;
20
- }
21
- .s-button-wrap[loading] .s-button-element {
22
- pointer-events: none !important;
23
- }
24
- .s-button-wrap[loading] .s-button-loader-center .s-button-text {
25
- opacity: 0;
26
- }
27
- .s-button-wrap .s-button-element[loading] {
28
- pointer-events: none !important;
29
- }
30
- .s-button-wrap .s-button-element:not(:disabled) {
31
- pointer-events: auto;
32
- }
33
- .s-button-wrap .s-button-solid .s-button-loader:before {
34
- border-color: #fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2);
35
- }
36
- .s-button-wrap .s-button-outline {
37
- border: 1px solid currentColor;
38
- }
39
- .s-button-wrap .s-button-outline:hover {
40
- border-color: transparent;
41
- }
42
- .s-button-wrap .s-button-outline .s-button-loader:before {
43
- border-top-color: currentColor;
44
- border-left-color: currentColor;
45
- }
46
- .s-button-wrap .s-button-icon.s-button-large {
47
- width: 56px;
48
- height: 56px;
49
- }
50
- .s-button-wrap .s-button-icon.s-button-small {
51
- width: 24px;
52
- height: 24px;
53
- }
54
- .s-button-wrap .s-button-icon.s-button-small .s-button-loader:before {
55
- width: 0.85rem;
56
- height: 0.85rem;
57
- }
58
- .s-button-wrap .s-button-loader-after .s-button-load {
59
- flex-direction: row;
60
- }
61
- .s-button-wrap .s-button-loader-start.s-button-element {
62
- padding-left: 32px;
63
- padding-right: 32px;
64
- }
65
- .s-button-wrap .s-button-loader-start .s-button-loader {
66
- position: absolute;
67
- right: 8px;
68
- }
69
- .s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr] {
70
- left: 8px;
71
- right: auto;
72
- }
73
- .s-button-wrap .s-button-loader-end.s-button-element {
74
- padding-left: 32px;
75
- padding-right: 32px;
76
- }
77
- .s-button-wrap .s-button-loader-end .s-button-loader {
78
- position: absolute;
79
- left: 8px;
80
- }
81
- .s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr] {
82
- right: 8px;
83
- left: auto;
84
- }
85
- .s-button-wrap .s-button-loader-center .s-button-loader {
86
- position: absolute;
87
- top: 50%;
88
- left: 50%;
89
- transform: translateY(-50%) translateX(-50%);
90
- margin: 0 !important;
91
- }
4
+ */
@@ -37,13 +37,6 @@ export class SallaButton {
37
37
  * If there is need to change loader position, pass the position
38
38
  */
39
39
  this.loaderPosition = 'after';
40
- /**
41
- * Is the button wide
42
- */
43
- this.wide = false;
44
- if (this.wide) {
45
- this.host.classList.add('s-button-wide');
46
- }
47
40
  }
48
41
  /**
49
42
  * Run loading animation
@@ -59,6 +52,7 @@ export class SallaButton {
59
52
  */
60
53
  async stop() {
61
54
  this.host.removeAttribute('loading');
55
+ this.host.querySelector('button').removeAttribute('loading');
62
56
  if (this.loaderPosition == 'center')
63
57
  this.text.classList.remove('s-button-hide');
64
58
  return this.host;
@@ -87,7 +81,7 @@ export class SallaButton {
87
81
  }
88
82
  getBtnAttributes() {
89
83
  for (let i = 0; i < this.host.attributes.length; i++) {
90
- if (!['color', 'fill', 'size', 'width', 'id', 'loading'].includes(this.host.attributes[i].name)) {
84
+ if (!['color', 'fill', 'size', 'width', 'id'].includes(this.host.attributes[i].name)) {
91
85
  this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
92
86
  }
93
87
  }
@@ -265,24 +259,6 @@ export class SallaButton {
265
259
  "reflect": false,
266
260
  "defaultValue": "'after'"
267
261
  },
268
- "wide": {
269
- "type": "boolean",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "boolean",
273
- "resolved": "boolean",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": false,
278
- "docs": {
279
- "tags": [],
280
- "text": "Is the button wide"
281
- },
282
- "attribute": "wide",
283
- "reflect": false,
284
- "defaultValue": "false"
285
- },
286
262
  "href": {
287
263
  "type": "string",
288
264
  "mutable": false,
@@ -9,6 +9,7 @@ import { Component, Element, Host, Listen, h } from '@stencil/core';
9
9
  export class SallaConditionalFields {
10
10
  changeHandler(event) {
11
11
  var _a;
12
+ console.log("🚀 ~ file: salla-conditional-fields.tsx ~ line 17 ~ SallaConditionalFields ~ changeHandler ~ changeHandler", event);
12
13
  salla.log('Received the change event: ', event);
13
14
  if (!event.target || !['SELECT'].includes(event.target.tagName) && !['checkbox'].includes(event.target.getAttribute('type'))) {
14
15
  salla.log('Ignore the change because is not support input: ' + (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.tagName) || 'N/A'));
@@ -17,7 +18,7 @@ export class SallaConditionalFields {
17
18
  // to extract the option id from the input name, the supported names are name[*] and name[*][]
18
19
  let optionId = event.target.name.replace('[]', '');
19
20
  let isMultiple = event.target.getAttribute('type') === 'checkbox';
20
- salla.log('Trying to find all the element with condation:', `[data-show-when^="${optionId}"]`);
21
+ salla.log('Trying to find all the element with condition:', `[data-show-when^="${optionId}"]`);
21
22
  this.host.querySelectorAll(`[data-show-when^="${optionId}"]`)
22
23
  .forEach((field) => {
23
24
  let isEqual = !(field === null || field === void 0 ? void 0 : field.dataset.showWhen.includes('!='));
@@ -66,6 +67,7 @@ export class SallaConditionalFields {
66
67
  var _a;
67
68
  // @ts-ignore
68
69
  let optionName = (_a = field === null || field === void 0 ? void 0 : field.dataset) === null || _a === void 0 ? void 0 : _a.showWhen.replace(/(.*)(=|!=)(.*)/gm, '$1').trim();
70
+ console.log("🚀 ~ file: salla-conditional-fields.tsx ~ line 83 ~ SallaConditionalFields ~ this.host.querySelectorAll ~ optionName", optionName);
69
71
  if (!optionName) {
70
72
  return;
71
73
  }
@@ -79,12 +81,6 @@ export class SallaConditionalFields {
79
81
  h("slot", null)));
80
82
  }
81
83
  static get is() { return "salla-conditional-fields"; }
82
- static get originalStyleUrls() { return {
83
- "$": ["salla-conditional-fields.css"]
84
- }; }
85
- static get styleUrls() { return {
86
- "$": ["salla-conditional-fields.css"]
87
- }; }
88
84
  static get elementRef() { return "host"; }
89
85
  static get listeners() { return [{
90
86
  "name": "change",
@@ -1,7 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Infinite Scroll Component: used in latest-products page, comments, brands, orders and so on..
6
3
  * You can use these classes to target the elements in the component.
7
4
  */
@@ -1,8 +1,9 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
2
+ The whole installment methods is a third-party widgets,
3
+ So there aren't a custom classes (as other components) to style them.
3
4
  */
4
5
  /*
5
- * Tabby ------------------------
6
+ * Installment::Tabby
6
7
  */
7
8
  #tabbyPromoWrapper {
8
9
  background: white;
@@ -52,7 +53,7 @@
52
53
  }
53
54
 
54
55
  /*
55
- * Tamara ---------------------
56
+ * Installment::Tamara & Spotii
56
57
  */
57
58
  .tamara-product-widget {
58
59
  margin-bottom: 20px;
@@ -1,21 +1,7 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Localization Component: Languages & Currencies popup modal
6
3
  * You can use these classes to target the elements in the component.
7
4
  */
8
- #salla-localization .s-localization-modal-label-slot {
9
- flex-grow: 1;
10
- }
11
- #salla-localization .s-localization-modal-select {
12
- appearance: none;
13
- -webkit-appearance: none;
14
- }
15
-
16
- /*
17
- * global flags style, imported from int-tel-input
18
- */
19
5
  .iti__flag {
20
6
  width: 20px;
21
7
  }
@@ -1078,7 +1064,7 @@
1078
1064
  .iti__flag {
1079
1065
  height: 15px;
1080
1066
  box-shadow: 0px 0px 1px 0px #888;
1081
- background-image: url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags.png");
1067
+ background-image: url("https://cdn.salla.network/images/flags.png");
1082
1068
  background-repeat: no-repeat;
1083
1069
  background-color: #f5f7f9;
1084
1070
  background-position: 20px 0;
@@ -1086,7 +1072,7 @@
1086
1072
 
1087
1073
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1088
1074
  .iti__flag {
1089
- background-image: url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags@2x.png");
1075
+ background-image: url("https://cdn.salla.network/images/flags@2x.png");
1090
1076
  }
1091
1077
  }
1092
1078
  .iti__flag.iti__np {
@@ -41,7 +41,8 @@ export class SallaLocalizationModal {
41
41
  * open the component
42
42
  */
43
43
  async open() {
44
- return this.modal.open()
44
+ console.log("🚀 ~ file: salla-localization-modal.tsx ~ line 59 ~ SallaLocalizationModal ~ open ~ this.modal", this.modal);
45
+ return await this.modal.open()
45
46
  .then(() => this.getLanguages())
46
47
  .then(() => this.getCurrencies())
47
48
  .then(() => this.isLoading = false);
@@ -98,7 +99,7 @@ export class SallaLocalizationModal {
98
99
  .replace(/\{name\}/g, lang.name)
99
100
  .replace(/\{code\}/g, lang.code)
100
101
  .replace(/\{country_code\}/g, lang.country_code) }))) :
101
- h("select", { class: "s-localization-modal-select", name: "currency", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language == lang.code }, lang.name)))))
102
+ h("select", { class: "s-localization-modal-select", name: "language", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language == lang.code }, lang.name)))))
102
103
  : '',
103
104
  this.currencies.length > 1 ?
104
105
  h("div", { class: "s-localization-modal-section" },
@@ -112,7 +113,7 @@ export class SallaLocalizationModal {
112
113
  .replace(/\{country_code\}/g, currency.country_code) }))) :
113
114
  h("select", { class: "s-localization-modal-select", name: "currency", onChange: e => this.onChangeCurrency(e) }, this.currencies.map(currency => h("option", { value: currency.code, selected: this.currency == currency.code }, currency.name)))))
114
115
  : '',
115
- h("salla-button", { wide: true, ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.ok')))
116
+ h("salla-button", { width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.ok')))
116
117
  : ''));
117
118
  }
118
119
  /**
@@ -1,11 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Login Component: login popup modal
6
3
  * You can use these classes to target the elements in the component.
7
- */
8
- [dir=ltr] #salla-login .s-login-modal-main-btn .arrow {
9
- display: inline-block;
10
- transform: scale(-1);
11
- }
4
+ */
@@ -147,7 +147,7 @@ export class SallaLoginModal {
147
147
  setTimeout(() => tabs.map(el => Helper.toggleElementClassIf(el, 's-login-modal-active', 's-login-modal-unactive', () => el == tab)), 200);
148
148
  //we should have only one salla-login, so it's okay to get it from document
149
149
  //todo:: use better way for resize the modal
150
- setTimeout(() => { var _a; return (_a = document.querySelector('.s-login-modal-wrapper')) === null || _a === void 0 ? void 0 : _a.setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'); });
150
+ setTimeout(() => { var _a; return (_a = this.modal.querySelector('.s-login-modal-wrapper')) === null || _a === void 0 ? void 0 : _a.setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'); });
151
151
  if ([this.mobileTab, this.emailTab].includes(tab)) {
152
152
  this.regType = tab === this.mobileTab ? 'phone' : 'email';
153
153
  }
@@ -219,8 +219,8 @@ export class SallaLoginModal {
219
219
  h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText)
220
220
  : '',
221
221
  h("slot", { name: "after-login-email" })) : '',
222
- h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false },
223
- h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })),
222
+ h("salla-verify", { display: "inline", ref: tab => this.verifyTab = tab, autoReload: false },
223
+ h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back sicon-arrow-right", slot: "after-footer", href: "#" })),
224
224
  h("div", { ref: tab => this.registrationTab = tab },
225
225
  h("slot", { name: "before-registration" }),
226
226
  h("div", null,
@@ -1,7 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Modal Component: popup modal used in most parts of the theme
6
3
  * You can use these classes to target the elements in the component.
7
4
  */
@@ -8,7 +8,7 @@ import Helper from "../../Helpers/Helper";
8
8
  */
9
9
  export class SallaModal {
10
10
  constructor() {
11
- this.isClosable = true; //todo::rename unclude
11
+ this.isClosable = true; //todo::rename unclude. Suggestion => persistent
12
12
  /**
13
13
  * The size of the modal
14
14
  */
@@ -124,7 +124,7 @@ export class SallaModal {
124
124
  //todo:: pref for each modal
125
125
  render() {
126
126
  this.host.id = this.host.id || 'salla-modal';
127
- return (h(Host, { class: 'salla-modal s-modal-container s-hidden', "aria-modal": "true", role: "dialog" },
127
+ return (h(Host, { class: 'salla-modal s-modal s-modal-container s-hidden', "aria-modal": "true", role: "dialog" },
128
128
  h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }),
129
129
  h("div", { class: "s-modal-wrapper" },
130
130
  h("span", { class: 's-modal-spacer s-modal-align-' + this.position }, "\u200B"),
@@ -138,16 +138,17 @@ export class SallaModal {
138
138
  h("button", { class: "s-modal-close", onClick: () => this.closeModal(), type: "button" },
139
139
  h("span", { class: "sicon-cancel" }))
140
140
  : '',
141
- this.modalTitle || this.subTitle ?
142
- h("div", { class: "s-modal-header-inner" },
143
- this.iconStyle || this.icon
144
- ? h("div", { class: this.iconBlockClasses() },
145
- h("i", { class: this.iconClasses() }))
146
- : this.imageIcon ? h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '',
147
- h("div", { class: "s-modal-header-content" },
148
- h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }),
149
- h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
150
- : ''),
141
+ h("div", { class: "s-modal-header-inner" },
142
+ this.iconStyle || this.icon
143
+ ? h("div", { class: this.iconBlockClasses() },
144
+ h("i", { class: this.iconClasses() }))
145
+ : this.imageIcon ? h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '',
146
+ h("div", { class: "s-modal-header-content" },
147
+ h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }),
148
+ h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
149
+ // : ''
150
+ ,
151
+ "// : ''"),
151
152
  h("slot", null),
152
153
  h("slot", { name: "footer" })
153
154
  ]))));
@@ -1,28 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Offer Modal Component: popup modal to display the offers
6
3
  * You can use these classes to target the elements in the component.
7
- */
8
- #salla-offer-modal .s-offer-modal-body {
9
- -webkit-overflow-scrolling: touch;
10
- }
11
- #salla-offer-modal .s-offer-modal-body::-webkit-scrollbar {
12
- display: none;
13
- }
14
- #salla-offer-modal .s-offer-modal-next-btn {
15
- background: linear-gradient(-90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%);
16
- }
17
- #salla-offer-modal .s-offer-modal-prev-btn {
18
- background: linear-gradient(90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%);
19
- }
20
- .rtl #salla-offer-modal .s-offer-modal-next-btn {
21
- transform: scale(-1) translateX(100%);
22
- }
23
- .rtl #salla-offer-modal .s-offer-modal-prev-btn {
24
- transform: scale(-1) translateX(-100%);
25
- }
26
- .rtl #salla-offer-modal .s-offer-modal-btn-is-active {
27
- transform: scale(-1) translateX(0);
28
- }
4
+ */
@@ -54,6 +54,7 @@ export class SallaOfferModal {
54
54
  return this.modal.open();
55
55
  }
56
56
  rememberMe(event) {
57
+ console.log("🚀 ~ file: salla-offer-modal.tsx ~ line 75 ~ SallaOfferModal ~ rememberMe ~ rememberMe", event);
57
58
  salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
58
59
  }
59
60
  //todo:: pass event then use sallaButton from it
@@ -108,7 +109,7 @@ export class SallaOfferModal {
108
109
  componentDidRender() {
109
110
  // Sooo mini Slider
110
111
  if (this.offer && window.screen.width > 639) {
111
- let sliderWrap = document.querySelector('.s-offer-modal-scrolled-slider-wrap'), slider = document.querySelector('.s-offer-modal-scrolled-slider'), navButtons = document.querySelectorAll('.s-offer-modal-nav-btn'), nexBtn = document.querySelector('.s-offer-modal-next-btn'), prevBtn = document.querySelector('.s-offer-modal-prev-btn'), items = document.querySelectorAll('.s-offer-modal-slider-item'), sliderNavMargin = 20, // space before displaying the next/prev btns.
112
+ let sliderWrap = this.modal.querySelector('.s-offer-modal-scrolled-slider-wrap'), slider = this.modal.querySelector('.s-offer-modal-scrolled-slider'), navButtons = this.modal.querySelectorAll('.s-offer-modal-nav-btn'), nexBtn = this.modal.querySelector('.s-offer-modal-next-btn'), prevBtn = this.modal.querySelector('.s-offer-modal-prev-btn'), items = this.modal.querySelectorAll('.s-offer-modal-slider-item'), sliderNavMargin = 20, // space before displaying the next/prev btns.
112
113
  current = 0, // current slide
113
114
  slidesToScroll = 3, itemsLength = items.length;
114
115
  console.log('items[0]:', items[0]);
@@ -1,7 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Product Availability Component: popup modal to notify user if the product is available,
6
3
  * used in the product single page if the product isn't available.
7
4
  * You can use these classes to target the elements in the component.
@@ -17,6 +17,7 @@ export class SallaProductAvailability {
17
17
  this.isSubscribed = false;
18
18
  // @Method()
19
19
  this.submit = async () => {
20
+ console.log("🚀 ~ file: salla-product-availability.tsx ~ line 74 ~ SallaProductAvailability ~ submit= ~ submit");
20
21
  if (this.isUser) {
21
22
  return salla.api.product.availabilitySubscribe(this.productId)
22
23
  .then(() => this.isSubscribed = true);
@@ -72,21 +73,25 @@ export class SallaProductAvailability {
72
73
  this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
73
74
  }
74
75
  channelsWatcher(newValue) {
75
- this.channels_ = newValue.split(',');
76
+ this.channels_ = !!newValue ? newValue.split(',') : [];
76
77
  }
77
78
  async validateform() {
78
- if (this.channels_.includes('email')) {
79
- const isEmailValid = Helper.isValidEmail(this.email.value);
80
- if (isEmailValid)
81
- return;
82
- !isEmailValid && this.validateField(this.email, this.emailErrorMsg);
79
+ try {
80
+ if (this.channels_.includes('email')) {
81
+ const isEmailValid = Helper.isValidEmail(this.email.value);
82
+ if (isEmailValid)
83
+ return;
84
+ !isEmailValid && this.validateField(this.email, this.emailErrorMsg);
85
+ }
86
+ if (this.channels_.includes('sms')) {
87
+ const isPhoneValid = await this.mobileInput.isValid();
88
+ if (isPhoneValid)
89
+ return;
90
+ }
83
91
  }
84
- if (this.channels_.includes('sms')) {
85
- const isPhoneValid = await this.mobileInput.isValid();
86
- if (isPhoneValid)
87
- return;
92
+ catch (error) {
93
+ throw ('Please insert required fields');
88
94
  }
89
- throw ('Please insert required fields');
90
95
  }
91
96
  validateField(field, errorMsg) {
92
97
  field.classList.add('s-has-error');
@@ -116,8 +121,8 @@ export class SallaProductAvailability {
116
121
  h("salla-tel-input", { ref: el => this.mobileInput = el, onKeyDown: e => this.typing(e, this.submit) })
117
122
  ] : ''),
118
123
  h("div", { slot: "footer", class: "s-product-availability-footer" },
119
- h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.close(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')),
120
- h("salla-button", { "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
124
+ h("salla-button", { class: "modal-cancel-btn", width: "wide", color: "light", fill: "outline", onClick: () => this.modal.close(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')),
125
+ h("salla-button", { class: "submit-btn", "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
121
126
  }
122
127
  static get is() { return "salla-product-availability"; }
123
128
  static get originalStyleUrls() { return {
@@ -1,3 +1,4 @@
1
- :host {
2
- display: block;
3
- }
1
+ /*
2
+ * Salla Qunatity Input Component: quantity input with increase & decrease buttons.
3
+ * You can use these classes to target the elements in the component.
4
+ */
@@ -68,17 +68,17 @@ export class SallaQuantityInput {
68
68
  }
69
69
  render() {
70
70
  return (h(Host, { class: "s-quantity-input s-quantity-input-container" },
71
- h("button", { onClick: () => this.increase(), class: "s-quantity-input-button", type: "button" },
71
+ h("button", { onClick: () => this.increase(), class: "s-quantity-input-increase-button", type: "button" },
72
72
  !this.hasIncrementSlot ? h("i", { class: "sicon-add" }) : '',
73
73
  h("slot", { name: "increment-button" })),
74
74
  h("input", Object.assign({ class: "s-quantity-input-input" }, this.getInputAttributes(), { ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", value: this.quantity })),
75
- h("button", { class: "s-quantity-input-button", onClick: () => this.decrease(), type: "button" },
75
+ h("button", { class: "s-quantity-input-decrease-button", onClick: () => this.decrease(), type: "button" },
76
76
  !this.hasDecrementSlot ? h("i", { class: "sicon-minus" }) : '',
77
77
  h("slot", { name: "decrement-button" }))));
78
78
  }
79
79
  static get is() { return "salla-quantity-input"; }
80
80
  static get originalStyleUrls() { return {
81
- "$": ["salla-quantity-input.css"]
81
+ "$": ["salla-quantity-input.scss"]
82
82
  }; }
83
83
  static get styleUrls() { return {
84
84
  "$": ["salla-quantity-input.css"]
@@ -1,23 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- /*
5
2
  * Salla Rating Component: Order rating modal, used in the order single page
6
3
  * You can use these classes to target the elements in the component.
7
- */
8
- #s-rating .s-rating-modal-product-img {
9
- font-size: 0;
10
- position: relative;
11
- }
12
- #s-rating .s-rating-modal-product-img:before {
13
- content: "";
14
- position: absolute;
15
- width: 100%;
16
- height: 100%;
17
- left: 0;
18
- top: 0;
19
- background: #eee;
20
- }
21
- #s-rating .unicode {
22
- unicode-bidi: plaintext;
23
- }
4
+ */
@@ -54,8 +54,8 @@ export class SallaRatingModal {
54
54
  }
55
55
  // handle wizard
56
56
  handleWizard() {
57
- this.steps = document.querySelectorAll(".s-rating-modal-step");
58
- this.dots = document.querySelectorAll(".s-rating-modal-step-dot");
57
+ this.steps = this.modal.querySelectorAll(".s-rating-modal-step");
58
+ this.dots = this.modal.querySelectorAll(".s-rating-modal-step-dot");
59
59
  this.showActiveStep();
60
60
  }
61
61
  showActiveStep(current = null) {
@@ -143,7 +143,7 @@ export class SallaRatingModal {
143
143
  this.thanksTime.remove();
144
144
  this.close().then(() => window.location.reload());
145
145
  }, 1000);
146
- document.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
146
+ this.modal.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
147
147
  this.showActiveStep(this.thanksTab);
148
148
  }
149
149
  render() {
@@ -1,6 +1,4 @@
1
1
  /*
2
- * Global flags style [imported from Int-tel-input]
3
- */
4
- :host {
5
- display: block;
6
- }
2
+ * Salla Rating Stars Component: Rating starts as rating input or to display rating values.
3
+ * You can use these classes to target the elements in the component.
4
+ */