@salla.sa/twilight-components 2.14.280 → 2.14.281

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 (140) hide show
  1. package/dist/cjs/{filepond-DsqUOkNG.js → filepond-CiZAawE8.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-7eXNQEWn.js → filepond-plugin-file-poster-dAAL74pv.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CRHT2AgS.js → filepond-plugin-file-validate-size-DX7dh9iS.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DnDqZ0hN.js → filepond-plugin-file-validate-type-D31jBk9C.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-H6VFdRrR.js → filepond-plugin-image-edit-Df-PKTgD.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BszJj7C6.js → filepond-plugin-image-exif-orientation-u0qcpPgn.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-dVSvYXjP.js → filepond-plugin-image-preview-B9cWK6w_.js} +1 -1
  8. package/dist/cjs/{index-DOBDJG73.js → index-9ilPrwvx.js} +6 -2
  9. package/dist/cjs/{index-BO3dRmRE.js → index-DFLwy1RU.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +9 -9
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-totals-card.cjs.entry.js +64 -0
  32. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  43. package/dist/cjs/twilight.cjs.js +2 -2
  44. package/dist/collection/collection-manifest.json +1 -0
  45. package/dist/collection/components/salla-order-totals-card/interfaces.js +1 -0
  46. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.css +3 -0
  47. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +101 -0
  48. package/dist/components/index.js +2 -2
  49. package/dist/components/salla-order-totals-card.d.ts +11 -0
  50. package/dist/components/salla-order-totals-card.js +85 -0
  51. package/dist/esm/{filepond-CHhEQZvc.js → filepond-dFr7ZRIh.js} +1 -1
  52. package/dist/esm/{filepond-plugin-file-poster-DSVBWkBJ.js → filepond-plugin-file-poster-C2Eh6onX.js} +1 -1
  53. package/dist/esm/{filepond-plugin-file-validate-size-Dqp8uxWB.js → filepond-plugin-file-validate-size-BFFKQeVo.js} +1 -1
  54. package/dist/esm/{filepond-plugin-file-validate-type-RevWYrSI.js → filepond-plugin-file-validate-type-BMcEx2wx.js} +1 -1
  55. package/dist/esm/{filepond-plugin-image-edit-vBD-HioG.js → filepond-plugin-image-edit-DBTi520I.js} +1 -1
  56. package/dist/esm/{filepond-plugin-image-exif-orientation-Bq-ObUI7.js → filepond-plugin-image-exif-orientation-BFi09BBP.js} +1 -1
  57. package/dist/esm/{filepond-plugin-image-preview-53CJeVvz.js → filepond-plugin-image-preview-CKBNBlwg.js} +1 -1
  58. package/dist/esm/{index-BDdB7Hhe.js → index-BI9_XUHd.js} +1 -1
  59. package/dist/esm/{index-Jl-UB-7q.js → index-DhLMCubZ.js} +6 -2
  60. package/dist/esm/loader.js +3 -3
  61. package/dist/esm/salla-accordion_62.entry.js +9 -9
  62. package/dist/esm/salla-advertisement.entry.js +1 -1
  63. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  64. package/dist/esm/salla-apps-icons.entry.js +1 -1
  65. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  66. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  67. package/dist/esm/salla-contacts.entry.js +1 -1
  68. package/dist/esm/salla-filters-widget.entry.js +1 -1
  69. package/dist/esm/salla-filters.entry.js +1 -1
  70. package/dist/esm/salla-installment.entry.js +1 -1
  71. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  72. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  73. package/dist/esm/salla-metadata.entry.js +1 -1
  74. package/dist/esm/salla-notification-item.entry.js +1 -1
  75. package/dist/esm/salla-notifications.entry.js +1 -1
  76. package/dist/esm/salla-offer.entry.js +1 -1
  77. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  78. package/dist/esm/salla-order-details-options.entry.js +1 -1
  79. package/dist/esm/salla-order-details.entry.js +1 -1
  80. package/dist/esm/salla-order-summary.entry.js +1 -1
  81. package/dist/esm/salla-order-totals-card.entry.js +62 -0
  82. package/dist/esm/salla-orders.entry.js +1 -1
  83. package/dist/esm/salla-payments.entry.js +1 -1
  84. package/dist/esm/salla-price-range.entry.js +1 -1
  85. package/dist/esm/salla-review-card.entry.js +1 -1
  86. package/dist/esm/salla-reviews-page.entry.js +1 -1
  87. package/dist/esm/salla-reviews.entry.js +1 -1
  88. package/dist/esm/salla-social.entry.js +1 -1
  89. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  90. package/dist/esm/salla-tooltip.entry.js +1 -1
  91. package/dist/esm/salla-verify.entry.js +1 -1
  92. package/dist/esm/salla-wallet.entry.js +1 -1
  93. package/dist/esm/twilight.js +3 -3
  94. package/dist/twilight/{p-d66c1bba.entry.js → p-13e45e14.entry.js} +1 -1
  95. package/dist/twilight/{p-9b4b9c2e.entry.js → p-19002923.entry.js} +1 -1
  96. package/dist/twilight/{p-f69d6885.entry.js → p-1d29712c.entry.js} +1 -1
  97. package/dist/twilight/{p-4bb7da0f.entry.js → p-2c1e4c1d.entry.js} +1 -1
  98. package/dist/twilight/{p-6a9aa1b0.entry.js → p-3070a321.entry.js} +1 -1
  99. package/dist/twilight/{p-5e050bbd.entry.js → p-3cd21363.entry.js} +2 -2
  100. package/dist/twilight/{p-172c5319.entry.js → p-3e4cdf22.entry.js} +1 -1
  101. package/dist/twilight/{p-36ebf98a.entry.js → p-458ceb0a.entry.js} +1 -1
  102. package/dist/twilight/{p-943cd80c.entry.js → p-4741c28f.entry.js} +1 -1
  103. package/dist/twilight/{p-b202c91c.entry.js → p-4add5e4b.entry.js} +1 -1
  104. package/dist/twilight/{p-e41b2528.entry.js → p-4e85f126.entry.js} +1 -1
  105. package/dist/twilight/{p-126df2a3.entry.js → p-502794c6.entry.js} +1 -1
  106. package/dist/twilight/{p-e2acf98d.entry.js → p-53f8167a.entry.js} +1 -1
  107. package/dist/twilight/{p-976281d9.entry.js → p-5b58d940.entry.js} +1 -1
  108. package/dist/twilight/{p-d13ad0d4.entry.js → p-6a663fe8.entry.js} +1 -1
  109. package/dist/twilight/{p-c39d74c4.entry.js → p-6a71bdfe.entry.js} +1 -1
  110. package/dist/twilight/{p-1c1f8fc4.entry.js → p-6c12da69.entry.js} +1 -1
  111. package/dist/twilight/{p-556cddbf.entry.js → p-71f38e37.entry.js} +1 -1
  112. package/dist/twilight/{p-688fee3d.entry.js → p-81175d28.entry.js} +1 -1
  113. package/dist/twilight/{p-da930cd8.entry.js → p-837db48c.entry.js} +1 -1
  114. package/dist/twilight/{p-6cbb4fa3.entry.js → p-872751a6.entry.js} +1 -1
  115. package/dist/twilight/{p-cb0f0a97.entry.js → p-89e68f52.entry.js} +1 -1
  116. package/dist/twilight/{p-3f0ff72a.entry.js → p-8c37f9c4.entry.js} +1 -1
  117. package/dist/twilight/{p-80f4edfe.entry.js → p-9d281d63.entry.js} +1 -1
  118. package/dist/twilight/{p-Dn5xdjWu.js → p-C59ZfmbG.js} +1 -1
  119. package/dist/twilight/{p-CMQVASlw.js → p-CN32_p_o.js} +1 -1
  120. package/dist/twilight/{p-Bevr-CJ8.js → p-Ch4CMan-.js} +1 -1
  121. package/dist/twilight/{p-CUUd-KOT.js → p-CnLRqhlE.js} +1 -1
  122. package/dist/twilight/{p-A3xpoYLO.js → p-DTSUHJHQ.js} +1 -1
  123. package/dist/twilight/p-DhLMCubZ.js +5 -0
  124. package/dist/twilight/{p-BYMpYccw.js → p-DnAUz24K.js} +1 -1
  125. package/dist/twilight/{p-gV7k-IWu.js → p-Dtc-T-TN.js} +1 -1
  126. package/dist/twilight/{p-Z_ENnsw3.js → p-Pw18qkk5.js} +1 -1
  127. package/dist/twilight/{p-f8344694.entry.js → p-b4541aa6.entry.js} +1 -1
  128. package/dist/twilight/{p-d30f0073.entry.js → p-cf4ed212.entry.js} +1 -1
  129. package/dist/twilight/p-d238cc37.entry.js +4 -0
  130. package/dist/twilight/{p-9f5a28f6.entry.js → p-df514abf.entry.js} +1 -1
  131. package/dist/twilight/{p-e7e698ae.entry.js → p-e12614dd.entry.js} +1 -1
  132. package/dist/twilight/{p-392148e6.entry.js → p-e5ccc45c.entry.js} +1 -1
  133. package/dist/twilight/{p-43959194.entry.js → p-f2796228.entry.js} +1 -1
  134. package/dist/twilight/{p-9a5e0b6d.entry.js → p-f8faaabc.entry.js} +1 -1
  135. package/dist/twilight/twilight.esm.js +1 -1
  136. package/dist/types/components/salla-order-totals-card/interfaces.d.ts +24 -0
  137. package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +15 -0
  138. package/dist/types/components.d.ts +23 -2
  139. package/package.json +5 -5
  140. package/dist/twilight/p-Jl-UB-7q.js +0 -5
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SallaOrderTotalsCard extends Components.SallaOrderTotalsCard, HTMLElement {}
4
+ export const SallaOrderTotalsCard: {
5
+ prototype: SallaOrderTotalsCard;
6
+ new (): SallaOrderTotalsCard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,85 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5
+
6
+ const sallaOrderTotalsCardCss = ":host{display:block}";
7
+
8
+ const SallaOrderTotalsCard$1 = /*@__PURE__*/ proxyCustomElement(class SallaOrderTotalsCard extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ }
13
+ handleOrderChange(newValue) {
14
+ if (newValue) {
15
+ this.setSummaryFromProp(newValue);
16
+ }
17
+ else {
18
+ this.summary = undefined;
19
+ }
20
+ }
21
+ async componentWillLoad() {
22
+ await new Promise(resolve => salla.onReady(resolve));
23
+ if (this.order) {
24
+ this.setSummaryFromProp(this.order);
25
+ }
26
+ }
27
+ setSummaryFromProp(value) {
28
+ try {
29
+ const parsedValue = typeof value === 'string' ? JSON.parse(value) : value;
30
+ this.summary = parsedValue;
31
+ }
32
+ catch (error) {
33
+ salla.logger.error('Failed to parse order summary data', error);
34
+ this.summary = undefined;
35
+ }
36
+ }
37
+ renderTotalRow(label, amount, labelClass, valueClass, isBold) {
38
+ return (h("div", { class: "s-order-totals-card-row" }, h("div", { class: "s-order-totals-card-row-inner" }, h("dt", { class: labelClass || 's-order-totals-card-label' }, label), h("dd", { class: valueClass || 's-order-totals-card-value' }, isBold ? (h("b", { innerHTML: salla.money(amount) })) : (h("span", { innerHTML: salla.money(amount) }))))));
39
+ }
40
+ renderDsicountRow() {
41
+ return (this.summary?.discounts?.map(discount => (h("div", { class: "s-order-totals-card-row", key: discount.name }, h("div", { class: "s-order-totals-card-row-inner" }, h("dt", { class: "s-order-totals-card-discount" }, discount.name), h("dd", { class: "s-order-totals-card-value" }, discount.discount))))));
42
+ }
43
+ render() {
44
+ if (!this.summary) {
45
+ return h(Host, { class: "s-order-totals-card-wrapper" });
46
+ }
47
+ const { summary } = this;
48
+ const hasOptions = Array.isArray(summary.options) ? summary.options.length > 0 : false;
49
+ return (h(Host, { class: "s-order-totals-card-wrapper" }, h("div", { class: "s-order-totals-card-panel" }, h("h2", { id: "summary-heading", class: "s-order-totals-card-heading" }, salla.lang.get('pages.orders.summary')), h("div", { class: "s-order-totals-card-flow" }, h("dl", { class: "s-order-totals-card-list" }, this.renderTotalRow(salla.lang.get('pages.cart.items_total'), summary.sub_total), hasOptions &&
50
+ this.renderTotalRow(salla.lang.get('pages.cart.order_options_total'), summary.options_total), summary.discounts && this.renderDsicountRow(), summary.cod_cost &&
51
+ this.renderTotalRow(salla.lang.get('pages.orders.cod_cost'), summary.cod_cost, ''), summary.shipping_cost &&
52
+ this.renderTotalRow(salla.lang.get('pages.orders.shipping_cost'), summary.shipping_cost, 's-order-totals-card-shipping'), summary.tax &&
53
+ this.renderTotalRow(`${salla.lang.get('pages.cart.tax')} ${summary.tax.percent}%`, summary.tax.amount, ''), summary.paid_amount ?
54
+ this.renderTotalRow(salla.lang.get('pages.orders.partially_paid'), summary.paid_amount, '') : null, summary.remaining_amount ?
55
+ this.renderTotalRow(salla.lang.get('pages.orders.remaining_amount'), summary.remaining_amount, '') : null, h("div", { class: "s-order-totals-card-total" }, this.renderTotalRow(salla.lang.get('pages.orders.final_total'), summary.total, 's-order-totals-card-total-label', 's-order-totals-card-total-value', true)))))));
56
+ }
57
+ static get watchers() { return {
58
+ "order": ["handleOrderChange"]
59
+ }; }
60
+ static get style() { return sallaOrderTotalsCardCss; }
61
+ }, [0, "salla-order-totals-card", {
62
+ "order": [1],
63
+ "summary": [32]
64
+ }, undefined, {
65
+ "order": ["handleOrderChange"]
66
+ }]);
67
+ function defineCustomElement$1() {
68
+ if (typeof customElements === "undefined") {
69
+ return;
70
+ }
71
+ const components = ["salla-order-totals-card"];
72
+ components.forEach(tagName => { switch (tagName) {
73
+ case "salla-order-totals-card":
74
+ if (!customElements.get(tagName)) {
75
+ customElements.define(tagName, SallaOrderTotalsCard$1);
76
+ }
77
+ break;
78
+ } });
79
+ }
80
+ defineCustomElement$1();
81
+
82
+ const SallaOrderTotalsCard = SallaOrderTotalsCard$1;
83
+ const defineCustomElement = defineCustomElement$1;
84
+
85
+ export { SallaOrderTotalsCard, defineCustomElement };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-Jl-UB-7q.js';
4
+ import { d as getDefaultExportFromCjs } from './index-DhLMCubZ.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {