@dropins/storefront-quote-management 1.2.0-beta.1 → 1.2.1-beta.0

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 (273) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/api/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +1 -2
  3. package/api/acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts +0 -1
  4. package/api/acceptQuoteTemplate/index.d.ts +0 -1
  5. package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +1 -2
  6. package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +0 -1
  7. package/api/addQuoteTemplateLineItemNote/index.d.ts +0 -1
  8. package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +1 -2
  9. package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +0 -1
  10. package/api/addQuoteTemplateShippingAddress/index.d.ts +0 -1
  11. package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +1 -2
  12. package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +0 -1
  13. package/api/cancelQuoteTemplate/index.d.ts +0 -1
  14. package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +0 -1
  15. package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +0 -1
  16. package/api/closeNegotiableQuote/index.d.ts +0 -1
  17. package/api/createQuoteTemplate/createQuoteTemplate.d.ts +8 -2
  18. package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +0 -1
  19. package/api/createQuoteTemplate/index.d.ts +0 -1
  20. package/api/deleteQuote/deleteQuote.d.ts +0 -1
  21. package/api/deleteQuote/graphql/DeleteQuoteMutation.d.ts +0 -1
  22. package/api/deleteQuote/index.d.ts +0 -1
  23. package/api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts +0 -1
  24. package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +0 -1
  25. package/api/deleteQuoteTemplate/index.d.ts +0 -1
  26. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +8 -2
  27. package/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.d.ts +0 -1
  28. package/api/duplicateNegotiableQuote/index.d.ts +0 -1
  29. package/api/fetch-graphql/fetch-graphql.d.ts +3 -4
  30. package/api/fetch-graphql/index.d.ts +0 -1
  31. package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +0 -1
  32. package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +0 -1
  33. package/api/generateQuoteFromTemplate/index.d.ts +0 -1
  34. package/api/getQuoteData/getQuoteData.d.ts +1 -2
  35. package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +0 -1
  36. package/api/getQuoteData/index.d.ts +0 -1
  37. package/api/getQuoteTemplateData/getQuoteTemplateData.d.ts +8 -2
  38. package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +0 -1
  39. package/api/getQuoteTemplateData/index.d.ts +0 -1
  40. package/api/getQuoteTemplates/getQuoteTemplates.d.ts +8 -2
  41. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +0 -1
  42. package/api/getQuoteTemplates/index.d.ts +0 -1
  43. package/api/getStoreConfig/getStoreConfig.d.ts +8 -2
  44. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +0 -1
  45. package/api/getStoreConfig/index.d.ts +0 -1
  46. package/api/graphql/NegotiableQuoteAddressFragment.d.ts +0 -1
  47. package/api/graphql/NegotiableQuoteFragment.d.ts +0 -1
  48. package/api/graphql/NegotiableQuoteListFragment.d.ts +0 -1
  49. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +0 -1
  50. package/api/graphql/SearchResultPageInfoFragment.d.ts +0 -1
  51. package/api/graphql/ShippingMethodFragment.d.ts +0 -1
  52. package/api/graphql/SortFieldsFragment.d.ts +0 -1
  53. package/api/index.d.ts +0 -1
  54. package/api/initialize/index.d.ts +0 -1
  55. package/api/initialize/initialize.d.ts +10 -12
  56. package/api/negotiableQuotes/graphql/NegotiableQuotesQuery.d.ts +0 -1
  57. package/api/negotiableQuotes/index.d.ts +0 -1
  58. package/api/negotiableQuotes/negotiableQuotes.d.ts +8 -2
  59. package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +0 -1
  60. package/api/openQuoteTemplate/index.d.ts +0 -1
  61. package/api/openQuoteTemplate/openQuoteTemplate.d.ts +1 -2
  62. package/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.d.ts +0 -1
  63. package/api/removeNegotiableQuoteItems/index.d.ts +0 -1
  64. package/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.d.ts +8 -2
  65. package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +0 -1
  66. package/api/removeQuoteTemplateItems/index.d.ts +0 -1
  67. package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +1 -2
  68. package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +0 -1
  69. package/api/renameNegotiableQuote/index.d.ts +0 -1
  70. package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +8 -2
  71. package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +0 -1
  72. package/api/requestNegotiableQuote/index.d.ts +0 -1
  73. package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +8 -2
  74. package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +0 -1
  75. package/api/sendForReview/index.d.ts +0 -1
  76. package/api/sendForReview/sendForReview.d.ts +8 -2
  77. package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +0 -1
  78. package/api/sendQuoteTemplateForReview/index.d.ts +0 -1
  79. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +1 -2
  80. package/api/setLineItemNote/graphql/SetLineItemNoteMutation.d.ts +0 -1
  81. package/api/setLineItemNote/index.d.ts +0 -1
  82. package/api/setLineItemNote/setLineItemNote.d.ts +8 -2
  83. package/api/setQuoteTemplateExpirationDate/graphql/setQuoteTemplateExpirationDate.d.ts +0 -1
  84. package/api/setQuoteTemplateExpirationDate/index.d.ts +0 -1
  85. package/api/setQuoteTemplateExpirationDate/setQuoteTemplateExpirationDate.d.ts +8 -2
  86. package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +0 -1
  87. package/api/setShippingAddress/index.d.ts +0 -1
  88. package/api/setShippingAddress/setShippingAddress.d.ts +8 -2
  89. package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +0 -1
  90. package/api/updateQuantities/index.d.ts +0 -1
  91. package/api/updateQuantities/updateQuantities.d.ts +8 -2
  92. package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +0 -1
  93. package/api/updateQuoteTemplateItemQuantities/index.d.ts +0 -1
  94. package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +1 -2
  95. package/api/uploadFile/graphql/FinishUploadMutation.d.ts +0 -1
  96. package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +0 -1
  97. package/api/uploadFile/index.d.ts +0 -1
  98. package/api/uploadFile/uploadFile.d.ts +0 -1
  99. package/api.d.ts +1 -1
  100. package/api.js +1 -1
  101. package/api.js.map +1 -1
  102. package/chunks/ShippingAddressDisplay.js +1 -1
  103. package/chunks/components.js +1 -1
  104. package/components/ActionsBar/ActionsBar.d.ts +8 -2
  105. package/components/ActionsBar/index.d.ts +0 -1
  106. package/components/AttachedFilesList/AttachedFilesList.d.ts +8 -2
  107. package/components/AttachedFilesList/index.d.ts +0 -1
  108. package/components/ConfirmationModal/ConfirmationModal.d.ts +8 -2
  109. package/components/ConfirmationModal/index.d.ts +0 -1
  110. package/components/ExpirationDateModal/ExpirationDateModal.d.ts +8 -2
  111. package/components/ExpirationDateModal/index.d.ts +0 -1
  112. package/components/ItemsQuoted/ItemsQuoted.d.ts +8 -2
  113. package/components/ItemsQuoted/index.d.ts +0 -1
  114. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +8 -2
  115. package/components/LineItemNoteModal/index.d.ts +0 -1
  116. package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +8 -2
  117. package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +1 -3
  118. package/components/ManageNegotiableQuote/index.d.ts +0 -1
  119. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +8 -2
  120. package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +1 -3
  121. package/components/ManageNegotiableQuoteTemplate/index.d.ts +0 -1
  122. package/components/OrderSummary/OrderSummary.d.ts +8 -2
  123. package/components/OrderSummary/index.d.ts +0 -1
  124. package/components/OrderSummaryLine/OrderSummaryLine.d.ts +8 -2
  125. package/components/OrderSummaryLine/index.d.ts +0 -1
  126. package/components/ProductListTable/ProductListTable.d.ts +8 -2
  127. package/components/ProductListTable/index.d.ts +0 -1
  128. package/components/QuoteCommentsList/QuoteCommentsList.d.ts +8 -2
  129. package/components/QuoteCommentsList/index.d.ts +0 -1
  130. package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +8 -2
  131. package/components/QuoteHistoryLog/index.d.ts +0 -1
  132. package/components/QuotePricesSummary/QuotePricesSummary.d.ts +8 -2
  133. package/components/QuotePricesSummary/index.d.ts +0 -1
  134. package/components/QuoteSummaryList/QuoteSummaryList.d.ts +8 -2
  135. package/components/QuoteSummaryList/index.d.ts +0 -1
  136. package/components/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +8 -2
  137. package/components/QuoteTemplatesListTable/index.d.ts +0 -1
  138. package/components/QuotesListTable/QuotesListTable.d.ts +8 -2
  139. package/components/QuotesListTable/index.d.ts +0 -1
  140. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +8 -2
  141. package/components/ReferenceDocumentFormModal/index.d.ts +0 -1
  142. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +8 -2
  143. package/components/ReferenceDocumentsList/index.d.ts +0 -1
  144. package/components/RenameQuoteModal/RenameQuoteModal.d.ts +8 -2
  145. package/components/RenameQuoteModal/index.d.ts +0 -1
  146. package/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +8 -2
  147. package/components/RequestNegotiableQuoteForm/index.d.ts +0 -1
  148. package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +8 -2
  149. package/components/ShippingAddressDisplay/index.d.ts +0 -1
  150. package/components/TabbedContent/TabbedContent.d.ts +8 -2
  151. package/components/TabbedContent/index.d.ts +0 -1
  152. package/components/index.d.ts +0 -1
  153. package/containers/ItemsQuoted/ItemsQuoted.d.ts +9 -3
  154. package/containers/ItemsQuoted/index.d.ts +0 -1
  155. package/containers/ItemsQuoted.d.ts +1 -3
  156. package/containers/ItemsQuoted.js +1 -1
  157. package/containers/ItemsQuoted.js.map +1 -1
  158. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +9 -3
  159. package/containers/ItemsQuotedTemplate/index.d.ts +0 -1
  160. package/containers/ItemsQuotedTemplate.d.ts +1 -3
  161. package/containers/ItemsQuotedTemplate.js +1 -1
  162. package/containers/ItemsQuotedTemplate.js.map +1 -1
  163. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +9 -3
  164. package/containers/ManageNegotiableQuote/index.d.ts +0 -1
  165. package/containers/ManageNegotiableQuote.d.ts +1 -3
  166. package/containers/ManageNegotiableQuote.js +3 -1
  167. package/containers/ManageNegotiableQuote.js.map +1 -1
  168. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +9 -3
  169. package/containers/ManageNegotiableQuoteTemplate/index.d.ts +0 -1
  170. package/containers/ManageNegotiableQuoteTemplate.d.ts +1 -3
  171. package/containers/ManageNegotiableQuoteTemplate.js +1 -3
  172. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
  173. package/containers/OrderSummary/OrderSummary.d.ts +9 -3
  174. package/containers/OrderSummary/index.d.ts +0 -1
  175. package/containers/OrderSummary.d.ts +1 -3
  176. package/containers/OrderSummary.js +1 -1
  177. package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +9 -3
  178. package/containers/OrderSummaryLine/index.d.ts +0 -1
  179. package/containers/OrderSummaryLine.d.ts +1 -3
  180. package/containers/OrderSummaryLine.js +1 -1
  181. package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -3
  182. package/containers/QuoteCommentsList/index.d.ts +0 -1
  183. package/containers/QuoteCommentsList.d.ts +1 -3
  184. package/containers/QuoteCommentsList.js +1 -1
  185. package/containers/QuoteCommentsList.js.map +1 -1
  186. package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -3
  187. package/containers/QuoteHistoryLog/index.d.ts +0 -1
  188. package/containers/QuoteHistoryLog.d.ts +1 -3
  189. package/containers/QuoteHistoryLog.js +1 -1
  190. package/containers/QuoteHistoryLog.js.map +1 -1
  191. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +10 -4
  192. package/containers/QuoteSummaryList/index.d.ts +0 -1
  193. package/containers/QuoteSummaryList.d.ts +1 -3
  194. package/containers/QuoteSummaryList.js +1 -1
  195. package/containers/QuoteSummaryList.js.map +1 -1
  196. package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -3
  197. package/containers/QuoteTemplateCommentsList/index.d.ts +0 -1
  198. package/containers/QuoteTemplateCommentsList.d.ts +1 -3
  199. package/containers/QuoteTemplateCommentsList.js +1 -1
  200. package/containers/QuoteTemplateCommentsList.js.map +1 -1
  201. package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -3
  202. package/containers/QuoteTemplateHistoryLog/index.d.ts +0 -1
  203. package/containers/QuoteTemplateHistoryLog.d.ts +1 -3
  204. package/containers/QuoteTemplateHistoryLog.js +1 -1
  205. package/containers/QuoteTemplateHistoryLog.js.map +1 -1
  206. package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +9 -3
  207. package/containers/QuoteTemplatesListTable/index.d.ts +0 -1
  208. package/containers/QuoteTemplatesListTable.d.ts +1 -3
  209. package/containers/QuoteTemplatesListTable.js +1 -1
  210. package/containers/QuotesListTable/QuotesListTable.d.ts +9 -3
  211. package/containers/QuotesListTable/index.d.ts +0 -1
  212. package/containers/QuotesListTable.d.ts +1 -3
  213. package/containers/QuotesListTable.js +1 -1
  214. package/containers/QuotesListTable.js.map +1 -1
  215. package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +9 -3
  216. package/containers/RequestNegotiableQuoteForm/index.d.ts +0 -1
  217. package/containers/RequestNegotiableQuoteForm.d.ts +1 -3
  218. package/containers/RequestNegotiableQuoteForm.js +1 -1
  219. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +9 -3
  220. package/containers/ShippingAddressDisplay/index.d.ts +0 -1
  221. package/containers/ShippingAddressDisplay.d.ts +1 -1
  222. package/containers/index.d.ts +0 -1
  223. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +8 -2
  224. package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +8 -2
  225. package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +8 -2
  226. package/data/models/__fixtures__/negotiableQuotesListModel.d.ts +8 -2
  227. package/data/models/__fixtures__/storeConfigModel.d.ts +8 -2
  228. package/data/models/index.d.ts +0 -1
  229. package/data/models/negotiable-quote-model.d.ts +1 -2
  230. package/data/models/negotiable-quote-template-model.d.ts +8 -2
  231. package/data/models/store-config-model.d.ts +0 -1
  232. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +9 -4
  233. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +0 -1
  234. package/data/transforms/__fixtures__/storeConfigData.d.ts +0 -1
  235. package/data/transforms/index.d.ts +0 -1
  236. package/data/transforms/transform-history.d.ts +8 -2
  237. package/data/transforms/transform-quote-items.d.ts +8 -2
  238. package/data/transforms/transform-quote-template.d.ts +8 -2
  239. package/data/transforms/transform-quote.d.ts +8 -2
  240. package/data/transforms/transform-store-config.d.ts +8 -2
  241. package/hooks/useExpirationDate.d.ts +0 -1
  242. package/hooks/useItemsQuotedTemplate.d.ts +8 -2
  243. package/hooks/useQuoteSummaryData.d.ts +9 -4
  244. package/hooks/useReferenceDocumentLinks.d.ts +8 -2
  245. package/hooks/useRemoveTemplateItems.d.ts +8 -2
  246. package/hooks/useRenameTemplate.d.ts +0 -1
  247. package/hooks/useUpdateTemplateQuantities.d.ts +8 -2
  248. package/lib/configurationTransformers.d.ts +0 -1
  249. package/lib/itemFormatters.d.ts +11 -7
  250. package/lib/priceCalculators.d.ts +14 -13
  251. package/lib/state.d.ts +8 -3
  252. package/package.json +1 -1
  253. package/render/Provider.d.ts +8 -2
  254. package/render/index.d.ts +0 -1
  255. package/render/render.d.ts +9 -4
  256. package/render.d.ts +1 -1
  257. package/types/state.types.d.ts +8 -2
  258. package/utils/dateUtils.d.ts +0 -1
  259. package/utils/fileUtils.d.ts +0 -1
  260. package/utils/mapAuthPermissions.d.ts +8 -2
  261. package/chunks/ItemsQuoted.js +0 -4
  262. package/chunks/ItemsQuoted.js.map +0 -1
  263. package/chunks/ItemsQuotedTemplate.js +0 -4
  264. package/chunks/ItemsQuotedTemplate.js.map +0 -1
  265. package/chunks/QuoteCommentsList.js +0 -4
  266. package/chunks/QuoteCommentsList.js.map +0 -1
  267. package/chunks/QuoteHistoryLog.js +0 -4
  268. package/chunks/QuoteHistoryLog.js.map +0 -1
  269. package/chunks/QuoteTemplateCommentsList.js +0 -4
  270. package/chunks/QuoteTemplateCommentsList.js.map +0 -1
  271. package/chunks/QuoteTemplateHistoryLog.js +0 -4
  272. package/chunks/QuoteTemplateHistoryLog.js.map +0 -1
  273. package/i18n/en_US.json.d.ts +0 -485
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{Q as u,Q as d}from"../chunks/QuoteHistoryLog.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";export{u as QuoteHistoryLog,d as default};
3
+ import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{useState as a,useEffect as u}from"@dropins/tools/preact-compat.js";import{events as p}from"@dropins/tools/event-bus.js";import{h as n}from"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";const f=({quoteData:r,...s})=>{const[t,i]=a(r);return u(()=>{const e=p.on("quote-management/quote-data",m=>{i(m.quote)},{eager:!0});return()=>e==null?void 0:e.off()},[]),t?o("div",{...s,children:o(n,{history:t.history,items:t.items,buyer:t.buyer,salesRepName:t.salesRepName})}):null};f.displayName="QuoteHistoryLog";export{f as QuoteHistoryLog,f as default};
4
4
  //# sourceMappingURL=QuoteHistoryLog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteHistoryLog.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"QuoteHistoryLog.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteHistoryLog/QuoteHistoryLog.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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { QuoteHistoryLog as QuoteHistoryLogComponent } from '@/quote-management/components/QuoteHistoryLog';\n\nexport interface QuoteHistoryLogProps extends HTMLAttributes<HTMLDivElement> {\n quoteData?: NegotiableQuoteModel;\n}\n \nexport const QuoteHistoryLog: Container<QuoteHistoryLogProps> = ({ quoteData: initialData, ...props }) => {\n\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n initialData\n );\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n if (!quoteData) {\n return null;\n }\n\n return (\n <div {...props}>\n <QuoteHistoryLogComponent \n history={quoteData.history}\n items={quoteData.items}\n buyer={quoteData.buyer}\n salesRepName={quoteData.salesRepName}\n />\n </div>\n );\n};\n"],"names":["QuoteHistoryLog","initialData","props","quoteData","setQuoteData","useState","useEffect","quoteDataEvent","events","data","jsx","QuoteHistoryLogComponent"],"mappings":"gZAmBO,MAAMA,EAAmD,CAAC,CAAE,UAAWC,EAAa,GAAGC,KAAY,CAExG,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAChCJ,CAAA,EAgBF,OAbAK,EAAU,IAAM,CACd,MAAMC,EAAiBC,EAAO,GAC5B,8BACCC,GAA0C,CACzCL,EAAaK,EAAK,KAAK,CACzB,EACA,CACE,MAAO,EAAA,CACT,EAEF,MAAO,IAAMF,GAAA,YAAAA,EAAgB,KAC/B,EAAG,CAAA,CAAE,EAEAJ,EAKHO,EAAC,MAAA,CAAK,GAAGR,EACP,SAAAQ,EAACC,EAAA,CACC,QAASR,EAAU,QACnB,MAAOA,EAAU,MACjB,MAAOA,EAAU,MACjB,aAAcA,EAAU,YAAA,CAAA,EAE5B,EAXO,IAaX"}
