@dropins/storefront-quote-management 1.0.0-beta1 → 1.0.0-beta10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/LICENSE.md +25 -26
  2. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +1 -0
  3. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +1 -1
  4. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +1 -1
  5. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
  6. package/api/sendForReview/index.d.ts +1 -1
  7. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +10 -0
  8. package/api.js +10 -47
  9. package/api.js.map +1 -1
  10. package/chunks/AttachedFilesList.js +1 -1
  11. package/chunks/AttachedFilesList.js.map +1 -1
  12. package/chunks/ConfirmationModal.js +1 -1
  13. package/chunks/ConfirmationModal.js.map +1 -1
  14. package/chunks/ItemsQuoted.js +1 -1
  15. package/chunks/ItemsQuoted.js.map +1 -1
  16. package/chunks/ItemsQuotedTemplate.js +1 -1
  17. package/chunks/ItemsQuotedTemplate.js.map +1 -1
  18. package/chunks/LineItemNoteModal.js +4 -0
  19. package/chunks/LineItemNoteModal.js.map +1 -0
  20. package/chunks/NegotiableQuoteFragment.js +1 -0
  21. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  22. package/chunks/NegotiableQuoteTemplateFragment.js +154 -6
  23. package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -1
  24. package/chunks/OrderSummaryLine.js +1 -1
  25. package/chunks/OrderSummaryLine.js.map +1 -1
  26. package/chunks/QuoteTemplateCommentsList.js +1 -1
  27. package/chunks/QuoteTemplateCommentsList.js.map +1 -1
  28. package/chunks/RenameQuoteModal.js +4 -0
  29. package/chunks/RenameQuoteModal.js.map +1 -0
  30. package/chunks/ShippingAddressDisplay.js +1 -1
  31. package/chunks/ShippingAddressDisplay.js.map +1 -1
  32. package/chunks/addQuoteTemplateLineItemNote.js +23 -3
  33. package/chunks/addQuoteTemplateLineItemNote.js.map +1 -1
  34. package/chunks/duplicateNegotiableQuote.js +5 -5
  35. package/chunks/duplicateNegotiableQuote.js.map +1 -1
  36. package/chunks/getQuoteTemplates.js +13 -11
  37. package/chunks/getQuoteTemplates.js.map +1 -1
  38. package/chunks/negotiableQuotes.js +1 -1
  39. package/chunks/openQuoteTemplate.js +29 -8
  40. package/chunks/openQuoteTemplate.js.map +1 -1
  41. package/chunks/state.js +1 -1
  42. package/chunks/state.js.map +1 -1
  43. package/chunks/transform-quote-template.js +1 -1
  44. package/chunks/transform-quote-template.js.map +1 -1
  45. package/chunks/transform-quote.js +1 -1
  46. package/chunks/transform-quote.js.map +1 -1
  47. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +2 -2
  48. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +5 -2
  49. package/components/ProductListTable/ProductListTable.d.ts +5 -49
  50. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +30 -0
  51. package/components/ReferenceDocumentFormModal/index.d.ts +11 -0
  52. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +18 -0
  53. package/components/ReferenceDocumentsList/index.d.ts +11 -0
  54. package/components/index.d.ts +2 -0
  55. package/containers/ItemsQuoted/ItemsQuoted.d.ts +7 -7
  56. package/containers/ItemsQuoted.js +1 -1
  57. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +5 -1
  58. package/containers/ItemsQuotedTemplate.js +1 -1
  59. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +3 -0
  60. package/containers/ManageNegotiableQuote.js +1 -1
  61. package/containers/ManageNegotiableQuote.js.map +1 -1
  62. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +46 -5
  63. package/containers/ManageNegotiableQuoteTemplate.js +3 -1
  64. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
  65. package/containers/OrderSummary.js +1 -1
  66. package/containers/OrderSummary.js.map +1 -1
  67. package/containers/OrderSummaryLine.js +1 -1
  68. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +1 -1
  69. package/containers/QuoteSummaryList.js +1 -1
  70. package/containers/QuoteSummaryList.js.map +1 -1
  71. package/containers/QuoteTemplatesListTable.js +1 -1
  72. package/containers/QuoteTemplatesListTable.js.map +1 -1
  73. package/containers/QuotesListTable.js +1 -1
  74. package/containers/QuotesListTable.js.map +1 -1
  75. package/containers/RequestNegotiableQuoteForm.js +1 -1
  76. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  77. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +2 -2
  78. package/containers/ShippingAddressDisplay.js +1 -1
  79. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +5 -5
  80. package/data/models/negotiable-quote-model.d.ts +3 -2
  81. package/data/models/negotiable-quote-template-model.d.ts +4 -39
  82. package/data/models/store-config-model.d.ts +2 -0
  83. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +8 -0
  84. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +616 -75
  85. package/data/transforms/__fixtures__/storeConfigData.d.ts +4 -0
  86. package/data/transforms/transform-history.d.ts +15 -0
  87. package/data/transforms/transform-quote-items.d.ts +15 -0
  88. package/hooks/useItemsQuotedTemplate.d.ts +15 -0
  89. package/hooks/useReferenceDocumentLinks.d.ts +34 -0
  90. package/hooks/useRemoveTemplateItems.d.ts +25 -0
  91. package/hooks/useRenameTemplate.d.ts +71 -0
  92. package/hooks/useUpdateTemplateQuantities.d.ts +27 -0
  93. package/i18n/en_US.json.d.ts +93 -6
  94. package/lib/itemFormatters.d.ts +1 -1
  95. package/lib/priceCalculators.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/render.js +3 -3
  98. package/render.js.map +1 -1
  99. package/chunks/LineItemNoteModal2.js +0 -4
  100. package/chunks/LineItemNoteModal2.js.map +0 -1
  101. package/chunks/TabbedContent.js +0 -4
  102. package/chunks/TabbedContent.js.map +0 -1
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as t,jsxs as C,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{useState as i,useEffect as D,useCallback as g}from"@dropins/tools/preact-compat.js";import{Slot as x}from"@dropins/tools/lib.js";import{events as F}from"@dropins/tools/event-bus.js";import{Price as S,InLineAlert as H}from"@dropins/tools/components.js";/* empty css */import{I as h,Q as O,P as j,L as A}from"./LineItemNoteModal2.js";/* empty css *//* empty css */import"./state.js";import{a as B}from"./addQuoteTemplateLineItemNote.js";import{S as k}from"./WarningFilled.js";import{useText as U}from"@dropins/tools/i18n.js";const te=({templateData:M,slots:n,...P})=>{const[e,Q]=i(M),[o,f]=i(null),[E,T]=i(!1),[L,m]=i(!1),[b,s]=i(""),[I,u]=i({}),d=U({subtotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes",errorHeading:"NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading"});D(()=>{const r=F.on("quote-management/quote-template-data",a=>{Q(a.quoteTemplate),u({})},{eager:!0});return()=>r==null?void 0:r.off()},[]);const y=g((r,a)=>{const l=r;a==="edit"&&(f(l),T(!0),u(w=>({...w,[l.uid||""]:""})))},[]),c=g(()=>{o&&u(r=>{const a={...r};return delete a[o.uid||""],a}),T(!1),f(null),m(!1),s("")},[o]),N=g(async r=>{if(!(!o||!e)){m(!0),s("");try{await B({templateId:e.id,itemId:o.uid||"",note:r}),c()}catch(a){console.error("Failed to set template line item note:",a);const l=a instanceof Error?a.message:"Unable to update the item. Please try again.";s(l),m(!1)}}},[o,e,c]);if(!e)return t(h,{loading:!0});const p=[];e.prices.subtotalExcludingTax&&p.push({label:d.subtotal,id:"subtotal",value:t(S,{amount:e.prices.subtotalExcludingTax.value,currency:e.prices.subtotalExcludingTax.currency,weight:"normal"})}),e.prices.grandTotal&&p.push({label:d.grandTotal,id:"total",value:t(S,{amount:e.prices.grandTotal.value,currency:e.prices.grandTotal.currency}),strong:!0});const q=b?t(H,{type:"error",variant:"primary",icon:t(k,{}),heading:d.errorHeading,description:b,onDismiss:()=>s(""),"data-testid":"line-item-note-error-banner"}):null;return C(v,{children:[t(h,{"data-testid":"items-quoted-template-container",...P,loading:!1,table:t(x,{name:"ProductListTable",slot:n==null?void 0:n.ProductListTable,context:{items:e.items,canEdit:!1,onItemDropdownChange:y,dropdownSelections:I},children:t(j,{items:e.items,canEdit:!1,showActions:e.canEditTemplateItems,onItemDropdownChange:y,dropdownSelections:I})}),pricesSummary:t(x,{name:"QuotePricesSummary",slot:n==null?void 0:n.QuotePricesSummary,context:{items:e.items,prices:e.prices},children:t(O,{entries:p})})}),o&&t(A,{open:E,item:o,onClose:c,onConfirm:N,isSubmitting:L,readOnlyQuantity:!0,errorBanner:q||void 0})]})};export{te as I};
3
+ import{jsx as o,jsxs as ne,Fragment as se}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useEffect as O,useCallback as p}from"@dropins/tools/preact-compat.js";import{Slot as W}from"@dropins/tools/lib.js";import{events as H}from"@dropins/tools/event-bus.js";import{InLineAlert as B,Price as Y}from"@dropins/tools/components.js";/* empty css */import{I as $,Q as re,P as ie,L as le}from"./LineItemNoteModal.js";import{C as me}from"./ConfirmationModal.js";/* empty css *//* empty css */import"./state.js";import{r as de,u as ue,a as ce}from"./addQuoteTemplateLineItemNote.js";import{S as z}from"./CheckWithCircle.js";import{S as U}from"./WarningFilled.js";import{useText as pe}from"@dropins/tools/i18n.js";const ge=3e3,Me=b=>{const{templateId:r,onRemoveModalStateChange:a,removeSuccessMessage:e,removeErrorMessage:T}=b,[i,g]=l(!1),[M,s]=l([]),[u,m]=l(!1),[S,n]=l({type:null,message:""});O(()=>{const d=H.on("quote-management/quote-template-data",()=>{s([]),m(!1),n({type:"success",message:e}),setTimeout(()=>{g(!1),n({type:null,message:""}),a==null||a(!1)},ge)});return()=>d==null?void 0:d.off()},[e,a]);const N=p(d=>{!d||d.length===0||(s(d),n({type:null,message:""}),g(!0))},[]),Q=p(async()=>{if(!r||M.length===0)return;const d=M.map(I=>I.uid).filter(Boolean);if(d.length!==0){m(!0),n({type:null,message:""});try{await de({templateId:r,itemUids:d})}catch(I){const c=I instanceof Error?I.message:T;n({type:"error",message:c}),m(!1)}}},[r,M,T]),t=p(()=>{g(!1),n({type:null,message:""}),a==null||a(!1),s([])},[a]);return{handleRemoveItems:N,handleConfirmRemove:Q,handleCancelRemove:t,isRemoveModalOpen:i,itemsToRemove:M,isRemoving:u,removeNotificationState:S}},fe=b=>{const{handleRemoveItems:r}=b,[a,e]=l({}),T=p(()=>{},[]),i=p((g,M)=>{const s=g;if(M==="remove"){e(u=>({...u,[s.uid||""]:M})),r([s]),e(u=>({...u,[s.uid||""]:""}));return}e(u=>{if(!s.uid||!(s.uid in u))return u;const m={...u};return delete m[s.uid],m})},[r]);return{dropdownSelections:a,handleItemDropdownChange:i,handleDismissRemoveBanner:T}},ve=3e3,Te=b=>{const{templateId:r,onUpdateModalStateChange:a,updateSuccessMessage:e,updateErrorMessage:T}=b,[i,g]=l({}),[M,s]=l(!1),[u,m]=l(!1),[S,n]=l({type:null,message:""});O(()=>{const c=H.on("quote-management/quote-template-data",()=>{g({}),m(!1),n({type:"success",message:e}),setTimeout(()=>{s(!1),n({type:null,message:""}),a==null||a(!1)},ve)});return()=>c==null?void 0:c.off()},[e,a]);const N=p((c,y)=>{const h=c;if(!h.uid)return;const C=h.uid;g(R=>({...R,[C]:y}))},[]),Q=p(c=>{c.preventDefault(),n({type:null,message:""}),s(!0)},[]),t=p(async()=>{if(!r||Object.keys(i).length===0){s(!1);return}m(!0),n({type:null,message:""});const c=Object.entries(i).map(([y,h])=>({itemId:y,quantity:h}));try{await ue({templateId:r,items:c})}catch(y){const h=y instanceof Error?y.message:T;n({type:"error",message:h}),m(!1)}},[r,i,T]),d=p(()=>{s(!1),n({type:null,message:""}),a==null||a(!1),g({})},[a]),I=p(()=>{n({type:null,message:""})},[]);return{quantityChanges:i,handleQuantityChange:N,handleUpdate:Q,handleConfirmUpdate:t,handleCancelUpdate:d,handleDismissBanner:I,isUpdateModalOpen:M,isUpdating:u,updateNotificationState:S}},Oe=({templateData:b,slots:r,...a})=>{const[e,T]=l(b),[i,g]=l(null),[M,s]=l(!1),[u,m]=l(!1),[S,n]=l(""),[N,Q]=l({}),t=pe({subtotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes",removeModalTitle:"NegotiableQuoteTemplate.Manage.removeItemsModal.title",removeModalDescription:"NegotiableQuoteTemplate.Manage.removeItemsModal.description",removeModalCancelButton:"NegotiableQuoteTemplate.Manage.removeItemsModal.cancelButton",removeModalConfirmButton:"NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButton",removeModalConfirmButtonRemoving:"NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButtonRemoving",removeSuccessHeading:"NegotiableQuoteTemplate.Manage.removeItemsModal.successHeading",removeSuccessMessage:"NegotiableQuoteTemplate.Manage.removeItemsModal.successMessage",removeErrorHeading:"NegotiableQuoteTemplate.Manage.removeItemsModal.errorHeading",removeErrorMessage:"NegotiableQuoteTemplate.Manage.removeItemsModal.errorMessage",updateModalTitle:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.title",updateModalDescription:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.description",updateModalCancelButton:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.cancelButton",updateModalUpdateButton:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.updateButton",updateSuccessHeading:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successHeading",updateSuccessMessage:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successMessage",updateErrorHeading:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorHeading",updateErrorMessage:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorMessage",errorHeading:"NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading"}),{handleRemoveItems:d,handleConfirmRemove:I,handleCancelRemove:c,isRemoveModalOpen:y,isRemoving:h,removeNotificationState:C}=Me({templateId:e==null?void 0:e.id,removeSuccessMessage:t.removeSuccessMessage,removeErrorMessage:t.removeErrorMessage}),{dropdownSelections:R,handleItemDropdownChange:P,handleDismissRemoveBanner:q}=fe({handleRemoveItems:d}),{handleQuantityChange:L,handleUpdate:A,handleConfirmUpdate:G,handleCancelUpdate:J,handleDismissBanner:F,isUpdateModalOpen:K,updateNotificationState:E}=Te({templateId:e==null?void 0:e.id,updateSuccessMessage:t.updateSuccessMessage,updateErrorMessage:t.updateErrorMessage});O(()=>{const v=H.on("quote-management/quote-template-data",f=>{T(f.quoteTemplate),Q({})},{eager:!0});return()=>v==null?void 0:v.off()},[]);const _=p((v,f)=>{const D=v;if(f==="edit"){g(D),s(!0),Q(oe=>({...oe,[D.uid]:""}));return}P(v,f)},[P]),k={...R,...N},w=p(()=>{i&&Q(v=>{const f={...v};return delete f[i.uid],f}),s(!1),g(null),m(!1),n("")},[i]),V=p(async v=>{if(!(!i||!e)){m(!0),n("");try{await ce({templateId:e.id,itemId:i.uid,note:v}),w()}catch(f){console.error("Failed to set template line item note:",f);const D=f instanceof Error?f.message:"Unable to update the item. Please try again.";n(D),m(!1)}}},[i,e,w]),X=C.type==="success"?o(B,{type:"success",variant:"primary",icon:o(z,{}),heading:t.removeSuccessHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-success-banner"}):C.type==="error"?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.removeErrorHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-error-banner"}):null,Z=E.type==="success"?o(B,{type:"success",variant:"primary",icon:o(z,{}),heading:t.updateSuccessHeading,description:E.message,onDismiss:F,"data-testid":"update-quantities-success-banner"}):E.type==="error"?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.updateErrorHeading,description:E.message,onDismiss:F,"data-testid":"update-quantities-error-banner"}):null;if(!e)return o($,{loading:!0});const ee=y?{open:!0,title:t.removeModalTitle,message:t.removeModalDescription,cancelLabel:t.removeModalCancelButton,confirmLabel:h?t.removeModalConfirmButtonRemoving:t.removeModalConfirmButton,onCancel:c,onConfirm:I,confirmationBanner:X}:null,te=K?{open:!0,title:t.updateModalTitle,message:t.updateModalDescription,cancelLabel:t.updateModalCancelButton,confirmLabel:t.updateModalUpdateButton,onCancel:J,onConfirm:G,confirmationBanner:Z}:null,j=ee||te,x=[];e.prices.subtotalExcludingTax&&x.push({label:t.subtotal,id:"subtotal",value:o(Y,{amount:e.prices.subtotalExcludingTax.value,currency:e.prices.subtotalExcludingTax.currency,weight:"normal"})}),e.prices.grandTotal&&x.push({label:t.grandTotal,id:"total",value:o(Y,{amount:e.prices.grandTotal.value,currency:e.prices.grandTotal.currency}),strong:!0});const ae=S?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.errorHeading,description:S,onDismiss:()=>n(""),"data-testid":"line-item-note-error-banner"}):null;return ne(se,{children:[o($,{"data-testid":"items-quoted-template-container",...a,loading:!1,table:o(W,{name:"ProductListTable",slot:r==null?void 0:r.ProductListTable,context:{items:e.items,canEdit:e.canSendForReview,dropdownSelections:k,handleItemDropdownChange:_,handleQuantityChange:L,handleUpdate:A},children:o(ie,{items:e.items,canEdit:e.canSendForReview,showActions:e.canEditTemplateItems,onItemDropdownChange:_,onQuantityChange:L,onUpdate:A,dropdownSelections:k})}),pricesSummary:o(W,{name:"QuotePricesSummary",slot:r==null?void 0:r.QuotePricesSummary,context:{items:e.items,prices:e.prices},children:o(re,{entries:x})})}),j&&o(me,{...j}),i&&o(le,{open:M,item:i,onClose:w,onConfirm:V,isSubmitting:u,readOnlyQuantity:!0,errorBanner:ae||void 0})]})};export{Oe as I};
4
4
  //# sourceMappingURL=ItemsQuotedTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ItemsQuotedTemplate.js","sources":["/@dropins/storefront-quote-management/src/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Price, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\nimport {\n NegotiableQuoteTemplateModel,\n QuoteTemplateCartItem,\n} from '@/quote-management/data/models/negotiable-quote-template-model';\nimport {\n QuotePricesSummary,\n ProductListTable,\n ItemsQuoted as ItemsQuotedComponent,\n} from '@/quote-management/components';\nimport { LineItemNoteModal } from '@/quote-management/components/LineItemNoteModal';\nimport { addQuoteTemplateLineItemNote } from '@/quote-management/api';\n\nexport interface ItemsQuotedTemplateProps\n extends HTMLAttributes<HTMLDivElement> {\n templateData?: NegotiableQuoteTemplateModel;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n canEdit: boolean;\n onItemDropdownChange?: (item: any, action: string) => void;\n dropdownSelections?: Record<string, string>;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n prices: NegotiableQuoteTemplateModel['prices'];\n }>;\n };\n}\n\nexport const ItemsQuotedTemplate: Container<ItemsQuotedTemplateProps> = ({\n templateData: initialData,\n slots,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<\n NegotiableQuoteTemplateModel | undefined\n >(initialData);\n const [selectedItem, setSelectedItem] =\n useState<QuoteTemplateCartItem | null>(null);\n const [isLineItemNoteModalOpen, setIsLineItemNoteModalOpen] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [modalErrorMessage, setModalErrorMessage] = useState('');\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string>\n >({});\n\n const dictionary = useText({\n subtotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes',\n errorHeading:\n 'NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading',\n });\n\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n (payload) => {\n setTemplateData(payload.quoteTemplate);\n setDropdownSelections({});\n },\n { eager: true }\n );\n\n return () => templateDataEvent?.off();\n }, []);\n\n // Handler for dropdown selection\n const handleItemDropdownChange = useCallback((item: any, action: string) => {\n const templateItem = item as QuoteTemplateCartItem;\n if (action === 'edit') {\n setSelectedItem(templateItem);\n setIsLineItemNoteModalOpen(true);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({\n ...prev,\n [templateItem.uid || '']: '',\n }));\n }\n }, []);\n\n // Handle modal close\n const handleModalClose = useCallback(() => {\n // Clean up dropdown selection for the selected item before clearing it\n /* istanbul ignore else: defensive check - selectedItem should always be truthy when modal is open */\n if (selectedItem) {\n setDropdownSelections((prev) => {\n const next = { ...prev };\n delete next[selectedItem.uid || ''];\n return next;\n });\n }\n setIsLineItemNoteModalOpen(false);\n setSelectedItem(null);\n setIsSubmitting(false);\n setModalErrorMessage('');\n }, [selectedItem]);\n\n // Handle modal confirm - submit note only (quantity is read-only for templates)\n const handleModalConfirm = useCallback(\n async (note: string) => {\n /* istanbul ignore next: defensive guard for async race conditions - unreachable in normal flow as modal only renders with selectedItem and templateData */\n if (!selectedItem || !templateData) return;\n\n setIsSubmitting(true);\n setModalErrorMessage('');\n\n try {\n // Set the line item note\n await addQuoteTemplateLineItemNote({\n templateId: templateData.id,\n itemId: selectedItem.uid || '',\n note,\n });\n\n // Close modal on success\n handleModalClose();\n } catch (error) {\n console.error('Failed to set template line item note:', error);\n const errorMessage =\n error instanceof Error\n ? error.message\n : 'Unable to update the item. Please try again.';\n setModalErrorMessage(errorMessage);\n setIsSubmitting(false);\n }\n },\n [selectedItem, templateData, handleModalClose]\n );\n\n if (!templateData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const quotePricesSummaryEntries = [];\n\n templateData.prices.subtotalExcludingTax &&\n quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: (\n <Price\n amount={templateData.prices.subtotalExcludingTax.value}\n currency={templateData.prices.subtotalExcludingTax.currency}\n weight=\"normal\"\n />\n ),\n });\n\n templateData.prices.grandTotal &&\n quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: (\n <Price\n amount={templateData.prices.grandTotal.value}\n currency={templateData.prices.grandTotal.currency}\n />\n ),\n strong: true,\n });\n\n // Create modal error banner\n const modalErrorBanner = modalErrorMessage ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.errorHeading}\n description={modalErrorMessage}\n onDismiss={() => setModalErrorMessage('')}\n data-testid=\"line-item-note-error-banner\"\n />\n ) : null;\n\n return (\n <>\n <ItemsQuotedComponent\n data-testid=\"items-quoted-template-container\"\n {...props}\n loading={false}\n table={\n <Slot\n name=\"ProductListTable\"\n slot={slots?.ProductListTable}\n context={{\n items: templateData.items,\n canEdit: false,\n onItemDropdownChange: handleItemDropdownChange,\n dropdownSelections,\n }}\n >\n <ProductListTable\n items={templateData.items as any}\n canEdit={false}\n showActions={templateData.canEditTemplateItems}\n onItemDropdownChange={handleItemDropdownChange}\n dropdownSelections={dropdownSelections}\n />\n </Slot>\n }\n pricesSummary={\n <Slot\n name=\"QuotePricesSummary\"\n slot={slots?.QuotePricesSummary}\n context={{\n items: templateData.items,\n prices: templateData.prices,\n }}\n >\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n {selectedItem && (\n <LineItemNoteModal\n open={isLineItemNoteModalOpen}\n item={selectedItem as any}\n onClose={handleModalClose}\n onConfirm={handleModalConfirm}\n isSubmitting={isSubmitting}\n readOnlyQuantity={true}\n errorBanner={modalErrorBanner || undefined}\n />\n )}\n </>\n );\n};\n"],"names":["ItemsQuotedTemplate","initialData","slots","props","templateData","setTemplateData","useState","selectedItem","setSelectedItem","isLineItemNoteModalOpen","setIsLineItemNoteModalOpen","isSubmitting","setIsSubmitting","modalErrorMessage","setModalErrorMessage","dropdownSelections","setDropdownSelections","dictionary","useText","useEffect","templateDataEvent","events","payload","handleItemDropdownChange","useCallback","item","action","templateItem","prev","handleModalClose","next","handleModalConfirm","note","addQuoteTemplateLineItemNote","error","errorMessage","jsx","ItemsQuotedComponent","quotePricesSummaryEntries","Price","modalErrorBanner","InLineAlert","WarningFilled","jsxs","Fragment","Slot","ProductListTable","QuotePricesSummary","LineItemNoteModal"],"mappings":"qpBAiDO,MAAMA,GAA2D,CAAC,CACvE,aAAcC,EACd,MAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAEtCL,CAAW,EACP,CAACM,EAAcC,CAAe,EAClCF,EAAuC,IAAI,EACvC,CAACG,EAAyBC,CAA0B,EAAIJ,EAAS,EAAK,EACtE,CAACK,EAAcC,CAAe,EAAIN,EAAS,EAAK,EAChD,CAACO,EAAmBC,CAAoB,EAAIR,EAAS,EAAE,EACvD,CAACS,EAAoBC,CAAqB,EAAIV,EAElD,CAAA,CAAE,EAEEW,EAAaC,EAAQ,CACzB,SACE,0EACF,WACE,4EACF,aACE,iEACF,a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,EAACY,EAAA,CACC,KAAMvC,EACN,KAAMF,EACN,QAASsB,EACT,UAAWE,EACX,aAAApB,EACA,iBAAkB,GAClB,YAAa6B,GAAoB,MAAA,CAAA,CACnC,EAEJ,CAEJ"}
1
+ {"version":3,"file":"ItemsQuotedTemplate.js","sources":["/@dropins/storefront-quote-management/src/hooks/useRemoveTemplateItems.ts","/@dropins/storefront-quote-management/src/hooks/useItemsQuotedTemplate.ts","/@dropins/storefront-quote-management/src/hooks/useUpdateTemplateQuantities.ts","/@dropins/storefront-quote-management/src/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { removeQuoteTemplateItems } from '@/quote-management/api/removeQuoteTemplateItems';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nconst NOTIFICATION_AUTO_DISMISS_DELAY = 3000;\n\nexport interface UseRemoveTemplateItemsReturn {\n handleRemoveItems: (items: CartItemModel[]) => void;\n handleConfirmRemove: () => Promise<void>;\n handleCancelRemove: () => void;\n isRemoveModalOpen: boolean;\n itemsToRemove: CartItemModel[];\n isRemoving: boolean;\n removeNotificationState: {\n type: 'success' | 'error' | null;\n message: string;\n };\n}\n\nexport interface UseRemoveTemplateItemsParams {\n templateId?: string;\n onRemoveModalStateChange?: (isOpen: boolean) => void;\n removeSuccessMessage: string;\n removeErrorMessage: string;\n}\n\n/**\n * Custom hook to manage removing items from a quote template\n */\nexport const useRemoveTemplateItems = (\n params: UseRemoveTemplateItemsParams\n): UseRemoveTemplateItemsReturn => {\n const {\n templateId,\n onRemoveModalStateChange,\n removeSuccessMessage,\n removeErrorMessage,\n } = params;\n\n const [isRemoveModalOpen, setIsRemoveModalOpen] = useState(false);\n const [itemsToRemove, setItemsToRemove] = useState<CartItemModel[]>([]);\n const [isRemoving, setIsRemoving] = useState(false);\n const [removeNotificationState, setRemoveNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n\n // Listen for quote template data event (successful removal)\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n () => {\n setItemsToRemove([]);\n setIsRemoving(false);\n setRemoveNotificationState({\n type: 'success',\n message: removeSuccessMessage,\n });\n // Auto-close success notification after delay\n setTimeout(() => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n }, NOTIFICATION_AUTO_DISMISS_DELAY);\n }\n );\n return () => templateDataEvent?.off();\n }, [removeSuccessMessage, onRemoveModalStateChange]);\n\n // Unified handler for removing items (single or multiple)\n const handleRemoveItems = useCallback((items: CartItemModel[]) => {\n if (!items || items.length === 0) {\n return;\n }\n setItemsToRemove(items);\n setRemoveNotificationState({ type: null, message: '' });\n setIsRemoveModalOpen(true);\n }, []);\n\n const handleConfirmRemove = useCallback(async () => {\n if (!templateId || itemsToRemove.length === 0) {\n return;\n }\n\n const uidsToRemove = itemsToRemove.map((item) => item.uid).filter(Boolean) as string[];\n\n if (uidsToRemove.length === 0) {\n return;\n }\n\n setIsRemoving(true);\n setRemoveNotificationState({ type: null, message: '' });\n\n try {\n await removeQuoteTemplateItems({\n templateId,\n itemUids: uidsToRemove,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : removeErrorMessage;\n setRemoveNotificationState({\n type: 'error',\n message: errorMessage,\n });\n setIsRemoving(false);\n }\n }, [templateId, itemsToRemove, removeErrorMessage]);\n\n const handleCancelRemove = useCallback(() => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n setItemsToRemove([]);\n }, [onRemoveModalStateChange]);\n\n return {\n handleRemoveItems,\n handleConfirmRemove,\n handleCancelRemove,\n isRemoveModalOpen,\n itemsToRemove,\n isRemoving,\n removeNotificationState,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/compat';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nexport interface UseItemsQuotedTemplateReturn {\n dropdownSelections: Record<string, string | undefined>;\n handleItemDropdownChange: (item: CartItemModel, action: string) => void;\n handleDismissRemoveBanner: () => void;\n}\n\nexport interface UseItemsQuotedTemplateParams {\n handleRemoveItems: (items: CartItemModel[]) => void;\n}\n\n/**\n * Custom hook to manage dropdown selections and item actions for quote template items\n */\nexport const useItemsQuotedTemplate = (\n params: UseItemsQuotedTemplateParams\n): UseItemsQuotedTemplateReturn => {\n const { handleRemoveItems } = params;\n\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string | undefined>\n >({});\n\n const handleDismissRemoveBanner = useCallback(() => {\n // The hook manages its own notification state, but we can add custom dismiss logic if needed\n }, []);\n\n const handleItemDropdownChange = useCallback(\n (item: CartItemModel, action: string) => {\n const cartItem = item;\n\n // Handle remove action\n if (action === 'remove') {\n setDropdownSelections((prev) => ({\n ...prev,\n [cartItem.uid || '']: action,\n }));\n handleRemoveItems([cartItem]);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({ ...prev, [cartItem.uid || '']: '' }));\n return;\n }\n\n // Clear dropdown selection for other actions\n setDropdownSelections((prev) => {\n if (!cartItem.uid || !(cartItem.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[cartItem.uid];\n return next;\n });\n },\n [handleRemoveItems]\n );\n\n return {\n dropdownSelections,\n handleItemDropdownChange,\n handleDismissRemoveBanner,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { updateQuoteTemplateItemQuantities } from '@/quote-management/api/updateQuoteTemplateItemQuantities';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nconst NOTIFICATION_AUTO_DISMISS_DELAY = 3000;\n\nexport interface UseUpdateTemplateQuantitiesReturn {\n quantityChanges: Record<string, number>;\n handleQuantityChange: (item: CartItemModel, newQuantity: number) => void;\n handleUpdate: (e: SubmitEvent) => void;\n handleConfirmUpdate: () => Promise<void>;\n handleCancelUpdate: () => void;\n handleDismissBanner: () => void;\n isUpdateModalOpen: boolean;\n isUpdating: boolean;\n updateNotificationState: {\n type: 'success' | 'error' | null;\n message: string;\n };\n}\n\nexport interface UseUpdateTemplateQuantitiesParams {\n templateId?: string;\n onUpdateModalStateChange?: (isOpen: boolean) => void;\n updateSuccessMessage: string;\n updateErrorMessage: string;\n}\n\n/**\n * Custom hook to manage updating quantities of items in a quote template\n */\nexport const useUpdateTemplateQuantities = (\n params: UseUpdateTemplateQuantitiesParams\n): UseUpdateTemplateQuantitiesReturn => {\n const {\n templateId,\n onUpdateModalStateChange,\n updateSuccessMessage,\n updateErrorMessage,\n } = params;\n\n const [quantityChanges, setQuantityChanges] = useState<Record<string, number>>({});\n const [isUpdateModalOpen, setIsUpdateModalOpen] = useState(false);\n const [isUpdating, setIsUpdating] = useState(false);\n const [updateNotificationState, setUpdateNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n\n // Listen for quote template data event (successful update)\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n () => {\n setQuantityChanges({});\n setIsUpdating(false);\n setUpdateNotificationState({\n type: 'success',\n message: updateSuccessMessage,\n });\n // Auto-close success notification after delay\n setTimeout(() => {\n setIsUpdateModalOpen(false);\n setUpdateNotificationState({ type: null, message: '' });\n onUpdateModalStateChange?.(false);\n }, NOTIFICATION_AUTO_DISMISS_DELAY);\n }\n );\n return () => templateDataEvent?.off();\n }, [updateSuccessMessage, onUpdateModalStateChange]);\n\n const handleQuantityChange = useCallback(\n (item: CartItemModel, newQuantity: number) => {\n const cartItem = item;\n if (!cartItem.uid) {\n return;\n }\n const itemUid = cartItem.uid;\n setQuantityChanges((prev) => ({\n ...prev,\n [itemUid]: newQuantity,\n }));\n },\n []\n );\n\n const handleUpdate = useCallback((e: SubmitEvent) => {\n e.preventDefault();\n setUpdateNotificationState({ type: null, message: '' });\n setIsUpdateModalOpen(true);\n }, []);\n\n const handleConfirmUpdate = useCallback(async () => {\n if (!templateId || Object.keys(quantityChanges).length === 0) {\n setIsUpdateModalOpen(false);\n return;\n }\n\n setIsUpdating(true);\n setUpdateNotificationState({ type: null, message: '' });\n\n // Map quantity changes to API format\n const items = Object.entries(quantityChanges).map(([itemId, quantity]) => ({\n itemId,\n quantity,\n }));\n\n try {\n await updateQuoteTemplateItemQuantities({\n templateId,\n items,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : updateErrorMessage;\n setUpdateNotificationState({\n type: 'error',\n message: errorMessage,\n });\n setIsUpdating(false);\n }\n }, [templateId, quantityChanges, updateErrorMessage]);\n\n const handleCancelUpdate = useCallback(() => {\n setIsUpdateModalOpen(false);\n setUpdateNotificationState({ type: null, message: '' });\n onUpdateModalStateChange?.(false);\n setQuantityChanges({});\n }, [onUpdateModalStateChange]);\n\n const handleDismissBanner = useCallback(() => {\n setUpdateNotificationState({ type: null, message: '' });\n }, []);\n\n return {\n quantityChanges,\n handleQuantityChange,\n handleUpdate,\n handleConfirmUpdate,\n handleCancelUpdate,\n handleDismissBanner,\n isUpdateModalOpen,\n isUpdating,\n updateNotificationState,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Price, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { CheckWithCircle, WarningFilled } from '@adobe-commerce/elsie/icons';\nimport {\n NegotiableQuoteTemplateModel,\n} from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport {\n QuotePricesSummary,\n ProductListTable,\n ItemsQuoted as ItemsQuotedComponent,\n ConfirmationModal,\n} from '@/quote-management/components';\nimport { LineItemNoteModal } from '@/quote-management/components/LineItemNoteModal';\nimport { addQuoteTemplateLineItemNote } from '@/quote-management/api';\nimport { useRemoveTemplateItems } from '@/quote-management/hooks/useRemoveTemplateItems';\nimport { useItemsQuotedTemplate } from '@/quote-management/hooks/useItemsQuotedTemplate';\nimport { useUpdateTemplateQuantities } from '@/quote-management/hooks/useUpdateTemplateQuantities';\n\nexport interface ItemsQuotedTemplateProps\n extends HTMLAttributes<HTMLDivElement> {\n templateData?: NegotiableQuoteTemplateModel;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n canEdit: boolean;\n dropdownSelections: Record<string, string | undefined>;\n handleItemDropdownChange: (item: CartItemModel, action: string) => void;\n handleQuantityChange: (item: CartItemModel, newQuantity: number) => void;\n handleUpdate: (e: SubmitEvent) => void;\n onItemDropdownChange?: (item: any, action: string) => void;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n prices: NegotiableQuoteTemplateModel['prices'];\n }>;\n };\n}\n\nexport const ItemsQuotedTemplate: Container<ItemsQuotedTemplateProps> = ({\n templateData: initialData,\n slots,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<\n NegotiableQuoteTemplateModel | undefined\n >(initialData);\n const [selectedItem, setSelectedItem] =\n useState<CartItemModel | null>(null);\n const [isLineItemNoteModalOpen, setIsLineItemNoteModalOpen] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [modalErrorMessage, setModalErrorMessage] = useState('');\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string>\n >({});\n\n const dictionary = useText({\n subtotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes',\n removeModalTitle: 'NegotiableQuoteTemplate.Manage.removeItemsModal.title',\n removeModalDescription: 'NegotiableQuoteTemplate.Manage.removeItemsModal.description',\n removeModalCancelButton: 'NegotiableQuoteTemplate.Manage.removeItemsModal.cancelButton',\n removeModalConfirmButton: 'NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButton',\n removeModalConfirmButtonRemoving: 'NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButtonRemoving',\n removeSuccessHeading: 'NegotiableQuoteTemplate.Manage.removeItemsModal.successHeading',\n removeSuccessMessage: 'NegotiableQuoteTemplate.Manage.removeItemsModal.successMessage',\n removeErrorHeading: 'NegotiableQuoteTemplate.Manage.removeItemsModal.errorHeading',\n removeErrorMessage: 'NegotiableQuoteTemplate.Manage.removeItemsModal.errorMessage',\n updateModalTitle: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.title',\n updateModalDescription: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.description',\n updateModalCancelButton: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.cancelButton',\n updateModalUpdateButton: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.updateButton',\n updateSuccessHeading: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successHeading',\n updateSuccessMessage: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successMessage',\n updateErrorHeading: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorHeading',\n updateErrorMessage: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorMessage',\n errorHeading:\n 'NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading',\n });\n\n // Use the remove template items hook\n const {\n handleRemoveItems,\n handleConfirmRemove,\n handleCancelRemove,\n isRemoveModalOpen,\n isRemoving,\n removeNotificationState,\n } = useRemoveTemplateItems({\n templateId: templateData?.id,\n removeSuccessMessage: dictionary.removeSuccessMessage,\n removeErrorMessage: dictionary.removeErrorMessage,\n });\n\n // Use the items quoted template hook for dropdown and interaction logic\n const {\n dropdownSelections: hookDropdownSelections,\n handleItemDropdownChange: hookHandleItemDropdownChange,\n handleDismissRemoveBanner,\n } = useItemsQuotedTemplate({\n handleRemoveItems,\n });\n\n // Use the update template quantities hook\n const {\n handleQuantityChange,\n handleUpdate,\n handleConfirmUpdate,\n handleCancelUpdate,\n handleDismissBanner,\n isUpdateModalOpen,\n updateNotificationState,\n } = useUpdateTemplateQuantities({\n templateId: templateData?.id,\n updateSuccessMessage: dictionary.updateSuccessMessage,\n updateErrorMessage: dictionary.updateErrorMessage,\n });\n\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n (payload) => {\n setTemplateData(payload.quoteTemplate);\n setDropdownSelections({});\n },\n { eager: true }\n );\n\n return () => templateDataEvent?.off();\n }, []);\n\n // Combined handler for dropdown selection that handles both remove (via hook) and edit (for line item notes)\n const handleItemDropdownChange = useCallback(\n (item: CartItemModel, action: string) => {\n const templateItem = item;\n \n // Handle edit action - open line item note modal\n if (action === 'edit') {\n setSelectedItem(templateItem);\n setIsLineItemNoteModalOpen(true);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({\n ...prev,\n [templateItem.uid]: '',\n }));\n return;\n }\n\n // For remove and other actions, delegate to hook handler\n hookHandleItemDropdownChange(item, action);\n },\n [hookHandleItemDropdownChange]\n );\n\n // Merge dropdown selections from hook and local state\n const mergedDropdownSelections = { ...hookDropdownSelections, ...dropdownSelections };\n\n // Handle modal close\n const handleModalClose = useCallback(() => {\n // Clean up dropdown selection for the selected item before clearing it\n /* istanbul ignore else: defensive check - selectedItem should always be truthy when modal is open */\n if (selectedItem) {\n setDropdownSelections((prev) => {\n const next = { ...prev };\n delete next[selectedItem.uid];\n return next;\n });\n }\n setIsLineItemNoteModalOpen(false);\n setSelectedItem(null);\n setIsSubmitting(false);\n setModalErrorMessage('');\n }, [selectedItem]);\n\n // Handle modal confirm - submit note only (quantity is read-only for templates)\n const handleModalConfirm = useCallback(\n async (note: string) => {\n /* istanbul ignore next: defensive guard for async race conditions - unreachable in normal flow as modal only renders with selectedItem and templateData */\n if (!selectedItem || !templateData) return;\n\n setIsSubmitting(true);\n setModalErrorMessage('');\n\n try {\n // Set the line item note\n await addQuoteTemplateLineItemNote({\n templateId: templateData.id,\n itemId: selectedItem.uid,\n note,\n });\n\n // Close modal on success\n handleModalClose();\n } catch (error) {\n console.error('Failed to set template line item note:', error);\n const errorMessage =\n error instanceof Error\n ? error.message\n : 'Unable to update the item. Please try again.';\n setModalErrorMessage(errorMessage);\n setIsSubmitting(false);\n }\n },\n [selectedItem, templateData, handleModalClose]\n );\n\n // Create remove confirmation banner based on notification state\n const removeConfirmationBanner =\n removeNotificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.removeSuccessHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-success-banner\"\n />\n ) : removeNotificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.removeErrorHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-error-banner\"\n />\n ) : null;\n\n // Create update quantities confirmation banner based on notification state\n const updateConfirmationBanner =\n updateNotificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.updateSuccessHeading}\n description={updateNotificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-success-banner\"\n />\n ) : updateNotificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.updateErrorHeading}\n description={updateNotificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-error-banner\"\n />\n ) : null;\n\n if (!templateData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const removeConfirmationModalProps = isRemoveModalOpen ? {\n open: true,\n title: dictionary.removeModalTitle,\n message: dictionary.removeModalDescription,\n cancelLabel: dictionary.removeModalCancelButton,\n confirmLabel: isRemoving\n ? dictionary.removeModalConfirmButtonRemoving\n : dictionary.removeModalConfirmButton,\n onCancel: handleCancelRemove,\n onConfirm: handleConfirmRemove,\n confirmationBanner: removeConfirmationBanner,\n } : null;\n\n const updateConfirmationModalProps = isUpdateModalOpen ? {\n open: true,\n title: dictionary.updateModalTitle,\n message: dictionary.updateModalDescription,\n cancelLabel: dictionary.updateModalCancelButton,\n confirmLabel: dictionary.updateModalUpdateButton,\n onCancel: handleCancelUpdate,\n onConfirm: handleConfirmUpdate,\n confirmationBanner: updateConfirmationBanner,\n } : null;\n\n // Only define a single confirmation modal\n const confirmationModalProps = removeConfirmationModalProps || updateConfirmationModalProps;\n\n const quotePricesSummaryEntries = [];\n\n templateData.prices.subtotalExcludingTax &&\n quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: (\n <Price\n amount={templateData.prices.subtotalExcludingTax.value}\n currency={templateData.prices.subtotalExcludingTax.currency}\n weight=\"normal\"\n />\n ),\n });\n\n templateData.prices.grandTotal &&\n quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: (\n <Price\n amount={templateData.prices.grandTotal.value}\n currency={templateData.prices.grandTotal.currency}\n />\n ),\n strong: true,\n });\n\n // Create modal error banner\n const modalErrorBanner = modalErrorMessage ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.errorHeading}\n description={modalErrorMessage}\n onDismiss={() => setModalErrorMessage('')}\n data-testid=\"line-item-note-error-banner\"\n />\n ) : null;\n\n return (\n <>\n <ItemsQuotedComponent\n data-testid=\"items-quoted-template-container\"\n {...props}\n loading={false}\n table={\n <Slot\n name=\"ProductListTable\"\n slot={slots?.ProductListTable}\n context={{\n items: templateData.items,\n canEdit: templateData.canSendForReview,\n dropdownSelections: mergedDropdownSelections,\n handleItemDropdownChange,\n handleQuantityChange,\n handleUpdate,\n }}\n >\n <ProductListTable\n items={templateData.items}\n canEdit={templateData.canSendForReview}\n showActions={templateData.canEditTemplateItems}\n onItemDropdownChange={handleItemDropdownChange}\n onQuantityChange={handleQuantityChange}\n onUpdate={handleUpdate}\n dropdownSelections={mergedDropdownSelections}\n />\n </Slot>\n }\n pricesSummary={\n <Slot\n name=\"QuotePricesSummary\"\n slot={slots?.QuotePricesSummary}\n context={{\n items: templateData.items,\n prices: templateData.prices,\n }}\n >\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n {/* Confirmation Modal for remove/update */}\n {confirmationModalProps && (\n <ConfirmationModal\n {...confirmationModalProps}\n />\n )}\n {/* Line Item Note Modal */}\n {selectedItem && (\n <LineItemNoteModal\n open={isLineItemNoteModalOpen}\n item={selectedItem as any}\n onClose={handleModalClose}\n onConfirm={handleModalConfirm}\n isSubmitting={isSubmitting}\n readOnlyQuantity={true}\n errorBanner={modalErrorBanner || undefined}\n />\n )}\n </>\n );\n};\n"],"names":["NOTIFICATION_AUTO_DISMISS_DELAY","useRemoveTemplateItems","params","templateId","onRemoveModalStateChange","removeSuccessMessage","removeErrorMessage","isRemoveModalOpen","setIsRemoveModalOpen","useState","itemsToRemove","setItemsToRemove","isRemoving","setIsRemoving","removeNotificationState","setRemoveNotificationState","useEffect","templateDataEvent","events","handleRemoveItems","useCallback","items","handleConfirmRemove","uidsToRemove","item","removeQuoteTemplateItems","err","errorMessage","handleCancelRemove","useItemsQuotedTemplate","dropdownSelections","setDropdownSelections","handleDismissRemoveBanner","handleItemDropdownChange","action","cartItem","prev","next","useUpdateTemplateQuantities","onUpdateModalStateChange","updateSuccessMessage","updateErrorMessage","quantityChanges","setQuantityChanges","isUpdateModalOpen","setIsUpdateModalOpen","isUpdating","setIsUpdating","updateNotificationState","setUpdateNotificationState","handleQuantityChange","newQuantity","itemUid","handleUpdate","e","handleConfirmUpdate","itemId","quantity","updateQuoteTemplateItemQuantities","handleCancelUpdate","handleDismissBanner","ItemsQuotedTemplate","initialData","slots","props","templateData","setTemplateData","selectedItem","setSelectedItem","isLineItemNoteModalOpen","setIsLineItemNoteModalOpen","isSubmitting","setIsSubmitting","modalErrorMessage","setModalErrorMessage","dictionary","useText","hookDropdownSelections","hookHandleItemDropdownChange","payload","templateItem","mergedDropdownSelections","handleModalClose","handleModalConfirm","note","addQuoteTemplateLineItemNote","error","removeConfirmationBanner","jsx","InLineAlert","CheckWithCircle","WarningFilled","updateConfirmationBanner","ItemsQuotedComponent","removeConfirmationModalProps","updateConfirmationModalProps","confirmationModalProps","quotePricesSummaryEntries","Price","modalErrorBanner","jsxs","Fragment","Slot","ProductListTable","QuotePricesSummary","ConfirmationModal","LineItemNoteModal"],"mappings":"qwBAcA,MAAMA,GAAkC,IAyB3BC,GACXC,GACiC,CACjC,KAAM,CACJ,WAAAC,EACA,yBAAAC,EACA,qBAAAC,EACA,mBAAAC,CAAA,EACEJ,EAEE,CAACK,EAAmBC,CAAoB,EAAIC,EAAS,EAAK,EAC1D,CAACC,EAAeC,CAAgB,EAAIF,EAA0B,CAAA,CAAE,EAChE,CAACG,EAAYC,CAAa,EAAIJ,EAAS,EAAK,EAC5C,CAACK,EAAyBC,CAA0B,EA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AAG7B,EACJ,QAAS,GACT,MACEwB,EAACc,EAAA,CACC,KAAK,mBACL,KAAMvC,GAAA,YAAAA,EAAO,iBACb,QAAS,CACP,MAAOE,EAAa,MACpB,QAASA,EAAa,iBACtB,mBAAoBgB,EACpB,yBAAAhD,EACA,qBAAAiB,EACA,aAAAG,CAAA,EAGF,SAAAmC,EAACe,GAAA,CACC,MAAOtC,EAAa,MACpB,QAASA,EAAa,iBACtB,YAAaA,EAAa,qBAC1B,qBAAsBhC,EACtB,iBAAkBiB,EAClB,SAAUG,EACV,mBAAoB4B,CAAA,CAAA,CACtB,CAAA,EAGJ,cACEO,EAACc,EAAA,CACC,KAAK,qBACL,KAAMvC,GAAA,YAAAA,EAAO,mBACb,QAAS,CACP,MAAOE,EAAa,MACpB,OAAQA,EAAa,MAAA,EAGvB,SAAAuB,EAACgB,GAAA,CAAmB,QAASP,CAAA,CAA2B,CAAA,CAAA,CAC1D,CAAA,EAIHD,GACCR,EAACiB,GAAA,CACE,GAAGT,CAAA,CAAA,EAIP7B,GACCqB,EAACkB,GAAA,CACC,KAAMrC,EACN,KAAMF,EACN,QAASe,EACT,UAAWC,EACX,aAAAZ,EACA,iBAAkB,GAClB,YAAa4B,IAAoB,MAAA,CAAA,CACnC,EAEJ,CAEJ"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as t,jsxs as n,Fragment as F}from"@dropins/tools/preact-jsx-runtime.js";import{classes as f,VComponent as D}from"@dropins/tools/lib.js";/* empty css */import{Skeleton as te,SkeletonRow as ae,Input as V,InLineAlert as oe,Picker as ne,Price as T,Checkbox as le,Button as E,Table as Z,Accordion as ie,AccordionSection as se,Modal as re,TextArea as ue}from"@dropins/tools/components.js";import{h as R}from"@dropins/tools/preact.js";import{useState as W,useEffect as ce}from"@dropins/tools/preact-hooks.js";import{g as de}from"./dateUtils.js";import{S as me}from"./WarningFilled.js";import{useText as J}from"@dropins/tools/i18n.js";import{useState as A,useEffect as be,useCallback as G}from"@dropins/tools/preact-compat.js";const Qe=({className:q,loading:d,table:o,pricesSummary:u,...i})=>d?t(pe,{}):n("div",{className:f(["quote-management-items-quoted",q]),...i,children:[o&&t(D,{node:o,className:f(["quote-management-items-quoted__table"]),"data-testid":"quote-management-items-quoted__table"}),u&&t(D,{node:u,className:f(["quote-management-items-quoted__prices-summary"]),"data-testid":"quote-management-items-quoted__prices-summary"})]}),pe=()=>t(te,{"data-testid":"items-quoted-skeleton",children:t(ae,{variant:"row",fullWidth:!0,size:"medium",lines:4,multilineGap:"xsmall"})}),Me=({className:q,items:d,canEdit:o,readOnly:u=!1,showActions:i,onItemCheckboxChange:b,onItemDropdownChange:g,onQuantityChange:k,onUpdate:S,dropdownSelections:_,...h})=>{const[I,L]=W({}),[y,p]=W({});ce(()=>{const e={};d.forEach(s=>{e[s.uid]=s.quantity}),L(e),p(e)},[d]);const v=Object.keys(y).some(e=>y[e]!==I[e]),a=J({updateButton:"NegotiableQuote.Manage.productListTable.submitButton",productNameHeader:"NegotiableQuote.Manage.productListTable.headers.productName",skuHeader:"NegotiableQuote.Manage.productListTable.headers.sku",priceHeader:"NegotiableQuote.Manage.productListTable.headers.price",quantityHeader:"NegotiableQuote.Manage.productListTable.headers.quantity",discountHeader:"NegotiableQuote.Manage.productListTable.headers.discount",subtotalHeader:"NegotiableQuote.Manage.productListTable.headers.subtotal",actionsHeader:"NegotiableQuote.Manage.productListTable.headers.actions",editNoteToSeller:"NegotiableQuote.Manage.productListTable.actions.editNoteToSeller",remove:"NegotiableQuote.Manage.productListTable.actions.remove",notesHeader:"NegotiableQuote.Manage.productListTable.notes.header",leftANote:"NegotiableQuote.Manage.productListTable.notes.leftANote",buyer:"NegotiableQuote.Manage.productListTable.notes.buyer",seller:"NegotiableQuote.Manage.productListTable.notes.seller",outOfStock:"NegotiableQuote.Manage.productListTable.outOfStock",outOfStockMessage:"NegotiableQuote.Manage.productListTable.outOfStockMessage"}),w=[{label:a.productNameHeader,key:"productName"},{label:a.skuHeader,key:"sku"},{label:a.priceHeader,key:"price"},{label:a.quantityHeader,key:"quantity"},{label:a.discountHeader,key:"discount"},{label:a.subtotalHeader,key:"subtotal"}];o&&!u&&w.unshift({label:"",key:"checkbox"}),(i??o)&&!u&&w.push({label:a.actionsHeader,key:"actions"});const j=(e,s)=>{const r=e.target.checked;b==null||b(s,r)},P=(e,s)=>{const r=e.target.value;g==null||g(s,r)},B=(e,s)=>{const r=parseInt(e.target.value,10);!isNaN(r)&&r>0&&(p(N=>({...N,[s.uid]:r})),k==null||k(s,r))},O=e=>{e.preventDefault(),S==null||S(e)},c=(e,s)=>e>0?n("div",{className:"quote-management-product-list-table__discount-container",children:[n("span",{className:"quote-management-product-list-table__discount-percent",children:[s,"%"]}),n("span",{className:"quote-management-product-list-table__discount-price",children:["(",t(T,{amount:e}),")"]})]}):void 0,Q=e=>{var N,M;const s=(N=e.configurableOptions)==null?void 0:N.map(m=>n("div",{className:"quote-management-product-list-table__configurable-option",children:[n("span",{className:"quote-management-product-list-table__configurable-option-label",children:[m.optionLabel,":"]}),t("span",{className:"quote-management-product-list-table__configurable-option-value",children:m.valueLabel})]},m.optionLabel)),r=(M=e.bundleOptions)==null?void 0:M.map(m=>n("div",{className:"quote-management-product-list-table__bundle-option",children:[t("span",{className:"quote-management-product-list-table__bundle-option-label",children:m.label}),t("div",{className:"quote-management-product-list-table__bundle-option-values",children:m.values.map(l=>n("span",{className:"quote-management-product-list-table__bundle-option-value",children:[n("span",{className:"quote-management-product-list-table__bundle-option-value-quantity",children:[l.quantity," x"]}),t("span",{className:"quote-management-product-list-table__bundle-option-value-label",children:l.label}),t(T,{className:"quote-management-product-list-table__bundle-option-value-original-price",amount:l.originalPrice.value,currency:l.originalPrice.currency,weight:"normal"})]},l.label))})]},m.label));return n("div",{className:"quote-management-product-list-table__product-name-container",children:[t("span",{className:"quote-management-product-list-table__product-name",children:e.product.name}),s,r]})},$=e=>new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZone:de()}),H=e=>{var M,m;const s=((M=e.noteFromBuyer)==null?void 0:M.filter(l=>l&&l.note&&l.note.trim()!==""))||[],r=((m=e.noteFromSeller)==null?void 0:m.filter(l=>l&&l.note&&l.note.trim()!==""))||[],N=[...s,...r];return N.length===0?null:n("div",{className:"quote-management-product-list-table__notes-container","data-testid":`item-notes-${e.product.sku}`,children:[t("div",{className:"quote-management-product-list-table__notes-header",children:a.notesHeader}),t("div",{className:"quote-management-product-list-table__notes-list",children:N.map((l,ee)=>n("div",{className:"quote-management-product-list-table__note-item",children:[n("div",{className:"quote-management-product-list-table__note-content",children:[n("strong",{className:"quote-management-product-list-table__note-meta",children:[$(l.createdAt)," (",s.includes(l)?a.buyer:a.seller,")"]})," ",a.leftANote]}),n("div",{className:"quote-management-product-list-table__note-text",children:[l.note," "]})]},l.noteUid||ee))})]})},z=new Set,K=d.flatMap((e,s)=>{var m;const r=H(e);(r||e.outOfStock)&&z.add(s);const N=o?t(V,{className:"quote-management-product-list-table__quantity-input",type:"number",min:"1",value:((m=y[e.uid])==null?void 0:m.toString())||e.quantity.toString(),onChange:l=>B(l,e),disabled:u||!o,"data-testid":`quantity-input-${e.product.sku}`}):t("span",{className:"quote-management-product-list-table__quantity",children:e.quantity});return[{checkbox:t(le,{className:"quote-management-product-list-table__checkbox",name:"itemSelected","data-testid":`item-checkbox-${e.product.sku}`,onChange:l=>j(l,e),value:e.product.sku}),productName:Q(e),sku:t("span",{className:"quote-management-product-list-table__sku",children:e.product.sku}),price:t(T,{className:"quote-management-product-list-table__price",amount:e.prices.originalItemPrice.value,currency:e.prices.originalItemPrice.currency}),quantity:N,discount:e.catalogDiscount?c(e.catalogDiscount.amountOff,e.catalogDiscount.percentOff):void 0,subtotal:t(T,{className:"quote-management-product-list-table__subtotal",amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency}),actions:t(ne,{className:"quote-management-product-list-table__actions","data-testid":`item-dropdown-${e.product.sku}`,name:`item-dropdown-${e.product.sku}`,handleSelect:l=>P(l,e),placeholder:"Select",value:(_==null?void 0:_[e.uid])??"",options:[{text:a.editNoteToSeller,value:"edit"},{text:a.remove,value:"remove"}]}),_rowDetails:n(F,{children:[e.outOfStock&&t("div",{className:"quote-management-product-list-table__out-of-stock-message",children:t(oe,{type:"warning",variant:"primary",icon:t(me,{}),heading:a.outOfStock,description:a.outOfStockMessage})}),r&&t("div",{className:"quote-management-product-list-table__notes-row-wrapper",children:r})]})}]}),U=t(Z,{columns:w,rowData:K,"data-testid":"product-list-table",mobileLayout:"stacked",expandedRows:z}),X=o?R("form",{}):R("div",{}),Y=o?{onSubmit:O,...h}:h,C=t(E,{type:"submit",disabled:u||!o||!v,"data-testid":"product-list-table-submit-button",children:a.updateButton});return n(D,{node:X,className:f(["quote-management-product-list-table-container",q]),"data-testid":"product-list-table-container",...Y,children:[U,t("div",{className:"quote-management-product-list-table-container__submit-container",children:C})]})},Te=({className:q,entries:d,...o})=>{const u=i=>{var g;const b=(g=i.children)==null?void 0:g.map(u);return t("div",{className:"quote-management-quote-prices-summary__entry","data-testid":`quote-prices-summary-entry-${i.id}`,children:b?t(ie,{className:"quote-management-quote-prices-summary__accordion","data-testid":`quote-prices-summary-entry-accordion-${i.id}`,children:t(se,{className:"quote-management-quote-prices-summary__accordion-section",title:i.label,ariaLabelTitle:i.label,secondaryText:i.value,children:b})}):n(F,{children:[t("span",{className:f(["quote-management-quote-prices-summary__label",["quote-management-quote-prices-summary__label--strong",i.strong]]),"data-testid":`quote-prices-summary-entry-label-${i.id}`,children:i.label}),t("span",{className:"quote-management-quote-prices-summary__value","data-testid":`quote-prices-summary-entry-value-${i.id}`,children:i.value})]})},i.id)};return t("div",{className:f(["quote-management-quote-prices-summary",q]),"data-testid":"quote-prices-summary",...o,children:d==null?void 0:d.map(u)})},Se=({className:q,open:d,item:o,onClose:u,onConfirm:i,isSubmitting:b=!1,errorBanner:g,successBanner:k,showCloseButton:S=!0,readOnlyQuantity:_=!1})=>{const[h,I]=A(""),[L,y]=A(o.quantity),[p,v]=A({}),a=J({title:"NegotiableQuote.Manage.lineItemNote.title",productLabel:"NegotiableQuote.Manage.lineItemNote.productLabel",skuLabel:"NegotiableQuote.Manage.lineItemNote.skuLabel",priceLabel:"NegotiableQuote.Manage.lineItemNote.priceLabel",stockLabel:"NegotiableQuote.Manage.lineItemNote.stockLabel",quantityLabel:"NegotiableQuote.Manage.lineItemNote.quantityLabel",discountLabel:"NegotiableQuote.Manage.lineItemNote.discountLabel",subtotalLabel:"NegotiableQuote.Manage.lineItemNote.subtotalLabel",noteLabel:"NegotiableQuote.Manage.lineItemNote.noteLabel",notePlaceholder:"NegotiableQuote.Manage.lineItemNote.notePlaceholder",noteHelper:"NegotiableQuote.Manage.lineItemNote.noteHelper",confirmButton:"NegotiableQuote.Manage.lineItemNote.confirmButton",cancelButton:"NegotiableQuote.Manage.lineItemNote.cancelButton",noteError:"NegotiableQuote.Manage.lineItemNote.noteError",quantityError:"NegotiableQuote.Manage.lineItemNote.quantityError"});be(()=>{var c;if(d){const Q=((c=o.noteFromBuyer)==null?void 0:c.filter(H=>H&&H.note))||[],$=Q.length>0?Q[0].note:"";I($||""),y(o.quantity),v({})}},[d,o.quantity,o.noteFromBuyer]);const w=G(()=>{const c={};if(h.trim()||(c.note=a.noteError),!_&&L<=0&&(c.quantity=a.quantityError),Object.keys(c).length>0){v(c);return}i(h.trim(),L)},[h,L,i,a,_]),x=G(()=>{I(""),y(o.quantity),v({}),u==null||u()},[u,o.quantity]);if(!d)return null;const P=o.discounts&&o.discounts.length>0?o.discounts.map(c=>c.label).join(", "):"-",B=[{label:a.productLabel,key:"productName"},{label:a.priceLabel,key:"price"},{label:a.stockLabel,key:"stock"},{label:a.quantityLabel,key:"quantity"},{label:a.discountLabel,key:"discount"},{label:a.subtotalLabel,key:"subtotal"}],O=[{productName:n("div",{className:"quote-management-line-item-note-modal__product-info",children:[t("div",{className:"quote-management-line-item-note-modal__product-name",children:o.product.name}),n("div",{className:"quote-management-line-item-note-modal__product-sku",children:[a.skuLabel,": ",o.product.sku]})]}),price:t(T,{amount:o.prices.originalItemPrice.value,currency:o.prices.originalItemPrice.currency}),stock:t("span",{className:"quote-management-line-item-note-modal__stock",children:o.stockStatus}),quantity:_?t("span",{className:"quote-management-line-item-note-modal__quantity-readonly",children:o.quantity}):t(V,{name:"quantity",type:"number",min:"1",value:L.toString(),onInput:c=>{const Q=parseInt(c.target.value,10)||0;y(Q),v({...p,quantity:void 0})},disabled:b,error:!!p.quantity,required:!0,"data-testid":"line-item-note-quantity-input",className:"quote-management-line-item-note-modal__quantity-input"}),discount:t("span",{className:"quote-management-line-item-note-modal__discount",children:P}),subtotal:t(T,{amount:o.prices.rowTotal.value,currency:o.prices.rowTotal.currency})}];return n(re,{open:d,size:"medium",title:t(F,{children:a.title}),onClose:x,clickToDismiss:!0,escapeToDismiss:!0,showCloseButton:S,className:f(["quote-management-line-item-note-modal",q]),"data-testid":"line-item-note-modal",children:[g&&t("div",{className:"quote-management-line-item-note-modal__error-banner","data-testid":"line-item-note-modal-error-banner",children:g}),k&&t("div",{className:"quote-management-line-item-note-modal__success-banner","data-testid":"line-item-note-modal-success-banner",children:k}),n("div",{className:"quote-management-line-item-note-modal__content",children:[n("div",{className:"quote-management-line-item-note-modal__details",children:[t(Z,{columns:B,rowData:O,"data-testid":"line-item-note-table",mobileLayout:"stacked",className:"quote-management-line-item-note-modal__details-table"}),p.quantity&&t("div",{className:"quote-management-line-item-note-modal__table-error",children:p.quantity})]}),n("div",{className:"quote-management-line-item-note-modal__form-field",children:[t(ue,{name:"note",placeholder:a.notePlaceholder,rows:4,value:h,onInput:c=>{I(c.target.value),v({...p,note:void 0})},label:a.noteLabel,disabled:b,"data-testid":"line-item-note-textarea"}),!p.note&&t("span",{className:"quote-management-line-item-note-modal__helper-text",children:a.noteHelper}),p.note&&t("span",{className:"quote-management-line-item-note-modal__error-text",children:p.note})]})]}),n("div",{className:"quote-management-line-item-note-modal__actions",children:[t(E,{variant:"secondary",size:"medium",onClick:x,disabled:b,className:"quote-management-line-item-note-modal__cancel-button","data-testid":"line-item-note-cancel-button",children:a.cancelButton}),t(E,{variant:"primary",size:"medium",onClick:w,disabled:b,className:"quote-management-line-item-note-modal__confirm-button","data-testid":"line-item-note-confirm-button",children:a.confirmButton})]})]})};export{Qe as I,Se as L,Me as P,Te as Q};
4
+ //# sourceMappingURL=LineItemNoteModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineItemNoteModal.js","sources":["/@dropins/storefront-quote-management/src/components/ItemsQuoted/ItemsQuoted.tsx","/@dropins/storefront-quote-management/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-quote-management/src/components/QuotePricesSummary/QuotePricesSummary.tsx","/@dropins/storefront-quote-management/src/components/LineItemNoteModal/LineItemNoteModal.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ItemsQuoted/ItemsQuoted.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n table?: VNode;\n pricesSummary?: VNode;\n}\n\nexport const ItemsQuoted: FunctionComponent<ItemsQuotedProps> = ({\n className,\n loading,\n table,\n pricesSummary,\n ...props\n}) => {\n if (loading) {\n return <ItemsQuotedSkeleton />;\n }\n\n return (\n <div className={classes(['quote-management-items-quoted', className])} {...props}>\n {table && (\n <VComponent\n node={table}\n className={classes(['quote-management-items-quoted__table'])}\n data-testid=\"quote-management-items-quoted__table\"\n />\n )}\n {pricesSummary && (\n <VComponent\n node={pricesSummary}\n className={classes(['quote-management-items-quoted__prices-summary'])}\n data-testid=\"quote-management-items-quoted__prices-summary\"\n />\n )}\n </div>\n );\n};\n\nexport const ItemsQuotedSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"items-quoted-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"medium\" lines={4} multilineGap='xsmall' />\n </Skeleton>\n );\n};","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState, useEffect } from 'preact/hooks';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Table,\n Checkbox,\n Picker,\n Price,\n Button,\n Input,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { getUserTimezone } from '@/quote-management/utils/dateUtils';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nimport '@/quote-management/components/ProductListTable/ProductListTable.css';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n items: CartItemModel[];\n canEdit: boolean;\n readOnly?: boolean;\n showActions?: boolean;\n onItemCheckboxChange?: (\n item: CartItemModel,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (item: CartItemModel, action: string) => void;\n onQuantityChange?: (item: CartItemModel, newQuantity: number) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string | undefined>;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n canEdit,\n readOnly = false,\n showActions,\n onItemCheckboxChange,\n onItemDropdownChange,\n onQuantityChange,\n onUpdate,\n dropdownSelections,\n ...props\n}) => {\n // Track original quantities to detect changes\n const [originalQuantities, setOriginalQuantities] = useState<\n Record<string, number>\n >({});\n const [currentQuantities, setCurrentQuantities] = useState<\n Record<string, number>\n >({});\n\n // Initialize quantities when items change\n useEffect(() => {\n const quantities: Record<string, number> = {};\n items.forEach((item) => {\n quantities[item.uid] = item.quantity;\n });\n setOriginalQuantities(quantities);\n setCurrentQuantities(quantities);\n }, [items]);\n\n // Check if any quantities have changed\n const hasQuantityChanges = Object.keys(currentQuantities).some(\n (uid) => currentQuantities[uid] !== originalQuantities[uid]\n );\n\n const dictionary = useText({\n updateButton: 'NegotiableQuote.Manage.productListTable.submitButton',\n productNameHeader:\n 'NegotiableQuote.Manage.productListTable.headers.productName',\n skuHeader: 'NegotiableQuote.Manage.productListTable.headers.sku',\n priceHeader: 'NegotiableQuote.Manage.productListTable.headers.price',\n quantityHeader: 'NegotiableQuote.Manage.productListTable.headers.quantity',\n discountHeader: 'NegotiableQuote.Manage.productListTable.headers.discount',\n subtotalHeader: 'NegotiableQuote.Manage.productListTable.headers.subtotal',\n actionsHeader: 'NegotiableQuote.Manage.productListTable.headers.actions',\n editNoteToSeller:\n 'NegotiableQuote.Manage.productListTable.actions.editNoteToSeller',\n remove: 'NegotiableQuote.Manage.productListTable.actions.remove',\n notesHeader: 'NegotiableQuote.Manage.productListTable.notes.header',\n leftANote: 'NegotiableQuote.Manage.productListTable.notes.leftANote',\n buyer: 'NegotiableQuote.Manage.productListTable.notes.buyer',\n seller: 'NegotiableQuote.Manage.productListTable.notes.seller',\n outOfStock: 'NegotiableQuote.Manage.productListTable.outOfStock',\n outOfStockMessage:\n 'NegotiableQuote.Manage.productListTable.outOfStockMessage',\n });\n\n const columns = [\n {\n label: dictionary.productNameHeader,\n key: 'productName',\n },\n {\n label: dictionary.skuHeader,\n key: 'sku',\n },\n {\n label: dictionary.priceHeader,\n key: 'price',\n },\n {\n label: dictionary.quantityHeader,\n key: 'quantity',\n },\n {\n label: dictionary.discountHeader,\n key: 'discount',\n },\n {\n label: dictionary.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n // Add checkbox column when canEdit (for bulk operations)\n if (canEdit && !readOnly) {\n columns.unshift({\n label: '',\n key: 'checkbox',\n });\n }\n\n // Add actions column when showActions is explicitly true, or when canEdit is true and showActions is not explicitly false\n const shouldShowActions = showActions ?? canEdit;\n if (shouldShowActions && !readOnly) {\n columns.push({\n label: dictionary.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: Event,\n item: CartItemModel\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n onItemCheckboxChange?.(item, isSelected);\n };\n\n const handleItemDropdownChange = (\n event: Event,\n item: CartItemModel\n ) => {\n const action = (event.target as HTMLSelectElement).value;\n onItemDropdownChange?.(item, action);\n };\n\n const handleQuantityChange = (event: Event, item: CartItemModel) => {\n const newQuantity = parseInt((event.target as HTMLInputElement).value, 10);\n if (!isNaN(newQuantity) && newQuantity > 0) {\n setCurrentQuantities((prev) => ({\n ...prev,\n [item.uid]: newQuantity,\n }));\n onQuantityChange?.(item, newQuantity);\n }\n };\n\n const handleUpdate = (event: SubmitEvent) => {\n event.preventDefault();\n onUpdate?.(event);\n };\n\n const discountElement = (amountOff: number, percentOff: number) => {\n return amountOff > 0 ? (\n <div className=\"quote-management-product-list-table__discount-container\">\n <span className=\"quote-management-product-list-table__discount-percent\">\n {percentOff}%\n </span>\n <span className=\"quote-management-product-list-table__discount-price\">\n (<Price amount={amountOff} />)\n </span>\n </div>\n ) : undefined;\n };\n\n const getProductNameContent = (item: CartItemModel) => {\n const configurableOptions = item.configurableOptions?.map((option) => (\n <div\n key={option.optionLabel}\n className=\"quote-management-product-list-table__configurable-option\"\n >\n <span className=\"quote-management-product-list-table__configurable-option-label\">\n {option.optionLabel}:\n </span>\n <span className=\"quote-management-product-list-table__configurable-option-value\">\n {option.valueLabel}\n </span>\n </div>\n ));\n\n const bundleOptions = item.bundleOptions?.map((option) => (\n <div\n key={option.label}\n className=\"quote-management-product-list-table__bundle-option\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-label\">\n {option.label}\n </span>\n <div className=\"quote-management-product-list-table__bundle-option-values\">\n {option.values.map((value) => (\n <span\n key={value.label}\n className=\"quote-management-product-list-table__bundle-option-value\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-value-quantity\">\n {value.quantity} x\n </span>\n <span className=\"quote-management-product-list-table__bundle-option-value-label\">\n {value.label}\n </span>\n <Price\n className=\"quote-management-product-list-table__bundle-option-value-original-price\"\n amount={value.originalPrice.value}\n currency={value.originalPrice.currency}\n weight=\"normal\"\n />\n </span>\n ))}\n </div>\n </div>\n ));\n\n return (\n <div className=\"quote-management-product-list-table__product-name-container\">\n <span className=\"quote-management-product-list-table__product-name\">\n {item.product.name}\n </span>\n {configurableOptions}\n {bundleOptions}\n </div>\n );\n };\n\n const formatNoteTimestamp = (timestamp: string) => {\n const date = new Date(timestamp);\n return date.toLocaleString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit',\n hour12: true,\n timeZone: getUserTimezone(),\n });\n };\n\n const getNotesContent = (item: CartItemModel) => {\n const validNotesFromBuyer = item.noteFromBuyer?.filter(\n (note) => note && note.note && note.note.trim() !== ''\n ) || [];\n\n const validNotesFromSeller = item.noteFromSeller?.filter(\n (note) => note && note.note && note.note.trim() !== ''\n ) || [];\n\n const validNotes = [...validNotesFromBuyer, ...validNotesFromSeller];\n\n if (validNotes.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"quote-management-product-list-table__notes-container\"\n data-testid={`item-notes-${item.product.sku}`}\n >\n <div className=\"quote-management-product-list-table__notes-header\">\n {dictionary.notesHeader}\n </div>\n <div className=\"quote-management-product-list-table__notes-list\">\n {validNotes.map((note, index) => (\n <div\n key={note.noteUid || index}\n className=\"quote-management-product-list-table__note-item\"\n >\n <div className=\"quote-management-product-list-table__note-content\">\n <strong className=\"quote-management-product-list-table__note-meta\">\n {/* TODO: When backend exposes creator_name for notes, replace (Buyer) with the actual name */}\n {formatNoteTimestamp(note.createdAt)} ({validNotesFromBuyer.includes(note) ? dictionary.buyer : dictionary.seller})\n </strong>{' '}\n {dictionary.leftANote}\n </div>\n <div className=\"quote-management-product-list-table__note-text\">\n {note.note}{' '}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n };\n\n const expandedRows = new Set<number>();\n const rowData = items.flatMap((item, index) => {\n const notes = getNotesContent(item);\n if (notes || item.outOfStock) {\n expandedRows.add(index);\n }\n\n const quantityElement = canEdit ? (\n <Input\n className=\"quote-management-product-list-table__quantity-input\"\n type=\"number\"\n min=\"1\"\n value={\n currentQuantities[item.uid]?.toString() || item.quantity.toString()\n }\n onChange={(e) => handleQuantityChange(e, item)}\n disabled={readOnly || !canEdit}\n data-testid={`quantity-input-${item.product.sku}`}\n />\n ) : (\n <span className=\"quote-management-product-list-table__quantity\">\n {item.quantity}\n </span>\n );\n\n const productRow = {\n checkbox: (\n <Checkbox\n className=\"quote-management-product-list-table__checkbox\"\n name=\"itemSelected\"\n data-testid={`item-checkbox-${item.product.sku}`}\n onChange={(e) => handleItemCheckboxChange(e, item)}\n value={item.product.sku}\n />\n ),\n productName: getProductNameContent(item),\n sku: (\n <span className=\"quote-management-product-list-table__sku\">\n {item.product.sku}\n </span>\n ),\n price: (\n <Price\n className=\"quote-management-product-list-table__price\"\n amount={item.prices.originalItemPrice.value}\n currency={item.prices.originalItemPrice.currency}\n />\n ),\n quantity: quantityElement,\n discount: item.catalogDiscount\n ? discountElement(\n item.catalogDiscount.amountOff,\n item.catalogDiscount.percentOff\n )\n : undefined,\n subtotal: (\n <Price\n className=\"quote-management-product-list-table__subtotal\"\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n />\n ),\n actions: (\n <Picker\n className=\"quote-management-product-list-table__actions\"\n data-testid={`item-dropdown-${item.product.sku}`}\n name={`item-dropdown-${item.product.sku}`}\n handleSelect={(e) => handleItemDropdownChange(e, item)}\n placeholder=\"Select\"\n value={dropdownSelections?.[item.uid] ?? ''}\n options={[\n { text: dictionary.editNoteToSeller, value: 'edit' },\n { text: dictionary.remove, value: 'remove' },\n ]}\n />\n ),\n _rowDetails: <>\n {/* If the item is out of stock, show a message */}\n {item.outOfStock && (\n <div className=\"quote-management-product-list-table__out-of-stock-message\">\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.outOfStock}\n description={dictionary.outOfStockMessage}\n />\n </div>\n )}\n {/* If there are notes, create a notes details */}\n {notes && (\n <div className=\"quote-management-product-list-table__notes-row-wrapper\">\n {notes}\n </div>\n )}\n </>\n };\n\n return [productRow];\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n expandedRows={expandedRows}\n />\n );\n\n // if can edit, the wrapper node should use the form element, else use the div element\n const wrapperNode = canEdit ? h('form', {}) : h('div', {});\n const wrapperProps = canEdit\n ? {\n onSubmit: handleUpdate,\n ...props,\n }\n : props;\n\n const submitButton = (\n <Button\n type=\"submit\"\n disabled={readOnly || !canEdit || !hasQuantityChanges}\n data-testid=\"product-list-table-submit-button\"\n >\n {dictionary.updateButton}\n </Button>\n );\n\n return (\n <VComponent\n node={wrapperNode}\n className={classes([\n 'quote-management-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...wrapperProps}\n >\n {table}\n <div className=\"quote-management-product-list-table-container__submit-container\">\n {submitButton}\n </div>\n </VComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/QuotePricesSummary/QuotePricesSummary.css';\nimport { Accordion, AccordionSection } from '@adobe-commerce/elsie/components';\n\ninterface Entry {\n label: string;\n id: string;\n value: VNode;\n strong?: boolean;\n children?: Entry[];\n}\n\nexport interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement> {\n entries?: Entry[];\n}\n\nexport const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps> = ({\n className,\n entries,\n ...props\n}) => {\n const createEntry = (entry: Entry) => {\n const children = entry.children?.map(createEntry);\n return (\n <div key={entry.id} className=\"quote-management-quote-prices-summary__entry\" data-testid={`quote-prices-summary-entry-${entry.id}`}>\n {children ? <Accordion\n className=\"quote-management-quote-prices-summary__accordion\"\n data-testid={`quote-prices-summary-entry-accordion-${entry.id}`}\n >\n <AccordionSection className=\"quote-management-quote-prices-summary__accordion-section\" title={entry.label} ariaLabelTitle={entry.label} secondaryText={entry.value}>\n {children}\n </AccordionSection>\n </Accordion>\n :\n <>\n <span className={classes(['quote-management-quote-prices-summary__label', ['quote-management-quote-prices-summary__label--strong', entry.strong]])} data-testid={`quote-prices-summary-entry-label-${entry.id}`}>{entry.label}</span>\n <span className=\"quote-management-quote-prices-summary__value\" data-testid={`quote-prices-summary-entry-value-${entry.id}`}>{entry.value}</span>\n </>\n }\n </div>\n );\n };\n\n return (\n <div className={classes(['quote-management-quote-prices-summary', className])} data-testid=\"quote-prices-summary\" {...props}>\n {entries?.map(createEntry)}\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n Button,\n TextArea,\n Input,\n Modal,\n Price,\n Table,\n} from '@adobe-commerce/elsie/components';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/LineItemNoteModal/LineItemNoteModal.css';\n\nexport interface LineItemNoteModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open: boolean;\n item: CartItemModel;\n onClose?: () => void;\n onConfirm: (note: string, quantity: number) => void;\n isSubmitting?: boolean;\n errorBanner?: VNode;\n successBanner?: VNode;\n showCloseButton?: boolean;\n readOnlyQuantity?: boolean;\n}\n\nexport const LineItemNoteModal: FunctionComponent<LineItemNoteModalProps> = ({\n className,\n open,\n item,\n onClose,\n onConfirm,\n isSubmitting = false,\n errorBanner,\n successBanner,\n showCloseButton = true,\n readOnlyQuantity = false,\n}) => {\n const [note, setNote] = useState('');\n const [quantity, setQuantity] = useState(item.quantity);\n const [errors, setErrors] = useState<{ note?: string; quantity?: string }>(\n {}\n );\n\n const dictionary = useText({\n title: 'NegotiableQuote.Manage.lineItemNote.title',\n productLabel: 'NegotiableQuote.Manage.lineItemNote.productLabel',\n skuLabel: 'NegotiableQuote.Manage.lineItemNote.skuLabel',\n priceLabel: 'NegotiableQuote.Manage.lineItemNote.priceLabel',\n stockLabel: 'NegotiableQuote.Manage.lineItemNote.stockLabel',\n quantityLabel: 'NegotiableQuote.Manage.lineItemNote.quantityLabel',\n discountLabel: 'NegotiableQuote.Manage.lineItemNote.discountLabel',\n subtotalLabel: 'NegotiableQuote.Manage.lineItemNote.subtotalLabel',\n noteLabel: 'NegotiableQuote.Manage.lineItemNote.noteLabel',\n notePlaceholder: 'NegotiableQuote.Manage.lineItemNote.notePlaceholder',\n noteHelper: 'NegotiableQuote.Manage.lineItemNote.noteHelper',\n confirmButton: 'NegotiableQuote.Manage.lineItemNote.confirmButton',\n cancelButton: 'NegotiableQuote.Manage.lineItemNote.cancelButton',\n noteError: 'NegotiableQuote.Manage.lineItemNote.noteError',\n quantityError: 'NegotiableQuote.Manage.lineItemNote.quantityError',\n });\n\n // Reset form when modal opens with new item\n useEffect(() => {\n if (open) {\n // Get the most recent valid note from buyer (if exists)\n const validNotes =\n item.noteFromBuyer?.filter((note) => note && note.note) || [];\n const existingNote = validNotes.length > 0 ? validNotes[0].note : '';\n setNote(existingNote || '');\n setQuantity(item.quantity);\n setErrors({});\n }\n }, [open, item.quantity, item.noteFromBuyer]);\n\n const handleConfirm = useCallback(() => {\n const newErrors: { note?: string; quantity?: string } = {};\n\n // Check if the note field is empty\n if (!note.trim()) {\n newErrors.note = dictionary.noteError;\n }\n\n // Only validate quantity if it's editable\n if (!readOnlyQuantity && quantity <= 0) {\n newErrors.quantity = dictionary.quantityError;\n }\n\n if (Object.keys(newErrors).length > 0) {\n setErrors(newErrors);\n return;\n }\n\n onConfirm(note.trim(), quantity);\n }, [note, quantity, onConfirm, dictionary, readOnlyQuantity]);\n\n const handleCancel = useCallback(() => {\n setNote('');\n setQuantity(item.quantity);\n setErrors({});\n onClose?.();\n }, [onClose, item.quantity]);\n\n if (!open) {\n return null;\n }\n\n // Calculate discount display\n const hasDiscount = item.discounts && item.discounts.length > 0;\n const discountDisplay = hasDiscount\n ? item.discounts.map((d) => d.label).join(', ')\n : '-';\n\n // Define table columns\n const columns = [\n {\n label: dictionary.productLabel,\n key: 'productName',\n },\n {\n label: dictionary.priceLabel,\n key: 'price',\n },\n {\n label: dictionary.stockLabel,\n key: 'stock',\n },\n {\n label: dictionary.quantityLabel,\n key: 'quantity',\n },\n {\n label: dictionary.discountLabel,\n key: 'discount',\n },\n {\n label: dictionary.subtotalLabel,\n key: 'subtotal',\n },\n ];\n\n // Define table row data\n const rowData = [\n {\n productName: (\n <div className=\"quote-management-line-item-note-modal__product-info\">\n <div className=\"quote-management-line-item-note-modal__product-name\">\n {item.product.name}\n </div>\n <div className=\"quote-management-line-item-note-modal__product-sku\">\n {dictionary.skuLabel}: {item.product.sku}\n </div>\n </div>\n ),\n price: (\n <Price\n amount={item.prices.originalItemPrice.value}\n currency={item.prices.originalItemPrice.currency}\n />\n ),\n stock: (\n <span className=\"quote-management-line-item-note-modal__stock\">\n {item.stockStatus}\n </span>\n ),\n quantity: readOnlyQuantity ? (\n <span className=\"quote-management-line-item-note-modal__quantity-readonly\">\n {item.quantity}\n </span>\n ) : (\n <Input\n name=\"quantity\"\n type=\"number\"\n min=\"1\"\n value={quantity.toString()}\n onInput={(e: any) => {\n const newQuantity = parseInt(e.target.value, 10) || 0;\n setQuantity(newQuantity);\n setErrors({ ...errors, quantity: undefined });\n }}\n disabled={isSubmitting}\n error={!!errors.quantity}\n required\n data-testid=\"line-item-note-quantity-input\"\n className=\"quote-management-line-item-note-modal__quantity-input\"\n />\n ),\n discount: (\n <span className=\"quote-management-line-item-note-modal__discount\">\n {discountDisplay}\n </span>\n ),\n subtotal: (\n <Price\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n />\n ),\n },\n ];\n\n return (\n <Modal\n open={open}\n size=\"medium\"\n title={<>{dictionary.title}</>}\n onClose={handleCancel}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n className={classes(['quote-management-line-item-note-modal', className])}\n data-testid=\"line-item-note-modal\"\n >\n {errorBanner && (\n <div\n className=\"quote-management-line-item-note-modal__error-banner\"\n data-testid=\"line-item-note-modal-error-banner\"\n >\n {errorBanner}\n </div>\n )}\n\n {successBanner && (\n <div\n className=\"quote-management-line-item-note-modal__success-banner\"\n data-testid=\"line-item-note-modal-success-banner\"\n >\n {successBanner}\n </div>\n )}\n\n <div className=\"quote-management-line-item-note-modal__content\">\n {/* Product Details Table */}\n <div className=\"quote-management-line-item-note-modal__details\">\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"line-item-note-table\"\n mobileLayout=\"stacked\"\n className=\"quote-management-line-item-note-modal__details-table\"\n />\n {errors.quantity && (\n <div className=\"quote-management-line-item-note-modal__table-error\">\n {errors.quantity}\n </div>\n )}\n </div>\n\n {/* Note TextArea */}\n <div className=\"quote-management-line-item-note-modal__form-field\">\n <TextArea\n name=\"note\"\n placeholder={dictionary.notePlaceholder}\n rows={4}\n value={note}\n onInput={(e: any) => {\n setNote(e.target.value);\n setErrors({ ...errors, note: undefined });\n }}\n label={dictionary.noteLabel}\n disabled={isSubmitting}\n data-testid=\"line-item-note-textarea\"\n />\n {!errors.note && (\n <span className=\"quote-management-line-item-note-modal__helper-text\">\n {dictionary.noteHelper}\n </span>\n )}\n {errors.note && (\n <span className=\"quote-management-line-item-note-modal__error-text\">\n {errors.note}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"quote-management-line-item-note-modal__actions\">\n <Button\n variant=\"secondary\"\n size=\"medium\"\n onClick={handleCancel}\n disabled={isSubmitting}\n className=\"quote-management-line-item-note-modal__cancel-button\"\n data-testid=\"line-item-note-cancel-button\"\n >\n {dictionary.cancelButton}\n </Button>\n <Button\n variant=\"primary\"\n size=\"medium\"\n onClick={handleConfirm}\n disabled={isSubmitting}\n className=\"quote-management-line-item-note-modal__confirm-button\"\n data-testid=\"line-item-note-confirm-button\"\n >\n {dictionary.confirmButton}\n </Button>\n </div>\n </Modal>\n );\n};\n"],"names":["ItemsQuoted","className","loading","table","pricesSummary","props","ItemsQuotedSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","ProductListTable","items","canEdit","readOnly","showActions","onItemCheckboxChange","onItemDropdownChange","onQuantityChange","onUpdate","dropdownSelections","originalQuantities","setOriginalQuantities","useState","currentQuantities","setCurrentQuantities","useEffect","quantities","item","hasQuantityChanges","uid","dictionary","useText","columns","handleItemCheckboxChange","event","isSelected","handleItemDropdownChange","action","handleQuantityChange","newQuantity","prev","handleUpdate","discountElement","amountOff","percentOff","Price","getProductNameContent","configurableOptions","_a","option","bundleOptions","_b","value","formatNoteTimestamp","timestamp","getUserTimezone","getNotesContent","validNotesFromBuyer","note","validNotesFromSeller","validNotes","index","expandedRows","rowData","notes","quantityElement","Input","e","Checkbox","Picker","Fragment","InLineAlert","WarningFilled","Table","wrapperNode","h","wrapperProps","submitButton","Button","QuotePricesSummary","entries","createEntry","entry","children","Accordion","AccordionSection","LineItemNoteModal","open","onClose","onConfirm","isSubmitting","errorBanner","successBanner","showCloseButton","readOnlyQuantity","setNote","quantity","setQuantity","errors","setErrors","existingNote","handleConfirm","useCallback","newErrors","handleCancel","discountDisplay","d","Modal","TextArea"],"mappings":"+uBAqBO,MAAMA,GAAmD,CAAC,CAC/D,UAAAC,EACA,QAAAC,EACA,MAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IACMH,IACMI,GAAA,EAAoB,EAI5BC,EAAC,MAAA,CAAI,UAAWC,EAAQ,CAAC,gCAAiCP,CAAS,CAAC,EAAI,GAAGI,EACxE,SAAA,CAAAF,GACCM,EAACC,EAAA,CACC,KAAMP,EACN,UAAWK,EAAQ,CAAC,sCAAsC,CAAC,EAC3D,cAAY,sCAAA,CAAA,EAGfJ,GACCK,EAACC,EAAA,CACC,KAAMN,EACN,UAAWI,EAAQ,CAAC,+CAA+C,CAAC,EACpE,cAAY,+CAAA,CAAA,CACd,EAEJ,EAISF,GAAyC,MAEjDK,GAAA,CAAS,cAAY,wBACpB,SAAAF,EAACG,IAAY,QAAQ,MAAM,UAAW,GAAM,KAAK,SAAS,MAAO,EAAG,aAAa,SAAS,EAC5F,ECXSC,GAA6D,CAAC,CACzE,UAAAZ,EACA,MAAAa,EACA,QAAAC,EACA,SAAAC,EAAW,GACX,YAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,iBAAAC,EACA,SAAAC,EACA,mBAAAC,EACA,GAAGjB,CACL,IAAM,CAEJ,KAAM,CAACkB,EAAoBC,CAAqB,EAAIC,EAElD,CAAA,CAAE,EACE,CAACC,EAAmBC,CAAoB,EAAIF,EAEhD,CAAA,CAAE,EAGJG,GAAU,IAAM,CACd,MAAMC,EAAqC,CAAA,EAC3Cf,EAAM,QAASgB,GAAS,CACtBD,EAAWC,EAAK,GAAG,EAAIA,EAAK,QAC9B,CAAC,EACDN,EAAsBK,CAAU,EAChCF,EAAqBE,CAAU,CACjC,EAAG,CAACf,CAAK,CAAC,EAGV,MAAMiB,EAAqB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ACC,QAAQ,YACR,KAAK,SACL,QAAS0B,EACT,SAAUd,EACV,UAAU,uDACV,cAAY,+BAEX,SAAA5D,EAAW,YAAA,CAAA,EAEdxB,EAACwE,EAAA,CACC,QAAQ,UACR,KAAK,SACL,QAASuB,EACT,SAAUX,EACV,UAAU,wDACV,cAAY,gCAEX,SAAA5D,EAAW,aAAA,CAAA,CACd,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
@@ -59,6 +59,7 @@ const e=`
59
59
  firstname
60
60
  lastname
61
61
  }
62
+ email
62
63
  comments {
63
64
  uid
64
65
  created_at
@@ -1 +1 @@
1
- {"version":3,"file":"NegotiableQuoteFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/ShippingMethodFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteAddressFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SELECTED_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_SHIPPING_METHOD_FRAGMENT on SelectedShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { SELECTED_SHIPPING_METHOD_FRAGMENT } from './ShippingMethodFragment';\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n }\n\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT } from './NegotiableQuoteAddressFragment';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n is_virtual\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n template_id\n template_name\n total_quantity\n items {\n __typename\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n row_total_including_tax {\n value\n currency\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n is_available\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on SimpleCartItem {\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n configured_variant {\n uid\n sku\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n products_removed {\n products_removed_from_catalog\n products_removed_from_quote {\n uid\n name\n sku\n quantity\n }\n }\n }\n }\n prices {\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n }\n\n ${NEGOTIABLE_QUOTE_S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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqVnDD,CAA0C;"}
1
+ {"version":3,"file":"NegotiableQuoteFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/ShippingMethodFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteAddressFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const SELECTED_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_SHIPPING_METHOD_FRAGMENT on SelectedShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { SELECTED_SHIPPING_METHOD_FRAGMENT } from './ShippingMethodFragment';\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n }\n\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT } from './NegotiableQuoteAddressFragment';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n is_virtual\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n email\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n template_id\n template_name\n total_quantity\n items {\n __typename\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n row_total_including_tax {\n value\n currency\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n is_available\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on SimpleCartItem {\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n configured_variant {\n uid\n sku\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n products_removed {\n products_removed_from_catalog\n products_removed_from_quote {\n uid\n name\n sku\n quantity\n }\n }\n }\n }\n prices {\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n }\n\n ${NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT}\n`;\n"],"names":["SELECTED_SHIPPING_METHOD_FRAGMENT","NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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ated_at
10
10
  status
11
- # sales_rep_name
11
+ sales_rep_name
12
12
  expiration_date
13
13
  buyer {
14
14
  firstname
@@ -28,26 +28,84 @@ const e=`
28
28
  }
29
29
  }
30
30
  items {
31
+ __typename
31
32
  uid
32
33
  product {
33
34
  name
34
35
  sku
35
36
  uid
36
37
  stock_status
38
+ quantity
39
+ thumbnail {
40
+ label
41
+ url
42
+ }
43
+ price_range {
44
+ minimum_price {
45
+ regular_price {
46
+ value
47
+ currency
48
+ }
49
+ final_price {
50
+ value
51
+ currency
52
+ }
53
+ discount {
54
+ percent_off
55
+ amount_off
56
+ }
57
+ }
58
+ maximum_price {
59
+ regular_price {
60
+ value
61
+ currency
62
+ }
63
+ final_price {
64
+ value
65
+ currency
66
+ }
67
+ discount {
68
+ percent_off
69
+ amount_off
70
+ }
71
+ }
72
+ }
73
+ price_tiers {
74
+ quantity
75
+ final_price {
76
+ value
77
+ }
78
+ discount {
79
+ amount_off
80
+ percent_off
81
+ }
82
+ }
37
83
  }
38
84
  prices {
39
85
  price {
40
86
  currency
41
87
  value
42
88
  }
89
+ price_including_tax {
90
+ value
91
+ currency
92
+ }
43
93
  original_item_price {
44
94
  currency
45
95
  value
46
96
  }
97
+ original_row_total {
98
+ currency
99
+ value
100
+ }
47
101
  row_total {
48
102
  currency
49
103
  value
50
104
  }
105
+ row_total_including_tax {
106
+ value
107
+ currency
108
+ }
51
109
  catalog_discount {
52
110
  amount_off
53
111
  percent_off
@@ -62,27 +120,97 @@ const e=`
62
120
  }
63
121
  }
