@foxy.io/elements 1.21.0-beta.1 → 1.21.0-beta.2
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.
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/{shared-4f9d2417.js → shared-4393ad93.js} +1 -1
- package/dist/cdn/translations/cart-form/en.json +1 -1
- package/dist/cdn/translations/customer/en.json +2 -2
- package/dist/cdn/translations/customer-portal/de.json +1 -1
- package/dist/cdn/translations/customer-portal/en.json +1 -1
- package/dist/cdn/translations/customer-portal/es.json +1 -1
- package/dist/cdn/translations/customer-portal/fr.json +2 -2
- package/dist/cdn/translations/customer-portal/nl.json +1 -1
- package/dist/cdn/translations/customer-portal/pl.json +1 -1
- package/dist/cdn/translations/customer-portal/se.json +1 -1
- package/dist/cdn/translations/item-category-form/en.json +2 -2
- package/dist/cdn/translations/item-form/en.json +1 -1
- package/dist/cdn/translations/shipment-card/en.json +1 -1
- package/dist/cdn/translations/subscription-form/en.json +1 -1
- package/dist/cdn/translations/transaction/en.json +3 -3
- package/dist/cdn/translations/transaction-card/en.json +1 -1
- package/dist/cdn/translations/transactions-table/en.json +1 -1
- package/dist/elements/public/PaymentsApi/PaymentsApi.d.ts +21 -2
- package/dist/elements/public/PaymentsApi/PaymentsApi.js +22 -3
- package/dist/elements/public/PaymentsApi/PaymentsApi.js.map +1 -1
- package/dist/elements/public/ReportForm/utils.js +3 -2
- package/dist/elements/public/ReportForm/utils.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js +1 -0
- package/dist/elements/public/SubscriptionCard/SubscriptionCard.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +1 -0
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
- package/dist/elements/public/TransactionCard/TransactionCard.js +1 -0
- package/dist/elements/public/TransactionCard/TransactionCard.js.map +1 -1
- package/dist/elements/public/TransactionsTable/TransactionsTable.js +1 -0
- package/dist/elements/public/TransactionsTable/TransactionsTable.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-0821cfdc.js";import"./shared-a0c8faf2.js";import{I as t}from"./shared-6581241a.js";import{I as r}from"./shared-9bdacf65.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as o,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-bc814810.js";import"./shared-8dd0af4d.js";import{_ as s}from"./shared-a8ced8bf.js";import{N as n}from"./shared-181f51bd.js";import{a}from"./shared-2cc638ad.js";import{B as d}from"./shared-76b3d76a.js";import"./shared-2092d86f.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-4e709717.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-ed0dee03.js";import"./shared-be66c2e7.js";import"./shared-08156595.js";import"./shared-5ea18e60.js";import"./shared-5a4829e3.js";import"./shared-1c94a156.js";import"./shared-bd252323.js";import"./shared-7d4fb1a2.js";import"./shared-4849ef5b.js";import"./shared-6cb1015f.js";import"./shared-08e27fe9.js";import"./shared-11c2efc8.js";import"./shared-62a54a6c.js";import"./shared-101d1234.js";import"./shared-404aa9cc.js";import"./shared-d8dc97f0.js";import"./shared-5378bd8c.js";import"./shared-88c4cfec.js";import"./shared-868065de.js";import"./shared-486d7bb5.js";import"./foxy-address-card.js";import"./foxy-item-card.js";import"./shared-21679ebd.js";import"./foxy-nucleon-element.js";import"./shared-988ec916.js";import"./shared-39c10b22.js";import"./shared-d518bd55.js";import"./shared-80fc2b6a.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-c95c17e6.js";import"./foxy-discount-builder.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-af226a9a.js";import"./shared-a41234b4.js";import"./shared-bc7f58ef.js";import"./shared-f7e4cd67.js";import"./foxy-subscription-card.js";import"./shared-d61b3e4f.js";import"./foxy-subscription-form.js";import"./shared-1000b848.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-ea67b3f3.js";import"./shared-75e78c70.js";import"./shared-99065f2a.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-f80f402a.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b738ee96.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-4f9d2417.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends r{renderControl(){var t,r,e,s;return o(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends r{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,r="fail"===t?"error":"idle"===t?this.theme:"";return o(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),r,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const r=new n.API(this),o=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends r{renderControl(){var t,r,e,i,s,n,a,d;return o(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"")}__renderSendEmailsAction(){var t,r;return o(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,r;return o(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,r,e;return o(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,r,e;return o(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends r{renderControl(){var t;return o(j||(j=S` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-bold">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,r;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r.status)||"completed";return o(_||(_=S` <foxy-i18n class="flex items-center h-xs px-s text-s font-semibold rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const r=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==r?void 0:r.currency_code;if(!r)return o(b||(b=S`--`));const i={amount:`${r.total_order} ${e}`};return o($||($=S`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t;const r=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==r?void 0:r.currency_code;return["total_item_price","total_shipping","total_tax"].map((t=>{const i={amount:`${null==r?void 0:r[t]} ${e}`};return o(g||(g=S` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,r?o(k||(k=S`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i):o(w||(w=S`<span>--</span>`)))}))}});let A,E,C=t=>t;class T extends(a(t,"transaction")){static get styles(){return[...super.styles,e(A||(A=C`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,r,o;return Boolean(null!==(r=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==r?r:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])?super.readonlySelector:new d(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,r,e,s,n,a;return o(E||(E=C` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(r=this.data)||void 0===r?void 0:r._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",T);export{T as Transaction};
|
|
1
|
+
import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-applied-tax-card.js";import"./foxy-discount-card.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-form.js";import"./shared-0821cfdc.js";import"./shared-a0c8faf2.js";import{I as t}from"./shared-6581241a.js";import{I as r}from"./shared-9bdacf65.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-customer.js";import{h as o,c as e}from"./shared-7f33a83a.js";import{i}from"./shared-d3bf9ac0.js";import"./shared-bc814810.js";import"./shared-8dd0af4d.js";import{_ as s}from"./shared-a8ced8bf.js";import{N as n}from"./shared-181f51bd.js";import{a}from"./shared-2cc638ad.js";import{B as d}from"./shared-76b3d76a.js";import"./shared-2092d86f.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-4e709717.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-ed0dee03.js";import"./shared-be66c2e7.js";import"./shared-08156595.js";import"./shared-5ea18e60.js";import"./shared-5a4829e3.js";import"./shared-1c94a156.js";import"./shared-bd252323.js";import"./shared-7d4fb1a2.js";import"./shared-4849ef5b.js";import"./shared-6cb1015f.js";import"./shared-08e27fe9.js";import"./shared-11c2efc8.js";import"./shared-62a54a6c.js";import"./shared-101d1234.js";import"./shared-404aa9cc.js";import"./shared-d8dc97f0.js";import"./shared-5378bd8c.js";import"./shared-88c4cfec.js";import"./shared-868065de.js";import"./shared-486d7bb5.js";import"./foxy-address-card.js";import"./foxy-item-card.js";import"./shared-21679ebd.js";import"./foxy-nucleon-element.js";import"./shared-988ec916.js";import"./shared-39c10b22.js";import"./shared-d518bd55.js";import"./shared-80fc2b6a.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-coupon-card.js";import"./shared-c95c17e6.js";import"./foxy-discount-builder.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-af226a9a.js";import"./shared-a41234b4.js";import"./shared-bc7f58ef.js";import"./shared-f7e4cd67.js";import"./foxy-subscription-card.js";import"./shared-d61b3e4f.js";import"./foxy-subscription-form.js";import"./shared-1000b848.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./shared-ea67b3f3.js";import"./shared-75e78c70.js";import"./shared-99065f2a.js";import"./foxy-payment-method-card.js";import"./foxy-transactions-table.js";import"./shared-f80f402a.js";import"./foxy-collection-pages.js";import"./foxy-customer-form.js";import"./shared-b738ee96.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-4393ad93.js";let l,c=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends r{renderControl(){var t,r,e,s;return o(l||(l=c` <foxy-internal-details summary="customer" infer="" open> <foxy-form-dialog header="header" infer="dialog" form="foxy-customer" href="${0}" id="dialog"> </foxy-form-dialog> <button class="w-full text-left block rounded-b-l transition-colors hover-bg-contrast-5 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <foxy-customer-card infer="card" class="p-m" href="${0}"> </foxy-customer-card> </button> </foxy-internal-details> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:customer"].href),(t=>{this.renderRoot.querySelector("#dialog").show(t.currentTarget)}),i(null===(s=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===s?void 0:s._links["fx:customer"].href))}});let f,m=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends r{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,r="fail"===t?"error":"idle"===t?this.theme:"";return o(f||(f=m` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),r,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const r=new n.API(this),o=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let u,p,h,y,x,v=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends r{renderControl(){var t,r,e,i,s,n,a,d;return o(u||(u=v` <div class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} </div> `),(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"")}__renderSendEmailsAction(){var t,r;return o(p||(p=v` <foxy-internal-transaction-post-action-control infer="send-emails" theme="contrast" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,r;return o(h||(h=v` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,r,e;return o(y||(y=v` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:void"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,r,e;return o(x||(x=v` <foxy-internal-transaction-post-action-control theme="contrast" infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),i(null===(e=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r._links["fx:refund"])||void 0===e?void 0:e.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}});let j,_,b,$,g,k,w,S=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends r{renderControl(){var t;return o(j||(j=S` <div class="border-t border-transparent"> <div class="h-m flex items-center justify-between"> <div class="text-xl font-bold">${0}</div> <div>${0}</div> </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} </div> `),this.__renderPrice(),(null===(t=this.nucleon)||void 0===t?void 0:t.data)?this.__renderStatus():"",this.__renderTotals())}__renderStatus(){var t,r;const e={authorized:"bg-success text-success-contrast",completed:"bg-success text-success-contrast",declined:"bg-error text-error-contrast",rejected:"bg-error text-error-contrast"},i=(null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===r?void 0:r.status)||"completed";return o(_||(_=S` <foxy-i18n class="flex items-center h-xs px-s text-s font-semibold rounded ${0}" infer="" key="transaction_${0}"> </foxy-i18n> `),i in e?e[i]:"bg-contrast-5 text-contrast",i)}__renderPrice(){var t;const r=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==r?void 0:r.currency_code;if(!r)return o(b||(b=S`--`));const i={amount:`${r.total_order} ${e}`};return o($||($=S`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i)}__renderTotals(){var t;const r=null===(t=this.nucleon)||void 0===t?void 0:t.data,e=null==r?void 0:r.currency_code;return["total_item_price","total_shipping","total_tax"].map((t=>{const i={amount:`${null==r?void 0:r[t]} ${e}`};return o(g||(g=S` <div class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer=""></foxy-i18n> ${0} </div> `),t,r?o(k||(k=S`<foxy-i18n infer="" key="price" .options="${0}"></foxy-i18n>`),i):o(w||(w=S`<span>--</span>`)))}))}});let A,E,C=t=>t;class T extends(a(t,"transaction")){static get styles(){return[...super.styles,e(A||(A=C`#body{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr))}#body>:first-child{grid-column-start:1;grid-column-end:-2}`))]}get readonlySelector(){var t,r,o;return Boolean(null!==(r=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==r?r:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])?super.readonlySelector:new d(`${super.readonlySelector} attributes custom-fields`)}renderBody(){var t,r,e,s,n,a;return o(E||(E=C` <div id="body" class="gap-m"> <foxy-internal-async-details-control infer="shipments" first="${0}" item="foxy-shipment-card" open> </foxy-internal-async-details-control> <div class="grid gap-m self-start"> <foxy-internal-transaction-summary-control infer="summary"> </foxy-internal-transaction-summary-control> <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <foxy-internal-async-details-control infer="payments" class="max-w-full overflow-hidden" first="${0}" limit="1" item="foxy-payment-card" open> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="discounts" first="${0}" limit="5" item="foxy-discount-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="applied-taxes" first="${0}" limit="5" item="foxy-applied-tax-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="custom-fields" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" .related="${0}"> </foxy-internal-async-details-control> <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> </div> </div> `),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:shipments"].href),i(null===(r=this.data)||void 0===r?void 0:r._links["fx:payments"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href),i(null===(s=this.data)||void 0===s?void 0:s._links["fx:applied_taxes"].href),i(null===(n=this.data)||void 0===n?void 0:n._links["fx:custom_fields"].href),[this.href],i(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),[this.href])}}customElements.define("foxy-transaction",T);export{T as Transaction};
|
|
@@ -8,7 +8,7 @@ import"./shared-2092d86f.js";import"./shared-62c088b7.js";import"./foxy-spinner.
|
|
|
8
8
|
.options=${0}
|
|
9
9
|
>
|
|
10
10
|
</foxy-i18n>
|
|
11
|
-
`),t.lang,t.ns,{amount:`${t.data.total_order} ${t.data.currency_code}`})},c.summaryColumn={cell:t=>{var s;const e=null===(s=t.data._embedded)||void 0===s?void 0:s["fx:items"];if(!e)return"";const n={most_expensive_item:[...e].sort(((t,s)=>t.price-s.price))[0],count:e.length};return t.html(a||(a=l`
|
|
11
|
+
`),t.lang,t.ns,{amount:`${t.data.total_order} ${t.data.currency_code}`})},c.summaryColumn={cell:t=>{var s;const e=null===(s=t.data._embedded)||void 0===s?void 0:s["fx:items"];if(!e)return"";const n={most_expensive_item:[...e].sort(((t,s)=>t.price-s.price))[0],count_minus_one:e.length-1,count:e.length};return t.html(a||(a=l`
|
|
12
12
|
<foxy-i18n
|
|
13
13
|
data-testclass="i18n summaries"
|
|
14
14
|
class="text-m"
|
|
@@ -8,7 +8,7 @@ import{_ as t}from"./shared-a8ced8bf.js";import{T as e}from"./shared-f80f402a.js
|
|
|
8
8
|
.options=${0}
|
|
9
9
|
>
|
|
10
10
|
</foxy-i18n>
|
|
11
|
-
`),e.lang,".5m"===e.data.frequency?"twice_a_month":"recurring",e.ns,t(t({},a(e.data.frequency)),{},{amount:o}))}},l.summaryColumn={cell:t=>{const e=t.data._embedded["fx:transaction_template"]._embedded["fx:items"],s={most_expensive_item:[...e].sort(((t,e)=>t.price-e.price))[0],count:e.length};return t.html(o||(o=c`
|
|
11
|
+
`),e.lang,".5m"===e.data.frequency?"twice_a_month":"recurring",e.ns,t(t({},a(e.data.frequency)),{},{amount:o}))}},l.summaryColumn={cell:t=>{const e=t.data._embedded["fx:transaction_template"]._embedded["fx:items"],s={most_expensive_item:[...e].sort(((t,e)=>t.price-e.price))[0],count_minus_one:e.length-1,count:e.length};return t.html(o||(o=c`
|
|
12
12
|
<foxy-i18n
|
|
13
13
|
data-testclass="i18n summaries"
|
|
14
14
|
class="text-m"
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"transaction_refunded": "Refunded",
|
|
170
170
|
"transaction_rejected": "Rejected",
|
|
171
171
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
172
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
172
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
173
173
|
"transaction_verified": "Verified",
|
|
174
174
|
"transaction_voided": "Voided",
|
|
175
175
|
"spinner": {
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"transaction_refunded": "Refunded",
|
|
187
187
|
"transaction_rejected": "Rejected",
|
|
188
188
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
189
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
189
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
190
190
|
"transaction_verified": "Verified",
|
|
191
191
|
"transaction_voided": "Voided",
|
|
192
192
|
"spinner": {
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"transaction_refunded": "Refunded",
|
|
236
236
|
"transaction_rejected": "Rejected",
|
|
237
237
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
238
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
238
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
239
239
|
"transaction_verified": "Verified",
|
|
240
240
|
"transaction_voided": "Voided",
|
|
241
241
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Erstattet",
|
|
195
195
|
"transaction_rejected": "Zurückgewiesen",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} und {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} und {{count_minus_one}} mehr",
|
|
198
198
|
"transaction_verified": "Überprüft",
|
|
199
199
|
"transaction_voided": "Storniert",
|
|
200
200
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Refunded",
|
|
195
195
|
"transaction_rejected": "Rejected",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
198
198
|
"transaction_verified": "Verified",
|
|
199
199
|
"transaction_voided": "Voided",
|
|
200
200
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Reintegrado",
|
|
195
195
|
"transaction_rejected": "Rechazado",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} y {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} y {{transaction_summary_plural}} más",
|
|
198
198
|
"transaction_verified": "Verificado",
|
|
199
199
|
"transaction_voided": "Anulado",
|
|
200
200
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Remboursé",
|
|
195
195
|
"transaction_rejected": "Rejeté",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} et {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} et {{transaction_summary_plural}} plus",
|
|
198
198
|
"transaction_verified": "Vérifié",
|
|
199
199
|
"transaction_voided": "Annulé",
|
|
200
200
|
"spinner": {
|
|
@@ -220,4 +220,4 @@
|
|
|
220
220
|
"loading_error": "Échec du chargement"
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
}
|
|
223
|
+
}
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Terugbetaald",
|
|
195
195
|
"transaction_rejected": "Afgewezen",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} en {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} en {{transaction_summary_plural}} meer",
|
|
198
198
|
"transaction_verified": "Geverifieerd",
|
|
199
199
|
"transaction_voided": "Ongeldig",
|
|
200
200
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Zwrócona",
|
|
195
195
|
"transaction_rejected": "Odrzucona",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} i {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} i {{transaction_summary_plural}} więcej",
|
|
198
198
|
"transaction_verified": "Zweryfikowana",
|
|
199
199
|
"transaction_voided": "Unieważniona",
|
|
200
200
|
"spinner": {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"transaction_refunded": "Återbetalad",
|
|
195
195
|
"transaction_rejected": "Avvisad",
|
|
196
196
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
197
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
197
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
198
198
|
"transaction_verified": "Verifierad",
|
|
199
199
|
"transaction_voided": "Ogiltigförklarad",
|
|
200
200
|
"spinner": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"option_downloaded": "Downloaded by the customer",
|
|
43
43
|
"option_pickup": "Picked up by the customer",
|
|
44
44
|
"option_notshipped": "Not shipped",
|
|
45
|
-
"placeholder": "
|
|
45
|
+
"placeholder": "Select...",
|
|
46
46
|
"helper_text": "",
|
|
47
47
|
"v8n_required": "Please select a delivery type"
|
|
48
48
|
},
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"option_flat_per_item": "Flat fee per product",
|
|
112
112
|
"option_flat_percent": "Flat fee per shipment + % of price",
|
|
113
113
|
"option_flat_percent_with_minimum": "Flat fee per shipment or % of price, whichever is greater",
|
|
114
|
-
"placeholder": "
|
|
114
|
+
"placeholder": "Select...",
|
|
115
115
|
"helper_text": "",
|
|
116
116
|
"v8n_required": "Please select a value"
|
|
117
117
|
},
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"transaction_refunded": "Refunded",
|
|
116
116
|
"transaction_rejected": "Rejected",
|
|
117
117
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
118
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
118
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
119
119
|
"transaction_verified": "Verified",
|
|
120
120
|
"transaction_voided": "Voided",
|
|
121
121
|
"spinner": {
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"transaction_refunded": "Refunded",
|
|
144
144
|
"transaction_rejected": "Rejected",
|
|
145
145
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
146
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
146
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
147
147
|
"transaction_verified": "Verified",
|
|
148
148
|
"transaction_voided": "Voided",
|
|
149
149
|
"spinner": {
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"transaction_refunded": "Refunded",
|
|
139
139
|
"transaction_rejected": "Rejected",
|
|
140
140
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
141
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
141
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
142
142
|
"transaction_verified": "Verified",
|
|
143
143
|
"transaction_voided": "Voided",
|
|
144
144
|
"spinner": {
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"transaction_refunded": "Refunded",
|
|
192
192
|
"transaction_rejected": "Rejected",
|
|
193
193
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
194
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
194
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
195
195
|
"transaction_verified": "Verified",
|
|
196
196
|
"transaction_voided": "Voided",
|
|
197
197
|
"spinner": {
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"transaction_refunded": "Refunded",
|
|
241
241
|
"transaction_rejected": "Rejected",
|
|
242
242
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
243
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
243
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
244
244
|
"transaction_verified": "Verified",
|
|
245
245
|
"transaction_voided": "Voided",
|
|
246
246
|
"spinner": {
|
|
@@ -479,7 +479,7 @@
|
|
|
479
479
|
"transaction_refunded": "Refunded",
|
|
480
480
|
"transaction_rejected": "Rejected",
|
|
481
481
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
482
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
482
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
483
483
|
"transaction_verified": "Verified",
|
|
484
484
|
"transaction_voided": "Voided",
|
|
485
485
|
"spinner": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"transaction_refunded": "Refunded",
|
|
15
15
|
"transaction_rejected": "Rejected",
|
|
16
16
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
17
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
17
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
18
18
|
"transaction_verified": "Verified",
|
|
19
19
|
"transaction_voided": "Voided",
|
|
20
20
|
"spinner": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"transaction_refunded": "Refunded",
|
|
12
12
|
"transaction_rejected": "Rejected",
|
|
13
13
|
"transaction_summary": "{{most_expensive_item.name}}",
|
|
14
|
-
"transaction_summary_plural": "{{most_expensive_item.name}} and {{
|
|
14
|
+
"transaction_summary_plural": "{{most_expensive_item.name}} and {{count_minus_one}} more",
|
|
15
15
|
"transaction_verified": "Verified",
|
|
16
16
|
"transaction_voided": "Voided",
|
|
17
17
|
"spinner": {
|
|
@@ -1,18 +1,37 @@
|
|
|
1
|
-
import type { PropertyDeclarations
|
|
1
|
+
import type { PropertyDeclarations } from 'lit-element';
|
|
2
2
|
import { LitElement } from 'lit-element';
|
|
3
|
+
/**
|
|
4
|
+
* Adapter element for Payments API. This element requires an additional hAPI adapter
|
|
5
|
+
* that will handle authentication and session management.
|
|
6
|
+
*
|
|
7
|
+
* _Payments API is a client-side virtual API layer built on top of hAPI
|
|
8
|
+
* in an attempt to streamline access to stores' payment method settings
|
|
9
|
+
* that is currently a bit quirky due to the legacy functionality. To use
|
|
10
|
+
* Payments API elements with hAPI, wrap them into this node._
|
|
11
|
+
*
|
|
12
|
+
* @element foxy-payments-api
|
|
13
|
+
* @since 1.21.0
|
|
14
|
+
*/
|
|
3
15
|
export declare class PaymentsApi extends LitElement {
|
|
4
16
|
static get properties(): PropertyDeclarations;
|
|
17
|
+
/** URL of the `fx:payment_method_set_hosted_payment_gateways` collection. */
|
|
5
18
|
paymentMethodSetHostedPaymentGatewaysUrl: string | null;
|
|
19
|
+
/** URL of the `fx:hosted_payment_gateways` property helper. */
|
|
6
20
|
hostedPaymentGatewaysHelperUrl: string | null;
|
|
21
|
+
/** URL of the `fx:hosted_payment_gateways` collection. */
|
|
7
22
|
hostedPaymentGatewaysUrl: string | null;
|
|
23
|
+
/** URL of the `fx:payment_gateways` property helper. */
|
|
8
24
|
paymentGatewaysHelperUrl: string | null;
|
|
25
|
+
/** URL of the `fx:payment_method_sets` collection. */
|
|
9
26
|
paymentMethodSetsUrl: string | null;
|
|
27
|
+
/** URL of the `fx:fraud_protections` collection. */
|
|
10
28
|
fraudProtectionsUrl: string | null;
|
|
29
|
+
/** URL of the `fx:payment_gateways` collection. */
|
|
11
30
|
paymentGatewaysUrl: string | null;
|
|
12
31
|
private readonly __api;
|
|
13
32
|
private readonly __fetch;
|
|
14
33
|
private readonly __handleFetch;
|
|
15
34
|
connectedCallback(): void;
|
|
16
|
-
|
|
35
|
+
createRenderRoot(): Element | ShadowRoot;
|
|
17
36
|
disconnectedCallback(): void;
|
|
18
37
|
}
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LitElement } from 'lit-element';
|
|
2
2
|
import { FetchEvent } from "../NucleonElement/FetchEvent.js";
|
|
3
3
|
import { getHandler } from "./api/index.js";
|
|
4
4
|
import { API } from "../NucleonElement/API.js";
|
|
5
|
+
/**
|
|
6
|
+
* Adapter element for Payments API. This element requires an additional hAPI adapter
|
|
7
|
+
* that will handle authentication and session management.
|
|
8
|
+
*
|
|
9
|
+
* _Payments API is a client-side virtual API layer built on top of hAPI
|
|
10
|
+
* in an attempt to streamline access to stores' payment method settings
|
|
11
|
+
* that is currently a bit quirky due to the legacy functionality. To use
|
|
12
|
+
* Payments API elements with hAPI, wrap them into this node._
|
|
13
|
+
*
|
|
14
|
+
* @element foxy-payments-api
|
|
15
|
+
* @since 1.21.0
|
|
16
|
+
*/
|
|
5
17
|
export class PaymentsApi extends LitElement {
|
|
6
18
|
constructor() {
|
|
7
19
|
super(...arguments);
|
|
20
|
+
/** URL of the `fx:payment_method_set_hosted_payment_gateways` collection. */
|
|
8
21
|
this.paymentMethodSetHostedPaymentGatewaysUrl = null;
|
|
22
|
+
/** URL of the `fx:hosted_payment_gateways` property helper. */
|
|
9
23
|
this.hostedPaymentGatewaysHelperUrl = null;
|
|
24
|
+
/** URL of the `fx:hosted_payment_gateways` collection. */
|
|
10
25
|
this.hostedPaymentGatewaysUrl = null;
|
|
26
|
+
/** URL of the `fx:payment_gateways` property helper. */
|
|
11
27
|
this.paymentGatewaysHelperUrl = null;
|
|
28
|
+
/** URL of the `fx:payment_method_sets` collection. */
|
|
12
29
|
this.paymentMethodSetsUrl = null;
|
|
30
|
+
/** URL of the `fx:fraud_protections` collection. */
|
|
13
31
|
this.fraudProtectionsUrl = null;
|
|
32
|
+
/** URL of the `fx:payment_gateways` collection. */
|
|
14
33
|
this.paymentGatewaysUrl = null;
|
|
15
34
|
this.__api = new API(this);
|
|
16
35
|
this.__fetch = this.__api.fetch.bind(this.__api);
|
|
@@ -81,8 +100,8 @@ export class PaymentsApi extends LitElement {
|
|
|
81
100
|
super.connectedCallback();
|
|
82
101
|
this.addEventListener('fetch', this.__handleFetch);
|
|
83
102
|
}
|
|
84
|
-
|
|
85
|
-
return
|
|
103
|
+
createRenderRoot() {
|
|
104
|
+
return this;
|
|
86
105
|
}
|
|
87
106
|
disconnectedCallback() {
|
|
88
107
|
super.disconnectedCallback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentsApi.js","sourceRoot":"","sources":["../../../../src/elements/public/PaymentsApi/PaymentsApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PaymentsApi.js","sourceRoot":"","sources":["../../../../src/elements/public/PaymentsApi/PaymentsApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE,UAAU,EAAE,uBA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AE,SAAS,EAAE,6BAA6B,EAAE;YACtE,wBAAwB,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE;YACtE,oBAAoB,EAAE,EAAE,SAAS,EAAE,yBAAyB,EAAE;YAC9D,mBAAmB,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE;YAC3D,kBAAkB,EAAE,EAAE,SAAS,EAAE,sBAAsB,EAAE;SAC1D,CAAC;IACJ,CAAC;IAoFD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\n\nimport { LitElement } from 'lit-element';\nimport { FetchEvent } from '../NucleonElement/FetchEvent';\nimport { getHandler } from './api/index';\nimport { API } from '../NucleonElement/API';\n\n/**\n * Adapter element for Payments API. This element requires an additional hAPI adapter\n * that will handle authentication and session management.\n *\n * _Payments API is a client-side virtual API layer built on top of hAPI\n * in an attempt to streamline access to stores' payment method settings\n * that is currently a bit quirky due to the legacy functionality. To use\n * Payments API elements with hAPI, wrap them into this node._\n *\n * @element foxy-payments-api\n * @since 1.21.0\n */\nexport class PaymentsApi extends LitElement {\n static get properties(): PropertyDeclarations {\n return {\n paymentMethodSetHostedPaymentGatewaysUrl: {\n attribute: 'payment-method-set-hosted-payment-gateways-url',\n },\n\n hostedPaymentGatewaysHelperUrl: { attribute: 'hosted-payment-gateways-helper-url' },\n hostedPaymentGatewaysUrl: { attribute: 'hosted-payment-gateways-url' },\n paymentGatewaysHelperUrl: { attribute: 'payment-gateways-helper-url' },\n paymentMethodSetsUrl: { attribute: 'payment-method-sets-url' },\n fraudProtectionsUrl: { attribute: 'fraud-protections-url' },\n paymentGatewaysUrl: { attribute: 'payment-gateways-url' },\n };\n }\n\n /** URL of the `fx:payment_method_set_hosted_payment_gateways` collection. */\n paymentMethodSetHostedPaymentGatewaysUrl: string | null = null;\n\n /** URL of the `fx:hosted_payment_gateways` property helper. */\n hostedPaymentGatewaysHelperUrl: string | null = null;\n\n /** URL of the `fx:hosted_payment_gateways` collection. */\n hostedPaymentGatewaysUrl: string | null = null;\n\n /** URL of the `fx:payment_gateways` property helper. */\n paymentGatewaysHelperUrl: string | null = null;\n\n /** URL of the `fx:payment_method_sets` collection. */\n paymentMethodSetsUrl: string | null = null;\n\n /** URL of the `fx:fraud_protections` collection. */\n fraudProtectionsUrl: string | null = null;\n\n /** URL of the `fx:payment_gateways` collection. */\n paymentGatewaysUrl: string | null = null;\n\n private readonly __api = new API(this);\n\n private readonly __fetch = this.__api.fetch.bind(this.__api);\n\n private readonly __handleFetch = (evt: Event) => {\n if (!(evt instanceof FetchEvent)) return;\n if (!evt.request.url.startsWith('https://foxy-payments-api.element/')) return;\n if (evt.defaultPrevented) return;\n\n const {\n paymentMethodSetHostedPaymentGatewaysUrl,\n hostedPaymentGatewaysHelperUrl,\n paymentGatewaysHelperUrl,\n hostedPaymentGatewaysUrl,\n paymentMethodSetsUrl,\n fraudProtectionsUrl,\n paymentGatewaysUrl,\n } = this;\n\n if (paymentMethodSetHostedPaymentGatewaysUrl === null) return;\n if (hostedPaymentGatewaysHelperUrl === null) return;\n if (paymentGatewaysHelperUrl === null) return;\n if (hostedPaymentGatewaysUrl === null) return;\n if (paymentMethodSetsUrl === null) return;\n if (fraudProtectionsUrl === null) return;\n if (paymentGatewaysUrl === null) return;\n\n const createGetter = (link: string) => (id: string) => {\n const url = new URL(link);\n if (!url.pathname.endsWith('/')) url.pathname += '/';\n url.pathname += id;\n return url.toString();\n };\n\n const handler = getHandler({\n hostedPaymentGatewaysHelperUrl,\n paymentGatewaysHelperUrl,\n hostedPaymentGatewaysUrl,\n paymentMethodSetsUrl,\n fraudProtectionsUrl,\n paymentGatewaysUrl,\n\n getPaymentMethodSetHostedPaymentGatewayUrl: createGetter(\n paymentMethodSetHostedPaymentGatewaysUrl\n ),\n\n getHostedPaymentGatewayUrl: createGetter(hostedPaymentGatewaysUrl),\n getPaymentMethodSetUrl: createGetter(paymentMethodSetsUrl),\n getFraudProtectionUrl: createGetter(fraudProtectionsUrl),\n getPaymentGatewayUrl: createGetter(paymentGatewaysUrl),\n\n request: evt.request,\n fetch: this.__fetch,\n });\n\n if (handler) {\n evt.preventDefault();\n evt.respondWith(handler);\n }\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('fetch', this.__handleFetch);\n }\n\n createRenderRoot(): Element | ShadowRoot {\n return this;\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('fetch', this.__handleFetch);\n }\n}\n"]}
|
|
@@ -8,10 +8,11 @@ export function getPreviousQuarter(now = new Date()) {
|
|
|
8
8
|
const currentMonth = now.getMonth();
|
|
9
9
|
const currentQuarter = quarters.findIndex(months => months.includes(currentMonth));
|
|
10
10
|
const previousQuarter = currentQuarter === 0 ? quarters.length - 1 : currentQuarter - 1;
|
|
11
|
+
const previousQuarterYear = now.getFullYear() - (currentQuarter === 0 ? 1 : 0);
|
|
11
12
|
const previousQuarterStart = quarters[previousQuarter][0];
|
|
12
|
-
const start = new Date(
|
|
13
|
+
const start = new Date(previousQuarterYear, previousQuarterStart);
|
|
13
14
|
const previousQuarterEnd = quarters[previousQuarter][2];
|
|
14
|
-
const end = new Date(new Date(
|
|
15
|
+
const end = new Date(new Date(previousQuarterYear, previousQuarterEnd + 1).getTime() - 1);
|
|
15
16
|
return { start, end };
|
|
16
17
|
}
|
|
17
18
|
export function getCurrentQuarter(now = new Date()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/elements/public/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QAAgB;;IAChD,mBAAO,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAG,CAAC,oCAAK,EAAE,CAAC;AACxD,CAAC","sourcesContent":["type Quarter = [number, number, number];\ntype Year = [Quarter, Quarter, Quarter, Quarter];\ntype Range = { start: Date; end: Date };\n\nconst quarters: Year = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n [9, 10, 11],\n];\n\nexport function getPreviousQuarter(now = new Date()): Range {\n const currentMonth = now.getMonth();\n const currentQuarter = quarters.findIndex(months => months.includes(currentMonth));\n const previousQuarter = currentQuarter === 0 ? quarters.length - 1 : currentQuarter - 1;\n const previousQuarterYear = now.getFullYear() - (currentQuarter === 0 ? 1 : 0);\n\n const previousQuarterStart = quarters[previousQuarter][0];\n const start = new Date(previousQuarterYear, previousQuarterStart);\n\n const previousQuarterEnd = quarters[previousQuarter][2];\n const end = new Date(new Date(previousQuarterYear, previousQuarterEnd + 1).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getCurrentQuarter(now = new Date()): Range {\n const currentMonth = now.getMonth();\n const currentQuarter = quarters.findIndex(months => months.includes(currentMonth));\n\n const currentQuarterStart = quarters[currentQuarter][0];\n const start = new Date(now.getFullYear(), currentQuarterStart);\n\n const currentQuarterEnd = quarters[currentQuarter][2];\n const end = new Date(new Date(now.getFullYear(), currentQuarterEnd + 1).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getPreviousMonth(now = new Date()): Range {\n const start = new Date(now.getFullYear(), now.getMonth() - 1);\n const end = new Date(new Date(now.getFullYear(), now.getMonth()).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getCurrentMonth(now = new Date()): Range {\n const start = new Date(now.getFullYear(), now.getMonth());\n const end = new Date(new Date(now.getFullYear(), now.getMonth() + 1).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getPreviousYear(now = new Date()): Range {\n const start = new Date(now.getFullYear() - 1, 0);\n const end = new Date(new Date(now.getFullYear(), 0).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getCurrentYear(now = new Date()): Range {\n const start = new Date(now.getFullYear(), 0);\n const end = new Date(new Date(now.getFullYear() + 1, 0).getTime() - 1);\n\n return { start, end };\n}\n\nexport function getLast365Days(now = new Date()): Range {\n const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 365);\n const end = new Date(\n new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1).getTime() - 1\n );\n\n return { start, end };\n}\n\nexport function getLast30Days(now = new Date()): Range {\n const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 30);\n const end = new Date(\n new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1).getTime() - 1\n );\n\n return { start, end };\n}\n\nexport function toAPIDateTime(date: Date): string {\n const YYYY = date.getFullYear().toString().padStart(4, '0');\n const MM = (date.getMonth() + 1).toString().padStart(2, '0');\n const DD = date.getDate().toString().padStart(2, '0');\n const hh = date.getHours().toString().padStart(2, '0');\n const mm = date.getMinutes().toString().padStart(2, '0');\n const ss = date.getSeconds().toString().padStart(2, '0');\n\n return `${YYYY}-${MM}-${DD}T${hh}:${mm}:${ss}`;\n}\n\nexport function toDateTimePickerValue(apiValue: string): string {\n return /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/.exec(apiValue)?.[0] ?? '';\n}\n\nexport function toDatePickerValue(apiValue: string): string {\n return /^\\d{4}-\\d{2}-\\d{2}/.exec(apiValue)?.[0] ?? '';\n}\n"]}
|
|
@@ -732,7 +732,7 @@ export class StoreForm extends Base {
|
|
|
732
732
|
const isDisabled = this.disabledSelector.matches('currency-style', true);
|
|
733
733
|
const isReadonly = this.readonlySelector.matches('currency-style', true);
|
|
734
734
|
return html `
|
|
735
|
-
<div data-testid="currency-style">
|
|
735
|
+
<div data-testid="currency-style" class="sm-col-span-2">
|
|
736
736
|
${this.renderTemplateOrSlot('currency-style:before')}
|
|
737
737
|
|
|
738
738
|
<div
|