@@ -1,8 +1,15 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { ImageProps } from '@dropins/tools/types/elsie/src/components';
3
- import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
10
+ import { ImageProps } from '@dropins/tools/components';
11
+ import { Container, SlotProps } from '@dropins/tools/lib';
4
12
  import { CartItemModel as NegotiableQuoteItemModel } from '../../data/models';
5
-
6
13
  export interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {
7
14
  hideHeading?: boolean;
8
15
  hideFooter?: boolean;
@@ -48,4 +55,3 @@ export interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {
48
55
  }
49
56
  export type SwitchableAttributes = 'name' | 'image' | 'configurations' | 'warning' | 'alert' | 'sku' | 'price' | 'quantity' | 'total' | 'totalDiscount' | 'totalExcludingTax';
50
57
  export declare const QuoteSummaryList: Container<QuoteSummaryListProps>;
51
- //# sourceMappingURL=QuoteSummaryList.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteSummaryList';
10
10
  export { QuoteSummaryList as default } from './QuoteSummaryList';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './QuoteSummaryList/index'
2
- import _default from './QuoteSummaryList/index'
3
- export default _default
1
+ export * from './QuoteSummaryList/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as c,jsxs as D,Fragment as ee}from"@dropins/tools/preact-jsx-runtime.js";import{useState as A,useEffect as te,useCallback as re}from"@dropins/tools/preact-compat.js";import{Price as T,Image as ne,Button as ae,CartList as ce,Accordion as oe,AccordionSection as ie,CartItem as ue}from"@dropins/tools/components.js";import{Slot as s,classes as le}from"@dropins/tools/lib.js";import{s as se,t as de,u as q}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{Q as v,s as me}from"../api.js";import{events as ge}from"@dropins/tools/event-bus.js";import{useText as ye}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const pe=()=>{const[e,n]=A(void 0),[t,r]=A(!0);return te(()=>{const u=ge.on("quote-management/quote-data",a=>{const{quote:l}=a;l&&(n(l),r(!1))},{eager:!0});return()=>u==null?void 0:u.off()},[]),{quoteData:e,loading:t}},R=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===v.TAX_INCLUDED?e.discounted?{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.priceIncludingTax.value,currency:e.prices.priceIncludingTax.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},U=e=>{var n,t;return{amount:(n=e.savingsAmount)==null?void 0:n.value,currency:(t=e.savingsAmount)==null?void 0:t.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},X=(e,n)=>{var u,a,l,g,y,h,b,P,i,p,f,Q;const t={"aria-label":n.dictionary.regularPrice},r=e.discounted?{}:null;return((u=n.quoteDisplaySettings)==null?void 0:u.price)===v.TAX_INCLUDED||((a=n.quoteDisplaySettings)==null?void 0:a.price)===v.TAX_INCLUDED_AND_EXCLUDED?(t.amount=(l=e.prices.rowTotalIncludingTax)==null?void 0:l.value,t.currency=(g=e.prices.rowTotalIncludingTax)==null?void 0:g.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="including-tax-item-total",r&&(t.amount=(y=e.prices.originalRowTotal)==null?void 0:y.value,t.currency=(h=e.prices.originalRowTotal)==null?void 0:h.currency,r.amount=(b=e.prices.rowTotalIncludingTax)==null?void 0:b.value,r.currency=(P=e.prices.rowTotalIncludingTax)==null?void 0:P.currency,r.sale=!0,r["aria-label"]=n.dictionary.discountedPrice,r["data-testid"]="discount-total")):(t.amount=(i=e.prices.originalRowTotal)==null?void 0:i.value,t.currency=(p=e.prices.originalRowTotal)==null?void 0:p.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="regular-item-total",r&&(r.amount=(f=e.discountedTotal)==null?void 0:f.value,r.currency=(Q=e.discountedTotal)==null?void 0:Q.currency,r.sale=!0,r["aria-label"]=n.dictionary.discountedPrice,r["data-testid"]="discount-total")),{totalProps:t,discountProps:r}},fe=e=>{const n=e==null?void 0:e.map(r=>({label:r.label,value:r.values.map(u=>u.label).join(", ")})),t={};return n==null||n.forEach(r=>{t[r.label]=r.value}),Object.keys(t).length>0?t:null},ve=e=>{const n=e==null?void 0:e.map(r=>({label:r.optionLabel,value:r.valueLabel})),t={};return n==null||n.forEach(r=>{t[r.label]=r.value}),Object.keys(t).length>0?t:null},he=e=>{const n=e==null?void 0:e.map(r=>({label:r.label,type:r.type,values:r.values.map(u=>({label:u.label,value:u.value}))})),t={};return n==null||n.forEach(r=>{var u;switch(r.type){case"field":case"area":case"date_time":t[r.label]=r.values[0].value;break;case"radio":case"drop_down":t[r.label]=r.values[0].label;break;case"multiple":case"checkbox":t[r.label]=r.values.reduce((a,l)=>a?`${a}, ${l.label}`:l.label,"");break;case"file":{const a=new DOMParser,l=r.values[0].value,y=((u=a.parseFromString(l,"text/html").querySelector("a"))==null?void 0:u.textContent)||"";t[r.label]=y;break}}}),t},be=4,j=(e,n,t)=>{var a;if(t.attributesToHide.includes("image"))return;const r={loading:n<be?"eager":"lazy",src:e.image.src,alt:e.image.alt,width:"300",height:"300",params:{width:300}},u=c(ne,{"data-testid":"quote-summary-list-item-image",...r});return c(s,{name:"Thumbnail",slot:(a=t.slots)==null?void 0:a.Thumbnail,context:{item:e,defaultImageProps:r},children:t.routeProduct?c("a",{href:t.routeProduct(e),children:u}):u})},F=(e,n)=>{if(!n.attributesToHide.includes("name"))return c("span",{"data-testid":"quote-summary-list-item-title",children:n.routeProduct?c("a",{href:n.routeProduct(e),children:e.product.name}):e.product.name})},$=e=>c("span",{"data-testid":"quote-summary-list-item-sku",children:e.product.sku}),z=(e,n)=>{var t;return c(s,{name:"ProductAttributes",slot:(t=n.slots)==null?void 0:t.ProductAttributes,context:{item:e}})},B=(e,n)=>{if(n.attributesToHide.includes("configurations"))return;const t={...fe(e.bundleOptions),...ve(e.configurableOptions),...he(e.customizableOptions),...e.links&&e.links.count?e.links.count>1?{[n.dictionary.files.replace("{count}",e.links.count.toString())]:e.links.result}:{[n.dictionary.file.replace("{count}",e.links.count.toString())]:e.links.result}:null};if(Object.keys(t).length!==0)return t},V=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===v.TAX_INCLUDED_AND_EXCLUDED?c(T,{amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":n.dictionary.regularPrice}):void 0},Ee=({hideHeading:e,hideFooter:n,routeProduct:t,showMaxItems:r=!0,attributesToHide:u=[],slots:a,accordion:l=!1,variant:g="primary",showDiscount:y,showSavings:h,...b})=>{const{quoteData:i,loading:p}=pe(),[f,Q]=A(r),{quoteDisplaySettings:d,quoteSummaryMaxItems:Y}=me.config,_=Y||5,m=ye({discountedPrice:"NegotiableQuote.QuoteSummaryList.discountedPrice",discountPercentage:"NegotiableQuote.QuoteSummaryList.discountPercentage",editQuote:"NegotiableQuote.QuoteSummaryList.editQuote",file:"NegotiableQuote.QuoteSummaryList.file",files:"NegotiableQuote.QuoteSummaryList.files",heading:"NegotiableQuote.QuoteSummaryList.heading",listOfQuoteItems:"NegotiableQuote.QuoteSummaryList.listOfQuoteItems",regularPrice:"NegotiableQuote.QuoteSummaryList.regularPrice",savingsAmount:"NegotiableQuote.QuoteSummaryList.savingsAmount",viewMore:"NegotiableQuote.QuoteSummaryList.viewMore"}),G=re(()=>{Q(o=>!o)},[]),x={attributesToHide:u,routeProduct:t,slots:a,dictionary:m,quoteDisplaySettings:d},k={dictionary:m,quoteDisplaySettings:d},L=o=>c(s,{name:"Footer",slot:a==null?void 0:a.Footer,context:{item:o}}),H=()=>i!=null&&i.totalQuantity?i.items.map((o,M)=>{const{totalProps:K,discountProps:w}=X(o,k),Z=c(ue,{loading:p,"data-testid":`quote-summary-list-item-entry-${o.uid}`,image:j(o,M,x),title:c(s,{name:"ItemTitle",slot:a==null?void 0:a.ItemTitle,context:{item:o},children:F(o,x)}),sku:u.includes("sku")?void 0:c(s,{name:"ItemSku",slot:a==null?void 0:a.ItemSku,context:{item:o},children:$(o)}),price:u.includes("price")?void 0:c(s,{name:"ItemPrice",slot:a==null?void 0:a.ItemPrice,context:{item:o},slotTag:"span",children:c(T,{...R(o,k)})}),quantity:u.includes("quantity")?void 0:o.quantity,total:D(ee,{children:[u.includes("total")?void 0:c(s,{name:"ItemTotal",slot:a==null?void 0:a.ItemTotal,context:{item:o},children:c(T,{...K})}),u.includes("totalDiscount")?void 0:w&&c(s,{name:"ItemTotal",slot:a==null?void 0:a.ItemTotal,context:{item:o},children:c(T,{...w})})]}),attributes:z(o,x),configurations:B(o,x),totalExcludingTax:u.includes("totalExcludingTax")?void 0:V(o,x),taxIncluded:(d==null?void 0:d.price)===v.TAX_INCLUDED,taxExcluded:!u.includes("totalExcludingTax")&&(d==null?void 0:d.price)===v.TAX_INCLUDED_AND_EXCLUDED,discount:y&&o.discounted&&o.discountPercentage!==void 0?c("div",{"data-testid":"item-discount-percentage",children:m.discountPercentage.replace("{discount}",o.discountPercentage.toString())}):void 0,savings:h&&o.discounted&&o.savingsAmount!==void 0?D("div",{children:[c("span",{children:c(T,{...U(o)})})," ",m.savingsAmount]}):void 0,footer:L(o)},o.uid);return c(s,{name:"CartItem",slot:a==null?void 0:a.QuoteItem,context:{item:o,index:M,loading:p,attributesToHide:u,quoteDisplaySettings:d,showDiscount:y,showSavings:h,dictionary:m,getImage:j,getTitle:F,getSku:$,getPriceProps:R,getTotalPriceProps:X,getProductAttributes:z,getConfigurations:B,getTotalExcludingTax:V,getFooter:L,getSavingsAmount:U},children:Z},o.uid)}):null,C=c(s,{name:"Heading",slot:a==null?void 0:a.Heading,context:{count:(i==null?void 0:i.totalQuantity)??0,quoteId:i==null?void 0:i.uid},children:c("div",{"data-testid":"default-quote-summary-list-heading",children:m.heading.replace("({count})",i!=null&&i.totalQuantity?`(${i==null?void 0:i.totalQuantity.toString()})`:"")})}),E=C.props.children.props.children,S=H(),I=(i==null?void 0:i.items.length)||0,W=f?Math.min(I,_):I,J=I>W,N=i!=null&&i.totalQuantity&&S?c(s,{name:"Footer",slot:a==null?void 0:a.QuoteSummaryFooter,context:{displayMaxItems:f},"data-testid":"quote-summary-list-footer-slot",className:"quote-management-quote-summary-list-footer",children:J?c(ae,{className:"quote-management-quote-summary-list-footer__action",onClick:G,"data-testid":"view-more-items-button",variant:"tertiary",children:m.viewMore}):null}):null,O=i!=null&&i.totalQuantity?c(ce,{"data-testid":"quote-summary-list",children:S==null?void 0:S.slice(0,f?Math.min(I,_):I)}):null;return l?c(oe,{"data-testid":"quote-summary-list-accordion",className:le(["quote-management-quote-summary-list-accordion",`quote-management-quote-summary-list__background--${g}`]),iconOpen:de,iconClose:se,children:c(ie,{title:E,ariaLabelTitle:E,"data-testid":"quote-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:c(q,{...b,"aria-expanded":!0,"aria-label":m.listOfQuoteItems,className:"quote-management-quote-summary-list-accordion__list",footer:n?void 0:N,products:O,outOfStockMessage:void 0,loading:p,variant:g})})}):c(q,{...b,heading:e?void 0:C,footer:n?void 0:N,products:O,outOfStockMessage:void 0,loading:p,variant:g})};export{Ee as QuoteSummaryList,Ee as default};
3
+ import{jsx as o,jsxs as D,Fragment as ee}from"@dropins/tools/preact-jsx-runtime.js";import{useState as A,useEffect as te,useCallback as re}from"@dropins/tools/preact-compat.js";import{Price as T,Image as ne,Button as ae,CartList as oe,Accordion as ce,AccordionSection as ie,CartItem as ue}from"@dropins/tools/components.js";import{Slot as s,classes as le}from"@dropins/tools/lib.js";import{m as se,n as de,o as q}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{Q as v,s as me}from"../api.js";import{events as ge}from"@dropins/tools/event-bus.js";import{useText as ye}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const pe=()=>{const[e,n]=A(void 0),[t,r]=A(!0);return te(()=>{const u=ge.on("quote-management/quote-data",a=>{const{quote:l}=a;l&&(n(l),r(!1))},{eager:!0});return()=>u==null?void 0:u.off()},[]),{quoteData:e,loading:t}},R=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===v.TAX_INCLUDED?e.discounted?{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.priceIncludingTax.value,currency:e.prices.priceIncludingTax.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},U=e=>{var n,t;return{amount:(n=e.savingsAmount)==null?void 0:n.value,currency:(t=e.savingsAmount)==null?void 0:t.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},X=(e,n)=>{var u,a,l,g,y,h,b,P,i,p,f,Q;const t={"aria-label":n.dictionary.regularPrice},r=e.discounted?{}:null;return((u=n.quoteDisplaySettings)==null?void 0:u.price)===v.TAX_INCLUDED||((a=n.quoteDisplaySettings)==null?void 0:a.price)===v.TAX_INCLUDED_AND_EXCLUDED?(t.amount=(l=e.prices.rowTotalIncludingTax)==null?void 0:l.value,t.currency=(g=e.prices.rowTotalIncludingTax)==null?void 0:g.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="including-tax-item-total",r&&(t.amount=(y=e.prices.originalRowTotal)==null?void 0:y.value,t.currency=(h=e.prices.originalRowTotal)==null?void 0:h.currency,r.amount=(b=e.prices.rowTotalIncludingTax)==null?void 0:b.value,r.currency=(P=e.prices.rowTotalIncludingTax)==null?void 0:P.currency,r.sale=!0,r["aria-label"]=n.dictionary.discountedPrice,r["data-testid"]="discount-total")):(t.amount=(i=e.prices.originalRowTotal)==null?void 0:i.value,t.currency=(p=e.prices.originalRowTotal)==null?void 0:p.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="regular-item-total",r&&(r.amount=(f=e.discountedTotal)==null?void 0:f.value,r.currency=(Q=e.discountedTotal)==null?void 0:Q.currency,r.sale=!0,r["aria-label"]=n.dictionary.discountedPrice,r["data-testid"]="discount-total")),{totalProps:t,discountProps:r}},fe=e=>{const n=e==null?void 0:e.map(r=>({label:r.label,value:r.values.map(u=>u.label).join(", ")})),t={};return n==null||n.forEach(r=>{t[r.label]=r.value}),Object.keys(t).length>0?t:null},ve=e=>{const n=e==null?void 0:e.map(r=>({label:r.optionLabel,value:r.valueLabel})),t={};return n==null||n.forEach(r=>{t[r.label]=r.value}),Object.keys(t).length>0?t:null},he=e=>{const n=e==null?void 0:e.map(r=>({label:r.label,type:r.type,values:r.values.map(u=>({label:u.label,value:u.value}))})),t={};return n==null||n.forEach(r=>{var u;switch(r.type){case"field":case"area":case"date_time":t[r.label]=r.values[0].value;break;case"radio":case"drop_down":t[r.label]=r.values[0].label;break;case"multiple":case"checkbox":t[r.label]=r.values.reduce((a,l)=>a?`${a}, ${l.label}`:l.label,"");break;case"file":{const a=new DOMParser,l=r.values[0].value,y=((u=a.parseFromString(l,"text/html").querySelector("a"))==null?void 0:u.textContent)||"";t[r.label]=y;break}}}),t},be=4,j=(e,n,t)=>{var a;if(t.attributesToHide.includes("image"))return;const r={loading:n<be?"eager":"lazy",src:e.image.src,alt:e.image.alt,width:"300",height:"300",params:{width:300}},u=o(ne,{"data-testid":"quote-summary-list-item-image",...r});return o(s,{name:"Thumbnail",slot:(a=t.slots)==null?void 0:a.Thumbnail,context:{item:e,defaultImageProps:r},children:t.routeProduct?o("a",{href:t.routeProduct(e),children:u}):u})},F=(e,n)=>{if(!n.attributesToHide.includes("name"))return o("span",{"data-testid":"quote-summary-list-item-title",children:n.routeProduct?o("a",{href:n.routeProduct(e),children:e.product.name}):e.product.name})},$=e=>o("span",{"data-testid":"quote-summary-list-item-sku",children:e.product.sku}),z=(e,n)=>{var t;return o(s,{name:"ProductAttributes",slot:(t=n.slots)==null?void 0:t.ProductAttributes,context:{item:e}})},B=(e,n)=>{if(n.attributesToHide.includes("configurations"))return;const t={...fe(e.bundleOptions),...ve(e.configurableOptions),...he(e.customizableOptions),...e.links&&e.links.count?e.links.count>1?{[n.dictionary.files.replace("{count}",e.links.count.toString())]:e.links.result}:{[n.dictionary.file.replace("{count}",e.links.count.toString())]:e.links.result}:null};if(Object.keys(t).length!==0)return t},V=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===v.TAX_INCLUDED_AND_EXCLUDED?o(T,{amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":n.dictionary.regularPrice}):void 0},xe=({hideHeading:e,hideFooter:n,routeProduct:t,showMaxItems:r=!0,attributesToHide:u=[],slots:a,accordion:l=!1,variant:g="primary",showDiscount:y,showSavings:h,...b})=>{const{quoteData:i,loading:p}=pe(),[f,Q]=A(r),{quoteDisplaySettings:d,quoteSummaryMaxItems:Y}=me.config,L=Y||5,m=ye({discountedPrice:"NegotiableQuote.QuoteSummaryList.discountedPrice",discountPercentage:"NegotiableQuote.QuoteSummaryList.discountPercentage",editQuote:"NegotiableQuote.QuoteSummaryList.editQuote",file:"NegotiableQuote.QuoteSummaryList.file",files:"NegotiableQuote.QuoteSummaryList.files",heading:"NegotiableQuote.QuoteSummaryList.heading",listOfQuoteItems:"NegotiableQuote.QuoteSummaryList.listOfQuoteItems",regularPrice:"NegotiableQuote.QuoteSummaryList.regularPrice",savingsAmount:"NegotiableQuote.QuoteSummaryList.savingsAmount",viewMore:"NegotiableQuote.QuoteSummaryList.viewMore"}),G=re(()=>{Q(c=>!c)},[]),x={attributesToHide:u,routeProduct:t,slots:a,dictionary:m,quoteDisplaySettings:d},_={dictionary:m,quoteDisplaySettings:d},k=c=>o(s,{name:"Footer",slot:a==null?void 0:a.Footer,context:{item:c}}),H=()=>i!=null&&i.totalQuantity?i.items.map((c,M)=>{const{totalProps:K,discountProps:w}=X(c,_),Z=o(ue,{loading:p,"data-testid":`quote-summary-list-item-entry-${c.uid}`,image:j(c,M,x),title:o(s,{name:"ItemTitle",slot:a==null?void 0:a.ItemTitle,context:{item:c},children:F(c,x)}),sku:u.includes("sku")?void 0:o(s,{name:"ItemSku",slot:a==null?void 0:a.ItemSku,context:{item:c},children:$(c)}),price:u.includes("price")?void 0:o(s,{name:"ItemPrice",slot:a==null?void 0:a.ItemPrice,context:{item:c},slotTag:"span",children:o(T,{...R(c,_)})}),quantity:u.includes("quantity")?void 0:c.quantity,total:D(ee,{children:[u.includes("total")?void 0:o(s,{name:"ItemTotal",slot:a==null?void 0:a.ItemTotal,context:{item:c},children:o(T,{...K})}),u.includes("totalDiscount")?void 0:w&&o(s,{name:"ItemTotal",slot:a==null?void 0:a.ItemTotal,context:{item:c},children:o(T,{...w})})]}),attributes:z(c,x),configurations:B(c,x),totalExcludingTax:u.includes("totalExcludingTax")?void 0:V(c,x),taxIncluded:(d==null?void 0:d.price)===v.TAX_INCLUDED,taxExcluded:!u.includes("totalExcludingTax")&&(d==null?void 0:d.price)===v.TAX_INCLUDED_AND_EXCLUDED,discount:y&&c.discounted&&c.discountPercentage!==void 0?o("div",{"data-testid":"item-discount-percentage",children:m.discountPercentage.replace("{discount}",c.discountPercentage.toString())}):void 0,savings:h&&c.discounted&&c.savingsAmount!==void 0?D("div",{children:[o("span",{children:o(T,{...U(c)})})," ",m.savingsAmount]}):void 0,footer:k(c)},c.uid);return o(s,{name:"CartItem",slot:a==null?void 0:a.QuoteItem,context:{item:c,index:M,loading:p,attributesToHide:u,quoteDisplaySettings:d,showDiscount:y,showSavings:h,dictionary:m,getImage:j,getTitle:F,getSku:$,getPriceProps:R,getTotalPriceProps:X,getProductAttributes:z,getConfigurations:B,getTotalExcludingTax:V,getFooter:k,getSavingsAmount:U},children:Z},c.uid)}):null,C=o(s,{name:"Heading",slot:a==null?void 0:a.Heading,context:{count:(i==null?void 0:i.totalQuantity)??0,quoteId:(i==null?void 0:i.uid)??""},children:o("div",{"data-testid":"default-quote-summary-list-heading",children:m.heading.replace("({count})",i!=null&&i.totalQuantity?`(${i==null?void 0:i.totalQuantity.toString()})`:"")})}),E=C.props.children.props.children,S=H(),I=(i==null?void 0:i.items.length)||0,W=f?Math.min(I,L):I,J=I>W,N=i!=null&&i.totalQuantity&&S?o(s,{name:"Footer",slot:a==null?void 0:a.QuoteSummaryFooter,context:{displayMaxItems:f},"data-testid":"quote-summary-list-footer-slot",className:"quote-management-quote-summary-list-footer",children:J?o(ae,{className:"quote-management-quote-summary-list-footer__action",onClick:G,"data-testid":"view-more-items-button",variant:"tertiary",children:m.viewMore}):null}):null,O=i!=null&&i.totalQuantity?o(oe,{"data-testid":"quote-summary-list",children:S==null?void 0:S.slice(0,f?Math.min(I,L):I)}):null;return l?o(ce,{"data-testid":"quote-summary-list-accordion",className:le(["quote-management-quote-summary-list-accordion",`quote-management-quote-summary-list__background--${g}`]),iconOpen:de,iconClose:se,children:o(ie,{title:E,ariaLabelTitle:E,"data-testid":"quote-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:o(q,{...b,"aria-expanded":!0,"aria-label":m.listOfQuoteItems,className:"quote-management-quote-summary-list-accordion__list",footer:n?void 0:N,products:O,outOfStockMessage:void 0,loading:p,variant:g})})}):o(q,{...b,heading:e?void 0:C,footer:n?void 0:N,products:O,outOfStockMessage:void 0,loading:p,variant:g})};xe.displayName="QuoteSummaryList";export{xe as QuoteSummaryList,xe as default};
4
4
  //# sourceMappingURL=QuoteSummaryList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteSummaryList.js","sources":["/@dropins/storefront-quote-management/src/hooks/useQuoteSummaryData.ts","/@dropins/storefront-quote-management/src/lib/priceCalculators.ts","/@dropins/storefront-quote-management/src/lib/configurationTransformers.ts","/@dropins/storefront-quote-management/src/lib/itemFormatters.tsx","/@dropins/storefront-quote-management/src/containers/QuoteSummaryList/QuoteSummaryList.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 { useEffect, useState } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models';\n\n/**\n * Custom hook to manage quote summary data and loading state\n */\nexport const useQuoteSummaryData = () => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n undefined\n );\n const [loading, setLoading] = useState<boolean>(true);\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (payload: { quote: NegotiableQuoteModel }) => {\n const { quote } = payload;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n return {\n quoteData,\n loading,\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 { PriceProps } from '@adobe-commerce/elsie/components';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\n\nexport interface PriceCalculatorOptions {\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get price props for an item\n */\nexport const getPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n return options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n ? item.discounted\n ? {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.priceIncludingTax.value,\n currency: item.prices.priceIncludingTax.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'regular-item-price',\n };\n};\n\n/**\n * Get savings amount props for an item\n */\nexport const getSavingsAmount = (item: NegotiableQuoteItemModel) => {\n return {\n amount: item.savingsAmount?.value,\n currency: item.savingsAmount?.currency,\n style: { font: 'inherit' },\n 'data-testid': 'item-savings-amount',\n };\n};\n\n/**\n * Calculate total price props and discount props for an item\n */\nexport const getTotalPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n const totalProps: PriceProps & { 'data-testid'?: string } = {\n 'aria-label': options.dictionary.regularPrice,\n };\n const discountProps: (PriceProps & { 'data-testid'?: string }) | null =\n item.discounted ? {} : null;\n\n if (\n options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED ||\n options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n ) {\n totalProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n totalProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'including-tax-item-total';\n\n if (discountProps) {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n\n discountProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n discountProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n } else {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'regular-item-total';\n\n if (discountProps) {\n discountProps['amount'] = item.discountedTotal?.value;\n discountProps['currency'] = item.discountedTotal?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n }\n\n return {\n totalProps,\n discountProps,\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\n/**\n * Helper function to transform bundle options data to be ready for a CartItem SDK component\n */\nexport const transformBundleOptions = (data: any) => {\n const bundle = data?.map((option: any) => ({\n label: option.label,\n value: option.values.map((value: any) => value.label).join(', '),\n }));\n\n const bundleOptions: { [key: string]: any } = {};\n\n bundle?.forEach((option: any) => {\n bundleOptions[option.label] = option.value;\n });\n\n return Object.keys(bundleOptions).length > 0 ? bundleOptions : null;\n};\n\n/**\n * Helper function to transform configurable options data to be ready for a CartItem SDK component\n */\nexport const transformConfigurableOptions = (data: any) => {\n const configurable = data?.map((option: any) => ({\n label: option.optionLabel,\n value: option.valueLabel,\n }));\n\n const configurableOptions: { [key: string]: any } = {};\n\n configurable?.forEach((option: any) => {\n configurableOptions[option.label] = option.value;\n });\n\n return Object.keys(configurableOptions).length > 0\n ? configurableOptions\n : null;\n};\n\n/**\n * Helper function to transform customizable options data to be ready for a CartItem SDK component\n */\nexport const transformCustomizableOptions = (data: any) => {\n const transformedOptions = data?.map((option: any) => ({\n label: option.label,\n type: option.type,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n }));\n\n const result: { [key: string]: any } = {};\n\n transformedOptions?.forEach((option: any) => {\n switch (option.type) {\n case 'field':\n case 'area':\n case 'date_time':\n result[option.label] = option.values[0].value;\n break;\n case 'radio':\n case 'drop_down':\n result[option.label] = option.values[0].label;\n break;\n case 'multiple':\n case 'checkbox':\n result[option.label] = (option.values as Array<any>).reduce(\n (previous, current) => {\n if (previous) return `${previous}, ${current.label}`;\n return current.label;\n },\n ''\n );\n break;\n case 'file': {\n const parser = new DOMParser();\n const fileAnchorElementHtml = option.values[0].value;\n const doc = parser.parseFromString(fileAnchorElementHtml, 'text/html');\n const anchorText = doc.querySelector('a')?.textContent || '';\n result[option.label] = anchorText;\n break;\n }\n }\n });\n\n return result;\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 { Image, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\nimport { SwitchableAttributes } from '@/quote-management/containers/QuoteSummaryList/QuoteSummaryList';\nimport {\n transformBundleOptions,\n transformConfigurableOptions,\n transformCustomizableOptions,\n} from './configurationTransformers';\n\nconst EAGER_LOAD_THRESHOLD = 4;\n\nexport interface ItemFormatterOptions {\n attributesToHide: SwitchableAttributes[];\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n slots?: {\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get image component for an item\n */\nexport const getImage = (\n item: NegotiableQuoteItemModel,\n index: number,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('image')) {\n return undefined;\n }\n\n const defaultImageProps: ImageProps = {\n loading: index < EAGER_LOAD_THRESHOLD ? 'eager' : 'lazy',\n src: item.image.src,\n alt: item.image.alt,\n width: '300',\n height: '300',\n params: { width: 300 },\n };\n\n const imageComponent = (\n <Image\n data-testid=\"quote-summary-list-item-image\"\n {...defaultImageProps}\n />\n );\n return (\n <Slot\n name=\"Thumbnail\"\n slot={options.slots?.Thumbnail}\n context={{ item, defaultImageProps }}\n >\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{imageComponent}</a>\n ) : (\n imageComponent\n )}\n </Slot>\n );\n};\n\n/**\n * Get title component for an item\n */\nexport const getTitle = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('name')) {\n return undefined;\n }\n\n return (\n <span data-testid=\"quote-summary-list-item-title\">\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{item.product.name}</a>\n ) : (\n item.product.name\n )}\n </span>\n );\n};\n\n/**\n * Get SKU component for an item\n */\nexport const getSku = (item: NegotiableQuoteItemModel) => {\n return (\n <span data-testid=\"quote-summary-list-item-sku\">{item.product.sku}</span>\n );\n};\n\n/**\n * Get product attributes slot for an item\n */\nexport const getProductAttributes = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return (\n <Slot\n name=\"ProductAttributes\"\n slot={options.slots?.ProductAttributes}\n context={{ item }}\n />\n );\n};\n\n/**\n * Get configurations for an item (bundle, configurable, customizable options)\n */\nexport const getConfigurations = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('configurations')) {\n return undefined;\n }\n\n const configuration = {\n ...transformBundleOptions(item.bundleOptions),\n ...transformConfigurableOptions(item.configurableOptions),\n ...transformCustomizableOptions(item.customizableOptions),\n ...(item.links && item.links.count\n ? item.links.count > 1\n ? {\n [options.dictionary.files.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : {\n [options.dictionary.file.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : null),\n };\n\n if (Object.keys(configuration).length === 0) {\n return undefined;\n }\n\n return configuration;\n};\n\n/**\n * Get total excluding tax component for an item\n */\nexport const getTotalExcludingTax = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED ? (\n <Price\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n data-testid=\"excluding-tax-total\"\n aria-label={options.dictionary.regularPrice}\n />\n ) : undefined;\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 { HTMLAttributes, useCallback, useState } from 'preact/compat';\n\nimport {\n Accordion,\n AccordionSection,\n Button,\n CartItem,\n CartList,\n ImageProps,\n Price,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, ChevronRight } from '@adobe-commerce/elsie/icons';\nimport { Container, Slot, SlotProps, classes } from '@adobe-commerce/elsie/lib';\n\nimport { QuoteSummaryList as QuoteSummaryListComponent } from '@/quote-management/components';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n} from '@/quote-management/data/models';\nimport { state } from '@/quote-management/lib/state';\nimport { useQuoteSummaryData } from '@/quote-management/hooks/useQuoteSummaryData';\nimport {\n getPriceProps,\n getSavingsAmount,\n getTotalPriceProps,\n} from '@/quote-management/lib/priceCalculators';\nimport {\n getImage,\n getTitle,\n getSku,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n} from '@/quote-management/lib/itemFormatters';\n\nexport interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {\n hideHeading?: boolean;\n hideFooter?: boolean;\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n showMaxItems?: boolean;\n attributesToHide?: SwitchableAttributes[];\n slots?: {\n Heading?: SlotProps<{ count: number; quoteId: string }>;\n Footer?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n QuoteSummaryFooter?: SlotProps<{\n displayMaxItems: boolean;\n }>;\n QuoteItem?: SlotProps;\n ItemTitle?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemPrice?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemTotal?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemSku?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n accordion?: boolean;\n variant?: 'primary' | 'secondary';\n showDiscount?: boolean;\n showSavings?: boolean;\n}\n\n// Attributes that can be hidden or shown\nexport type SwitchableAttributes =\n | 'name'\n | 'image'\n | 'configurations'\n | 'warning'\n | 'alert'\n | 'sku'\n | 'price'\n | 'quantity'\n | 'total'\n | 'totalDiscount'\n | 'totalExcludingTax';\n\nexport const QuoteSummaryList: Container<QuoteSummaryListProps> = ({\n hideHeading,\n hideFooter,\n routeProduct,\n showMaxItems = true,\n attributesToHide = [],\n slots,\n accordion = false,\n variant = 'primary',\n showDiscount,\n showSavings,\n ...props\n}) => {\n const CART_SUMMARY_MAX_ITEMS = 5;\n\n const { quoteData, loading } = useQuoteSummaryData();\n const [displayMaxItems, setDisplayMaxItems] = useState<boolean>(showMaxItems);\n\n const { quoteDisplaySettings, quoteSummaryMaxItems } = state.config;\n const maxItems = quoteSummaryMaxItems || CART_SUMMARY_MAX_ITEMS;\n\n const dictionary = useText({\n discountedPrice: 'NegotiableQuote.QuoteSummaryList.discountedPrice',\n discountPercentage: 'NegotiableQuote.QuoteSummaryList.discountPercentage',\n editQuote: 'NegotiableQuote.QuoteSummaryList.editQuote',\n file: 'NegotiableQuote.QuoteSummaryList.file',\n files: 'NegotiableQuote.QuoteSummaryList.files',\n heading: 'NegotiableQuote.QuoteSummaryList.heading',\n listOfQuoteItems: 'NegotiableQuote.QuoteSummaryList.listOfQuoteItems',\n regularPrice: 'NegotiableQuote.QuoteSummaryList.regularPrice',\n savingsAmount: 'NegotiableQuote.QuoteSummaryList.savingsAmount',\n viewMore: 'NegotiableQuote.QuoteSummaryList.viewMore',\n });\n\n // Display max items\n const handleMaxItemsView = useCallback(() => {\n setDisplayMaxItems((prev) => !prev);\n }, []);\n\n // Options for item formatters\n const formatterOptions = {\n attributesToHide,\n routeProduct,\n slots,\n dictionary,\n quoteDisplaySettings,\n };\n\n // Options for price calculators\n const calculatorOptions = {\n dictionary,\n quoteDisplaySettings,\n };\n\n const getFooter = (item: NegotiableQuoteItemModel) => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ item }} />;\n };\n\n const getCartItemEntries = () => {\n return quoteData?.totalQuantity\n ? quoteData.items.map((item, index) => {\n const { totalProps, discountProps } = getTotalPriceProps(\n item,\n calculatorOptions\n );\n\n const defaultCartItem = (\n <CartItem\n loading={loading}\n key={item.uid}\n data-testid={`quote-summary-list-item-entry-${item.uid}`}\n image={getImage(item, index, formatterOptions)}\n title={\n <Slot\n name=\"ItemTitle\"\n slot={slots?.ItemTitle}\n context={{ item }}\n >\n {getTitle(item, formatterOptions)}\n </Slot>\n }\n sku={\n attributesToHide.includes('sku') ? undefined : (\n <Slot name=\"ItemSku\" slot={slots?.ItemSku} context={{ item }}>\n {getSku(item)}\n </Slot>\n )\n }\n price={\n attributesToHide.includes('price') ? undefined : (\n <Slot\n name=\"ItemPrice\"\n slot={slots?.ItemPrice}\n context={{ item }}\n slotTag=\"span\"\n >\n <Price {...getPriceProps(item, calculatorOptions)} />\n </Slot>\n )\n }\n quantity={\n attributesToHide.includes('quantity')\n ? undefined\n : item.quantity\n }\n total={\n <>\n {attributesToHide.includes('total') ? undefined : (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...totalProps} />\n </Slot>\n )}\n {attributesToHide.includes('totalDiscount')\n ? undefined\n : discountProps && (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...discountProps} />\n </Slot>\n )}\n </>\n }\n attributes={getProductAttributes(item, formatterOptions)}\n configurations={getConfigurations(item, formatterOptions)}\n totalExcludingTax={\n attributesToHide.includes('totalExcludingTax')\n ? undefined\n : getTotalExcludingTax(item, formatterOptions)\n }\n taxIncluded={\n quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n }\n taxExcluded={\n !attributesToHide.includes('totalExcludingTax') &&\n quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n }\n discount={\n showDiscount &&\n item.discounted &&\n item.discountPercentage !== undefined ? (\n <div data-testid=\"item-discount-percentage\">\n {dictionary.discountPercentage.replace(\n '{discount}',\n item.discountPercentage.toString()\n )}\n </div>\n ) : undefined\n }\n savings={\n showSavings &&\n item.discounted &&\n item.savingsAmount !== undefined ? (\n <div>\n <span>\n <Price {...getSavingsAmount(item)} />\n </span>\n &nbsp;\n {dictionary.savingsAmount}\n </div>\n ) : undefined\n }\n footer={getFooter(item)}\n />\n );\n\n return (\n <Slot\n key={item.uid}\n name=\"CartItem\"\n slot={slots?.QuoteItem}\n context={{\n item,\n index,\n loading,\n attributesToHide,\n quoteDisplaySettings,\n showDiscount,\n showSavings,\n dictionary,\n getImage,\n getTitle,\n getSku,\n getPriceProps,\n getTotalPriceProps,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n getFooter,\n getSavingsAmount,\n }}\n >\n {defaultCartItem}\n </Slot>\n );\n })\n : null;\n };\n\n const heading = (\n <Slot\n name=\"Heading\"\n slot={slots?.Heading}\n context={{\n count: quoteData?.totalQuantity ?? 0,\n quoteId: quoteData?.uid!,\n }}\n >\n <div data-testid=\"default-quote-summary-list-heading\">\n {dictionary.heading.replace(\n '({count})',\n quoteData?.totalQuantity\n ? `(${quoteData?.totalQuantity.toString()})`\n : ''\n )}\n </div>\n </Slot>\n );\n\n // Heading Section text for screen reader\n const headingSection = heading.props.children.props.children;\n\n // Main Product Entries\n const mainProductEntries = getCartItemEntries();\n\n const totalLineItems = quoteData?.items.length || 0;\n const numOfVisibleItems = displayMaxItems\n ? Math.min(totalLineItems, maxItems)\n : totalLineItems;\n\n const hasHiddenItems = totalLineItems > numOfVisibleItems;\n\n const footerActions =\n quoteData?.totalQuantity && mainProductEntries ? (\n <Slot\n name=\"Footer\"\n slot={slots?.QuoteSummaryFooter}\n context={{ displayMaxItems }}\n data-testid=\"quote-summary-list-footer-slot\"\n className=\"quote-management-quote-summary-list-footer\"\n >\n {hasHiddenItems ? (\n <Button\n className=\"quote-management-quote-summary-list-footer__action\"\n onClick={handleMaxItemsView}\n data-testid=\"view-more-items-button\"\n variant=\"tertiary\"\n >\n {dictionary.viewMore}\n </Button>\n ) : null}\n </Slot>\n ) : null;\n\n const productEntries = quoteData?.totalQuantity ? (\n <CartList data-testid=\"quote-summary-list\">\n {mainProductEntries?.slice(\n 0,\n displayMaxItems ? Math.min(totalLineItems, maxItems) : totalLineItems\n )}\n </CartList>\n ) : null;\n\n return accordion ? (\n <Accordion\n data-testid=\"quote-summary-list-accordion\"\n className={classes([\n `quote-management-quote-summary-list-accordion`,\n `quote-management-quote-summary-list__background--${variant}`,\n ])}\n iconOpen={ChevronRight}\n iconClose={ChevronDown}\n >\n <AccordionSection\n title={headingSection}\n ariaLabelTitle={headingSection}\n data-testid=\"quote-summary-list-accordion__section\"\n open={true}\n renderContentWhenClosed={true}\n >\n <QuoteSummaryListComponent\n {...props}\n aria-expanded={true}\n aria-label={dictionary.listOfQuoteItems}\n className={`quote-management-quote-summary-list-accordion__list`}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n </AccordionSection>\n </Accordion>\n ) : (\n <QuoteSummaryListComponent\n {...props}\n heading={hideHeading ? undefined : heading}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n );\n};\n"],"names":["useQuoteSummaryData","quoteData","setQuoteData","useState","loading","setLoading","useEffect","quoteDataEvent","events","payload","quote","getPriceProps","item","options","_a","QuoteDisplayAmount","getSavingsAmount","_b","getTotalPriceProps","totalProps","discountProps","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","transformBundleOptions","data","bundle","option","value","bundleOptions","transformConfigurableOptions","configurable","configurableOptions","transformCustomizableOptions","transformedOptions","result","previous","current","parser","fileAnchorElementHtml","anchorText","EAGER_LOAD_THRESHOLD","getImage","index","defaultImageProps","imageComponent","jsx","Image","Slot","getTitle","getSku","getProductAttributes","getConfigurations","configuration","getTotalExcludingTax","Price","QuoteSummaryList","hideHeading","hideFooter","routeProduct","showMaxItems","attributesToHide","slots","accordion","variant","showDiscount","showSavings","props","displayMaxItems","setDisplayMaxItems","quoteDisplaySettings","quoteSummaryMaxItems","state","maxItems","dictionary","useText","handleMaxItemsView","useCallback","prev","formatterOptions","calculatorOptions","getFooter","getCartItemEntries","defaultCartItem","CartItem","jsxs","Fragment","heading","headingSection","mainProductEntries","totalLineItems","numOfVisibleItems","hasHiddenItems","footerActions","Button","productEntries","CartList","Accordion","classes","ChevronRight","ChevronDown","AccordionSection","QuoteSummaryListComponent"],"mappings":"yrBAgBO,MAAMA,GAAsB,IAAM,CACvC,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAChC,MAAA,EAEI,CAACC,EAASC,CAAU,EAAIF,EAAkB,EAAI,EAEpD,OAAAG,GAAU,IAAM,CACd,MAAMC,EAAiBC,GAAO,GAC5B,8BACCC,GAA6C,CAC5C,KAAM,CAAE,MAAAC,GAAUD,EACdC,IACFR,EAAaQ,CAAK,EAClBL,EAAW,EAAK,EAEpB,EACA,CACE,MAAO,EAAA,CACT,EAEF,MAAO,IAAME,GAAA,YAAAA,EAAgB,KAC/B,EAAG,CAAA,CAAE,EAEE,CACL,UAAAN,EACA,QAAAG,CAAA,CAEJ,ECnBaO,EA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cAAY,wCACZ,KAAM,GACN,wBAAyB,GAEzB,SAAA1C,EAACwD,EAAA,CACE,GAAGnC,EACJ,gBAAe,GACf,aAAYO,EAAW,iBACvB,UAAW,sDACX,OAAQhB,EAAa,OAAYmC,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAAlG,EACA,QAAAmE,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EAGFlB,EAACwD,EAAA,CACE,GAAGnC,EACJ,QAASV,EAAc,OAAY8B,EACnC,OAAQ7B,EAAa,OAAYmC,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAAlG,EACA,QAAAmE,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"QuoteSummaryList.js","sources":["/@dropins/storefront-quote-management/src/hooks/useQuoteSummaryData.ts","/@dropins/storefront-quote-management/src/lib/priceCalculators.ts","/@dropins/storefront-quote-management/src/lib/configurationTransformers.ts","/@dropins/storefront-quote-management/src/lib/itemFormatters.tsx","/@dropins/storefront-quote-management/src/containers/QuoteSummaryList/QuoteSummaryList.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 { useEffect, useState } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models';\n\n/**\n * Custom hook to manage quote summary data and loading state\n */\nexport const useQuoteSummaryData = () => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n undefined\n );\n const [loading, setLoading] = useState<boolean>(true);\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (payload: { quote: NegotiableQuoteModel }) => {\n const { quote } = payload;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n return {\n quoteData,\n loading,\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 { PriceProps } from '@adobe-commerce/elsie/components';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\n\nexport interface PriceCalculatorOptions {\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get price props for an item\n */\nexport const getPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n return options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n ? item.discounted\n ? {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.priceIncludingTax.value,\n currency: item.prices.priceIncludingTax.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'regular-item-price',\n };\n};\n\n/**\n * Get savings amount props for an item\n */\nexport const getSavingsAmount = (item: NegotiableQuoteItemModel) => {\n return {\n amount: item.savingsAmount?.value,\n currency: item.savingsAmount?.currency,\n style: { font: 'inherit' },\n 'data-testid': 'item-savings-amount',\n };\n};\n\n/**\n * Calculate total price props and discount props for an item\n */\nexport const getTotalPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n const totalProps: PriceProps & { 'data-testid'?: string } = {\n 'aria-label': options.dictionary.regularPrice,\n };\n const discountProps: (PriceProps & { 'data-testid'?: string }) | null =\n item.discounted ? {} : null;\n\n if (\n options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED ||\n options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n ) {\n totalProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n totalProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'including-tax-item-total';\n\n if (discountProps) {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n\n discountProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n discountProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n } else {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'regular-item-total';\n\n if (discountProps) {\n discountProps['amount'] = item.discountedTotal?.value;\n discountProps['currency'] = item.discountedTotal?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n }\n\n return {\n totalProps,\n discountProps,\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\n/**\n * Helper function to transform bundle options data to be ready for a CartItem SDK component\n */\nexport const transformBundleOptions = (data: any) => {\n const bundle = data?.map((option: any) => ({\n label: option.label,\n value: option.values.map((value: any) => value.label).join(', '),\n }));\n\n const bundleOptions: { [key: string]: any } = {};\n\n bundle?.forEach((option: any) => {\n bundleOptions[option.label] = option.value;\n });\n\n return Object.keys(bundleOptions).length > 0 ? bundleOptions : null;\n};\n\n/**\n * Helper function to transform configurable options data to be ready for a CartItem SDK component\n */\nexport const transformConfigurableOptions = (data: any) => {\n const configurable = data?.map((option: any) => ({\n label: option.optionLabel,\n value: option.valueLabel,\n }));\n\n const configurableOptions: { [key: string]: any } = {};\n\n configurable?.forEach((option: any) => {\n configurableOptions[option.label] = option.value;\n });\n\n return Object.keys(configurableOptions).length > 0\n ? configurableOptions\n : null;\n};\n\n/**\n * Helper function to transform customizable options data to be ready for a CartItem SDK component\n */\nexport const transformCustomizableOptions = (data: any) => {\n const transformedOptions = data?.map((option: any) => ({\n label: option.label,\n type: option.type,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n }));\n\n const result: { [key: string]: any } = {};\n\n transformedOptions?.forEach((option: any) => {\n switch (option.type) {\n case 'field':\n case 'area':\n case 'date_time':\n result[option.label] = option.values[0].value;\n break;\n case 'radio':\n case 'drop_down':\n result[option.label] = option.values[0].label;\n break;\n case 'multiple':\n case 'checkbox':\n result[option.label] = (option.values as Array<any>).reduce(\n (previous, current) => {\n if (previous) return `${previous}, ${current.label}`;\n return current.label;\n },\n ''\n );\n break;\n case 'file': {\n const parser = new DOMParser();\n const fileAnchorElementHtml = option.values[0].value;\n const doc = parser.parseFromString(fileAnchorElementHtml, 'text/html');\n const anchorText = doc.querySelector('a')?.textContent || '';\n result[option.label] = anchorText;\n break;\n }\n }\n });\n\n return result;\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 { Image, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\nimport { SwitchableAttributes } from '@/quote-management/containers/QuoteSummaryList/QuoteSummaryList';\nimport {\n transformBundleOptions,\n transformConfigurableOptions,\n transformCustomizableOptions,\n} from './configurationTransformers';\n\nconst EAGER_LOAD_THRESHOLD = 4;\n\nexport interface ItemFormatterOptions {\n attributesToHide: SwitchableAttributes[];\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n slots?: {\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get image component for an item\n */\nexport const getImage = (\n item: NegotiableQuoteItemModel,\n index: number,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('image')) {\n return undefined;\n }\n\n const defaultImageProps: ImageProps = {\n loading: index < EAGER_LOAD_THRESHOLD ? 'eager' : 'lazy',\n src: item.image.src,\n alt: item.image.alt,\n width: '300',\n height: '300',\n params: { width: 300 },\n };\n\n const imageComponent = (\n <Image\n data-testid=\"quote-summary-list-item-image\"\n {...defaultImageProps}\n />\n );\n return (\n <Slot\n name=\"Thumbnail\"\n slot={options.slots?.Thumbnail}\n context={{ item, defaultImageProps }}\n >\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{imageComponent}</a>\n ) : (\n imageComponent\n )}\n </Slot>\n );\n};\n\n/**\n * Get title component for an item\n */\nexport const getTitle = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('name')) {\n return undefined;\n }\n\n return (\n <span data-testid=\"quote-summary-list-item-title\">\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{item.product.name}</a>\n ) : (\n item.product.name\n )}\n </span>\n );\n};\n\n/**\n * Get SKU component for an item\n */\nexport const getSku = (item: NegotiableQuoteItemModel) => {\n return (\n <span data-testid=\"quote-summary-list-item-sku\">{item.product.sku}</span>\n );\n};\n\n/**\n * Get product attributes slot for an item\n */\nexport const getProductAttributes = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return (\n <Slot\n name=\"ProductAttributes\"\n slot={options.slots?.ProductAttributes}\n context={{ item }}\n />\n );\n};\n\n/**\n * Get configurations for an item (bundle, configurable, customizable options)\n */\nexport const getConfigurations = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('configurations')) {\n return undefined;\n }\n\n const configuration = {\n ...transformBundleOptions(item.bundleOptions),\n ...transformConfigurableOptions(item.configurableOptions),\n ...transformCustomizableOptions(item.customizableOptions),\n ...(item.links && item.links.count\n ? item.links.count > 1\n ? {\n [options.dictionary.files.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : {\n [options.dictionary.file.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : null),\n };\n\n if (Object.keys(configuration).length === 0) {\n return undefined;\n }\n\n return configuration;\n};\n\n/**\n * Get total excluding tax component for an item\n */\nexport const getTotalExcludingTax = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED ? (\n <Price\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n data-testid=\"excluding-tax-total\"\n aria-label={options.dictionary.regularPrice}\n />\n ) : undefined;\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 { HTMLAttributes, useCallback, useState } from 'preact/compat';\n\nimport {\n Accordion,\n AccordionSection,\n Button,\n CartItem,\n CartList,\n ImageProps,\n Price,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, ChevronRight } from '@adobe-commerce/elsie/icons';\nimport { Container, Slot, SlotProps, classes } from '@adobe-commerce/elsie/lib';\n\nimport { QuoteSummaryList as QuoteSummaryListComponent } from '@/quote-management/components';\nimport {\n CartItemModel as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n} from '@/quote-management/data/models';\nimport { state } from '@/quote-management/lib/state';\nimport { useQuoteSummaryData } from '@/quote-management/hooks/useQuoteSummaryData';\nimport {\n getPriceProps,\n getSavingsAmount,\n getTotalPriceProps,\n} from '@/quote-management/lib/priceCalculators';\nimport {\n getImage,\n getTitle,\n getSku,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n} from '@/quote-management/lib/itemFormatters';\n\nexport interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {\n hideHeading?: boolean;\n hideFooter?: boolean;\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n showMaxItems?: boolean;\n attributesToHide?: SwitchableAttributes[];\n slots?: {\n Heading?: SlotProps<{ count: number; quoteId: string }>;\n Footer?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n QuoteSummaryFooter?: SlotProps<{\n displayMaxItems: boolean;\n }>;\n QuoteItem?: SlotProps;\n ItemTitle?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemPrice?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemTotal?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemSku?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n accordion?: boolean;\n variant?: 'primary' | 'secondary';\n showDiscount?: boolean;\n showSavings?: boolean;\n}\n\n// Attributes that can be hidden or shown\nexport type SwitchableAttributes =\n | 'name'\n | 'image'\n | 'configurations'\n | 'warning'\n | 'alert'\n | 'sku'\n | 'price'\n | 'quantity'\n | 'total'\n | 'totalDiscount'\n | 'totalExcludingTax';\n\nexport const QuoteSummaryList: Container<QuoteSummaryListProps> = ({\n hideHeading,\n hideFooter,\n routeProduct,\n showMaxItems = true,\n attributesToHide = [],\n slots,\n accordion = false,\n variant = 'primary',\n showDiscount,\n showSavings,\n ...props\n}) => {\n const CART_SUMMARY_MAX_ITEMS = 5;\n\n const { quoteData, loading } = useQuoteSummaryData();\n const [displayMaxItems, setDisplayMaxItems] = useState<boolean>(showMaxItems);\n\n const { quoteDisplaySettings, quoteSummaryMaxItems } = state.config;\n const maxItems = quoteSummaryMaxItems || CART_SUMMARY_MAX_ITEMS;\n\n const dictionary = useText({\n discountedPrice: 'NegotiableQuote.QuoteSummaryList.discountedPrice',\n discountPercentage: 'NegotiableQuote.QuoteSummaryList.discountPercentage',\n editQuote: 'NegotiableQuote.QuoteSummaryList.editQuote',\n file: 'NegotiableQuote.QuoteSummaryList.file',\n files: 'NegotiableQuote.QuoteSummaryList.files',\n heading: 'NegotiableQuote.QuoteSummaryList.heading',\n listOfQuoteItems: 'NegotiableQuote.QuoteSummaryList.listOfQuoteItems',\n regularPrice: 'NegotiableQuote.QuoteSummaryList.regularPrice',\n savingsAmount: 'NegotiableQuote.QuoteSummaryList.savingsAmount',\n viewMore: 'NegotiableQuote.QuoteSummaryList.viewMore',\n });\n\n // Display max items\n const handleMaxItemsView = useCallback(() => {\n setDisplayMaxItems((prev) => !prev);\n }, []);\n\n // Options for item formatters\n const formatterOptions = {\n attributesToHide,\n routeProduct,\n slots,\n dictionary,\n quoteDisplaySettings,\n };\n\n // Options for price calculators\n const calculatorOptions = {\n dictionary,\n quoteDisplaySettings,\n };\n\n const getFooter = (item: NegotiableQuoteItemModel) => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ item }} />;\n };\n\n const getCartItemEntries = () => {\n return quoteData?.totalQuantity\n ? quoteData.items.map((item, index) => {\n const { totalProps, discountProps } = getTotalPriceProps(\n item,\n calculatorOptions\n );\n\n const defaultCartItem = (\n <CartItem\n loading={loading}\n key={item.uid}\n data-testid={`quote-summary-list-item-entry-${item.uid}`}\n image={getImage(item, index, formatterOptions)}\n title={\n <Slot\n name=\"ItemTitle\"\n slot={slots?.ItemTitle}\n context={{ item }}\n >\n {getTitle(item, formatterOptions)}\n </Slot>\n }\n sku={\n attributesToHide.includes('sku') ? undefined : (\n <Slot name=\"ItemSku\" slot={slots?.ItemSku} context={{ item }}>\n {getSku(item)}\n </Slot>\n )\n }\n price={\n attributesToHide.includes('price') ? undefined : (\n <Slot\n name=\"ItemPrice\"\n slot={slots?.ItemPrice}\n context={{ item }}\n slotTag=\"span\"\n >\n <Price {...getPriceProps(item, calculatorOptions)} />\n </Slot>\n )\n }\n quantity={\n attributesToHide.includes('quantity')\n ? undefined\n : item.quantity\n }\n total={\n <>\n {attributesToHide.includes('total') ? undefined : (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...totalProps} />\n </Slot>\n )}\n {attributesToHide.includes('totalDiscount')\n ? undefined\n : discountProps && (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...discountProps} />\n </Slot>\n )}\n </>\n }\n attributes={getProductAttributes(item, formatterOptions)}\n configurations={getConfigurations(item, formatterOptions)}\n totalExcludingTax={\n attributesToHide.includes('totalExcludingTax')\n ? undefined\n : getTotalExcludingTax(item, formatterOptions)\n }\n taxIncluded={\n quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n }\n taxExcluded={\n !attributesToHide.includes('totalExcludingTax') &&\n quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n }\n discount={\n showDiscount &&\n item.discounted &&\n item.discountPercentage !== undefined ? (\n <div data-testid=\"item-discount-percentage\">\n {dictionary.discountPercentage.replace(\n '{discount}',\n item.discountPercentage.toString()\n )}\n </div>\n ) : undefined\n }\n savings={\n showSavings &&\n item.discounted &&\n item.savingsAmount !== undefined ? (\n <div>\n <span>\n <Price {...getSavingsAmount(item)} />\n </span>\n &nbsp;\n {dictionary.savingsAmount}\n </div>\n ) : undefined\n }\n footer={getFooter(item)}\n />\n );\n\n return (\n <Slot\n key={item.uid}\n name=\"CartItem\"\n slot={slots?.QuoteItem}\n context={{\n item,\n index,\n loading,\n attributesToHide,\n quoteDisplaySettings,\n showDiscount,\n showSavings,\n dictionary,\n getImage,\n getTitle,\n getSku,\n getPriceProps,\n getTotalPriceProps,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n getFooter,\n getSavingsAmount,\n }}\n >\n {defaultCartItem}\n </Slot>\n );\n })\n : null;\n };\n\n const heading = (\n <Slot\n name=\"Heading\"\n slot={slots?.Heading}\n context={{\n count: quoteData?.totalQuantity ?? 0,\n quoteId: quoteData?.uid ?? '',\n }}\n >\n <div data-testid=\"default-quote-summary-list-heading\">\n {dictionary.heading.replace(\n '({count})',\n quoteData?.totalQuantity\n ? `(${quoteData?.totalQuantity.toString()})`\n : ''\n )}\n </div>\n </Slot>\n );\n\n // Heading Section text for screen reader\n const headingSection = heading.props.children.props.children;\n\n // Main Product Entries\n const mainProductEntries = getCartItemEntries();\n\n const totalLineItems = quoteData?.items.length || 0;\n const numOfVisibleItems = displayMaxItems\n ? Math.min(totalLineItems, maxItems)\n : totalLineItems;\n\n const hasHiddenItems = totalLineItems > numOfVisibleItems;\n\n const footerActions =\n quoteData?.totalQuantity && mainProductEntries ? (\n <Slot\n name=\"Footer\"\n slot={slots?.QuoteSummaryFooter}\n context={{ displayMaxItems }}\n data-testid=\"quote-summary-list-footer-slot\"\n className=\"quote-management-quote-summary-list-footer\"\n >\n {hasHiddenItems ? (\n <Button\n className=\"quote-management-quote-summary-list-footer__action\"\n onClick={handleMaxItemsView}\n data-testid=\"view-more-items-button\"\n variant=\"tertiary\"\n >\n {dictionary.viewMore}\n </Button>\n ) : null}\n </Slot>\n ) : null;\n\n const productEntries = quoteData?.totalQuantity ? (\n <CartList data-testid=\"quote-summary-list\">\n {mainProductEntries?.slice(\n 0,\n displayMaxItems ? Math.min(totalLineItems, maxItems) : totalLineItems\n )}\n </CartList>\n ) : null;\n\n return accordion ? (\n <Accordion\n data-testid=\"quote-summary-list-accordion\"\n className={classes([\n `quote-management-quote-summary-list-accordion`,\n `quote-management-quote-summary-list__background--${variant}`,\n ])}\n iconOpen={ChevronRight}\n iconClose={ChevronDown}\n >\n <AccordionSection\n title={headingSection}\n ariaLabelTitle={headingSection}\n data-testid=\"quote-summary-list-accordion__section\"\n open={true}\n renderContentWhenClosed={true}\n >\n <QuoteSummaryListComponent\n {...props}\n aria-expanded={true}\n aria-label={dictionary.listOfQuoteItems}\n className={`quote-management-quote-summary-list-accordion__list`}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n </AccordionSection>\n </Accordion>\n ) : (\n <QuoteSummaryListComponent\n {...props}\n heading={hideHeading ? undefined : heading}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n );\n};\n"],"names":["useQuoteSummaryData","quoteData","setQuoteData","useState","loading","setLoading","useEffect","quoteDataEvent","events","payload","quote","getPriceProps","item","options","_a","QuoteDisplayAmount","getSavingsAmount","_b","getTotalPriceProps","totalProps","discountProps","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","transformBundleOptions","data","bundle","option","value","bundleOptions","transformConfigurableOptions","configurable","configurableOptions","transformCustomizableOptions","transformedOptions","result","previous","current","parser","fileAnchorElementHtml","anchorText","EAGER_LOAD_THRESHOLD","getImage","index","defaultImageProps","imageComponent","jsx","Image","Slot","getTitle","getSku","getProductAttributes","getConfigurations","configuration","getTotalExcludingTax","Price","QuoteSummaryList","hideHeading","hideFooter","routeProduct","showMaxItems","attributesToHide","slots","accordion","variant","showDiscount","showSavings","props","displayMaxItems","setDisplayMaxItems","quoteDisplaySettings","quoteSummaryMaxItems","state","maxItems","dictionary","useText","handleMaxItemsView","useCallback","prev","formatterOptions","calculatorOptions","getFooter","getCartItemEntries","defaultCartItem","CartItem","jsxs","Fragment","heading","headingSection","mainProductEntries","totalLineItems","numOfVisibleItems","hasHiddenItems","footerActions","Button","productEntries","CartList","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,EACC9C,EAACgD,GAAA,CACC,UAAU,qDACV,QAASlB,EACT,cAAY,yBACZ,QAAQ,WAEP,SAAAF,EAAW,QAAA,CAAA,EAEZ,IAAA,CAAA,EAEJ,KAEAqB,EAAiBrG,GAAA,MAAAA,EAAW,gBAC/BsG,GAAA,CAAS,cAAY,qBACnB,SAAAP,GAAA,YAAAA,EAAoB,MACnB,EACArB,EAAkB,KAAK,IAAIsB,EAAgBjB,CAAQ,EAAIiB,GAE3D,EACE,KAEJ,OAAO3B,EACLjB,EAACmD,GAAA,CACC,cAAY,+BACZ,UAAWC,GAAQ,CACjB,gDACA,oDAAoDlC,CAAO,EAAA,CAC5D,EACD,SAAUmC,GACV,UAAWC,GAEX,SAAAtD,EAACuD,GAAA,CACC,MAAOb,EACP,eAAgBA,EAChB,cAAY,wCACZ,KAAM,GACN,wBAAyB,GAEzB,SAAA1C,EAACwD,EAAA,CACE,GAAGnC,EACJ,gBAAe,GACf,aAAYO,EAAW,iBACvB,UAAW,sDACX,OAAQhB,EAAa,OAAYmC,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAAlG,EACA,QAAAmE,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EAGFlB,EAACwD,EAAA,CACE,GAAGnC,EACJ,QAASV,EAAc,OAAY8B,EACnC,OAAQ7B,EAAa,OAAYmC,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAAlG,EACA,QAAAmE,CAAA,CAAA,CAGN"}