64
122
  quantity
123
+ is_available
65
124
  note_from_buyer {
66
125
  created_at
67
126
  creator_id
68
127
  creator_type
69
- # negotiable_quote_template_item_uid
128
+ negotiable_quote_item_uid
70
129
  note
71
130
  note_uid
131
+ __typename
72
132
  }
73
133
  note_from_seller {
74
134
  created_at
75
135
  creator_id
76
136
  creator_type
77
- # negotiable_quote_template_item_uid
137
+ negotiable_quote_item_uid
78
138
  note
79
139
  note_uid
140
+ __typename
141
+ }
142
+ ... on SimpleCartItem {
143
+ customizable_options {
144
+ type
145
+ label
146
+ values {
147
+ label
148
+ value
149
+ }
150
+ }
80
151
  }
81
152
  ... on ConfigurableCartItem {
82
153
  configurable_options {
83
154
  option_label
84
155
  value_label
85
156
  }
157
+ configured_variant {
158
+ uid
159
+ sku
160
+ stock_status
161
+ thumbnail {
162
+ label
163
+ url
164
+ }
165
+ price_range {
166
+ minimum_price {
167
+ regular_price {
168
+ value
169
+ currency
170
+ }
171
+ final_price {
172
+ value
173
+ currency
174
+ }
175
+ discount {
176
+ percent_off
177
+ amount_off
178
+ }
179
+ }
180
+ maximum_price {
181
+ regular_price {
182
+ value
183
+ currency
184
+ }
185
+ final_price {
186
+ value
187
+ currency
188
+ }
189
+ discount {
190
+ percent_off
191
+ amount_off
192
+ }
193
+ }
194
+ }
195
+ price_tiers {
196
+ quantity
197
+ final_price {
198
+ value
199
+ }
200
+ discount {
201
+ amount_off
202
+ percent_off
203
+ }
204
+ }
205
+ }
206
+ customizable_options {
207
+ type
208
+ label
209
+ values {
210
+ label
211
+ value
212
+ }
213
+ }
86
214
  }
87
215
  ... on BundleCartItem {
88
216
  bundle_options {
@@ -101,6 +229,20 @@ const e=`
101
229
  }
102
230
  }
103
231
  }
232
+ ... on DownloadableCartItem {
233
+ links {
234
+ sort_order
235
+ title
236
+ }
237
+ customizable_options {
238
+ type
239
+ label
240
+ values {
241
+ label
242
+ value
243
+ }
244
+ }
245
+ }
104
246
  }
105
247
  history {
106
248
  uid
@@ -185,6 +327,12 @@ const e=`
185
327
  }
186
328
  telephone
187
329
  }
330
+ reference_document_links {
331
+ link_id
332
+ document_name
333
+ document_identifier
334
+ reference_document_url
335
+ }
188
336
  }
189
337
  `;export{e as N};
190
338
  //# sourceMappingURL=NegotiableQuoteTemplateFragment.js.map