@dropins/storefront-quote-management 1.0.0-beta9 → 1.1.0-beta1
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/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
- package/api/index.d.ts +1 -0
- package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +3 -0
- package/api/setQuoteTemplateExpirationDate/graphql/setQuoteTemplateExpirationDate.d.ts +10 -0
- package/api/setQuoteTemplateExpirationDate/index.d.ts +10 -0
- package/api/setQuoteTemplateExpirationDate/setQuoteTemplateExpirationDate.d.ts +8 -0
- package/api.js +5 -5
- package/api.js.map +1 -1
- package/chunks/AttachedFilesList.js +1 -1
- package/chunks/CheckWithCircle.js +1 -1
- package/chunks/ChevronDown.js +1 -1
- package/chunks/ConfirmationModal.js +1 -1
- package/chunks/ItemsQuoted.js +1 -1
- package/chunks/ItemsQuotedTemplate.js +2 -2
- package/chunks/ItemsQuotedTemplate.js.map +1 -1
- package/chunks/LineItemNoteModal.js +2 -2
- package/chunks/LineItemNoteModal.js.map +1 -1
- package/chunks/NegotiableQuoteFragment.js +5 -1
- package/chunks/NegotiableQuoteFragment.js.map +1 -1
- package/chunks/NegotiableQuoteTemplateFragment.js +5 -1
- package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -1
- package/chunks/OrderSummaryLine.js +1 -1
- package/chunks/QuoteCommentsList.js +1 -1
- package/chunks/QuoteCommentsList3.js +1 -1
- package/chunks/QuoteHistoryLog.js +1 -1
- package/chunks/QuoteHistoryLog3.js +1 -1
- package/chunks/QuoteTemplateCommentsList.js +2 -2
- package/chunks/QuoteTemplateCommentsList.js.map +1 -1
- package/chunks/QuoteTemplateHistoryLog.js +1 -1
- package/chunks/RenameQuoteModal.js +1 -1
- package/chunks/ShippingAddressDisplay.js +1 -1
- package/chunks/WarningFilled.js +1 -1
- package/chunks/addQuoteTemplateLineItemNote.js +1 -1
- package/chunks/dateUtils.js +2 -2
- package/chunks/dateUtils.js.map +1 -1
- package/chunks/duplicateNegotiableQuote.js +1 -1
- package/chunks/generateQuoteFromTemplate.js +1 -1
- package/chunks/getQuoteTemplates.js +1 -1
- package/chunks/negotiableQuotes.js +1 -1
- package/chunks/openQuoteTemplate.js +23 -12
- package/chunks/openQuoteTemplate.js.map +1 -1
- package/chunks/requestNegotiableQuote.js +1 -1
- package/chunks/setLineItemNote.js +1 -1
- package/chunks/state.js +1 -1
- package/chunks/transform-quote-template.js +1 -1
- package/chunks/transform-quote.js +2 -2
- package/chunks/transform-quote.js.map +1 -1
- package/chunks/uploadFile.js +1 -1
- package/components/ExpirationDateModal/ExpirationDateModal.d.ts +16 -0
- package/components/ExpirationDateModal/index.d.ts +11 -0
- package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +2 -0
- package/components/index.d.ts +1 -0
- package/containers/ItemsQuoted.js +1 -1
- package/containers/ItemsQuotedTemplate.js +1 -1
- package/containers/ManageNegotiableQuote.js +1 -1
- package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +19 -1
- package/containers/ManageNegotiableQuoteTemplate.js +3 -3
- package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
- package/containers/OrderSummary.js +1 -1
- package/containers/OrderSummaryLine.js +1 -1
- package/containers/QuoteCommentsList.js +1 -1
- package/containers/QuoteHistoryLog.js +1 -1
- package/containers/QuoteSummaryList.js +1 -1
- package/containers/QuoteTemplateCommentsList.js +1 -1
- package/containers/QuoteTemplateHistoryLog.js +1 -1
- package/containers/QuoteTemplatesListTable.js +1 -1
- package/containers/QuotesListTable.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/ShippingAddressDisplay.js +1 -1
- package/data/models/negotiable-quote-model.d.ts +4 -0
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +16 -0
- package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +60 -0
- package/hooks/useExpirationDate.d.ts +64 -0
- package/hooks/useItemsQuotedTemplate.d.ts +1 -0
- package/i18n/en_US.json.d.ts +12 -0
- package/package.json +1 -1
- package/render.js +4 -3
- package/render.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as u,jsx as t,Fragment as _e}from"@dropins/tools/preact-jsx-runtime.js";import{VComponent as M,classes as Ee}from"@dropins/tools/lib.js";/* empty css */import{Accordion as Ce,AccordionSection as fe,Divider as we,Price as l,Icon as Me}from"@dropins/tools/components.js";import{O as s}from"../chunks/OrderSummaryLine.js";import*as H from"@dropins/tools/preact-compat.js";import{useState as Se,useEffect as Ze}from"@dropins/tools/preact-compat.js";import{S as ve}from"../chunks/ChevronDown.js";import{useText as Ne}from"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */import{s as He,Q as Z}from"../chunks/state.js";import{events as Ve}from"@dropins/tools/event-bus.js";const Le=m=>H.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m},H.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square",strokeLinejoin:"round"})),Ie=m=>H.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m},H.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"currentColor"})),ke=({className:m,children:V,variant:T="primary",heading:y,subTotal:d,shipping:e,discounts:g,taxTotal:c,taxesApplied:r,total:n,totalSaved:b,updateLineItems:C=p=>p,...f})=>{const[p,x]=Se(!1),o=Ne({taxesBreakdownTitle:"NegotiableQuote.PriceSummary.taxes.breakdown",taxTotal:"NegotiableQuote.PriceSummary.taxes.total",taxTotalOnly:"NegotiableQuote.PriceSummary.taxes.totalOnly",showTaxBreakdown:"NegotiableQuote.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"NegotiableQuote.PriceSummary.taxes.hideBreakdown",subtotalLabel:"NegotiableQuote.PriceSummary.subTotal.label",subtotalWithTaxes:"NegotiableQuote.PriceSummary.subTotal.withTaxes",subtotalWithoutTaxes:"NegotiableQuote.PriceSummary.subTotal.withoutTaxes",shippingLabel:"NegotiableQuote.PriceSummary.shipping.label",shippingWithTaxes:"NegotiableQuote.PriceSummary.shipping.withTaxes",shippingWithoutTaxes:"NegotiableQuote.PriceSummary.shipping.withoutTaxes",totalLabel:"NegotiableQuote.PriceSummary.total.label",totalWithoutTax:"NegotiableQuote.PriceSummary.total.withoutTax",totalSaved:"NegotiableQuote.PriceSummary.total.saved"}),v=d&&u(s,{label:o.subtotalLabel,price:d.price,classSuffixes:["subTotal"],children:[d.taxIncluded&&t("div",{"data-testid":"sub-total-tax-caption",className:"quote-order-summary__caption",children:t("span",{children:o.subtotalWithTaxes})}),d.taxExcluded?t("div",{"data-testid":"sub-total-tax-caption-excluded",className:"quote-order-summary__caption",children:u("span",{children:[d.priceExcludingTax," ",o.subtotalWithoutTaxes]})}):void 0]},o.subtotalLabel),L=e&&u(s,{label:o.shippingLabel,price:e.price,classSuffixes:["shipping"],children:[e.taxIncluded&&t("div",{"data-testid":"shipping-tax-caption",className:"quote-order-summary__caption",children:t("span",{children:o.shippingWithTaxes})}),e.taxExcluded?t("div",{"data-testid":"shipping-tax-caption-excluded",className:"quote-order-summary__caption",children:u("span",{children:[e.priceExcludingTax," ",o.shippingWithoutTaxes]})}):void 0]},o.shippingLabel),S=g&&g.length>0&&t(_e,{children:g.map(a=>u(s,{label:a.label,price:a.price,classSuffixes:["discount"],children:[a.coupon&&t(M,{node:a.coupon,className:"quote-order-summary__coupon__code"}),a.caption&&t(M,{node:a.caption,className:"quote-order-summary__caption"})]},a.label))}),N=r&&r.length>0?t(Ce,{"data-testid":"tax-breakdown",className:"quote-order-summary__taxes",iconOpen:ve,iconClose:Le,children:u(fe,{ariaLabelTitle:o.taxesBreakdownTitle,title:o.taxesBreakdownTitle,secondaryText:!p&&c?t(M,{node:c.price,className:"quote-order-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:x,children:[t("div",{className:"quote-order-summary__appliedTaxes",children:r.map(a=>t(s,{label:a.label,price:a.price,classSuffixes:["taxEntry"],labelClassSuffix:"muted"},a.label))}),c&&t(s,{label:o.taxTotal,price:c.price,classSuffixes:["taxTotal"],labelClassSuffix:"muted"})]})}):c&&t(s,{label:o.taxTotalOnly,price:c.price,classSuffixes:["taxTotal"],testId:"tax-total-only"}),_=[{key:"subTotalContent",sortOrder:100,content:v},{key:"shippingContent",sortOrder:200,content:L},{key:"discountsContent",sortOrder:600,content:S},{key:"taxContent",sortOrder:800,content:N},...n?[{key:"totalContent",sortOrder:900,content:t(s,{label:o.totalLabel,price:n.price,classSuffixes:["total","total--padded"],testId:"total-content",labelClassSuffix:"bold"})}]:[],...n!=null&&n.priceWithoutTax?[{key:"totalWithoutTaxContent",sortOrder:1e3,content:t(s,{label:o.totalWithoutTax,price:n.priceWithoutTax,classSuffixes:["totalWithoutTax"],testId:"total-without-tax",labelClassSuffix:"muted"})}]:[],...b?[{key:"totalSavedContent",sortOrder:1100,content:t(s,{label:o.totalSaved,price:b,classSuffixes:["saved"],testId:"total-saved",labelClassSuffix:"muted"})}]:[]],E=C(_).sort((a,h)=>a.sortOrder-h.sortOrder);return u("div",{...f,className:Ee(["quote-order-summary",[`quote-order-summary__${T}`,T],m]),children:[u("div",{className:"quote-order-summary__heading",children:[y&&t(M,{node:y,className:"quote-order-summary__heading-text"}),t(we,{variant:"primary",className:"quote-order-summary__divider-primary"})]}),t("div",{className:"quote-order-summary__content",children:E.map(a=>Array.isArray(a.content)?t(Ce,{className:a.className,actionIconPosition:"right",iconOpen:ve,iconClose:Le,children:t(fe,{defaultOpen:!1,title:a.title,renderContentWhenClosed:!1,children:a.content.map(h=>h.content)})},a.key):a.content)})]})},Re=({children:m,initialData:V=null,showTotalSaved:T,updateLineItems:y=e=>e,...d})=>{var o,v,L,S,N,_,E,a,h,I,k,O,P,Q,W,B,A,D,q,U,X,j,z,$,F,R,G,J,K,Y,ee,te,re,ae,oe,ie,ne,le,ce,se,ue,de,me,pe,xe,he,ge,be,Te,ye;const[e,g]=Se(V),c=e==null?void 0:e.isVirtual,{quoteDisplaySettings:r}=He.config,n=!!(r!=null&&r.zeroTax),b=(r==null?void 0:r.subtotal)===Z.TAX_INCLUDED,C=(r==null?void 0:r.subtotal)===Z.TAX_INCLUDED_AND_EXCLUDED,f=(r==null?void 0:r.shipping)===Z.TAX_INCLUDED,p=(r==null?void 0:r.shipping)===Z.TAX_INCLUDED_AND_EXCLUDED;Ze(()=>{const i=Ve.on("quote-management/quote-data",w=>{g(w.quote)},{eager:!0});return()=>{i==null||i.off()}},[]);const x=Ne({free:"NegotiableQuote.PriceSummary.total.free",orderSummary:"NegotiableQuote.PriceSummary.orderSummary",taxToBeDetermined:"NegotiableQuote.PriceSummary.taxToBeDetermined"});return Object.keys(e??{}).length?t(ke,{...d,"data-testid":"quote-order-summary",heading:t("div",{children:x.orderSummary}),updateLineItems:y,subTotal:{taxIncluded:b&&!n,taxExcluded:C,priceExcludingTax:t(l,{"data-testid":"subtotal",amount:(v=(o=e==null?void 0:e.prices)==null?void 0:o.subtotalExcludingTax)==null?void 0:v.value,currency:(S=(L=e==null?void 0:e.prices)==null?void 0:L.subtotalExcludingTax)==null?void 0:S.currency}),price:!n&&b||!n&&C?t(l,{"data-testid":"subtotal",amount:(_=(N=e==null?void 0:e.prices)==null?void 0:N.subtotalIncludingTax)==null?void 0:_.value,currency:(a=(E=e==null?void 0:e.prices)==null?void 0:E.subtotalIncludingTax)==null?void 0:a.currency}):t(l,{"data-testid":"subtotal",amount:(I=(h=e==null?void 0:e.prices)==null?void 0:h.subtotalExcludingTax)==null?void 0:I.value,currency:(O=(k=e==null?void 0:e.prices)==null?void 0:k.subtotalExcludingTax)==null?void 0:O.currency})},shipping:{taxIncluded:f&&!n,taxExcluded:p,priceExcludingTax:t(l,{"data-testid":"shipping",amount:(Q=(P=e==null?void 0:e.prices)==null?void 0:P.shippingExcludingTax)==null?void 0:Q.value,currency:(B=(W=e==null?void 0:e.prices)==null?void 0:W.shippingExcludingTax)==null?void 0:B.currency}),price:!n&&f||!n&&p?t(l,{"data-testid":"shipping",amount:(D=(A=e==null?void 0:e.prices)==null?void 0:A.shippingIncludingTax)==null?void 0:D.value,currency:(U=(q=e==null?void 0:e.prices)==null?void 0:q.shippingIncludingTax)==null?void 0:U.currency}):t(l,{"data-testid":"shipping",amount:(j=(X=e==null?void 0:e.prices)==null?void 0:X.shippingExcludingTax)==null?void 0:j.value,currency:($=(z=e==null?void 0:e.prices)==null?void 0:z.shippingExcludingTax)==null?void 0:$.currency})},discounts:(R=(F=e==null?void 0:e.prices)==null?void 0:F.appliedDiscounts)==null?void 0:R.map(i=>{var w;return{label:i.label,price:t(l,{"data-testid":"summary-discount-total",amount:-i.amount.value,currency:i.amount.currency,sale:!0}),coupon:i!=null&&i.coupon?u("span",{children:[t(Me,{source:Ie,size:"16"}),(w=i==null?void 0:i.coupon)==null?void 0:w.code]}):void 0}}),taxTotal:c&&!((J=(G=e==null?void 0:e.prices)==null?void 0:G.appliedTaxes)!=null&&J.length)?{price:t("span",{"data-testid":"tax-total-tbd",children:x.taxToBeDetermined})}:{price:t(l,{"data-testid":"tax-total-actual",amount:(Y=(K=e==null?void 0:e.prices)==null?void 0:K.totalTax)==null?void 0:Y.value,currency:(te=(ee=e==null?void 0:e.prices)==null?void 0:ee.totalTax)==null?void 0:te.currency})},taxesApplied:c?void 0:r!=null&&r.fullSummary?(ae=(re=e==null?void 0:e.prices)==null?void 0:re.appliedTaxes)==null?void 0:ae.map(i=>({label:i.label,price:t(l,{"data-testid":"applied-taxes",amount:i.amount.value,currency:i.amount.currency})})):void 0,total:{price:((ie=(oe=e==null?void 0:e.prices)==null?void 0:oe.grandTotal)==null?void 0:ie.value)===0?t("span",{"data-testid":"total-including-tax",children:x.free}):t(l,{"data-testid":"total-including-tax-actual",amount:(le=(ne=e==null?void 0:e.prices)==null?void 0:ne.grandTotal)==null?void 0:le.value,currency:(se=(ce=e==null?void 0:e.prices)==null?void 0:ce.grandTotal)==null?void 0:se.currency}),priceWithoutTax:r!=null&&r.grandTotal?((de=(ue=e==null?void 0:e.prices)==null?void 0:ue.grandTotalExcludingTax)==null?void 0:de.value)===0?t("span",{"data-testid":"total-excluding-tax",children:x.free}):t(l,{"data-testid":"total-excluding-tax",amount:(pe=(me=e==null?void 0:e.prices)==null?void 0:me.grandTotalExcludingTax)==null?void 0:pe.value,currency:(he=(xe=e==null?void 0:e.prices)==null?void 0:xe.grandTotalExcludingTax)==null?void 0:he.currency}):void 0},totalSaved:T?t(l,{amount:(be=(ge=e==null?void 0:e.prices)==null?void 0:ge.discount)==null?void 0:be.value,currency:(ye=(Te=e==null?void 0:e.prices)==null?void 0:Te.grandTotal)==null?void 0:ye.currency}):void 0}):null};export{Re as OrderSummary,Re as default};
|
|
4
4
|
//# sourceMappingURL=OrderSummary.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{O as s,O as u}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */export{s as OrderSummaryLine,u as default};
|
|
4
4
|
//# sourceMappingURL=OrderSummaryLine.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{Q as f,Q as u}from"../chunks/QuoteCommentsList3.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/QuoteCommentsList.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"../chunks/dateUtils.js";export{f as QuoteCommentsList,u as default};
|
|
4
4
|
//# sourceMappingURL=QuoteCommentsList.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{Q as f,Q as u}from"../chunks/QuoteHistoryLog3.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"../chunks/QuoteHistoryLog.js";import"@dropins/tools/lib.js";import"../chunks/dateUtils.js";/* empty css */import"@dropins/tools/i18n.js";export{f as QuoteHistoryLog,u as default};
|
|
4
4
|
//# sourceMappingURL=QuoteHistoryLog.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as i,jsxs as f,Fragment as k}from"@dropins/tools/preact-jsx-runtime.js";import*as S from"@dropins/tools/preact-compat.js";import{useState as A,useEffect as ie,useCallback as oe}from"@dropins/tools/preact-compat.js";import{Divider as $,Skeleton as ce,SkeletonRow as ue,Price as Q,Image as le,Button as se,CartList as de,Accordion as me,AccordionSection as ge,CartItem as ye}from"@dropins/tools/components.js";import{classes as v,VComponent as E,Slot as s}from"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */import{Q as _,s as he}from"../chunks/state.js";import{events as pe}from"@dropins/tools/event-bus.js";import{S as ve}from"../chunks/ChevronDown.js";import{useText as fe}from"@dropins/tools/i18n.js";const _e=e=>S.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},S.createElement("g",{id:"Large"},S.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),S.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},S.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),j=({className:e,children:n,heading:t,footer:a,products:o,outOfStockMessage:r,loading:l=!0,variant:d="primary",...m})=>i("div",{...m,className:v(["quote-management-quote-summary-list",e,`quote-management-quote-summary-list__background--${d}`]),children:l?i(be,{}):f(k,{children:[(t||r)&&f("div",{"data-testid":"quote-summary-list-heading-wrapper",className:v(["quote-management-quote-summary-list__heading",["quote-management-quote-summary-list__heading--full-width",!o]]),children:[t&&f(k,{children:[i(E,{node:t,className:"quote-management-quote-summary-list__heading-text"}),i($,{variant:"primary",className:v(["quote-management-quote-summary-list__heading-divider"])})]}),r&&i(E,{node:r,className:"quote-management-quote-summary-list__out-of-stock-message"})]}),i("div",{className:v(["quote-management-quote-summary-list__content"]),children:o}),a&&f(k,{children:[i($,{variant:"primary",className:v(["quote-management-quote-summary-list__footer-divider"])}),i(E,{node:a,className:"quote-management-quote-summary-list__footer-text"})]})]})}),be=()=>i(ce,{"data-testid":"quote-summary-list-skeleton",className:"quote-management-quote-summary-list__skeleton",rowGap:"medium",children:i(ue,{variant:"row",size:"xlarge",fullWidth:!0,lines:3,multilineGap:"small"})}),xe=()=>{const[e,n]=A(void 0),[t,a]=A(!0);return ie(()=>{const o=pe.on("quote-management/quote-data",r=>{const{quote:l}=r;l&&(n(l),a(!1))},{eager:!0});return()=>o==null?void 0:o.off()},[]),{quoteData:e,loading:t}},F=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===_.TAX_INCLUDED?e.discounted?{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.priceIncludingTax.value,currency:e.prices.priceIncludingTax.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},B=e=>{var n,t;return{amount:(n=e.savingsAmount)==null?void 0:n.value,currency:(t=e.savingsAmount)==null?void 0:t.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},z=(e,n)=>{var o,r,l,d,m,b,x,C,u,h,p,q;const t={"aria-label":n.dictionary.regularPrice},a=e.discounted?{}:null;return((o=n.quoteDisplaySettings)==null?void 0:o.price)===_.TAX_INCLUDED||((r=n.quoteDisplaySettings)==null?void 0:r.price)===_.TAX_INCLUDED_AND_EXCLUDED?(t.amount=(l=e.prices.rowTotalIncludingTax)==null?void 0:l.value,t.currency=(d=e.prices.rowTotalIncludingTax)==null?void 0:d.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="including-tax-item-total",a&&(t.amount=(m=e.prices.originalRowTotal)==null?void 0:m.value,t.currency=(b=e.prices.originalRowTotal)==null?void 0:b.currency,a.amount=(x=e.prices.rowTotalIncludingTax)==null?void 0:x.value,a.currency=(C=e.prices.rowTotalIncludingTax)==null?void 0:C.currency,a.sale=!0,a["aria-label"]=n.dictionary.discountedPrice,a["data-testid"]="discount-total")):(t.amount=(u=e.prices.originalRowTotal)==null?void 0:u.value,t.currency=(h=e.prices.originalRowTotal)==null?void 0:h.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="regular-item-total",a&&(a.amount=(p=e.discountedTotal)==null?void 0:p.value,a.currency=(q=e.discountedTotal)==null?void 0:q.currency,a.sale=!0,a["aria-label"]=n.dictionary.discountedPrice,a["data-testid"]="discount-total")),{totalProps:t,discountProps:a}},Ie=e=>{const n=e==null?void 0:e.map(a=>({label:a.label,value:a.values.map(o=>o.label).join(", ")})),t={};return n==null||n.forEach(a=>{t[a.label]=a.value}),Object.keys(t).length>0?t:null},Te=e=>{const n=e==null?void 0:e.map(a=>({label:a.optionLabel,value:a.valueLabel})),t={};return n==null||n.forEach(a=>{t[a.label]=a.value}),Object.keys(t).length>0?t:null},Se=e=>{const n=e==null?void 0:e.map(a=>({label:a.label,type:a.type,values:a.values.map(o=>({label:o.label,value:o.value}))})),t={};return n==null||n.forEach(a=>{var o;switch(a.type){case"field":case"area":case"date_time":t[a.label]=a.values[0].value;break;case"radio":case"drop_down":t[a.label]=a.values[0].label;break;case"multiple":case"checkbox":t[a.label]=a.values.reduce((r,l)=>r?`${r}, ${l.label}`:l.label,"");break;case"file":{const r=new DOMParser,l=a.values[0].value,m=((o=r.parseFromString(l,"text/html").querySelector("a"))==null?void 0:o.textContent)||"";t[a.label]=m;break}}}),t},Qe=4,G=(e,n,t)=>{var r;if(t.attributesToHide.includes("image"))return;const a={loading:n<Qe?"eager":"lazy",src:e.image.src,alt:e.image.alt,width:"300",height:"300",params:{width:300}},o=i(le,{"data-testid":"quote-summary-list-item-image",...a});return i(s,{name:"Thumbnail",slot:(r=t.slots)==null?void 0:r.Thumbnail,context:{item:e,defaultImageProps:a},children:t.routeProduct?i("a",{href:t.routeProduct(e),children:o}):o})},V=(e,n)=>{if(!n.attributesToHide.includes("name"))return i("span",{"data-testid":"quote-summary-list-item-title",children:n.routeProduct?i("a",{href:n.routeProduct(e),children:e.product.name}):e.product.name})},W=e=>i("span",{"data-testid":"quote-summary-list-item-sku",children:e.product.sku}),Y=(e,n)=>{var t;return i(s,{name:"ProductAttributes",slot:(t=n.slots)==null?void 0:t.ProductAttributes,context:{item:e}})},H=(e,n)=>{if(n.attributesToHide.includes("configurations"))return;const t={...Ie(e.bundleOptions),...Te(e.configurableOptions),...Se(e.customizableOptions),...e.links&&e.links.count?e.links.count>1?{[n.dictionary.files.replace("{count}",e.links.count.toString())]:e.links.result}:{[n.dictionary.file.replace("{count}",e.links.count.toString())]:e.links.result}:null};if(Object.keys(t).length!==0)return t},J=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===_.TAX_INCLUDED_AND_EXCLUDED?i(Q,{amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":n.dictionary.regularPrice}):void 0},Ue=({hideHeading:e,hideFooter:n,routeProduct:t,showMaxItems:a=!0,attributesToHide:o=[],slots:r,accordion:l=!1,variant:d="primary",showDiscount:m,showSavings:b,...x})=>{const{quoteData:u,loading:h}=xe(),[p,q]=A(a),{quoteDisplaySettings:g,quoteSummaryMaxItems:K}=he.config,N=K||5,y=fe({discountedPrice:"NegotiableQuote.QuoteSummaryList.discountedPrice",discountPercentage:"NegotiableQuote.QuoteSummaryList.discountPercentage",editQuote:"NegotiableQuote.QuoteSummaryList.editQuote",file:"NegotiableQuote.QuoteSummaryList.file",files:"NegotiableQuote.QuoteSummaryList.files",heading:"NegotiableQuote.QuoteSummaryList.heading",listOfQuoteItems:"NegotiableQuote.QuoteSummaryList.listOfQuoteItems",regularPrice:"NegotiableQuote.QuoteSummaryList.regularPrice",savingsAmount:"NegotiableQuote.QuoteSummaryList.savingsAmount",viewMore:"NegotiableQuote.QuoteSummaryList.viewMore"}),Z=oe(()=>{q(c=>!c)},[]),I={attributesToHide:o,routeProduct:t,slots:r,dictionary:y,quoteDisplaySettings:g},w={dictionary:y,quoteDisplaySettings:g},L=c=>i(s,{name:"Footer",slot:r==null?void 0:r.Footer,context:{item:c}}),ee=()=>u!=null&&u.totalQuantity?u.items.map((c,U)=>{const{totalProps:re,discountProps:X}=z(c,w),ne=i(ye,{loading:h,"data-testid":`quote-summary-list-item-entry-${c.uid}`,image:G(c,U,I),title:i(s,{name:"ItemTitle",slot:r==null?void 0:r.ItemTitle,context:{item:c},children:V(c,I)}),sku:o.includes("sku")?void 0:i(s,{name:"ItemSku",slot:r==null?void 0:r.ItemSku,context:{item:c},children:W(c)}),price:o.includes("price")?void 0:i(s,{name:"ItemPrice",slot:r==null?void 0:r.ItemPrice,context:{item:c},slotTag:"span",children:i(Q,{...F(c,w)})}),quantity:o.includes("quantity")?void 0:c.quantity,total:f(k,{children:[o.includes("total")?void 0:i(s,{name:"ItemTotal",slot:r==null?void 0:r.ItemTotal,context:{item:c},children:i(Q,{...re})}),o.includes("totalDiscount")?void 0:X&&i(s,{name:"ItemTotal",slot:r==null?void 0:r.ItemTotal,context:{item:c},children:i(Q,{...X})})]}),attributes:Y(c,I),configurations:H(c,I),totalExcludingTax:o.includes("totalExcludingTax")?void 0:J(c,I),taxIncluded:(g==null?void 0:g.price)===_.TAX_INCLUDED,taxExcluded:!o.includes("totalExcludingTax")&&(g==null?void 0:g.price)===_.TAX_INCLUDED_AND_EXCLUDED,discount:m&&c.discounted&&c.discountPercentage!==void 0?i("div",{"data-testid":"item-discount-percentage",children:y.discountPercentage.replace("{discount}",c.discountPercentage.toString())}):void 0,savings:b&&c.discounted&&c.savingsAmount!==void 0?f("div",{children:[i("span",{children:i(Q,{...B(c)})})," ",y.savingsAmount]}):void 0,footer:L(c)},c.uid);return i(s,{name:"CartItem",slot:r==null?void 0:r.QuoteItem,context:{item:c,index:U,loading:h,attributesToHide:o,quoteDisplaySettings:g,showDiscount:m,showSavings:b,dictionary:y,getImage:G,getTitle:V,getSku:W,getPriceProps:F,getTotalPriceProps:z,getProductAttributes:Y,getConfigurations:H,getTotalExcludingTax:J,getFooter:L,getSavingsAmount:B},children:ne},c.uid)}):null,O=i(s,{name:"Heading",slot:r==null?void 0:r.Heading,context:{count:(u==null?void 0:u.totalQuantity)??0,quoteId:u==null?void 0:u.uid},children:i("div",{"data-testid":"default-quote-summary-list-heading",children:y.heading.replace("({count})",u!=null&&u.totalQuantity?`(${u==null?void 0:u.totalQuantity.toString()})`:"")})}),M=O.props.children.props.children,P=ee(),T=(u==null?void 0:u.items.length)||0,te=p?Math.min(T,N):T,ae=T>te,D=u!=null&&u.totalQuantity&&P?i(s,{name:"Footer",slot:r==null?void 0:r.QuoteSummaryFooter,context:{displayMaxItems:p},"data-testid":"quote-summary-list-footer-slot",className:"quote-management-quote-summary-list-footer",children:ae?i(se,{className:"quote-management-quote-summary-list-footer__action",onClick:Z,"data-testid":"view-more-items-button",variant:"tertiary",children:y.viewMore}):null}):null,R=u!=null&&u.totalQuantity?i(de,{"data-testid":"quote-summary-list",children:P==null?void 0:P.slice(0,p?Math.min(T,N):T)}):null;return l?i(me,{"data-testid":"quote-summary-list-accordion",className:v(["quote-management-quote-summary-list-accordion",`quote-management-quote-summary-list__background--${d}`]),iconOpen:_e,iconClose:ve,children:i(ge,{title:M,ariaLabelTitle:M,"data-testid":"quote-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:i(j,{...x,"aria-expanded":!0,"aria-label":y.listOfQuoteItems,className:"quote-management-quote-summary-list-accordion__list",footer:n?void 0:D,products:R,outOfStockMessage:void 0,loading:h,variant:d})})}):i(j,{...x,heading:e?void 0:O,footer:n?void 0:D,products:R,outOfStockMessage:void 0,loading:h,variant:d})};export{Ue as QuoteSummaryList,Ue as default};
|
|
4
4
|
//# sourceMappingURL=QuoteSummaryList.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{Q as f,Q as l}from"../chunks/QuoteTemplateCommentsList.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/QuoteCommentsList.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"../chunks/dateUtils.js";export{f as QuoteTemplateCommentsList,l as default};
|
|
4
4
|
//# sourceMappingURL=QuoteTemplateCommentsList.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{Q as f,Q as l}from"../chunks/QuoteTemplateHistoryLog.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"../chunks/QuoteHistoryLog.js";import"@dropins/tools/lib.js";import"../chunks/dateUtils.js";/* empty css */import"@dropins/tools/i18n.js";export{f as QuoteTemplateHistoryLog,l as default};
|
|
4
4
|
//# sourceMappingURL=QuoteTemplateHistoryLog.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as m,jsx as t,Fragment as ie}from"@dropins/tools/preact-jsx-runtime.js";import{useState as d,useEffect as ce,createPortal as le}from"@dropins/tools/preact-compat.js";import{classes as se,Slot as s}from"@dropins/tools/lib.js";import{Table as de,IllustratedMessage as ue,Picker as ge,Pagination as me,InLineAlert as R,Icon as A,Button as j,Price as pe}from"@dropins/tools/components.js";import{events as Qe}from"@dropins/tools/event-bus.js";/* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{f as D}from"../chunks/dateUtils.js";import{useText as $}from"@dropins/tools/i18n.js";import{C as he}from"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import{g as W}from"../chunks/transform-quote.js";import"../chunks/state.js";import{g as fe}from"../chunks/getQuoteTemplates.js";import{g as Me}from"../chunks/generateQuoteFromTemplate.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-quote-template.js";const be=({rowData:p=[],loading:Q=!1,className:x,emptyStateMessage:S,showItemRange:z=!0,itemRangeMessage:u,showPageSizePicker:h=!0,pageSizePickerMessage:g,showPagination:i=!0,paginationMessage:P,...l})=>{const o=$({name:"QuoteManagement.QuoteTemplatesListTable.name",state:"QuoteManagement.QuoteTemplatesListTable.state",status:"QuoteManagement.QuoteTemplatesListTable.status",validUntil:"QuoteManagement.QuoteTemplatesListTable.validUntil",minQuoteTotal:"QuoteManagement.QuoteTemplatesListTable.minQuoteTotal",ordersPlaced:"QuoteManagement.QuoteTemplatesListTable.ordersPlaced",lastOrdered:"QuoteManagement.QuoteTemplatesListTable.lastOrdered",actions:"QuoteManagement.QuoteTemplatesListTable.actions"}),y=[{key:"name",label:o.name},{key:"state",label:o.state},{key:"status",label:o.status},{key:"validUntil",label:o.validUntil},{key:"minQuoteTotal",label:o.minQuoteTotal},{key:"ordersPlaced",label:o.ordersPlaced},{key:"lastOrdered",label:o.lastOrdered},{key:"actions",label:o.actions}],q=Q||p.length>0,f=!Q&&p.length===0&&S,M=z&&u,b=h&&g,T=i&&P,v=M||b||T;return m("div",{...l,className:se(["quote-management-quote-templates-list-table",x]),children:[q&&t(de,{columns:y,rowData:p,loading:Q,mobileLayout:"none",className:"quote-management-quote-templates-list-table__table"}),f&&t("div",{className:"quote-templates-list-table__empty-state",children:S}),v&&m("div",{className:"quote-templates-list-table__footer",children:[t("div",{className:"quote-templates-list-table__item-range",children:M&&u}),t("div",{className:"quote-templates-list-table__pagination",children:T&&P}),t("div",{className:"quote-templates-list-table__page-size-picker",children:b&&g})]})]})},Ue=({pageSize:p,showItemRange:Q=!0,showPageSizePicker:x=!0,showPagination:S=!0,onViewQuoteTemplate:z,onGenerateQuoteFromTemplate:u,onPageSizeChange:h,onPageChange:g,slots:i,...P})=>{const l=$({view:"QuoteManagement.QuoteTemplatesListTable.view",generateQuote:"NegotiableQuoteTemplate.Manage.actionButtons.generateQuote",generateQuoteModalMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.message",generateQuoteModalCancel:"NegotiableQuoteTemplate.Manage.confirmationModal.cancel",generateQuoteModalConfirm:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirm",generateQuoteModalConfirmLoading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirmLoading",generateQuoteModalSuccessHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successHeading",generateQuoteSuccessMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successDescription",generateQuoteModalErrorHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorHeading",generateQuoteErrorFallback:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorFallback"}),[o,y]=d(null),[q,f]=d(!0),[M,b]=d(!1),[T,v]=d(!1),[I,O]=d(null),[_,N]=d(""),[w,k]=d(""),J=W()[0],[E,K]=d(p||J),[G,F]=d(1);ce(()=>{const n=async()=>{try{f(!0);const c=await fe({pageSize:E,currentPage:G});y(c)}catch(c){console.error("Failed to fetch quote templates:",c)}finally{f(!1)}},e=Qe.on("authenticated",c=>{c?n():(y(null),f(!1))},{eager:!0});return()=>{e==null||e.off()}},[E,G]);const U=n=>{K(n),F(1),h==null||h(n)},H=n=>{F(n),g==null||g(n)},X=n=>{const e=n.target,c=e==null?void 0:e.value;c&&U(Number(c))},Y=(n,e)=>{O({id:n,name:e}),N(""),k(""),b(!0)},Z=async n=>{v(!0),N(""),k("");try{const e=await Me({templateId:n.id});N(l.generateQuoteSuccessMessage),u==null||u(n.id,n.name,e.quoteId)}catch(e){console.error("Failed to generate quote from template:",e);const c=e instanceof Error?e.message:l.generateQuoteErrorFallback;k(c)}finally{v(!1)}},V=()=>{b(!1),O(null),N(""),k("")},ee=(n,e,c)=>n.filter(a=>a==null?void 0:a.uid).map(a=>{var B;return{id:a.id,name:t(s,{name:"Name",slot:e==null?void 0:e.Name,context:{template:a},children:t("span",{children:a.name})}),state:t(s,{name:"State",slot:e==null?void 0:e.State,context:{template:a},children:t("span",{style:{textTransform:"capitalize"},children:((B=a.state)==null?void 0:B.replace(/_/g," "))||"-"})}),status:t(s,{name:"Status",slot:e==null?void 0:e.Status,context:{template:a},children:t("span",{children:a.status})}),validUntil:t(s,{name:"ValidUntil",slot:e==null?void 0:e.ValidUntil,context:{template:a},children:t("span",{children:D(a.expirationDate,"short")})}),minQuoteTotal:t(s,{name:"MinQuoteTotal",slot:e==null?void 0:e.MinQuoteTotal,context:{template:a},children:t(pe,{amount:a.prices.minNegotiatedGrandTotal.value,currency:a.prices.minNegotiatedGrandTotal.currency})}),ordersPlaced:t(s,{name:"OrdersPlaced",slot:e==null?void 0:e.OrdersPlaced,context:{template:a},children:t("span",{children:a.ordersPlaced})}),lastOrdered:t(s,{name:"LastOrdered",slot:e==null?void 0:e.LastOrdered,context:{template:a},children:t("span",{children:D(a.lastOrderedAt,"short")})}),actions:m(s,{name:"Actions",slot:e==null?void 0:e.Actions,context:{template:a,onViewQuoteTemplate:c},className:"quote-management-quote-templates-list-table__actions-cell",children:[t(j,{variant:"tertiary",size:"medium",onClick:()=>c==null?void 0:c(a.id,a.name,a.status),children:l.view}),a.canGenerateQuoteFromTemplate&&t(j,{variant:"primary",size:"medium",onClick:()=>Y(a.id,a.name),"data-testid":`generate-quote-button-${a.id}`,children:l.generateQuote})]})}}),te=o!=null&&o.items?ee(o.items,i,z):[],r=o!=null&&o.paginationInfo?{...o.paginationInfo,pageSizeOptions:W()}:void 0,C=!!r,ae=t(s,{name:"EmptyTemplates",slot:i==null?void 0:i.EmptyTemplates,context:{templatesData:o},children:t(ue,{heading:"No Quote Templates Found"})}),ne=r?t(s,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:r,children:m("span",{children:["Items ",r.startItem," to ",r.endItem," of"," ",r.totalCount," total"]})}):void 0,oe=r&&r.pageSizeOptions?m(s,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:r.pageSize,pageSizeOptions:r.pageSizeOptions,onPageSizeChange:U},children:[t("span",{children:"Show "}),t(ge,{variant:"primary",size:"medium",value:String(r.pageSize),options:r.pageSizeOptions.map(n=>({value:String(n),text:String(n)})),handleSelect:X}),t("span",{children:" per page"})]}):void 0,re=r?t(s,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:r.currentPage,totalPages:r.totalPages,onChange:H},children:t(me,{currentPage:r.currentPage,totalPages:r.totalPages,onChange:H})}):void 0;let L=null;return _?L=t(R,{type:"success",variant:"primary",icon:t(A,{source:"CheckWithCircle"}),heading:l.generateQuoteModalSuccessHeading,description:_,"data-testid":"generate-quote-success-banner"}):w&&(L=t(R,{type:"error",variant:"primary",icon:t(A,{source:"WarningFilled"}),heading:l.generateQuoteModalErrorHeading,description:w,"data-testid":"generate-quote-error-banner"})),m(ie,{children:[t(be,{rowData:te,loading:q,className:P.className,emptyStateMessage:ae,showItemRange:Q&&C,itemRangeMessage:ne,showPageSizePicker:x&&C,pageSizePickerMessage:oe,showPagination:S&&C,paginationMessage:re}),M&&le(t(he,{open:M,title:l.generateQuote,message:l.generateQuoteModalMessage,cancelLabel:l.generateQuoteModalCancel,confirmLabel:T?l.generateQuoteModalConfirmLoading:l.generateQuoteModalConfirm,onCancel:V,onConfirm:T||!I?void 0:()=>Z(I),showCloseButton:!L,confirmationBanner:L,"data-testid":"generate-quote-confirmation-modal"}),document.body)]})};export{Ue as QuoteTemplatesListTable,Ue as default};
|
|
4
4
|
//# sourceMappingURL=QuoteTemplatesListTable.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as N,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as P,useEffect as A}from"@dropins/tools/preact-compat.js";import{classes as J,Slot as o}from"@dropins/tools/lib.js";import{Table as K,IllustratedMessage as W,Picker as X,Pagination as Y,Button as Z,Price as q}from"@dropins/tools/components.js";import{events as U}from"@dropins/tools/event-bus.js";/* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{f as C}from"../chunks/dateUtils.js";import{useText as V}from"@dropins/tools/i18n.js";/* empty css *//* empty css */import{g as ee}from"../chunks/transform-quote.js";import"../chunks/state.js";import{n as O}from"../chunks/negotiableQuotes.js";import"@dropins/tools/fetch-graphql.js";const te=({rowData:p=[],loading:g=!1,className:v,emptyStateMessage:b,showItemRange:x=!0,itemRangeMessage:u,showPageSizePicker:h=!0,pageSizePickerMessage:i,showPagination:z=!0,paginationMessage:m,...f})=>{const l=V({quoteName:"QuoteManagement.QuotesListTable.quoteName",created:"QuoteManagement.QuotesListTable.created",createdBy:"QuoteManagement.QuotesListTable.createdBy",status:"QuoteManagement.QuotesListTable.status",lastUpdated:"QuoteManagement.QuotesListTable.lastUpdated",quoteTemplate:"QuoteManagement.QuotesListTable.quoteTemplate",quoteTotal:"QuoteManagement.QuotesListTable.quoteTotal",actions:"QuoteManagement.QuotesListTable.actions"}),y=[{key:"quoteName",label:l.quoteName},{key:"created",label:l.created},{key:"createdBy",label:l.createdBy},{key:"status",label:l.status},{key:"lastUpdated",label:l.lastUpdated},{key:"quoteTemplate",label:l.quoteTemplate},{key:"quoteTotal",label:l.quoteTotal},{key:"actions",label:l.actions}],k=g||p.length>0,s=!g&&p.length===0&&b,T=x&&u,d=h&&i,S=z&&m,Q=T||d||S;return N("div",{...f,className:J(["quote-management-quotes-list-table",v]),children:[k&&t(K,{columns:y,rowData:p,loading:g,mobileLayout:"none",className:"quote-management-quotes-list-table__table"}),s&&t("div",{className:"quotes-list-table__empty-state",children:b}),Q&&N("div",{className:"quotes-list-table__footer",children:[t("div",{className:"quotes-list-table__item-range",children:T&&u}),t("div",{className:"quotes-list-table__pagination",children:S&&m}),t("div",{className:"quotes-list-table__page-size-picker",children:d&&i})]})]})},Se=({pageSize:p,showItemRange:g=!0,showPageSizePicker:v=!0,showPagination:b=!0,onViewQuote:x,onPageSizeChange:u,onPageChange:h,slots:i,...z})=>{const[m,f]=P(null),[l,y]=P(!0),k=ee()[0],[s,T]=P(p||k),[d,S]=P(1);A(()=>{const c=async()=>{try{y(!0);const r=await O({pageSize:s,currentPage:d});f(r)}catch(r){console.error("Failed to fetch quotes:",r)}finally{y(!1)}},e=U.on("authenticated",r=>{r?c():(f(null),y(!1))},{eager:!0});return()=>{e==null||e.off()}},[s,d]),A(()=>{const c=async()=>{try{const r=await O({pageSize:s,currentPage:d});f(r)}catch(r){console.error("Failed to fetch quotes:",r)}},e=U.on("quote-management/quote-renamed",()=>{c()},{eager:!0});return()=>{e==null||e.off()}},[s,d]);const Q=c=>{T(c),S(1),u==null||u(c)},_=c=>{S(c),h==null||h(c)},R=c=>{const e=c.target,r=e==null?void 0:e.value;r&&Q(Number(r))},E=(c,e,r)=>c.filter(a=>a==null?void 0:a.uid).map(a=>{var I,B,M,w;const H=`${a.buyer.firstname} ${a.buyer.lastname}`;return{id:a.uid,quoteName:t(o,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quote:a},children:t("span",{children:a.name})}),created:t(o,{name:"Created",slot:e==null?void 0:e.Created,context:{quote:a},children:t("span",{children:a.createdAt?C(a.createdAt,"short"):"N/A"})}),createdBy:t(o,{name:"CreatedBy",slot:e==null?void 0:e.CreatedBy,context:{quote:a},children:t("span",{children:H})}),status:t(o,{name:"Status",slot:e==null?void 0:e.Status,context:{quote:a},children:t("span",{children:a.status})}),lastUpdated:t(o,{name:"LastUpdated",slot:e==null?void 0:e.LastUpdated,context:{quote:a},children:t("span",{children:a.updatedAt?C(a.updatedAt,"short"):"N/A"})}),quoteTemplate:t(o,{name:"QuoteTemplate",slot:e==null?void 0:e.QuoteTemplate,context:{quote:a},children:t("span",{children:a.templateName})}),quoteTotal:t(o,{name:"QuoteTotal",slot:e==null?void 0:e.QuoteTotal,context:{quote:a},children:t(q,{amount:(B=(I=a.prices)==null?void 0:I.grandTotal)==null?void 0:B.value,currency:(w=(M=a.prices)==null?void 0:M.grandTotal)==null?void 0:w.currency})}),actions:t(o,{name:"Actions",slot:e==null?void 0:e.Actions,context:{quote:a,onViewQuote:r},children:t(Z,{variant:"tertiary",size:"medium",onClick:()=>r==null?void 0:r(a.uid,a.name,a.status),children:"View"})})}}),F=m!=null&&m.items?E(m.items,i,x):[],n=m==null?void 0:m.paginationInfo,L=!!n,$=t(o,{name:"EmptyQuotes",slot:i==null?void 0:i.EmptyQuotes,context:{quotesData:m},children:t(W,{heading:"No Quotes Found"})}),j=n?t(o,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:n,children:N("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,D=n&&n.pageSizeOptions?N(o,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:Q},children:[t("span",{children:"Show "}),t(X,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(c=>({value:String(c),text:String(c)})),handleSelect:R}),t("span",{children:" per page"})]}):void 0,G=n?t(o,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_},children:t(Y,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_})}):void 0;return t(te,{rowData:F,loading:l,className:z.className,emptyStateMessage:$,showItemRange:g&&L,itemRangeMessage:j,showPageSizePicker:v&&L,pageSizePickerMessage:D,showPagination:b&&L,paginationMessage:G})};export{Se as QuotesListTable,Se as default};
|
|
4
4
|
//# sourceMappingURL=QuotesListTable.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as K,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as x,useEffect as L,useCallback as G}from"@dropins/tools/preact-compat.js";import{classes as c,VComponent as N,Slot as b,getFormErrors as J,getFormValues as me}from"@dropins/tools/lib.js";import{TextArea as ce,Field as de,Input as le,InputFile as fe,Button as T,InLineAlert as qe}from"@dropins/tools/components.js";/* empty css */import{events as U}from"@dropins/tools/event-bus.js";import{r as H}from"../chunks/requestNegotiableQuote.js";import"../chunks/state.js";import{u as ge}from"../chunks/uploadFile.js";import{v as he,f as Ne,a as be,S as pe,A as ve}from"../chunks/AttachedFilesList.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */import{S as Fe}from"../chunks/CheckWithCircle.js";import{S as Qe}from"../chunks/WarningFilled.js";import{useText as Re}from"@dropins/tools/i18n.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";const xe=({className:S,title:t,banner:B,commentField:D,quoteNameField:C,attachFile:d,attachedFilesList:p,requestButton:z,saveButton:v,onSubmit:_,...g})=>K("form",{...g,className:c(["request-negotiable-quote-form",S]),onSubmit:_,children:[B&&a(N,{node:B,className:c(["request-negotiable-quote-form__banner"])}),t&&a(N,{node:t,className:c(["request-negotiable-quote-form__title"])}),D&&a(N,{node:D,className:c(["request-negotiable-quote-form__comment-field"])}),C&&a(N,{node:C,className:c(["request-negotiable-quote-form__quote-name-field"])}),d&&a(N,{node:d,className:c(["request-negotiable-quote-form__attach-file-field"])}),p&&a(N,{node:p,className:c(["request-negotiable-quote-form__attached-files-list"])}),K("div",{className:c(["request-negotiable-quote-form__actions"]),children:[z&&a(N,{node:z,className:c(["request-negotiable-quote-form__request-button"])}),v&&a(N,{node:v,className:c(["request-negotiable-quote-form__save-button"])})]})]}),We=({cartId:S,slots:t,onRequestNegotiableQuote:B,onSaveNegotiableQuote:D,onAttachFiles:C,onSubmitErrors:d,onError:p,className:z,maxFiles:v,maxFileSize:_,acceptedFileTypes:g})=>{const[w,X]=x(void 0),[P,Y]=x(void 0),[F,E]=x([]),[y,k]=x(void 0),[h,u]=x({}),[j,Z]=x(void 0),[i,l]=x(!1),n=Re({title:"NegotiableQuote.Request.title",comment:"NegotiableQuote.Request.comment",commentError:"NegotiableQuote.Request.commentError",quoteName:"NegotiableQuote.Request.quoteName",quoteNameError:"NegotiableQuote.Request.quoteNameError",attachmentsError:"NegotiableQuote.Request.attachmentsError",maxFilesExceeded:"NegotiableQuote.Request.maxFilesExceeded",maxFileSizeExceeded:"NegotiableQuote.Request.maxFileSizeExceeded",invalidFileType:"NegotiableQuote.Request.invalidFileType",requestCta:"NegotiableQuote.Request.requestCta",saveDraftCta:"NegotiableQuote.Request.saveDraftCta",errorHeader:"NegotiableQuote.Request.error.header",unauthenticated:"NegotiableQuote.Request.error.unauthenticated",unauthorized:"NegotiableQuote.Request.error.unauthorized",missingCart:"NegotiableQuote.Request.error.missingCart",successHeader:"NegotiableQuote.Request.success.header",submitSuccess:"NegotiableQuote.Request.success.submitted",draftSuccess:"NegotiableQuote.Request.success.draftSaved"});L(()=>{const e=U.on("quote-management/permissions",o=>{k(void 0),o.requestQuote?l(!1):(k(n.unauthorized),l(!0))},{eager:!0});return()=>e==null?void 0:e.off()},[n.unauthorized]),L(()=>{const e=U.on("authenticated",o=>{k(void 0),o?l(!1):(k(n.unauthenticated),l(!0))},{eager:!0});return()=>e==null?void 0:e.off()},[n.unauthenticated]),L(()=>{S||(k(n.missingCart),l(!0))},[S,n.missingCart]),L(()=>{y&&(p==null||p({error:y,isFormDisabled:i,setIsFormDisabled:l}))},[y,p,i]);const V=G(async e=>{var s;if(!(e!=null&&e.length))return;if(v&&F.length+e.length>v){u(r=>({...r,attachments:n.maxFilesExceeded.replace("{maxFiles}",String(v))}));return}for(const r of e){if(_&&!he(r.size,_)){u(m=>({...m,attachments:n.maxFileSizeExceeded.replace("{maxSize}",Ne(_))}));return}if(g&&!be(r.type,g)){u(m=>({...m,attachments:n.invalidFileType}));return}}if(u(r=>{const{attachments:m,...f}=r;return f}),C){(s=C(e))==null||s.catch(()=>{u(r=>({...r,attachments:n.attachmentsError}))});return}const o=e.map(r=>({key:`temp-${Date.now()}-${Math.random()}-${r.name}`,name:r.name,size:r.size,status:"uploading"}));E(r=>[...r,...o]);for(let r=0;r<e.length;r++){const m=e[r],f=o[r].key;try{const Q=await ge(m);E(R=>R.map(q=>q.key===f?{...q,key:Q.key,status:"success"}:q))}catch(Q){u(R=>({...R,attachments:Q.message})),E(R=>R.map(q=>q.key===f?{...q,status:"error",error:Q.message}:q))}}},[C,n,v,_,g,F]),I=G(e=>{E(o=>o.filter(s=>s.key!==e))},[]),ee=()=>{let e,o;if(j?(o={name:"SuccessBanner",slot:t==null?void 0:t.SuccessBanner,context:{message:j},"data-testid":"form-success-banner"},e={type:"success",variant:"primary",icon:a(Fe,{}),heading:n.successHeader,description:j,className:"request-negotiable-quote-form__success-banner"}):y&&(o={name:"ErrorBanner",slot:t==null?void 0:t.ErrorBanner,context:{message:y},"data-testid":"form-error-banner"},e={type:"error",variant:"primary",icon:a(Qe,{}),heading:n.errorHeader,description:y,className:"request-negotiable-quote-form__error-banner"}),o&&e)return a(b,{...o,children:a(qe,{...e})})},O=e=>{u({});const o=e.target.closest("form"),s=J(o);Object.keys(s).length>0&&(u(s),d==null||d(s))},te=e=>{var W;e.preventDefault(),l(!0);const o=e.target,r={...J(o),...h};if(Object.keys(r).length>0){d==null||d(r);return}const m=e.submitter,f=me(o);X(f.comment),Y(f.quoteName);const Q=((W=m==null?void 0:m.dataset)==null?void 0:W.draft)==="true"||!1,R=F.filter(A=>A.status==="success").map(A=>({key:A.key})),q={cartId:S,quoteName:f.quoteName,comment:f.comment,attachments:R,isDraft:Q};let M,$;Q?(M=D??H,$=n.draftSuccess):(M=B??H,$=n.submitSuccess),M(q).then(()=>{Z($)}).catch(A=>{k(A.message)})},ae=a(b,{name:"Title",slot:t==null?void 0:t.Title,context:{text:n.title},children:a("span",{"data-testid":"form-title",children:n.title})}),re=a(b,{name:"CommentField",slot:t==null?void 0:t.CommentField,context:{value:w,required:!0,errorMessage:h.comment,setFormErrors:u,isFormDisabled:i},children:a(ce,{name:"comment",value:w,label:n.comment,required:!0,autoComplete:"off","data-testid":"form-comment-field",errorMessage:h.comment,disabled:i})}),oe=a(b,{name:"QuoteNameField",slot:t==null?void 0:t.QuoteNameField,context:{value:P,required:!0,errorMessage:h.quoteName,setFormErrors:u,isFormDisabled:i},children:a(de,{error:h.quoteName,disabled:i,children:a(le,{value:P,name:"quoteName",floatingLabel:n.quoteName,required:!0,autoComplete:"off","data-testid":"form-quote-name-field"})})}),ne=a(b,{name:"AttachFileField",slot:t==null?void 0:t.AttachFileField,context:{onChange:V,formErrors:h,isFormDisabled:i,attachedFiles:F},children:a(fe,{multiple:!0,onChange:e=>{const o=e.target,s=o==null?void 0:o.files,r=s?Array.from(s):[];r.length>0&&V(r)},icon:a(pe,{}),disabled:i,"data-testid":"form-attach-file-field",accept:g==null?void 0:g.join(",")})}),ie=F.length>0?a(b,{name:"AttachedFilesList",slot:t==null?void 0:t.AttachedFilesList,context:{files:F,onRemove:I,disabled:i},children:a(ve,{files:F,onRemove:I,disabled:i})}):void 0,se=a(b,{name:"RequestButton",slot:t==null?void 0:t.RequestButton,context:{requestNegotiableQuote:H,formErrors:h,isFormDisabled:i,setIsFormDisabled:l},children:a(T,{type:"submit","data-testid":"form-request-button",onClick:O,disabled:i,children:n.requestCta})}),ue=a(b,{name:"SaveDraftButton",slot:t==null?void 0:t.SaveDraftButton,context:{requestNegotiableQuote:H,formErrors:h,isFormDisabled:i,setIsFormDisabled:l},children:a(T,{type:"submit","data-draft":"true",variant:"secondary","data-testid":"form-save-draft-button",onClick:O,disabled:i,children:n.saveDraftCta})});return a(xe,{title:ae,banner:ee(),commentField:re,quoteNameField:oe,attachFile:ne,attachedFilesList:ie,requestButton:se,saveButton:ue,onSubmit:te,className:z,disabled:i,"data-testid":"form-container"})};export{We as RequestNegotiableQuoteForm,We as default};
|
|
4
4
|
//# sourceMappingURL=RequestNegotiableQuoteForm.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{S as e}from"../chunks/ShippingAddressDisplay.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"../chunks/WarningFilled.js";import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";export{e as ShippingAddressDisplay};
|
|
4
4
|
//# sourceMappingURL=ShippingAddressDisplay.js.map
|
|
@@ -190,6 +190,10 @@ export declare const mockQuoteData: {
|
|
|
190
190
|
amount_off: number;
|
|
191
191
|
percent_off: number;
|
|
192
192
|
};
|
|
193
|
+
row_catalog_discount: {
|
|
194
|
+
amount_off: number;
|
|
195
|
+
percent_off: number;
|
|
196
|
+
};
|
|
193
197
|
discounts: {
|
|
194
198
|
label: string;
|
|
195
199
|
value: number;
|
|
@@ -282,6 +286,10 @@ export declare const mockQuoteData: {
|
|
|
282
286
|
amount_off: number;
|
|
283
287
|
percent_off: number;
|
|
284
288
|
};
|
|
289
|
+
row_catalog_discount: {
|
|
290
|
+
amount_off: number;
|
|
291
|
+
percent_off: number;
|
|
292
|
+
};
|
|
285
293
|
discounts: never[];
|
|
286
294
|
};
|
|
287
295
|
quantity: number;
|
|
@@ -395,6 +403,10 @@ export declare const mockQuoteData: {
|
|
|
395
403
|
amount_off: number;
|
|
396
404
|
percent_off: number;
|
|
397
405
|
};
|
|
406
|
+
row_catalog_discount: {
|
|
407
|
+
amount_off: number;
|
|
408
|
+
percent_off: number;
|
|
409
|
+
};
|
|
398
410
|
discounts: {
|
|
399
411
|
label: string;
|
|
400
412
|
value: number;
|
|
@@ -507,6 +519,10 @@ export declare const mockQuoteData: {
|
|
|
507
519
|
amount_off: number;
|
|
508
520
|
percent_off: number;
|
|
509
521
|
};
|
|
522
|
+
row_catalog_discount: {
|
|
523
|
+
amount_off: number;
|
|
524
|
+
percent_off: number;
|
|
525
|
+
};
|
|
510
526
|
discounts: {
|
|
511
527
|
label: string;
|
|
512
528
|
value: number;
|
|
@@ -91,6 +91,10 @@ export declare const mockQuoteTemplateData: {
|
|
|
91
91
|
amount_off: number;
|
|
92
92
|
percent_off: number;
|
|
93
93
|
};
|
|
94
|
+
row_catalog_discount: {
|
|
95
|
+
amount_off: number;
|
|
96
|
+
percent_off: number;
|
|
97
|
+
};
|
|
94
98
|
discounts: {
|
|
95
99
|
label: string;
|
|
96
100
|
value: string;
|
|
@@ -188,6 +192,10 @@ export declare const mockQuoteTemplateData: {
|
|
|
188
192
|
amount_off: number;
|
|
189
193
|
percent_off: number;
|
|
190
194
|
};
|
|
195
|
+
row_catalog_discount: {
|
|
196
|
+
amount_off: number;
|
|
197
|
+
percent_off: number;
|
|
198
|
+
};
|
|
191
199
|
discounts: {
|
|
192
200
|
label: string;
|
|
193
201
|
value: string;
|
|
@@ -263,6 +271,10 @@ export declare const mockQuoteTemplateData: {
|
|
|
263
271
|
amount_off: number;
|
|
264
272
|
percent_off: number;
|
|
265
273
|
};
|
|
274
|
+
row_catalog_discount: {
|
|
275
|
+
amount_off: number;
|
|
276
|
+
percent_off: number;
|
|
277
|
+
};
|
|
266
278
|
discounts: {
|
|
267
279
|
label: string;
|
|
268
280
|
value: string;
|
|
@@ -521,6 +533,10 @@ export declare const mockSubmittedQuoteTemplateData: {
|
|
|
521
533
|
amount_off: number;
|
|
522
534
|
percent_off: number;
|
|
523
535
|
};
|
|
536
|
+
row_catalog_discount: {
|
|
537
|
+
amount_off: number;
|
|
538
|
+
percent_off: number;
|
|
539
|
+
};
|
|
524
540
|
discounts: {
|
|
525
541
|
label: string;
|
|
526
542
|
value: string;
|
|
@@ -618,6 +634,10 @@ export declare const mockSubmittedQuoteTemplateData: {
|
|
|
618
634
|
amount_off: number;
|
|
619
635
|
percent_off: number;
|
|
620
636
|
};
|
|
637
|
+
row_catalog_discount: {
|
|
638
|
+
amount_off: number;
|
|
639
|
+
percent_off: number;
|
|
640
|
+
};
|
|
621
641
|
discounts: {
|
|
622
642
|
label: string;
|
|
623
643
|
value: string;
|
|
@@ -693,6 +713,10 @@ export declare const mockSubmittedQuoteTemplateData: {
|
|
|
693
713
|
amount_off: number;
|
|
694
714
|
percent_off: number;
|
|
695
715
|
};
|
|
716
|
+
row_catalog_discount: {
|
|
717
|
+
amount_off: number;
|
|
718
|
+
percent_off: number;
|
|
719
|
+
};
|
|
696
720
|
discounts: {
|
|
697
721
|
label: string;
|
|
698
722
|
value: string;
|
|
@@ -938,6 +962,10 @@ export declare const mockInReviewQuoteTemplateData: {
|
|
|
938
962
|
amount_off: number;
|
|
939
963
|
percent_off: number;
|
|
940
964
|
};
|
|
965
|
+
row_catalog_discount: {
|
|
966
|
+
amount_off: number;
|
|
967
|
+
percent_off: number;
|
|
968
|
+
};
|
|
941
969
|
discounts: {
|
|
942
970
|
label: string;
|
|
943
971
|
value: string;
|
|
@@ -1035,6 +1063,10 @@ export declare const mockInReviewQuoteTemplateData: {
|
|
|
1035
1063
|
amount_off: number;
|
|
1036
1064
|
percent_off: number;
|
|
1037
1065
|
};
|
|
1066
|
+
row_catalog_discount: {
|
|
1067
|
+
amount_off: number;
|
|
1068
|
+
percent_off: number;
|
|
1069
|
+
};
|
|
1038
1070
|
discounts: {
|
|
1039
1071
|
label: string;
|
|
1040
1072
|
value: string;
|
|
@@ -1110,6 +1142,10 @@ export declare const mockInReviewQuoteTemplateData: {
|
|
|
1110
1142
|
amount_off: number;
|
|
1111
1143
|
percent_off: number;
|
|
1112
1144
|
};
|
|
1145
|
+
row_catalog_discount: {
|
|
1146
|
+
amount_off: number;
|
|
1147
|
+
percent_off: number;
|
|
1148
|
+
};
|
|
1113
1149
|
discounts: {
|
|
1114
1150
|
label: string;
|
|
1115
1151
|
value: string;
|
|
@@ -1355,6 +1391,10 @@ export declare const mockClosedQuoteTemplateData: {
|
|
|
1355
1391
|
amount_off: number;
|
|
1356
1392
|
percent_off: number;
|
|
1357
1393
|
};
|
|
1394
|
+
row_catalog_discount: {
|
|
1395
|
+
amount_off: number;
|
|
1396
|
+
percent_off: number;
|
|
1397
|
+
};
|
|
1358
1398
|
discounts: {
|
|
1359
1399
|
label: string;
|
|
1360
1400
|
value: string;
|
|
@@ -1452,6 +1492,10 @@ export declare const mockClosedQuoteTemplateData: {
|
|
|
1452
1492
|
amount_off: number;
|
|
1453
1493
|
percent_off: number;
|
|
1454
1494
|
};
|
|
1495
|
+
row_catalog_discount: {
|
|
1496
|
+
amount_off: number;
|
|
1497
|
+
percent_off: number;
|
|
1498
|
+
};
|
|
1455
1499
|
discounts: {
|
|
1456
1500
|
label: string;
|
|
1457
1501
|
value: string;
|
|
@@ -1527,6 +1571,10 @@ export declare const mockClosedQuoteTemplateData: {
|
|
|
1527
1571
|
amount_off: number;
|
|
1528
1572
|
percent_off: number;
|
|
1529
1573
|
};
|
|
1574
|
+
row_catalog_discount: {
|
|
1575
|
+
amount_off: number;
|
|
1576
|
+
percent_off: number;
|
|
1577
|
+
};
|
|
1530
1578
|
discounts: {
|
|
1531
1579
|
label: string;
|
|
1532
1580
|
value: string;
|
|
@@ -1772,6 +1820,10 @@ export declare const mockInactiveQuoteTemplateData: {
|
|
|
1772
1820
|
amount_off: number;
|
|
1773
1821
|
percent_off: number;
|
|
1774
1822
|
};
|
|
1823
|
+
row_catalog_discount: {
|
|
1824
|
+
amount_off: number;
|
|
1825
|
+
percent_off: number;
|
|
1826
|
+
};
|
|
1775
1827
|
discounts: {
|
|
1776
1828
|
label: string;
|
|
1777
1829
|
value: string;
|
|
@@ -1869,6 +1921,10 @@ export declare const mockInactiveQuoteTemplateData: {
|
|
|
1869
1921
|
amount_off: number;
|
|
1870
1922
|
percent_off: number;
|
|
1871
1923
|
};
|
|
1924
|
+
row_catalog_discount: {
|
|
1925
|
+
amount_off: number;
|
|
1926
|
+
percent_off: number;
|
|
1927
|
+
};
|
|
1872
1928
|
discounts: {
|
|
1873
1929
|
label: string;
|
|
1874
1930
|
value: string;
|
|
@@ -1944,6 +2000,10 @@ export declare const mockInactiveQuoteTemplateData: {
|
|
|
1944
2000
|
amount_off: number;
|
|
1945
2001
|
percent_off: number;
|
|
1946
2002
|
};
|
|
2003
|
+
row_catalog_discount: {
|
|
2004
|
+
amount_off: number;
|
|
2005
|
+
percent_off: number;
|
|
2006
|
+
};
|
|
1947
2007
|
discounts: {
|
|
1948
2008
|
label: string;
|
|
1949
2009
|
value: string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export interface UseExpirationDateParams {
|
|
10
|
+
templateId?: string;
|
|
11
|
+
initialExpirationDate?: string;
|
|
12
|
+
expirationDateRequiredErrorMessage?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UseExpirationDateReturn {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the expiration date modal is currently open.
|
|
17
|
+
*/
|
|
18
|
+
isExpirationModalOpen: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The new expiration date entered by the user (in YYYY-MM-DD format).
|
|
21
|
+
*/
|
|
22
|
+
expirationDate: string;
|
|
23
|
+
/**
|
|
24
|
+
* Error message for expiration date operation.
|
|
25
|
+
*/
|
|
26
|
+
expirationError: string;
|
|
27
|
+
/**
|
|
28
|
+
* Error message for expiration date validation.
|
|
29
|
+
*/
|
|
30
|
+
expirationDateError: string;
|
|
31
|
+
/**
|
|
32
|
+
* Success message for expiration date operation.
|
|
33
|
+
*/
|
|
34
|
+
expirationSuccess: string;
|
|
35
|
+
/**
|
|
36
|
+
* Opens the expiration date modal and initializes state with the current expiration date.
|
|
37
|
+
*/
|
|
38
|
+
handleExpirationClick: (currentExpirationDate?: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Closes the expiration date modal and resets all state.
|
|
41
|
+
*/
|
|
42
|
+
handleExpirationClose: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Updates the expiration date and clears any date-related errors.
|
|
45
|
+
*/
|
|
46
|
+
handleExpirationDateChange: (value: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Validates and saves the expiration date. Makes an API call to save immediately.
|
|
49
|
+
* Closes the modal if successful.
|
|
50
|
+
* Returns a promise that resolves to true if successful, false otherwise.
|
|
51
|
+
*/
|
|
52
|
+
handleExpirationSave: () => Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Resets expiration date state (useful after successful submission).
|
|
55
|
+
*/
|
|
56
|
+
resetExpirationState: () => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Custom hook to manage quote template expiration date functionality.
|
|
60
|
+
* Handles state management for the expiration date modal, validation, and API calls.
|
|
61
|
+
* Saves the expiration date immediately when user clicks "Save" in the modal.
|
|
62
|
+
*/
|
|
63
|
+
export declare const useExpirationDate: (params?: UseExpirationDateParams) => UseExpirationDateReturn;
|
|
64
|
+
//# sourceMappingURL=useExpirationDate.d.ts.map
|
|
@@ -4,6 +4,7 @@ export interface UseItemsQuotedTemplateReturn {
|
|
|
4
4
|
dropdownSelections: Record<string, string | undefined>;
|
|
5
5
|
handleItemDropdownChange: (item: CartItemModel, action: string) => void;
|
|
6
6
|
handleDismissRemoveBanner: () => void;
|
|
7
|
+
clearDropdownSelection: (item: CartItemModel) => void;
|
|
7
8
|
}
|
|
8
9
|
export interface UseItemsQuotedTemplateParams {
|
|
9
10
|
handleRemoveItems: (items: CartItemModel[]) => void;
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -408,6 +408,18 @@ declare const _default: {
|
|
|
408
408
|
"successHeading": "Success",
|
|
409
409
|
"successMessage": "Quote template renamed successfully!"
|
|
410
410
|
},
|
|
411
|
+
"expirationDate": {
|
|
412
|
+
"title": "Set Expiration Date",
|
|
413
|
+
"expirationDateLabel": "Expiration date",
|
|
414
|
+
"saveButton": "Save",
|
|
415
|
+
"cancelButton": "Cancel",
|
|
416
|
+
"errorHeading": "Error",
|
|
417
|
+
"expirationDateRequired": "Expiration date is required",
|
|
418
|
+
"invalidDate": "Please enter a valid date",
|
|
419
|
+
"pastDateError": "Expiration date must be in the future",
|
|
420
|
+
"errorDefault": "Failed to set expiration date. Please try again.",
|
|
421
|
+
"successHeading": "Success"
|
|
422
|
+
},
|
|
411
423
|
"unsavedChangesWarningHeading": "Unsaved Changes",
|
|
412
424
|
"unsavedChangesWarningMessage": "The quote template must be submitted for review to save the changes.",
|
|
413
425
|
"shippingAddressWarningHeading": "No Shipping Address",
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-quote-management", "version": "1.
|
|
1
|
+
{"name": "@dropins/storefront-quote-management", "version": "1.1.0-beta1", "@dropins/tools": "^1.6.0", "license": "SEE LICENSE IN LICENSE.md"}
|