@@ -1,9 +1,15 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteTemplateModel } from '../../data/models/negotiable-quote-template-model';
4
-
5
12
  export interface QuoteTemplateCommentsListProps extends HTMLAttributes<HTMLUListElement> {
6
13
  templateData?: NegotiableQuoteTemplateModel;
7
14
  }
8
15
  export declare const QuoteTemplateCommentsList: Container<QuoteTemplateCommentsListProps>;
9
- //# sourceMappingURL=QuoteTemplateCommentsList.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteTemplateCommentsList';
10
10
  export { QuoteTemplateCommentsList as default } from './QuoteTemplateCommentsList';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './QuoteTemplateCommentsList/index'
2
- import _default from './QuoteTemplateCommentsList/index'
3
- export default _default
1
+ export * from './QuoteTemplateCommentsList/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{Q as l,Q as u}from"../chunks/QuoteTemplateCommentsList.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";export{l as QuoteTemplateCommentsList,u as default};
3
+ import{jsx as a,jsxs as p}from"@dropins/tools/preact-jsx-runtime.js";import{useState as u,useEffect as l}from"@dropins/tools/preact-compat.js";import{e as d,i as f}from"../chunks/components.js";import{events as c}from"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";const h=({templateData:r,...s})=>{var o;const[e,m]=u(r);if(l(()=>{const t=c.on("quote-management/quote-template-data",i=>{m(i.quoteTemplate)},{eager:!0});return()=>t==null?void 0:t.off()},[]),!e)return null;const n=(o=e==null?void 0:e.comments)==null?void 0:o.map(t=>({uid:t.uid,createdAt:a("span",{children:d(t.createdAt,"long")}),author:p("span",{children:[t.author.firstname," ",t.author.lastname]}),text:a("p",{children:t.text}),attachments:t.attachments}));return a(f,{"data-testid":"quote-template-comments-list-container",...s,comments:n||[]})};h.displayName="QuoteTemplateCommentsList";export{h as QuoteTemplateCommentsList,h as default};
4
4
  //# sourceMappingURL=QuoteTemplateCommentsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteTemplateCommentsList.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"QuoteTemplateCommentsList.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { QuoteCommentsList as QuoteCommentsListComponent } from '@/quote-management/components/QuoteCommentsList';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\n\nexport interface QuoteTemplateCommentsListProps extends HTMLAttributes<HTMLUListElement> {\n templateData?: NegotiableQuoteTemplateModel;\n}\n\nexport const QuoteTemplateCommentsList: Container<QuoteTemplateCommentsListProps> = ({\n templateData: initialData,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<NegotiableQuoteTemplateModel | undefined>(initialData);\n\n useEffect(() => {\n const templateDataEvent = events.on('quote-management/quote-template-data', (data: { quoteTemplate: NegotiableQuoteTemplateModel }) => {\n setTemplateData(data.quoteTemplate);\n }, { eager: true });\n return () => templateDataEvent?.off();\n }, []);\n\n if (!templateData) {\n return null;\n }\n\n // Format comments data\n const formattedComments = templateData?.comments?.map((comment) => ({\n uid: comment.uid,\n createdAt: <span>{formattedDate(comment.createdAt, 'long')}</span>,\n author: (\n <span>\n {comment.author.firstname} {comment.author.lastname}\n </span>\n ),\n text: <p>{comment.text}</p>,\n attachments: comment.attachments,\n }));\n\n return (\n <QuoteCommentsListComponent\n data-testid=\"quote-template-comments-list-container\"\n {...props}\n comments={formattedComments || []}\n />\n );\n};\n"],"names":["QuoteTemplateCommentsList","initialData","props","templateData","setTemplateData","useState","useEffect","templateDataEvent","events","data","formattedComments","_a","comment","jsx","QuoteCommentsListComponent"],"mappings":"iaAoBO,MAAMA,EAAuE,CAAC,CACnF,aAAcC,EACd,GAAGC,CACL,IAAM,OACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAmDJ,CAAW,EAStG,GAPAK,EAAU,IAAM,CACd,MAAMC,EAAoBC,EAAO,GAAG,uCAAyCC,GAA0D,CACrIL,EAAgBK,EAAK,aAAa,CACpC,EAAG,CAAE,MAAO,GAAM,EAClB,MAAO,IAAMF,GAAA,YAAAA,EAAmB,KAClC,EAAG,CAAA,CAAE,EAED,CAACJ,EACH,OAAO,KAIT,MAAMO,GAAoBC,EAAAR,GAAA,YAAAA,EAAc,WAAd,YAAAQ,EAAwB,IAAKC,IAAa,CAClE,IAAKA,EAAQ,IACb,UAAWC,EAAC,OAAA,CAAM,WAAcD,EAAQ,UAAW,MAAM,EAAE,EAC3D,SACG,OAAA,CACE,SAAA,CAAAA,EAAQ,OAAO,UAAU,IAAEA,EAAQ,OAAO,QAAA,EAC7C,EAEF,KAAMC,EAAC,IAAA,CAAG,SAAAD,EAAQ,KAAK,EACvB,YAAaA,EAAQ,WAAA,IAGvB,OACEC,EAACC,EAAA,CACC,cAAY,yCACX,GAAGZ,EACJ,SAAUQ,GAAqB,CAAA,CAAC,CAAA,CAGtC"}
@@ -1,9 +1,15 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteTemplateModel } from '../../data/models/negotiable-quote-template-model';
4
-
5
12
  export interface QuoteTemplateHistoryLogProps extends HTMLAttributes<HTMLDivElement> {
6
13
  templateData?: NegotiableQuoteTemplateModel;
7
14
  }
8
15
  export declare const QuoteTemplateHistoryLog: Container<QuoteTemplateHistoryLogProps>;
9
- //# sourceMappingURL=QuoteTemplateHistoryLog.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteTemplateHistoryLog';
10
10
  export { QuoteTemplateHistoryLog as default } from './QuoteTemplateHistoryLog';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './QuoteTemplateHistoryLog/index'
2
- import _default from './QuoteTemplateHistoryLog/index'
3
- export default _default
1
+ export * from './QuoteTemplateHistoryLog/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{Q as l,Q as u}from"../chunks/QuoteTemplateHistoryLog.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";export{l as QuoteTemplateHistoryLog,u as default};
3
+ import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{useState as i,useEffect as p}from"@dropins/tools/preact-compat.js";import{events as u}from"@dropins/tools/event-bus.js";import{h as l}from"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";const n=({templateData:r,...m})=>{const[t,a]=i(r);return p(()=>{const e=u.on("quote-management/quote-template-data",s=>{a(s.quoteTemplate)},{eager:!0});return()=>e==null?void 0:e.off()},[]),t?o("div",{...m,children:o(l,{history:t.history,items:t.items,buyer:t.buyer,salesRepName:t.salesRepName})}):null};n.displayName="QuoteTemplateHistoryLog";export{n as QuoteTemplateHistoryLog,n as default};
4
4
  //# sourceMappingURL=QuoteTemplateHistoryLog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteTemplateHistoryLog.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"QuoteTemplateHistoryLog.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { QuoteHistoryLog as QuoteHistoryLogComponent } from '@/quote-management/components/QuoteHistoryLog';\n\nexport interface QuoteTemplateHistoryLogProps extends HTMLAttributes<HTMLDivElement> {\n templateData?: NegotiableQuoteTemplateModel;\n}\n\nexport const QuoteTemplateHistoryLog: Container<QuoteTemplateHistoryLogProps> = ({\n templateData: initialData,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<NegotiableQuoteTemplateModel | undefined>(initialData);\n\n useEffect(() => {\n const templateDataEvent = events.on('quote-management/quote-template-data', (payload) => {\n setTemplateData(payload.quoteTemplate);\n }, { eager: true });\n\n return () => templateDataEvent?.off();\n }, []);\n\n if (!templateData) {\n return null;\n }\n\n return (\n <div {...props}>\n <QuoteHistoryLogComponent \n history={templateData.history}\n items={templateData.items}\n buyer={templateData.buyer}\n salesRepName={templateData.salesRepName}\n />\n </div>\n );\n};\n"],"names":["QuoteTemplateHistoryLog","initialData","props","templateData","setTemplateData","useState","useEffect","templateDataEvent","events","payload","jsx","QuoteHistoryLogComponent"],"mappings":"gZAmBO,MAAMA,EAAmE,CAAC,CAC/E,aAAcC,EACd,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAmDJ,CAAW,EAUtG,OARAK,EAAU,IAAM,CACd,MAAMC,EAAoBC,EAAO,GAAG,uCAAyCC,GAAY,CACvFL,EAAgBK,EAAQ,aAAa,CACvC,EAAG,CAAE,MAAO,GAAM,EAElB,MAAO,IAAMF,GAAA,YAAAA,EAAmB,KAClC,EAAG,CAAA,CAAE,EAEAJ,EAKHO,EAAC,MAAA,CAAK,GAAGR,EACP,SAAAQ,EAACC,EAAA,CACC,QAASR,EAAa,QACtB,MAAOA,EAAa,MACpB,MAAOA,EAAa,MACpB,aAAcA,EAAa,YAAA,CAAA,EAE/B,EAXO,IAaX"}
@@ -1,7 +1,14 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container, SlotProps } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteTemplateListEntry } from '../../data/models';
4
-
5
12
  export interface QuoteTemplatesListTableProps extends HTMLAttributes<HTMLDivElement> {
6
13
  pageSize?: number;
7
14
  showItemRange?: boolean;
@@ -71,4 +78,3 @@ export interface QuoteTemplatesListTableProps extends HTMLAttributes<HTMLDivElem
71
78
  };
72
79
  }
73
80
  export declare const QuoteTemplatesListTable: Container<QuoteTemplatesListTableProps>;
74
- //# sourceMappingURL=QuoteTemplatesListTable.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteTemplatesListTable';
10
10
  export { QuoteTemplatesListTable as default } from './QuoteTemplatesListTable';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './QuoteTemplatesListTable/index'
2
- import _default from './QuoteTemplatesListTable/index'
3
- export default _default
1
+ export * from './QuoteTemplatesListTable/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as a,jsxs as f,Fragment as oe}from"@dropins/tools/preact-jsx-runtime.js";import{useState as u,useEffect as ie,createPortal as ce}from"@dropins/tools/preact-compat.js";import{Slot as c}from"@dropins/tools/lib.js";import{IllustratedMessage as de,Picker as ge,Pagination as ue,InLineAlert as w,Icon as G,Button as F,Price as le}from"@dropins/tools/components.js";import{events as se}from"@dropins/tools/event-bus.js";import{e as me,C as fe,d as H}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{g as B,getQuoteTemplates as pe,generateQuoteFromTemplate as Me}from"../api.js";import{useText as Qe}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const Ie=({pageSize:R,showItemRange:A=!0,showPageSizePicker:D=!0,showPagination:U=!0,onViewQuoteTemplate:_,onGenerateQuoteFromTemplate:p,onPageSizeChange:M,onPageChange:Q,slots:i,...j})=>{const d=Qe({view:"QuoteManagement.QuoteTemplatesListTable.view",generateQuote:"NegotiableQuoteTemplate.Manage.actionButtons.generateQuote",generateQuoteModalMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.message",generateQuoteModalCancel:"NegotiableQuoteTemplate.Manage.confirmationModal.cancel",generateQuoteModalConfirm:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirm",generateQuoteModalConfirmLoading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirmLoading",generateQuoteModalSuccessHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successHeading",generateQuoteSuccessMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successDescription",generateQuoteModalErrorHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorHeading",generateQuoteErrorFallback:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorFallback"}),[g,P]=u(null),[W,h]=u(!0),[T,b]=u(!1),[y,v]=u(!1),[x,z]=u(null),[N,l]=u(""),[C,s]=u(""),$=B()[0],[I,J]=u(R||$),[k,L]=u(1);ie(()=>{const n=async()=>{try{h(!0);const o=await pe({pageSize:I,currentPage:k});P(o)}catch(o){console.error("Failed to fetch quote templates:",o)}finally{h(!1)}},e=se.on("authenticated",o=>{o?n():(P(null),h(!1))},{eager:!0});return()=>{e==null||e.off()}},[I,k]);const O=n=>{J(n),L(1),M==null||M(n)},E=n=>{L(n),Q==null||Q(n)},K=n=>{const e=n.target,o=e==null?void 0:e.value;o&&O(Number(o))},X=(n,e)=>{z({id:n,name:e}),l(""),s(""),b(!0)},Y=async n=>{v(!0),l(""),s("");try{const e=await Me({templateId:n.id});l(d.generateQuoteSuccessMessage),p==null||p(n.id,n.name,e.quoteId)}catch(e){console.error("Failed to generate quote from template:",e);const o=e instanceof Error?e.message:d.generateQuoteErrorFallback;s(o)}finally{v(!1)}},Z=()=>{b(!1),z(null),l(""),s("")},V=(n,e,o)=>n.filter(t=>t==null?void 0:t.uid).map(t=>{var q;return{id:t.id,name:a(c,{name:"Name",slot:e==null?void 0:e.Name,context:{template:t},children:a("span",{children:t.name})}),state:a(c,{name:"State",slot:e==null?void 0:e.State,context:{template:t},children:a("span",{style:{textTransform:"capitalize"},children:((q=t.state)==null?void 0:q.replace(/_/g," "))||"-"})}),status:a(c,{name:"Status",slot:e==null?void 0:e.Status,context:{template:t},children:a("span",{children:t.status})}),validUntil:a(c,{name:"ValidUntil",slot:e==null?void 0:e.ValidUntil,context:{template:t},children:a("span",{children:H(t.expirationDate,"short")})}),minQuoteTotal:a(c,{name:"MinQuoteTotal",slot:e==null?void 0:e.MinQuoteTotal,context:{template:t},children:a(le,{amount:t.prices.minNegotiatedGrandTotal.value,currency:t.prices.minNegotiatedGrandTotal.currency})}),ordersPlaced:a(c,{name:"OrdersPlaced",slot:e==null?void 0:e.OrdersPlaced,context:{template:t},children:a("span",{children:t.ordersPlaced})}),lastOrdered:a(c,{name:"LastOrdered",slot:e==null?void 0:e.LastOrdered,context:{template:t},children:a("span",{children:H(t.lastOrderedAt,"short")})}),actions:f(c,{name:"Actions",slot:e==null?void 0:e.Actions,context:{template:t,onViewQuoteTemplate:o},className:"quote-management-quote-templates-list-table__actions-cell",children:[a(F,{variant:"tertiary",size:"medium",onClick:()=>o==null?void 0:o(t.id,t.name,t.status),children:d.view}),t.canGenerateQuoteFromTemplate&&a(F,{variant:"primary",size:"medium",onClick:()=>X(t.id,t.name),"data-testid":`generate-quote-button-${t.id}`,children:d.generateQuote})]})}}),ee=g!=null&&g.items?V(g.items,i,_):[],r=g!=null&&g.paginationInfo?{...g.paginationInfo,pageSizeOptions:B()}:void 0,S=!!r,ae=a(c,{name:"EmptyTemplates",slot:i==null?void 0:i.EmptyTemplates,context:{templatesData:g},children:a(de,{heading:"No Quote Templates Found"})}),te=r?a(c,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:r,children:f("span",{children:["Items ",r.startItem," to ",r.endItem," of"," ",r.totalCount," total"]})}):void 0,ne=r&&r.pageSizeOptions?f(c,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:r.pageSize,pageSizeOptions:r.pageSizeOptions,onPageSizeChange:O},children:[a("span",{children:"Show "}),a(ge,{variant:"primary",size:"medium",value:String(r.pageSize),options:r.pageSizeOptions.map(n=>({value:String(n),text:String(n)})),handleSelect:K}),a("span",{children:" per page"})]}):void 0,re=r?a(c,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:r.currentPage,totalPages:r.totalPages,onChange:E},children:a(ue,{currentPage:r.currentPage,totalPages:r.totalPages,onChange:E})}):void 0;let m=null;return N?m=a(w,{type:"success",variant:"primary",icon:a(G,{source:"CheckWithCircle"}),heading:d.generateQuoteModalSuccessHeading,description:N,"data-testid":"generate-quote-success-banner"}):C&&(m=a(w,{type:"error",variant:"primary",icon:a(G,{source:"WarningFilled"}),heading:d.generateQuoteModalErrorHeading,description:C,"data-testid":"generate-quote-error-banner"})),f(oe,{children:[a(me,{rowData:ee,loading:W,className:j.className,emptyStateMessage:ae,showItemRange:A&&S,itemRangeMessage:te,showPageSizePicker:D&&S,pageSizePickerMessage:ne,showPagination:U&&S,paginationMessage:re}),T&&ce(a(fe,{open:T,title:d.generateQuote,message:d.generateQuoteModalMessage,cancelLabel:d.generateQuoteModalCancel,confirmLabel:y?d.generateQuoteModalConfirmLoading:d.generateQuoteModalConfirm,onCancel:Z,onConfirm:y||!x?void 0:()=>Y(x),showCloseButton:!m,confirmationBanner:m,"data-testid":"generate-quote-confirmation-modal"}),document.body)]})};export{Ie as QuoteTemplatesListTable,Ie as default};
3
+ import{jsx as a,jsxs as f,Fragment as oe}from"@dropins/tools/preact-jsx-runtime.js";import{useState as u,useEffect as ie,createPortal as ce}from"@dropins/tools/preact-compat.js";import{Slot as c}from"@dropins/tools/lib.js";import{IllustratedMessage as de,Picker as ge,Pagination as ue,InLineAlert as w,Icon as G,Button as F,Price as le}from"@dropins/tools/components.js";import{events as se}from"@dropins/tools/event-bus.js";import{g as me,C as fe,e as H}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{g as B,getQuoteTemplates as pe,generateQuoteFromTemplate as Qe}from"../api.js";import{useText as Me}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const he=({pageSize:R,showItemRange:A=!0,showPageSizePicker:D=!0,showPagination:U=!0,onViewQuoteTemplate:_,onGenerateQuoteFromTemplate:p,onPageSizeChange:Q,onPageChange:M,slots:i,...j})=>{const d=Me({view:"QuoteManagement.QuoteTemplatesListTable.view",generateQuote:"NegotiableQuoteTemplate.Manage.actionButtons.generateQuote",generateQuoteModalMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.message",generateQuoteModalCancel:"NegotiableQuoteTemplate.Manage.confirmationModal.cancel",generateQuoteModalConfirm:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirm",generateQuoteModalConfirmLoading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.confirmLoading",generateQuoteModalSuccessHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successHeading",generateQuoteSuccessMessage:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.successDescription",generateQuoteModalErrorHeading:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorHeading",generateQuoteErrorFallback:"NegotiableQuoteTemplate.Manage.confirmationModal.generateQuote.errorFallback"}),[g,P]=u(null),[W,h]=u(!0),[T,b]=u(!1),[y,v]=u(!1),[x,N]=u(null),[z,l]=u(""),[C,s]=u(""),$=B()[0],[I,J]=u(R||$),[L,k]=u(1);ie(()=>{const n=async()=>{try{h(!0);const o=await pe({pageSize:I,currentPage:L});P(o)}catch(o){console.error("Failed to fetch quote templates:",o)}finally{h(!1)}},e=se.on("authenticated",o=>{o?n():(P(null),h(!1))},{eager:!0});return()=>{e==null||e.off()}},[I,L]);const O=n=>{J(n),k(1),Q==null||Q(n)},E=n=>{k(n),M==null||M(n)},K=n=>{const e=n.target,o=e==null?void 0:e.value;o&&O(Number(o))},X=(n,e)=>{N({id:n,name:e}),l(""),s(""),b(!0)},Y=async n=>{v(!0),l(""),s("");try{const e=await Qe({templateId:n.id});l(d.generateQuoteSuccessMessage),p==null||p(n.id,n.name,e.quoteId)}catch(e){console.error("Failed to generate quote from template:",e);const o=e instanceof Error?e.message:d.generateQuoteErrorFallback;s(o)}finally{v(!1)}},Z=()=>{b(!1),N(null),l(""),s("")},V=(n,e,o)=>n.filter(t=>t==null?void 0:t.uid).map(t=>{var q;return{id:t.id,name:a(c,{name:"Name",slot:e==null?void 0:e.Name,context:{template:t},children:a("span",{children:t.name})}),state:a(c,{name:"State",slot:e==null?void 0:e.State,context:{template:t},children:a("span",{style:{textTransform:"capitalize"},children:((q=t.state)==null?void 0:q.replace(/_/g," "))||"-"})}),status:a(c,{name:"Status",slot:e==null?void 0:e.Status,context:{template:t},children:a("span",{children:t.status})}),validUntil:a(c,{name:"ValidUntil",slot:e==null?void 0:e.ValidUntil,context:{template:t},children:a("span",{children:H(t.expirationDate,"short")})}),minQuoteTotal:a(c,{name:"MinQuoteTotal",slot:e==null?void 0:e.MinQuoteTotal,context:{template:t},children:a(le,{amount:t.prices.minNegotiatedGrandTotal.value,currency:t.prices.minNegotiatedGrandTotal.currency})}),ordersPlaced:a(c,{name:"OrdersPlaced",slot:e==null?void 0:e.OrdersPlaced,context:{template:t},children:a("span",{children:t.ordersPlaced})}),lastOrdered:a(c,{name:"LastOrdered",slot:e==null?void 0:e.LastOrdered,context:{template:t},children:a("span",{children:H(t.lastOrderedAt,"short")})}),actions:f(c,{name:"Actions",slot:e==null?void 0:e.Actions,context:{template:t,onViewQuoteTemplate:o},className:"quote-management-quote-templates-list-table__actions-cell",children:[a(F,{variant:"tertiary",size:"medium",onClick:()=>o==null?void 0:o(t.id,t.name,t.status),children:d.view}),t.canGenerateQuoteFromTemplate&&a(F,{variant:"primary",size:"medium",onClick:()=>X(t.id,t.name),"data-testid":`generate-quote-button-${t.id}`,children:d.generateQuote})]})}}),ee=g!=null&&g.items?V(g.items,i,_):[],r=g!=null&&g.paginationInfo?{...g.paginationInfo,pageSizeOptions:B()}:void 0,S=!!r,ae=a(c,{name:"EmptyTemplates",slot:i==null?void 0:i.EmptyTemplates,context:{templatesData:g},children:a(de,{heading:"No Quote Templates Found"})}),te=r?a(c,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:r,children:f("span",{children:["Items ",r.startItem," to ",r.endItem," of"," ",r.totalCount," total"]})}):void 0,ne=r&&r.pageSizeOptions?f(c,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:r.pageSize,pageSizeOptions:r.pageSizeOptions,onPageSizeChange:O},children:[a("span",{children:"Show "}),a(ge,{variant:"primary",size:"medium",value:String(r.pageSize),options:r.pageSizeOptions.map(n=>({value:String(n),text:String(n)})),handleSelect:K}),a("span",{children:" per page"})]}):void 0,re=r?a(c,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:r.currentPage,totalPages:r.totalPages,onChange:E},children:a(ue,{currentPage:r.currentPage,totalPages:r.totalPages,onChange:E})}):void 0;let m=null;return z?m=a(w,{type:"success",variant:"primary",icon:a(G,{source:"CheckWithCircle"}),heading:d.generateQuoteModalSuccessHeading,description:z,"data-testid":"generate-quote-success-banner"}):C&&(m=a(w,{type:"error",variant:"primary",icon:a(G,{source:"WarningFilled"}),heading:d.generateQuoteModalErrorHeading,description:C,"data-testid":"generate-quote-error-banner"})),f(oe,{children:[a(me,{rowData:ee,loading:W,className:j.className,emptyStateMessage:ae,showItemRange:A&&S,itemRangeMessage:te,showPageSizePicker:D&&S,pageSizePickerMessage:ne,showPagination:U&&S,paginationMessage:re}),T&&ce(a(fe,{open:T,title:d.generateQuote,message:d.generateQuoteModalMessage,cancelLabel:d.generateQuoteModalCancel,confirmLabel:y?d.generateQuoteModalConfirmLoading:d.generateQuoteModalConfirm,onCancel:Z,onConfirm:y||!x?void 0:()=>Y(x),showCloseButton:!m,confirmationBanner:m,"data-testid":"generate-quote-confirmation-modal"}),document.body)]})};he.displayName="QuoteTemplatesListTable";export{he as QuoteTemplatesListTable,he as default};
4
4
  //# sourceMappingURL=QuoteTemplatesListTable.js.map
@@ -1,7 +1,14 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container, SlotProps } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteListEntry } from '../../data/models';
4
-
5
12
  export interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {
6
13
  pageSize?: number;
7
14
  showItemRange?: boolean;
@@ -69,4 +76,3 @@ export interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {
69
76
  };
70
77
  }
71
78
  export declare const QuotesListTable: Container<QuotesListTableProps>;
72
- //# sourceMappingURL=QuotesListTable.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuotesListTable';
10
10
  export { QuotesListTable as default } from './QuotesListTable';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './QuotesListTable/index'
2
- import _default from './QuotesListTable/index'
3
- export default _default
1
+ export * from './QuotesListTable/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as t,jsxs as s}from"@dropins/tools/preact-jsx-runtime.js";import{useState as g,useEffect as T}from"@dropins/tools/preact-compat.js";import{Slot as d}from"@dropins/tools/lib.js";import{IllustratedMessage as K,Picker as W,Pagination as X,Button as Y,Price as Z}from"@dropins/tools/components.js";import{events as I}from"@dropins/tools/event-bus.js";import{Q as _,d as A}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{g as V,negotiableQuotes as k}from"../api.js";import"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const pe=({pageSize:B,showItemRange:C=!0,showPageSizePicker:L=!0,showPagination:M=!0,onViewQuote:O,onPageSizeChange:u,onPageChange:h,slots:c,...R})=>{const[m,f]=g(null),[w,l]=g(!0),E=V()[0],[o,F]=g(B||E),[p,P]=g(1);T(()=>{const i=async()=>{try{l(!0);const r=await k({pageSize:o,currentPage:p});f(r)}catch(r){console.error("Failed to fetch quotes:",r)}finally{l(!1)}},e=I.on("authenticated",r=>{r?i():(f(null),l(!1))},{eager:!0});return()=>{e==null||e.off()}},[o,p]),T(()=>{const i=async()=>{try{const r=await k({pageSize:o,currentPage:p});f(r)}catch(r){console.error("Failed to fetch quotes:",r)}},e=I.on("quote-management/quote-renamed",()=>{i()},{eager:!0});return()=>{e==null||e.off()}},[o,p]);const y=i=>{F(i),P(1),u==null||u(i)},x=i=>{P(i),h==null||h(i)},U=i=>{const e=i.target,r=e==null?void 0:e.value;r&&y(Number(r))},$=(i,e,r)=>i.filter(a=>a==null?void 0:a.uid).map(a=>{var z,Q,v,N;const J=`${a.buyer.firstname} ${a.buyer.lastname}`;return{id:a.uid,quoteName:t(d,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quote:a},children:t("span",{children:a.name})}),created:t(d,{name:"Created",slot:e==null?void 0:e.Created,context:{quote:a},children:t("span",{children:a.createdAt?A(a.createdAt,"short"):"N/A"})}),createdBy:t(d,{name:"CreatedBy",slot:e==null?void 0:e.CreatedBy,context:{quote:a},children:t("span",{children:J})}),status:t(d,{name:"Status",slot:e==null?void 0:e.Status,context:{quote:a},children:t("span",{children:a.status})}),lastUpdated:t(d,{name:"LastUpdated",slot:e==null?void 0:e.LastUpdated,context:{quote:a},children:t("span",{children:a.updatedAt?A(a.updatedAt,"short"):"N/A"})}),quoteTemplate:t(d,{name:"QuoteTemplate",slot:e==null?void 0:e.QuoteTemplate,context:{quote:a},children:t("span",{children:a.templateName})}),quoteTotal:t(d,{name:"QuoteTotal",slot:e==null?void 0:e.QuoteTotal,context:{quote:a},children:t(Z,{amount:(Q=(z=a.prices)==null?void 0:z.grandTotal)==null?void 0:Q.value,currency:(N=(v=a.prices)==null?void 0:v.grandTotal)==null?void 0:N.currency})}),actions:t(d,{name:"Actions",slot:e==null?void 0:e.Actions,context:{quote:a,onViewQuote:r},children:t(Y,{variant:"tertiary",size:"medium",onClick:()=>r==null?void 0:r(a.uid,a.name,a.status),children:"View"})})}}),b=m!=null&&m.items?$(m.items,c,O):[],n=m==null?void 0:m.paginationInfo,S=!!n,j=t(d,{name:"EmptyQuotes",slot:c==null?void 0:c.EmptyQuotes,context:{quotesData:m},children:t(K,{heading:"No Quotes Found"})}),D=n?t(d,{name:"ItemRange",slot:c==null?void 0:c.ItemRange,context:n,children:s("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,G=n&&n.pageSizeOptions?s(d,{name:"PageSizePicker",slot:c==null?void 0:c.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:y},children:[t("span",{children:"Show "}),t(W,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(i=>({value:String(i),text:String(i)})),handleSelect:U}),t("span",{children:" per page"})]}):void 0,H=n?t(d,{name:"Pagination",slot:c==null?void 0:c.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:x},children:t(X,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:x})}):void 0;return t(_,{rowData:b,loading:w,className:R.className,emptyStateMessage:j,showItemRange:C&&S,itemRangeMessage:D,showPageSizePicker:L&&S,pageSizePickerMessage:G,showPagination:M&&S,paginationMessage:H})};export{pe as QuotesListTable,pe as default};
3
+ import{jsx as t,jsxs as v}from"@dropins/tools/preact-jsx-runtime.js";import{useState as g,useEffect as T}from"@dropins/tools/preact-compat.js";import{Slot as d}from"@dropins/tools/lib.js";import{IllustratedMessage as K,Picker as W,Pagination as X,Button as Y,Price as Z}from"@dropins/tools/components.js";import{events as I}from"@dropins/tools/event-bus.js";import{Q as _,e as A}from"../chunks/components.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{g as V,negotiableQuotes as k}from"../api.js";import"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const q=({pageSize:L,showItemRange:B=!0,showPageSizePicker:C=!0,showPagination:M=!0,onViewQuote:O,onPageSizeChange:u,onPageChange:h,slots:c,...R})=>{const[m,l]=g(null),[w,f]=g(!0),b=V()[0],[o,E]=g(L||b),[p,P]=g(1);T(()=>{const i=async()=>{try{f(!0);const r=await k({pageSize:o,currentPage:p});l(r)}catch(r){console.error("Failed to fetch quotes:",r)}finally{f(!1)}},e=I.on("authenticated",r=>{r?i():(l(null),f(!1))},{eager:!0});return()=>{e==null||e.off()}},[o,p]),T(()=>{const i=async()=>{try{const r=await k({pageSize:o,currentPage:p});l(r)}catch(r){console.error("Failed to fetch quotes:",r)}},e=I.on("quote-management/quote-renamed",()=>{i()},{eager:!0});return()=>{e==null||e.off()}},[o,p]);const y=i=>{E(i),P(1),u==null||u(i)},x=i=>{P(i),h==null||h(i)},F=i=>{const e=i.target,r=e==null?void 0:e.value;r&&y(Number(r))},U=(i,e,r)=>i.filter(a=>a==null?void 0:a.uid).map(a=>{var z,s,Q,N;const J=`${a.buyer.firstname} ${a.buyer.lastname}`;return{id:a.uid,quoteName:t(d,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quote:a},children:t("span",{children:a.name})}),created:t(d,{name:"Created",slot:e==null?void 0:e.Created,context:{quote:a},children:t("span",{children:a.createdAt?A(a.createdAt,"short"):"N/A"})}),createdBy:t(d,{name:"CreatedBy",slot:e==null?void 0:e.CreatedBy,context:{quote:a},children:t("span",{children:J})}),status:t(d,{name:"Status",slot:e==null?void 0:e.Status,context:{quote:a},children:t("span",{children:a.status})}),lastUpdated:t(d,{name:"LastUpdated",slot:e==null?void 0:e.LastUpdated,context:{quote:a},children:t("span",{children:a.updatedAt?A(a.updatedAt,"short"):"N/A"})}),quoteTemplate:t(d,{name:"QuoteTemplate",slot:e==null?void 0:e.QuoteTemplate,context:{quote:a},children:t("span",{children:a.templateName})}),quoteTotal:t(d,{name:"QuoteTotal",slot:e==null?void 0:e.QuoteTotal,context:{quote:a},children:t(Z,{amount:(s=(z=a.prices)==null?void 0:z.grandTotal)==null?void 0:s.value,currency:(N=(Q=a.prices)==null?void 0:Q.grandTotal)==null?void 0:N.currency})}),actions:t(d,{name:"Actions",slot:e==null?void 0:e.Actions,context:{quote:a,onViewQuote:r},children:t(Y,{variant:"tertiary",size:"medium",onClick:()=>r==null?void 0:r(a.uid,a.name,a.status),children:"View"})})}}),$=m!=null&&m.items?U(m.items,c,O):[],n=m==null?void 0:m.paginationInfo,S=!!n,j=t(d,{name:"EmptyQuotes",slot:c==null?void 0:c.EmptyQuotes,context:{quotesData:m},children:t(K,{heading:"No Quotes Found"})}),D=n?t(d,{name:"ItemRange",slot:c==null?void 0:c.ItemRange,context:n,children:v("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,G=n&&n.pageSizeOptions?v(d,{name:"PageSizePicker",slot:c==null?void 0:c.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:y},children:[t("span",{children:"Show "}),t(W,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(i=>({value:String(i),text:String(i)})),handleSelect:F}),t("span",{children:" per page"})]}):void 0,H=n?t(d,{name:"Pagination",slot:c==null?void 0:c.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:x},children:t(X,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:x})}):void 0;return t(_,{rowData:$,loading:w,className:R.className,emptyStateMessage:j,showItemRange:B&&S,itemRangeMessage:D,showPageSizePicker:C&&S,pageSizePickerMessage:G,showPagination:M&&S,paginationMessage:H})};q.displayName="QuotesListTable";export{q as QuotesListTable,q as default};
4
4
  //# sourceMappingURL=QuotesListTable.js.map