@dropins/storefront-quote-management 0.0.1-alpha9 → 1.0.0-beta10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/LICENSE.md +25 -26
  2. package/api/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +13 -0
  3. package/api/{getCustomerData/getCustomerData.d.ts → acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts} +2 -2
  4. package/{data/transforms/__fixtures__/customerData.d.ts → api/acceptQuoteTemplate/index.d.ts} +2 -2
  5. package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +15 -0
  6. package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +10 -0
  7. package/api/addQuoteTemplateLineItemNote/index.d.ts +10 -0
  8. package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +37 -0
  9. package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +10 -0
  10. package/api/addQuoteTemplateShippingAddress/index.d.ts +10 -0
  11. package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +14 -0
  12. package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +10 -0
  13. package/api/cancelQuoteTemplate/index.d.ts +10 -0
  14. package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +31 -0
  15. package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +2 -0
  16. package/api/closeNegotiableQuote/index.d.ts +10 -0
  17. package/api/createQuoteTemplate/createQuoteTemplate.d.ts +4 -0
  18. package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +10 -0
  19. package/api/createQuoteTemplate/index.d.ts +10 -0
  20. package/api/deleteQuote/deleteQuote.d.ts +28 -0
  21. package/api/deleteQuote/graphql/DeleteQuoteMutation.d.ts +10 -0
  22. package/api/{getCustomerData → deleteQuote}/index.d.ts +1 -1
  23. package/{data/models/customer-model.d.ts → api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts} +6 -8
  24. package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +10 -0
  25. package/api/deleteQuoteTemplate/index.d.ts +10 -0
  26. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +9 -0
  27. package/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.d.ts +10 -0
  28. package/api/duplicateNegotiableQuote/index.d.ts +10 -0
  29. package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +15 -0
  30. package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +10 -0
  31. package/api/generateQuoteFromTemplate/index.d.ts +10 -0
  32. package/api/getQuoteData/getQuoteData.d.ts +10 -0
  33. package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +2 -0
  34. package/api/getQuoteData/index.d.ts +10 -0
  35. package/api/getQuoteTemplateData/getQuoteTemplateData.d.ts +4 -0
  36. package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +10 -0
  37. package/api/getQuoteTemplateData/index.d.ts +10 -0
  38. package/api/getQuoteTemplates/getQuoteTemplates.d.ts +34 -0
  39. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +10 -0
  40. package/api/getQuoteTemplates/index.d.ts +10 -0
  41. package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
  42. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +10 -0
  43. package/api/getStoreConfig/index.d.ts +10 -0
  44. package/api/graphql/NegotiableQuoteAddressFragment.d.ts +10 -0
  45. package/api/graphql/NegotiableQuoteFragment.d.ts +5 -13
  46. package/api/graphql/NegotiableQuoteListFragment.d.ts +10 -0
  47. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +10 -0
  48. package/api/graphql/SearchResultPageInfoFragment.d.ts +10 -0
  49. package/api/graphql/ShippingMethodFragment.d.ts +10 -0
  50. package/api/graphql/SortFieldsFragment.d.ts +10 -0
  51. package/api/index.d.ts +34 -1
  52. package/api/initialize/initialize.d.ts +2 -0
  53. package/api/negotiableQuotes/graphql/NegotiableQuotesQuery.d.ts +10 -0
  54. package/api/negotiableQuotes/index.d.ts +10 -0
  55. package/api/negotiableQuotes/negotiableQuotes.d.ts +39 -0
  56. package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +10 -0
  57. package/api/openQuoteTemplate/index.d.ts +10 -0
  58. package/api/openQuoteTemplate/openQuoteTemplate.d.ts +13 -0
  59. package/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.d.ts +10 -0
  60. package/api/removeNegotiableQuoteItems/index.d.ts +10 -0
  61. package/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.d.ts +8 -0
  62. package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +10 -0
  63. package/api/removeQuoteTemplateItems/index.d.ts +10 -0
  64. package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +14 -0
  65. package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +10 -0
  66. package/api/renameNegotiableQuote/index.d.ts +10 -0
  67. package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +9 -0
  68. package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +4 -12
  69. package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -3
  70. package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +10 -0
  71. package/api/sendForReview/index.d.ts +10 -0
  72. package/api/sendForReview/sendForReview.d.ts +11 -0
  73. package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +10 -0
  74. package/api/sendQuoteTemplateForReview/index.d.ts +10 -0
  75. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +25 -0
  76. package/api/setLineItemNote/graphql/SetLineItemNoteMutation.d.ts +10 -0
  77. package/api/setLineItemNote/index.d.ts +10 -0
  78. package/api/setLineItemNote/setLineItemNote.d.ts +10 -0
  79. package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +10 -0
  80. package/api/setShippingAddress/index.d.ts +2 -0
  81. package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
  82. package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +10 -0
  83. package/api/updateQuantities/index.d.ts +10 -0
  84. package/api/updateQuantities/updateQuantities.d.ts +36 -0
  85. package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +10 -0
  86. package/api/updateQuoteTemplateItemQuantities/index.d.ts +10 -0
  87. package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +20 -0
  88. package/api/uploadFile/graphql/FinishUploadMutation.d.ts +10 -0
  89. package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +10 -0
  90. package/api/uploadFile/index.d.ts +10 -0
  91. package/api/uploadFile/uploadFile.d.ts +12 -0
  92. package/api.js +58 -22
  93. package/api.js.map +1 -1
  94. package/chunks/AttachedFilesList.js +4 -0
  95. package/chunks/AttachedFilesList.js.map +1 -0
  96. package/chunks/CheckWithCircle.js +4 -0
  97. package/chunks/CheckWithCircle.js.map +1 -0
  98. package/chunks/ChevronDown.js +4 -0
  99. package/chunks/ChevronDown.js.map +1 -0
  100. package/chunks/ConfirmationModal.js +4 -0
  101. package/chunks/ConfirmationModal.js.map +1 -0
  102. package/chunks/ItemsQuoted.js +4 -0
  103. package/chunks/ItemsQuoted.js.map +1 -0
  104. package/chunks/ItemsQuotedTemplate.js +4 -0
  105. package/chunks/ItemsQuotedTemplate.js.map +1 -0
  106. package/chunks/LineItemNoteModal.js +4 -0
  107. package/chunks/LineItemNoteModal.js.map +1 -0
  108. package/chunks/NegotiableQuoteFragment.js +392 -0
  109. package/chunks/NegotiableQuoteFragment.js.map +1 -0
  110. package/chunks/NegotiableQuoteTemplateFragment.js +338 -0
  111. package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -0
  112. package/chunks/OrderSummaryLine.js +4 -0
  113. package/chunks/OrderSummaryLine.js.map +1 -0
  114. package/chunks/QuoteCommentsList.js +4 -0
  115. package/chunks/QuoteCommentsList.js.map +1 -0
  116. package/chunks/QuoteCommentsList3.js +4 -0
  117. package/chunks/QuoteCommentsList3.js.map +1 -0
  118. package/chunks/QuoteHistoryLog.js +4 -0
  119. package/chunks/QuoteHistoryLog.js.map +1 -0
  120. package/chunks/QuoteHistoryLog3.js +4 -0
  121. package/chunks/QuoteHistoryLog3.js.map +1 -0
  122. package/chunks/QuoteTemplateCommentsList.js +4 -0
  123. package/chunks/QuoteTemplateCommentsList.js.map +1 -0
  124. package/chunks/QuoteTemplateHistoryLog.js +4 -0
  125. package/chunks/QuoteTemplateHistoryLog.js.map +1 -0
  126. package/chunks/RenameQuoteModal.js +4 -0
  127. package/chunks/RenameQuoteModal.js.map +1 -0
  128. package/chunks/ShippingAddressDisplay.js +4 -0
  129. package/chunks/ShippingAddressDisplay.js.map +1 -0
  130. package/chunks/WarningFilled.js +4 -0
  131. package/chunks/WarningFilled.js.map +1 -0
  132. package/chunks/addQuoteTemplateLineItemNote.js +33 -0
  133. package/chunks/addQuoteTemplateLineItemNote.js.map +1 -0
  134. package/chunks/dateUtils.js +4 -0
  135. package/chunks/dateUtils.js.map +1 -0
  136. package/chunks/duplicateNegotiableQuote.js +121 -0
  137. package/chunks/duplicateNegotiableQuote.js.map +1 -0
  138. package/chunks/generateQuoteFromTemplate.js +12 -0
  139. package/chunks/generateQuoteFromTemplate.js.map +1 -0
  140. package/chunks/getQuoteTemplates.js +52 -0
  141. package/chunks/getQuoteTemplates.js.map +1 -0
  142. package/chunks/negotiableQuotes.js +77 -0
  143. package/chunks/negotiableQuotes.js.map +1 -0
  144. package/chunks/openQuoteTemplate.js +52 -0
  145. package/chunks/openQuoteTemplate.js.map +1 -0
  146. package/chunks/requestNegotiableQuote.js +6 -81
  147. package/chunks/requestNegotiableQuote.js.map +1 -1
  148. package/chunks/setLineItemNote.js +47 -0
  149. package/chunks/setLineItemNote.js.map +1 -0
  150. package/chunks/state.js +4 -0
  151. package/chunks/state.js.map +1 -0
  152. package/chunks/transform-quote-template.js +4 -0
  153. package/chunks/transform-quote-template.js.map +1 -0
  154. package/chunks/transform-quote.js +4 -0
  155. package/chunks/transform-quote.js.map +1 -0
  156. package/chunks/uploadFile.js +20 -0
  157. package/chunks/uploadFile.js.map +1 -0
  158. package/components/ActionsBar/ActionsBar.d.ts +15 -0
  159. package/components/ActionsBar/index.d.ts +11 -0
  160. package/components/AttachedFilesList/AttachedFilesList.d.ts +16 -0
  161. package/components/AttachedFilesList/index.d.ts +11 -0
  162. package/components/ConfirmationModal/ConfirmationModal.d.ts +17 -0
  163. package/components/ConfirmationModal/index.d.ts +11 -0
  164. package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
  165. package/components/ItemsQuoted/index.d.ts +11 -0
  166. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +17 -0
  167. package/components/LineItemNoteModal/index.d.ts +11 -0
  168. package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +22 -0
  169. package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
  170. package/components/ManageNegotiableQuote/index.d.ts +11 -0
  171. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +23 -0
  172. package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +4 -0
  173. package/components/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
  174. package/components/OrderSummary/OrderSummary.d.ts +48 -0
  175. package/components/OrderSummary/index.d.ts +11 -0
  176. package/components/OrderSummaryLine/OrderSummaryLine.d.ts +13 -0
  177. package/components/OrderSummaryLine/index.d.ts +11 -0
  178. package/components/ProductListTable/ProductListTable.d.ts +17 -0
  179. package/components/ProductListTable/index.d.ts +11 -0
  180. package/components/QuoteCommentsList/QuoteCommentsList.d.ts +17 -0
  181. package/components/QuoteCommentsList/index.d.ts +11 -0
  182. package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +77 -0
  183. package/components/QuoteHistoryLog/index.d.ts +11 -0
  184. package/components/QuotePricesSummary/QuotePricesSummary.d.ts +16 -0
  185. package/components/QuotePricesSummary/index.d.ts +11 -0
  186. package/components/QuoteSummaryList/QuoteSummaryList.d.ts +13 -0
  187. package/components/QuoteSummaryList/index.d.ts +11 -0
  188. package/components/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +29 -0
  189. package/components/QuoteTemplatesListTable/index.d.ts +10 -0
  190. package/components/QuotesListTable/QuotesListTable.d.ts +29 -0
  191. package/components/QuotesListTable/index.d.ts +11 -0
  192. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +30 -0
  193. package/components/ReferenceDocumentFormModal/index.d.ts +11 -0
  194. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +18 -0
  195. package/components/ReferenceDocumentsList/index.d.ts +11 -0
  196. package/components/RenameQuoteModal/RenameQuoteModal.d.ts +18 -0
  197. package/components/RenameQuoteModal/index.d.ts +11 -0
  198. package/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +1 -0
  199. package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +12 -0
  200. package/components/ShippingAddressDisplay/index.d.ts +11 -0
  201. package/components/TabbedContent/TabbedContent.d.ts +10 -0
  202. package/components/TabbedContent/index.d.ts +11 -0
  203. package/components/index.d.ts +30 -0
  204. package/containers/ItemsQuoted/ItemsQuoted.d.ts +30 -0
  205. package/containers/ItemsQuoted/index.d.ts +11 -0
  206. package/containers/ItemsQuoted.d.ts +3 -0
  207. package/containers/ItemsQuoted.js +4 -0
  208. package/containers/ItemsQuoted.js.map +1 -0
  209. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +25 -0
  210. package/containers/ItemsQuotedTemplate/index.d.ts +11 -0
  211. package/containers/ItemsQuotedTemplate.d.ts +3 -0
  212. package/containers/ItemsQuotedTemplate.js +4 -0
  213. package/containers/ItemsQuotedTemplate.js.map +1 -0
  214. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +90 -0
  215. package/containers/ManageNegotiableQuote/index.d.ts +11 -0
  216. package/containers/ManageNegotiableQuote.d.ts +3 -0
  217. package/containers/ManageNegotiableQuote.js +4 -0
  218. package/containers/ManageNegotiableQuote.js.map +1 -0
  219. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +108 -0
  220. package/containers/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
  221. package/containers/ManageNegotiableQuoteTemplate.d.ts +3 -0
  222. package/containers/ManageNegotiableQuoteTemplate.js +6 -0
  223. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -0
  224. package/containers/OrderSummary/OrderSummary.d.ts +11 -0
  225. package/containers/OrderSummary/index.d.ts +11 -0
  226. package/containers/OrderSummary.d.ts +3 -0
  227. package/containers/OrderSummary.js +4 -0
  228. package/containers/OrderSummary.js.map +1 -0
  229. package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +14 -0
  230. package/containers/OrderSummaryLine/index.d.ts +11 -0
  231. package/containers/OrderSummaryLine.d.ts +3 -0
  232. package/containers/OrderSummaryLine.js +4 -0
  233. package/containers/OrderSummaryLine.js.map +1 -0
  234. package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -0
  235. package/containers/QuoteCommentsList/index.d.ts +11 -0
  236. package/containers/QuoteCommentsList.d.ts +3 -0
  237. package/containers/QuoteCommentsList.js +4 -0
  238. package/containers/QuoteCommentsList.js.map +1 -0
  239. package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -0
  240. package/containers/QuoteHistoryLog/index.d.ts +11 -0
  241. package/containers/QuoteHistoryLog.d.ts +3 -0
  242. package/containers/QuoteHistoryLog.js +4 -0
  243. package/containers/QuoteHistoryLog.js.map +1 -0
  244. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +51 -0
  245. package/containers/QuoteSummaryList/index.d.ts +11 -0
  246. package/containers/QuoteSummaryList.d.ts +3 -0
  247. package/containers/QuoteSummaryList.js +4 -0
  248. package/containers/QuoteSummaryList.js.map +1 -0
  249. package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -0
  250. package/containers/QuoteTemplateCommentsList/index.d.ts +11 -0
  251. package/containers/QuoteTemplateCommentsList.d.ts +3 -0
  252. package/containers/QuoteTemplateCommentsList.js +4 -0
  253. package/containers/QuoteTemplateCommentsList.js.map +1 -0
  254. package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -0
  255. package/containers/QuoteTemplateHistoryLog/index.d.ts +11 -0
  256. package/containers/QuoteTemplateHistoryLog.d.ts +3 -0
  257. package/containers/QuoteTemplateHistoryLog.js +4 -0
  258. package/containers/QuoteTemplateHistoryLog.js.map +1 -0
  259. package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +74 -0
  260. package/containers/QuoteTemplatesListTable/index.d.ts +11 -0
  261. package/containers/QuoteTemplatesListTable.d.ts +3 -0
  262. package/containers/QuoteTemplatesListTable.js +4 -0
  263. package/containers/QuoteTemplatesListTable.js.map +1 -0
  264. package/containers/QuotesListTable/QuotesListTable.d.ts +72 -0
  265. package/containers/QuotesListTable/index.d.ts +11 -0
  266. package/containers/QuotesListTable.d.ts +3 -0
  267. package/containers/QuotesListTable.js +4 -0
  268. package/containers/QuotesListTable.js.map +1 -0
  269. package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +10 -1
  270. package/containers/RequestNegotiableQuoteForm.js +1 -1
  271. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  272. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +10 -0
  273. package/containers/ShippingAddressDisplay/index.d.ts +11 -0
  274. package/containers/ShippingAddressDisplay.d.ts +1 -0
  275. package/containers/ShippingAddressDisplay.js +4 -0
  276. package/containers/ShippingAddressDisplay.js.map +1 -0
  277. package/containers/index.d.ts +22 -0
  278. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +8 -0
  279. package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +4 -0
  280. package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +5 -0
  281. package/data/models/__fixtures__/negotiableQuotesListModel.d.ts +5 -0
  282. package/data/models/__fixtures__/storeConfigModel.d.ts +5 -0
  283. package/data/models/index.d.ts +11 -1
  284. package/data/models/negotiable-quote-model.d.ts +263 -27
  285. package/data/models/negotiable-quote-template-model.d.ts +112 -0
  286. package/data/models/store-config-model.d.ts +29 -0
  287. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +673 -2
  288. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +2151 -0
  289. package/data/transforms/__fixtures__/storeConfigData.d.ts +35 -0
  290. package/data/transforms/index.d.ts +6 -13
  291. package/data/transforms/transform-history.d.ts +15 -0
  292. package/data/transforms/transform-quote-items.d.ts +15 -0
  293. package/data/transforms/transform-quote-template.d.ts +5 -0
  294. package/data/transforms/transform-quote.d.ts +13 -2
  295. package/data/transforms/transform-store-config.d.ts +4 -0
  296. package/hooks/useItemsQuotedTemplate.d.ts +15 -0
  297. package/hooks/useQuoteSummaryData.d.ts +10 -0
  298. package/hooks/useReferenceDocumentLinks.d.ts +34 -0
  299. package/hooks/useRemoveTemplateItems.d.ts +25 -0
  300. package/hooks/useRenameTemplate.d.ts +71 -0
  301. package/hooks/useUpdateTemplateQuantities.d.ts +27 -0
  302. package/i18n/en_US.json.d.ts +447 -1
  303. package/lib/configurationTransformers.d.ts +27 -0
  304. package/lib/itemFormatters.d.ts +47 -0
  305. package/lib/priceCalculators.d.ts +41 -0
  306. package/lib/state.d.ts +6 -0
  307. package/package.json +1 -1
  308. package/render.js +6 -2
  309. package/render.js.map +1 -1
  310. package/types/state.types.d.ts +13 -0
  311. package/utils/dateUtils.d.ts +26 -0
  312. package/utils/fileUtils.d.ts +46 -0
  313. package/utils/mapAuthPermissions.d.ts +39 -0
  314. package/api/getCustomerData/graphql/CustomerQuery.d.ts +0 -2
  315. package/api/graphql/CustomerFragment.d.ts +0 -2
  316. package/data/models/__fixtures__/customerModel.d.ts +0 -4
  317. package/data/transforms/transform-customer.d.ts +0 -15
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as i,jsxs as r}from"@dropins/tools/preact-jsx-runtime.js";import{Modal as v,Button as c}from"@dropins/tools/components.js";/* empty css */import{useText as N}from"@dropins/tools/i18n.js";const y=({open:d=!1,title:o,message:n,cancelLabel:s,confirmLabel:e,onCancel:a,onConfirm:l,onClose:f,showCloseButton:_,confirmationBanner:t,...h})=>{const m=N({cancel:"ConfirmationModal.cancel",confirm:"ConfirmationModal.confirm"});if(!d)return null;const{className:p,...u}=h;return i(v,{...u,size:"medium",onClose:f||a,clickToDismiss:!0,escapeToDismiss:!0,showCloseButton:_,"data-testid":"confirmation-modal",className:p,children:r("div",{className:"confirmation-modal__content",children:[t&&i("div",{className:"confirmation-modal__banner","data-testid":"confirmation-modal-banner",children:t}),o&&i("div",{className:"confirmation-modal__title","data-testid":"confirmation-modal-title",children:o}),n&&i("div",{className:"confirmation-modal__message","data-testid":"confirmation-modal-message",children:n}),r("div",{className:"confirmation-modal__actions","data-testid":"confirmation-modal-actions",children:[a&&i(c,{variant:"secondary",onClick:a,"data-testid":"confirmation-modal-cancel",children:s??m.cancel}),i(c,{variant:"primary",onClick:l,"data-testid":"confirmation-modal-confirm",children:e??m.confirm})]})]})})};export{y as C};
4
+ //# sourceMappingURL=ConfirmationModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmationModal.js","sources":["/@dropins/storefront-quote-management/src/components/ConfirmationModal/ConfirmationModal.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Modal } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/ConfirmationModal/ConfirmationModal.css';\n\nexport interface ConfirmationModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open?: boolean;\n title?: VNode | string;\n message?: VNode | string;\n cancelLabel?: VNode | string;\n confirmLabel?: VNode | string;\n onCancel?: () => void;\n onConfirm?: () => void;\n onClose?: () => void;\n showCloseButton?: boolean;\n confirmationBanner?: VNode | null;\n}\n\nexport const ConfirmationModal: FunctionComponent<ConfirmationModalProps> = ({\n open = false,\n title,\n message,\n cancelLabel,\n confirmLabel,\n onCancel,\n onConfirm,\n onClose,\n showCloseButton,\n confirmationBanner,\n ...props\n}) => {\n const dictionary = useText({\n cancel: 'ConfirmationModal.cancel',\n confirm: 'ConfirmationModal.confirm',\n });\n\n if (!open) {\n return null;\n }\n\n const { className, ...restProps } = props;\n\n return (\n <Modal\n {...restProps}\n size={'medium'}\n onClose={onClose || onCancel}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n data-testid=\"confirmation-modal\"\n className={className}\n >\n <div className=\"confirmation-modal__content\">\n {confirmationBanner && (\n <div\n className=\"confirmation-modal__banner\"\n data-testid=\"confirmation-modal-banner\"\n >\n {confirmationBanner}\n </div>\n )}\n {title && (\n <div\n className=\"confirmation-modal__title\"\n data-testid=\"confirmation-modal-title\"\n >\n {title}\n </div>\n )}\n {message && (\n <div\n className=\"confirmation-modal__message\"\n data-testid=\"confirmation-modal-message\"\n >\n {message}\n </div>\n )}\n <div\n className=\"confirmation-modal__actions\"\n data-testid=\"confirmation-modal-actions\"\n >\n {onCancel && (\n <Button\n variant=\"secondary\"\n onClick={onCancel}\n data-testid=\"confirmation-modal-cancel\"\n >\n {cancelLabel ?? dictionary.cancel}\n </Button>\n )}\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n data-testid=\"confirmation-modal-confirm\"\n >\n {confirmLabel ?? dictionary.confirm}\n </Button>\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":["ConfirmationModal","open","title","message","cancelLabel","confirmLabel","onCancel","onConfirm","onClose","showCloseButton","confirmationBanner","props","dictionary","useText","className","restProps","jsx","Modal","jsxs","Button"],"mappings":"2NA6BO,MAAMA,EAA+D,CAAC,CAC3E,KAAAC,EAAO,GACP,MAAAC,EACA,QAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,OAAQ,2BACR,QAAS,2BAAA,CACV,EAED,GAAI,CAACZ,EACH,OAAO,KAGT,KAAM,CAAE,UAAAa,EAAW,GAAGC,CAAA,EAAcJ,EAEpC,OACEK,EAACC,EAAA,CACE,GAAGF,EACJ,KAAM,SACN,QAASP,GAAWF,EACpB,eAAgB,GAChB,gBAAiB,GACjB,gBAAAG,EACA,cAAY,qBACZ,UAAAK,EAEA,SAAAI,EAAC,MAAA,CAAI,UAAU,8BACZ,SAAA,CAAAR,GACCM,EAAC,MAAA,CACC,UAAU,6BACV,cAAY,4BAEX,SAAAN,CAAA,CAAA,EAGJR,GACCc,EAAC,MAAA,CACC,UAAU,4BACV,cAAY,2BAEX,SAAAd,CAAA,CAAA,EAGJC,GACCa,EAAC,MAAA,CACC,UAAU,8BACV,cAAY,6BAEX,SAAAb,CAAA,CAAA,EAGLe,EAAC,MAAA,CACC,UAAU,8BACV,cAAY,6BAEX,SAAA,CAAAZ,GACCU,EAACG,EAAA,CACC,QAAQ,YACR,QAASb,EACT,cAAY,4BAEX,YAAeM,EAAW,MAAA,CAAA,EAG/BI,EAACG,EAAA,CACC,QAAQ,UACR,QAASZ,EACT,cAAY,6BAEX,YAAgBK,EAAW,OAAA,CAAA,CAC9B,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAGN"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as n,jsxs as ye,Fragment as be}from"@dropins/tools/preact-jsx-runtime.js";import{useState as i,useEffect as T,useCallback as H}from"@dropins/tools/preact-compat.js";import{Slot as K}from"@dropins/tools/lib.js";import{events as P}from"@dropins/tools/event-bus.js";import{Price as V,InLineAlert as y}from"@dropins/tools/components.js";/* empty css */import{I as X,Q as Qe,P as ve,L as Ne}from"./LineItemNoteModal.js";import{C as Z}from"./ConfirmationModal.js";/* empty css *//* empty css */import"./state.js";import{u as R,s as Te,r as Ie}from"./setLineItemNote.js";import{S as ee}from"./CheckWithCircle.js";import{S as D}from"./WarningFilled.js";import{useText as he}from"@dropins/tools/i18n.js";const qe=3e3,_e=({quoteData:te,onItemCheckboxChange:I,onItemDropdownChange:g,onRemoveItemsRef:b,onRemoveModalStateChange:m,slots:p,...ae})=>{const[s,h]=i(te),[F,q]=i({}),[u,j]=i(null),[se,Q]=i(!1),[oe,A]=i(!1),[k,B]=i(""),[v,l]=i({type:null,message:""}),[ne,x]=i(!1),[f,S]=i([]),[re,C]=i(!1),[N,d]=i({type:null,message:""}),[_,c]=i({}),[ie,U]=i(!1),o=he({subtotal:"NegotiableQuote.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuote.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuote.Manage.quotePricesSummary.appliedTaxes",modalTitle:"NegotiableQuote.Manage.updateQuantitiesModal.title",modalDescription:"NegotiableQuote.Manage.updateQuantitiesModal.description",modalCancelButton:"NegotiableQuote.Manage.updateQuantitiesModal.cancelButton",modalUpdateButton:"NegotiableQuote.Manage.updateQuantitiesModal.updateButton",successHeading:"NegotiableQuote.Manage.updateQuantitiesModal.successHeading",successMessage:"NegotiableQuote.Manage.updateQuantitiesModal.successMessage",errorHeading:"NegotiableQuote.Manage.updateQuantitiesModal.errorHeading",errorMessage:"NegotiableQuote.Manage.updateQuantitiesModal.errorMessage",removeModalTitle:"NegotiableQuote.Manage.removeItemsModal.title",removeModalDescription:"NegotiableQuote.Manage.removeItemsModal.description",removeModalCancelButton:"NegotiableQuote.Manage.removeItemsModal.cancelButton",removeModalConfirmButton:"NegotiableQuote.Manage.removeItemsModal.confirmButton",removeModalConfirmButtonRemoving:"NegotiableQuote.Manage.removeItemsModal.confirmButtonRemoving",removeSuccessHeading:"NegotiableQuote.Manage.removeItemsModal.successHeading",removeSuccessMessage:"NegotiableQuote.Manage.removeItemsModal.successMessage",removeErrorHeading:"NegotiableQuote.Manage.removeItemsModal.errorHeading",removeErrorMessage:"NegotiableQuote.Manage.removeItemsModal.errorMessage"});T(()=>{const t=P.on("quote-management/quote-data",e=>{h(e.quote),q({}),l({type:null,message:""}),c({})},{eager:!0});return()=>t==null?void 0:t.off()},[]),T(()=>{const t=P.on("quote-management/quantities-updated",e=>{h(e.quote),q({}),l({type:"success",message:o.successMessage}),setTimeout(()=>{Q(!1),l({type:null,message:""})},3e3)});return()=>t==null?void 0:t.off()},[o.successMessage]),T(()=>{const t=P.on("quote-management/quote-items-removed",e=>{h(e.quote),S([]),C(!1),d({type:"success",message:o.removeSuccessMessage}),setTimeout(()=>{x(!1),d({type:null,message:""}),m==null||m(!1)},qe)});return()=>t==null?void 0:t.off()},[o.removeSuccessMessage,m]);const O=H(t=>{!t||t.length===0||(S(t),d({type:null,message:""}),x(!0))},[]);T(()=>{b==null||b(O)},[O,b]);const W=()=>{d({type:null,message:""})},w=(t,e)=>{const a=t;if(e==="edit"){j(a),A(!0),c(r=>({...r,[a.uid]:""}));return}if(e==="remove"){c(r=>({...r,[a.uid]:e})),O([a]),g==null||g(a,e),c(r=>({...r,[a.uid]:""}));return}e&&(g==null||g(a,e)),c(r=>{if(!(a.uid in r))return r;const M={...r};return delete M[a.uid],M})},ue=async()=>{if(!s||f.length===0)return;const t=f.map(e=>e.uid);C(!0),d({type:null,message:""});try{await Ie({quoteUid:s.uid,quoteItemUids:t})}catch(e){const a=e instanceof Error?e.message:o.removeErrorMessage;if(d({type:"error",message:a}),f.length===1){const r=f[0];c(M=>{if(!(r.uid in M))return M;const J={...M};return delete J[r.uid],J})}C(!1)}},le=()=>{if(x(!1),d({type:null,message:""}),m==null||m(!1),f.length===1){const t=f[0];c(e=>{if(!(t.uid in e))return e;const a={...e};return delete a[t.uid],a})}S([])},E=H(()=>{u&&c(t=>{const e={...t};return delete e[u.uid],e}),A(!1),j(null),U(!1),B("")},[u]),ce=H(async(t,e)=>{if(!(!u||!s)){U(!0);try{e!==u.quantity&&await R({quoteUid:s.uid,items:[{quoteItemUid:u.uid,quantity:e}]}),await Te({quoteUid:s.uid,itemUid:u.uid,note:t,quantity:e}),E()}catch(a){console.error("Failed to set line item note:",a);const r=a instanceof Error?a.message:"Unable to update the item. Please try again.";B(r),U(!1)}}},[u,s,E]);if(!s)return n(X,{loading:!0});const Y=!!s.canUpdateQuote,$=(t,e)=>{q(a=>({...a,[t.uid]:e}))},z=t=>{t.preventDefault(),l({type:null,message:""}),Q(!0)},me=async()=>{if(!s)return;if(Object.keys(F).length===0){Q(!1);return}l({type:null,message:""});const t=Object.entries(F).map(([e,a])=>({quoteItemUid:e,quantity:a}));try{await R({quoteUid:s.uid,items:t})}catch(e){const a=e instanceof Error?e.message:o.errorMessage;l({type:"error",message:a}),console.error("Failed to update quantities:",e)}},de=()=>{Q(!1),l({type:null,message:""})},G=()=>{l({type:null,message:""})},L=[];s.prices.subtotalExcludingTax&&L.push({label:o.subtotal,id:"subtotal",value:n(V,{amount:s.prices.subtotalExcludingTax.value,currency:s.prices.subtotalExcludingTax.currency,weight:"normal"})}),s.prices.grandTotal&&L.push({label:o.grandTotal,id:"total",value:n(V,{amount:s.prices.grandTotal.value,currency:s.prices.grandTotal.currency}),strong:!0});const ge=v.type==="success"?n(y,{type:"success",variant:"primary",icon:n(ee,{}),heading:o.successHeading,description:v.message,onDismiss:G,"data-testid":"update-quantities-success-banner"}):v.type==="error"?n(y,{type:"error",variant:"primary",icon:n(D,{}),heading:o.errorHeading,description:v.message,onDismiss:G,"data-testid":"update-quantities-error-banner"}):null,pe=I?(t,e)=>{I(t,e)}:void 0,fe=N.type==="success"?n(y,{type:"success",variant:"primary",icon:n(ee,{}),heading:o.removeSuccessHeading,description:N.message,onDismiss:W,"data-testid":"remove-items-success-banner"}):N.type==="error"?n(y,{type:"error",variant:"primary",icon:n(D,{}),heading:o.removeErrorHeading,description:N.message,onDismiss:W,"data-testid":"remove-items-error-banner"}):null,Me=k?n(y,{type:"error",variant:"primary",icon:n(D,{}),heading:o.errorHeading,description:k,onDismiss:()=>B(""),"data-testid":"line-item-note-error-banner"}):null;return ye(be,{children:[n(X,{"data-testid":"items-quoted-container",...ae,loading:!1,table:n(K,{name:"ProductListTable",slot:p==null?void 0:p.ProductListTable,context:{items:s.items,canEdit:Y,readOnly:s.readOnly,onItemCheckboxChange:I,onItemDropdownChange:w,onQuantityChange:$,onUpdate:z,dropdownSelections:_},children:n(ve,{items:s.items,canEdit:Y,onItemCheckboxChange:pe,readOnly:s.readOnly,onItemDropdownChange:w,onQuantityChange:$,onUpdate:z,dropdownSelections:_})}),pricesSummary:n(K,{name:"QuotePricesSummary",slot:p==null?void 0:p.QuotePricesSummary,context:{items:s.items,prices:s.prices},children:n(Qe,{entries:L})})}),n(Z,{open:se,title:o.modalTitle,message:o.modalDescription,cancelLabel:o.modalCancelButton,confirmLabel:o.modalUpdateButton,onCancel:de,onConfirm:me,confirmationBanner:ge,"data-testid":"update-quantities-modal"}),n(Z,{open:ne,title:o.removeModalTitle,message:o.removeModalDescription,cancelLabel:o.removeModalCancelButton,confirmLabel:re?o.removeModalConfirmButtonRemoving:o.removeModalConfirmButton,onCancel:le,onConfirm:ue,confirmationBanner:fe,"data-testid":"remove-items-modal"}),u&&n(Ne,{open:oe,item:u,onClose:E,onConfirm:ce,isSubmitting:ie,errorBanner:Me||void 0})]})};export{_e as I};
4
+ //# sourceMappingURL=ItemsQuoted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemsQuoted.js","sources":["/@dropins/storefront-quote-management/src/containers/ItemsQuoted/ItemsQuoted.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Price, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n NegotiableQuoteModel,\n CartItemModel,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport {\n ProductListTable,\n QuotePricesSummary,\n ItemsQuoted as ItemsQuotedComponent,\n} from '@/quote-management/components';\nimport { CheckWithCircle, WarningFilled } from '@adobe-commerce/elsie/icons';\nimport { ConfirmationModal } from '@/quote-management/components/ConfirmationModal';\nimport { LineItemNoteModal } from '@/quote-management/components/LineItemNoteModal';\nimport { updateQuantities, setLineItemNote } from '@/quote-management/api';\nimport { removeNegotiableQuoteItems } from '@/quote-management/api/removeNegotiableQuoteItems';\n\nconst NOTIFICATION_AUTO_DISMISS_DELAY = 3000;\n\nexport interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {\n quoteData?: NegotiableQuoteModel;\n onItemCheckboxChange?: (\n item: CartItemModel,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: CartItemModel,\n action: string\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n onRemoveItemsRef?: (\n handler: (items: CartItemModel[]) => void\n ) => void;\n onRemoveModalStateChange?: (isOpen: boolean) => void;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteModel['items'];\n canEdit: boolean;\n readOnly?: boolean;\n onItemCheckboxChange?: (\n item: CartItemModel,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: CartItemModel,\n action: string\n ) => void;\n onQuantityChange?: (\n item: CartItemModel,\n newQuantity: number\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string | undefined>;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteModel['items'];\n prices: NegotiableQuoteModel['prices'];\n }>;\n };\n}\n\nexport const ItemsQuoted: Container<ItemsQuotedProps> = ({\n quoteData: initialData,\n onItemCheckboxChange,\n onItemDropdownChange,\n onRemoveItemsRef,\n onRemoveModalStateChange,\n slots,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n initialData\n );\n const [quantityChanges, setQuantityChanges] = useState<{\n [itemUid: string]: number;\n }>({});\n const [selectedItem, setSelectedItem] =\n useState<CartItemModel | null>(null);\n const [isUpdateQuantitiesModalOpen, setIsUpdateQuantitiesModalOpen] =\n useState(false);\n const [isLineItemNoteModalOpen, setIsLineItemNoteModalOpen] = useState(false);\n const [modalErrorMessage, setModalErrorMessage] = useState('');\n const [notificationState, setNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n // State for remove items functionality\n const [isRemoveModalOpen, setIsRemoveModalOpen] = useState(false);\n const [itemsToRemove, setItemsToRemove] = useState<CartItemModel[]>(\n []\n );\n const [isRemoving, setIsRemoving] = useState(false);\n const [removeNotificationState, setRemoveNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string>\n >({});\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const dictionary = useText({\n subtotal: 'NegotiableQuote.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal:\n 'NegotiableQuote.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes: 'NegotiableQuote.Manage.quotePricesSummary.appliedTaxes',\n modalTitle: 'NegotiableQuote.Manage.updateQuantitiesModal.title',\n modalDescription:\n 'NegotiableQuote.Manage.updateQuantitiesModal.description',\n modalCancelButton:\n 'NegotiableQuote.Manage.updateQuantitiesModal.cancelButton',\n modalUpdateButton:\n 'NegotiableQuote.Manage.updateQuantitiesModal.updateButton',\n successHeading:\n 'NegotiableQuote.Manage.updateQuantitiesModal.successHeading',\n successMessage:\n 'NegotiableQuote.Manage.updateQuantitiesModal.successMessage',\n errorHeading: 'NegotiableQuote.Manage.updateQuantitiesModal.errorHeading',\n errorMessage: 'NegotiableQuote.Manage.updateQuantitiesModal.errorMessage',\n removeModalTitle: 'NegotiableQuote.Manage.removeItemsModal.title',\n removeModalDescription:\n 'NegotiableQuote.Manage.removeItemsModal.description',\n removeModalCancelButton:\n 'NegotiableQuote.Manage.removeItemsModal.cancelButton',\n removeModalConfirmButton:\n 'NegotiableQuote.Manage.removeItemsModal.confirmButton',\n removeModalConfirmButtonRemoving:\n 'NegotiableQuote.Manage.removeItemsModal.confirmButtonRemoving',\n removeSuccessHeading:\n 'NegotiableQuote.Manage.removeItemsModal.successHeading',\n removeSuccessMessage:\n 'NegotiableQuote.Manage.removeItemsModal.successMessage',\n removeErrorHeading: 'NegotiableQuote.Manage.removeItemsModal.errorHeading',\n removeErrorMessage: 'NegotiableQuote.Manage.removeItemsModal.errorMessage',\n });\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n\n (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n setQuantityChanges({});\n setNotificationState({ type: null, message: '' });\n setDropdownSelections({});\n },\n\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n useEffect(() => {\n const quantitiesUpdatedEvent = events.on(\n 'quote-management/quantities-updated',\n (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n setQuantityChanges({});\n setNotificationState({\n type: 'success',\n message: dictionary.successMessage,\n });\n // Auto-close success notification after 3 seconds\n setTimeout(() => {\n setIsUpdateQuantitiesModalOpen(false);\n setNotificationState({ type: null, message: '' });\n }, 3000);\n }\n );\n return () => quantitiesUpdatedEvent?.off();\n }, [dictionary.successMessage]);\n\n // Listen for quote items removed event\n useEffect(() => {\n const itemsRemovedEvent = events.on(\n 'quote-management/quote-items-removed',\n (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n setItemsToRemove([]);\n setIsRemoving(false);\n setRemoveNotificationState({\n type: 'success',\n message: dictionary.removeSuccessMessage,\n });\n // Auto-close success notification after 3 seconds\n setTimeout(() => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n }, NOTIFICATION_AUTO_DISMISS_DELAY);\n }\n );\n return () => itemsRemovedEvent?.off();\n }, [dictionary.removeSuccessMessage, onRemoveModalStateChange]);\n\n // Unified handler for removing items (single or multiple)\n const handleRemoveItems = useCallback((items: CartItemModel[]) => {\n if (!items || items.length === 0) {\n return;\n }\n setItemsToRemove(items);\n setRemoveNotificationState({ type: null, message: '' });\n setIsRemoveModalOpen(true);\n }, []);\n\n // Expose handler to parent component\n useEffect(() => {\n onRemoveItemsRef?.(handleRemoveItems);\n }, [handleRemoveItems, onRemoveItemsRef]);\n\n const handleDismissRemoveBanner = () => {\n setRemoveNotificationState({ type: null, message: '' });\n };\n\n const handleItemDropdownChange = (\n item: CartItemModel,\n action: string\n ) => {\n const cartItem = item;\n // Handle edit action - open line item note modal\n if (action === 'edit') {\n setSelectedItem(cartItem);\n setIsLineItemNoteModalOpen(true);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({ ...prev, [cartItem.uid]: '' }));\n return;\n }\n\n // Handle remove action\n if (action === 'remove') {\n setDropdownSelections((prev) => ({\n ...prev,\n [cartItem.uid]: action,\n }));\n handleRemoveItems([cartItem]); // Use unified handler\n onItemDropdownChange?.(cartItem, action);\n // Reset dropdown immediately (consistent with edit action)\n setDropdownSelections((prev) => ({ ...prev, [cartItem.uid]: '' }));\n return;\n }\n\n // For any other actions, pass through to parent (but ignore empty/placeholder selections)\n if (action) {\n onItemDropdownChange?.(cartItem, action);\n }\n\n // Clear dropdown selection for non-edit/remove actions\n /* istanbul ignore next: defensive cleanup - custom actions shouldn't have dropdown state due to proper cleanup in edit/remove handlers */\n setDropdownSelections((prev) => {\n if (!(cartItem.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[cartItem.uid];\n return next;\n });\n };\n\n const handleConfirmRemove = async () => {\n /* istanbul ignore next */\n if (!quoteData || itemsToRemove.length === 0) {\n return;\n }\n\n const uidsToRemove = itemsToRemove.map((item) => item.uid);\n\n setIsRemoving(true);\n setRemoveNotificationState({ type: null, message: '' });\n\n try {\n await removeNegotiableQuoteItems({\n quoteUid: quoteData.uid,\n quoteItemUids: uidsToRemove,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n /* istanbul ignore next */\n err instanceof Error ? err.message : dictionary.removeErrorMessage;\n setRemoveNotificationState({\n type: 'error',\n message: errorMessage,\n });\n // Clear dropdown selections for failed items (single item only)\n /* istanbul ignore next */ // UI-driven state; covered by tests but line sometimes mis-attributed in source maps\n if (itemsToRemove.length === 1) {\n const failedItem = itemsToRemove[0];\n setDropdownSelections((prev) => {\n if (!(failedItem.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[failedItem.uid];\n return next;\n });\n }\n setIsRemoving(false);\n }\n };\n\n const handleCancelRemove = () => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n // Clear dropdown selections for single item cancellation\n /* istanbul ignore next */ // UI-driven state; covered by tests but line sometimes mis-attributed in source maps\n if (itemsToRemove.length === 1) {\n const cancelledItem = itemsToRemove[0];\n setDropdownSelections((prev) => {\n if (!(cancelledItem.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[cancelledItem.uid];\n return next;\n });\n }\n setItemsToRemove([]);\n };\n\n // Handle modal close\n const handleModalClose = useCallback(() => {\n // Clean up dropdown selection for the selected item before clearing it\n /* istanbul ignore else: defensive check - selectedItem should always be truthy when modal is open */\n if (selectedItem) {\n setDropdownSelections((prev) => {\n const next = { ...prev };\n delete next[selectedItem.uid];\n return next;\n });\n }\n setIsLineItemNoteModalOpen(false);\n setSelectedItem(null);\n setIsSubmitting(false);\n setModalErrorMessage('');\n }, [selectedItem]);\n\n // Handle modal confirm - submit note and quantity\n const handleModalConfirm = useCallback(\n async (note: string, quantity: number) => {\n /* istanbul ignore next: defensive guard for async race conditions - unreachable in normal flow as modal only renders with selectedItem and quoteData */\n if (!selectedItem || !quoteData) return;\n\n setIsSubmitting(true);\n try {\n // Check if quantity has changed from the original\n const quantityChanged = quantity !== selectedItem.quantity;\n\n // If quantity changed, update it first\n if (quantityChanged) {\n await updateQuantities({\n quoteUid: quoteData.uid,\n items: [{ quoteItemUid: selectedItem.uid, quantity }],\n });\n }\n\n // Then set the line item note\n await setLineItemNote({\n quoteUid: quoteData.uid,\n itemUid: selectedItem.uid,\n note,\n quantity,\n });\n\n // Close modal on success\n handleModalClose();\n } catch (error) {\n console.error('Failed to set line item note:', error);\n // Extract error message from API\n const errorMessage =\n /* istanbul ignore next */\n error instanceof Error\n ? error.message\n : 'Unable to update the item. Please try again.';\n setModalErrorMessage(errorMessage);\n setIsSubmitting(false);\n }\n },\n [selectedItem, quoteData, handleModalClose]\n );\n\n if (!quoteData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const canEdit = Boolean(quoteData.canUpdateQuote);\n\n const handleQuantityChange = (\n item: CartItemModel,\n newQuantity: number\n ) => {\n setQuantityChanges((prev) => ({\n ...prev,\n [item.uid]: newQuantity,\n }));\n };\n\n const handleUpdate = (e: SubmitEvent) => {\n e.preventDefault();\n setNotificationState({ type: null, message: '' });\n setIsUpdateQuantitiesModalOpen(true);\n };\n\n const handleConfirmUpdate = async () => {\n /* istanbul ignore next */\n if (!quoteData) {\n return;\n }\n\n if (Object.keys(quantityChanges).length === 0) {\n setIsUpdateQuantitiesModalOpen(false);\n return;\n }\n\n // Clear any previous notifications\n setNotificationState({ type: null, message: '' });\n\n const items = Object.entries(quantityChanges).map(\n ([quoteItemUid, quantity]) => ({\n quoteItemUid,\n quantity,\n })\n );\n\n try {\n await updateQuantities({\n quoteUid: quoteData.uid,\n items,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n /* istanbul ignore next */\n err instanceof Error ? err.message : dictionary.errorMessage;\n setNotificationState({\n type: 'error',\n message: errorMessage,\n });\n console.error('Failed to update quantities:', err);\n }\n };\n\n const handleCancelUpdate = () => {\n setIsUpdateQuantitiesModalOpen(false);\n setNotificationState({ type: null, message: '' });\n };\n\n const handleDismissBanner = () => {\n setNotificationState({ type: null, message: '' });\n };\n\n const quotePricesSummaryEntries = [];\n\n quoteData.prices.subtotalExcludingTax &&\n quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: (\n <Price\n amount={quoteData.prices.subtotalExcludingTax.value}\n currency={quoteData.prices.subtotalExcludingTax.currency}\n weight=\"normal\"\n />\n ),\n });\n\n quoteData.prices.grandTotal &&\n quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: (\n <Price\n amount={quoteData.prices.grandTotal.value}\n currency={quoteData.prices.grandTotal.currency}\n />\n ),\n strong: true,\n });\n\n // Create confirmation banner based on notification state\n const confirmationBanner =\n notificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.successHeading}\n description={notificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-success-banner\"\n />\n ) : notificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.errorHeading}\n description={notificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-error-banner\"\n />\n ) : null;\n\n // Create wrapper for checkbox change handler\n const handleItemCheckboxChange = onItemCheckboxChange\n ? (item: CartItemModel, isSelected: boolean) => {\n onItemCheckboxChange(item, isSelected);\n }\n : undefined;\n\n // Create remove confirmation banner based on notification state\n const removeConfirmationBanner =\n removeNotificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.removeSuccessHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-success-banner\"\n />\n ) : removeNotificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.removeErrorHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-error-banner\"\n />\n ) : null;\n\n // Create modal error banner\n const modalErrorBanner = modalErrorMessage ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.errorHeading}\n description={modalErrorMessage}\n onDismiss={() => setModalErrorMessage('')}\n data-testid=\"line-item-note-error-banner\"\n />\n ) : null;\n\n return (\n <>\n <ItemsQuotedComponent\n data-testid=\"items-quoted-container\"\n {...props}\n loading={false}\n table={\n <Slot\n name=\"ProductListTable\"\n slot={slots?.ProductListTable}\n context={{\n items: quoteData.items,\n canEdit,\n readOnly: quoteData.readOnly,\n onItemCheckboxChange,\n onItemDropdownChange: handleItemDropdownChange,\n onQuantityChange: handleQuantityChange,\n onUpdate: handleUpdate,\n dropdownSelections,\n }}\n >\n <ProductListTable\n items={quoteData.items}\n canEdit={canEdit}\n onItemCheckboxChange={handleItemCheckboxChange}\n readOnly={quoteData.readOnly}\n onItemDropdownChange={handleItemDropdownChange}\n onQuantityChange={handleQuantityChange}\n onUpdate={handleUpdate}\n dropdownSelections={dropdownSelections}\n />\n </Slot>\n }\n pricesSummary={\n <Slot\n name=\"QuotePricesSummary\"\n slot={slots?.QuotePricesSummary}\n context={{\n items: quoteData.items,\n prices: quoteData.prices,\n }}\n >\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n\n {/* Update Quantities Modal */}\n <ConfirmationModal\n open={isUpdateQuantitiesModalOpen}\n title={dictionary.modalTitle}\n message={dictionary.modalDescription}\n cancelLabel={dictionary.modalCancelButton}\n confirmLabel={dictionary.modalUpdateButton}\n onCancel={handleCancelUpdate}\n onConfirm={handleConfirmUpdate}\n confirmationBanner={confirmationBanner}\n data-testid=\"update-quantities-modal\"\n />\n\n {/* Remove Items Modal */}\n <ConfirmationModal\n open={isRemoveModalOpen}\n title={dictionary.removeModalTitle}\n message={dictionary.removeModalDescription}\n cancelLabel={dictionary.removeModalCancelButton}\n confirmLabel={\n isRemoving\n ? dictionary.removeModalConfirmButtonRemoving\n : dictionary.removeModalConfirmButton\n }\n onCancel={handleCancelRemove}\n onConfirm={handleConfirmRemove}\n confirmationBanner={removeConfirmationBanner}\n data-testid=\"remove-items-modal\"\n />\n {/* Line Item Note Modal */}\n {selectedItem && (\n <LineItemNoteModal\n open={isLineItemNoteModalOpen}\n item={selectedItem}\n onClose={handleModalClose}\n onConfirm={handleModalConfirm}\n isSubmitting={isSubmitting}\n errorBanner={modalErrorBanner || undefined}\n />\n )}\n </>\n );\n};\n"],"names":["NOTIFICATION_AUTO_DISMISS_DELAY","ItemsQuoted","initialData","onItemCheckboxChange","onItemDropdownChange","onRemoveItemsRef","onRemoveModalStateChange","slots","props","quoteData","setQuoteData","useState","quantityChanges","setQuantityChanges","selectedItem","setSelectedItem","isUpdateQuantitiesModalOpen","setIsUpdateQuantitiesModalOpen","isLineItemNoteModalOpen","setIsLineItemNoteModalOpen","modalErrorMessage","setModalErrorMessage","notificationState","setNotificationState","isRemoveModalOpen","setIsRemoveModalOpen","itemsToRemove","setItemsToRemove","isRemoving","setIsRemoving","removeNotificationState","setRemoveNotificationState","dropdownSelections","setDropdownSelections","isSubmitting","setIsSubmitting","dictionary","useText","useEffect","quoteDataEvent","events","data","quantitiesUpdatedEvent","itemsRemovedEvent","handleRemoveItems","useCallback","items","handleDismissRemoveBanner","handleItemDropdownChange","item","action","cartItem","prev","next","handleConfirmRemove","uidsToRemove","removeNegotiableQuoteItems","err","errorMessage","failedItem","handleCancelRemove","cancelledItem","handleModalClose","handleModalConfirm","note","quantity","updateQuantities","setLineItemNote","error","jsx","ItemsQuotedComponent","canEdit","handleQuantityChange","newQuantity","handleUpdate","e","handleConfirmUpdate","quoteItemUid","handleCancelUpdate","handleDismissBanner","quotePricesSummaryEntries","Price","confirmationBanner","InLineAlert","CheckWithCircle","WarningFilled","handleItemCheckboxChange","isSelected","removeConfirmationBanner","modalErrorBanner","jsxs","Fragment","Slot","ProductListTable","QuotePricesSummary","ConfirmationModal","LineItemNoteModal"],"mappings":"uvBAkCA,MAAMA,GAAkC,IA4C3BC,GAA2C,CAAC,CACvD,UAAWC,GACX,qBAAAC,EACA,qBAAAC,EACA,iBAAAC,EACA,yBAAAC,EACA,MAAAC,EACA,GAAGC,EACL,IAAM,CACJ,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAChCT,EAAA,EAEI,CAACU,EAAiBC,CAAkB,EAAIF,EAE3C,CAAA,CAAE,EACC,CAACG,EAAcC,CAAe,EAClCJ,EAA+B,IAAI,EAC/B,CAACK,GAA6BC,CAA8B,EAChEN,EAAS,EAAK,EACV,CAACO,GAAyBC,CAA0B,EAAIR,EAAS,EAAK,EACtE,CAACS,EAAmBC,CAAoB,EAAIV,EAAS,EAAE,EACvD,CAACW,EAAmBC,CAAoB,EAAIZ,EAG/C,CAAE,KAAM,KAAM,QAAS,GAAI,EAExB,CAACa,GAAmBC,CAAoB,EAAId,EAAS,EAAK,EAC1D,CAACe,EAAeC,CAAgB,EAAIhB,EACxC,CAAA,CAAC,EAEG,CAACiB,GAAYC,CAAa,EAAIlB,EAAS,EAAK,EAC5C,CAACmB,EAAyBC,CAA0B,EAA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F,CAAA,EAGJ,cACEqC,EAACuB,EAAA,CACC,KAAK,qBACL,KAAMrF,GAAA,YAAAA,EAAO,mBACb,QAAS,CACP,MAAOE,EAAU,MACjB,OAAQA,EAAU,MAAA,EAGpB,SAAA4D,EAACyB,GAAA,CAAmB,QAASd,CAAA,CAA2B,CAAA,CAAA,CAC1D,CAAA,EAKJX,EAAC0B,EAAA,CACC,KAAM/E,GACN,MAAOoB,EAAW,WAClB,QAASA,EAAW,iBACpB,YAAaA,EAAW,kBACxB,aAAcA,EAAW,kBACzB,SAAU0C,GACV,UAAWF,GACX,mBAAAM,GACA,cAAY,yBAAA,CAAA,EAIdb,EAAC0B,EAAA,CACC,KAAMvE,GACN,MAAOY,EAAW,iBAClB,QAASA,EAAW,uBACpB,YAAaA,EAAW,wBACxB,aACER,GACIQ,EAAW,iCACXA,EAAW,yBAEjB,SAAUwB,GACV,UAAWN,GACX,mBAAoBkC,GACpB,cAAY,oBAAA,CAAA,EAGb1E,GACCuD,EAAC2B,GAAA,CACC,KAAM9E,GACN,KAAMJ,EACN,QAASgD,EACT,UAAWC,GACX,aAAA7B,GACA,YAAauD,IAAoB,MAAA,CAAA,CACnC,EAEJ,CAEJ"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as o,jsxs as ne,Fragment as se}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useEffect as O,useCallback as p}from"@dropins/tools/preact-compat.js";import{Slot as W}from"@dropins/tools/lib.js";import{events as H}from"@dropins/tools/event-bus.js";import{InLineAlert as B,Price as Y}from"@dropins/tools/components.js";/* empty css */import{I as $,Q as re,P as ie,L as le}from"./LineItemNoteModal.js";import{C as me}from"./ConfirmationModal.js";/* empty css *//* empty css */import"./state.js";import{r as de,u as ue,a as ce}from"./addQuoteTemplateLineItemNote.js";import{S as z}from"./CheckWithCircle.js";import{S as U}from"./WarningFilled.js";import{useText as pe}from"@dropins/tools/i18n.js";const ge=3e3,Me=b=>{const{templateId:r,onRemoveModalStateChange:a,removeSuccessMessage:e,removeErrorMessage:T}=b,[i,g]=l(!1),[M,s]=l([]),[u,m]=l(!1),[S,n]=l({type:null,message:""});O(()=>{const d=H.on("quote-management/quote-template-data",()=>{s([]),m(!1),n({type:"success",message:e}),setTimeout(()=>{g(!1),n({type:null,message:""}),a==null||a(!1)},ge)});return()=>d==null?void 0:d.off()},[e,a]);const N=p(d=>{!d||d.length===0||(s(d),n({type:null,message:""}),g(!0))},[]),Q=p(async()=>{if(!r||M.length===0)return;const d=M.map(I=>I.uid).filter(Boolean);if(d.length!==0){m(!0),n({type:null,message:""});try{await de({templateId:r,itemUids:d})}catch(I){const c=I instanceof Error?I.message:T;n({type:"error",message:c}),m(!1)}}},[r,M,T]),t=p(()=>{g(!1),n({type:null,message:""}),a==null||a(!1),s([])},[a]);return{handleRemoveItems:N,handleConfirmRemove:Q,handleCancelRemove:t,isRemoveModalOpen:i,itemsToRemove:M,isRemoving:u,removeNotificationState:S}},fe=b=>{const{handleRemoveItems:r}=b,[a,e]=l({}),T=p(()=>{},[]),i=p((g,M)=>{const s=g;if(M==="remove"){e(u=>({...u,[s.uid||""]:M})),r([s]),e(u=>({...u,[s.uid||""]:""}));return}e(u=>{if(!s.uid||!(s.uid in u))return u;const m={...u};return delete m[s.uid],m})},[r]);return{dropdownSelections:a,handleItemDropdownChange:i,handleDismissRemoveBanner:T}},ve=3e3,Te=b=>{const{templateId:r,onUpdateModalStateChange:a,updateSuccessMessage:e,updateErrorMessage:T}=b,[i,g]=l({}),[M,s]=l(!1),[u,m]=l(!1),[S,n]=l({type:null,message:""});O(()=>{const c=H.on("quote-management/quote-template-data",()=>{g({}),m(!1),n({type:"success",message:e}),setTimeout(()=>{s(!1),n({type:null,message:""}),a==null||a(!1)},ve)});return()=>c==null?void 0:c.off()},[e,a]);const N=p((c,y)=>{const h=c;if(!h.uid)return;const C=h.uid;g(R=>({...R,[C]:y}))},[]),Q=p(c=>{c.preventDefault(),n({type:null,message:""}),s(!0)},[]),t=p(async()=>{if(!r||Object.keys(i).length===0){s(!1);return}m(!0),n({type:null,message:""});const c=Object.entries(i).map(([y,h])=>({itemId:y,quantity:h}));try{await ue({templateId:r,items:c})}catch(y){const h=y instanceof Error?y.message:T;n({type:"error",message:h}),m(!1)}},[r,i,T]),d=p(()=>{s(!1),n({type:null,message:""}),a==null||a(!1),g({})},[a]),I=p(()=>{n({type:null,message:""})},[]);return{quantityChanges:i,handleQuantityChange:N,handleUpdate:Q,handleConfirmUpdate:t,handleCancelUpdate:d,handleDismissBanner:I,isUpdateModalOpen:M,isUpdating:u,updateNotificationState:S}},Oe=({templateData:b,slots:r,...a})=>{const[e,T]=l(b),[i,g]=l(null),[M,s]=l(!1),[u,m]=l(!1),[S,n]=l(""),[N,Q]=l({}),t=pe({subtotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes",removeModalTitle:"NegotiableQuoteTemplate.Manage.removeItemsModal.title",removeModalDescription:"NegotiableQuoteTemplate.Manage.removeItemsModal.description",removeModalCancelButton:"NegotiableQuoteTemplate.Manage.removeItemsModal.cancelButton",removeModalConfirmButton:"NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButton",removeModalConfirmButtonRemoving:"NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButtonRemoving",removeSuccessHeading:"NegotiableQuoteTemplate.Manage.removeItemsModal.successHeading",removeSuccessMessage:"NegotiableQuoteTemplate.Manage.removeItemsModal.successMessage",removeErrorHeading:"NegotiableQuoteTemplate.Manage.removeItemsModal.errorHeading",removeErrorMessage:"NegotiableQuoteTemplate.Manage.removeItemsModal.errorMessage",updateModalTitle:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.title",updateModalDescription:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.description",updateModalCancelButton:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.cancelButton",updateModalUpdateButton:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.updateButton",updateSuccessHeading:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successHeading",updateSuccessMessage:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successMessage",updateErrorHeading:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorHeading",updateErrorMessage:"NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorMessage",errorHeading:"NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading"}),{handleRemoveItems:d,handleConfirmRemove:I,handleCancelRemove:c,isRemoveModalOpen:y,isRemoving:h,removeNotificationState:C}=Me({templateId:e==null?void 0:e.id,removeSuccessMessage:t.removeSuccessMessage,removeErrorMessage:t.removeErrorMessage}),{dropdownSelections:R,handleItemDropdownChange:P,handleDismissRemoveBanner:q}=fe({handleRemoveItems:d}),{handleQuantityChange:L,handleUpdate:A,handleConfirmUpdate:G,handleCancelUpdate:J,handleDismissBanner:F,isUpdateModalOpen:K,updateNotificationState:E}=Te({templateId:e==null?void 0:e.id,updateSuccessMessage:t.updateSuccessMessage,updateErrorMessage:t.updateErrorMessage});O(()=>{const v=H.on("quote-management/quote-template-data",f=>{T(f.quoteTemplate),Q({})},{eager:!0});return()=>v==null?void 0:v.off()},[]);const _=p((v,f)=>{const D=v;if(f==="edit"){g(D),s(!0),Q(oe=>({...oe,[D.uid]:""}));return}P(v,f)},[P]),k={...R,...N},w=p(()=>{i&&Q(v=>{const f={...v};return delete f[i.uid],f}),s(!1),g(null),m(!1),n("")},[i]),V=p(async v=>{if(!(!i||!e)){m(!0),n("");try{await ce({templateId:e.id,itemId:i.uid,note:v}),w()}catch(f){console.error("Failed to set template line item note:",f);const D=f instanceof Error?f.message:"Unable to update the item. Please try again.";n(D),m(!1)}}},[i,e,w]),X=C.type==="success"?o(B,{type:"success",variant:"primary",icon:o(z,{}),heading:t.removeSuccessHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-success-banner"}):C.type==="error"?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.removeErrorHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-error-banner"}):null,Z=E.type==="success"?o(B,{type:"success",variant:"primary",icon:o(z,{}),heading:t.updateSuccessHeading,description:E.message,onDismiss:F,"data-testid":"update-quantities-success-banner"}):E.type==="error"?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.updateErrorHeading,description:E.message,onDismiss:F,"data-testid":"update-quantities-error-banner"}):null;if(!e)return o($,{loading:!0});const ee=y?{open:!0,title:t.removeModalTitle,message:t.removeModalDescription,cancelLabel:t.removeModalCancelButton,confirmLabel:h?t.removeModalConfirmButtonRemoving:t.removeModalConfirmButton,onCancel:c,onConfirm:I,confirmationBanner:X}:null,te=K?{open:!0,title:t.updateModalTitle,message:t.updateModalDescription,cancelLabel:t.updateModalCancelButton,confirmLabel:t.updateModalUpdateButton,onCancel:J,onConfirm:G,confirmationBanner:Z}:null,j=ee||te,x=[];e.prices.subtotalExcludingTax&&x.push({label:t.subtotal,id:"subtotal",value:o(Y,{amount:e.prices.subtotalExcludingTax.value,currency:e.prices.subtotalExcludingTax.currency,weight:"normal"})}),e.prices.grandTotal&&x.push({label:t.grandTotal,id:"total",value:o(Y,{amount:e.prices.grandTotal.value,currency:e.prices.grandTotal.currency}),strong:!0});const ae=S?o(B,{type:"error",variant:"primary",icon:o(U,{}),heading:t.errorHeading,description:S,onDismiss:()=>n(""),"data-testid":"line-item-note-error-banner"}):null;return ne(se,{children:[o($,{"data-testid":"items-quoted-template-container",...a,loading:!1,table:o(W,{name:"ProductListTable",slot:r==null?void 0:r.ProductListTable,context:{items:e.items,canEdit:e.canSendForReview,dropdownSelections:k,handleItemDropdownChange:_,handleQuantityChange:L,handleUpdate:A},children:o(ie,{items:e.items,canEdit:e.canSendForReview,showActions:e.canEditTemplateItems,onItemDropdownChange:_,onQuantityChange:L,onUpdate:A,dropdownSelections:k})}),pricesSummary:o(W,{name:"QuotePricesSummary",slot:r==null?void 0:r.QuotePricesSummary,context:{items:e.items,prices:e.prices},children:o(re,{entries:x})})}),j&&o(me,{...j}),i&&o(le,{open:M,item:i,onClose:w,onConfirm:V,isSubmitting:u,readOnlyQuantity:!0,errorBanner:ae||void 0})]})};export{Oe as I};
4
+ //# sourceMappingURL=ItemsQuotedTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemsQuotedTemplate.js","sources":["/@dropins/storefront-quote-management/src/hooks/useRemoveTemplateItems.ts","/@dropins/storefront-quote-management/src/hooks/useItemsQuotedTemplate.ts","/@dropins/storefront-quote-management/src/hooks/useUpdateTemplateQuantities.ts","/@dropins/storefront-quote-management/src/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { removeQuoteTemplateItems } from '@/quote-management/api/removeQuoteTemplateItems';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nconst NOTIFICATION_AUTO_DISMISS_DELAY = 3000;\n\nexport interface UseRemoveTemplateItemsReturn {\n handleRemoveItems: (items: CartItemModel[]) => void;\n handleConfirmRemove: () => Promise<void>;\n handleCancelRemove: () => void;\n isRemoveModalOpen: boolean;\n itemsToRemove: CartItemModel[];\n isRemoving: boolean;\n removeNotificationState: {\n type: 'success' | 'error' | null;\n message: string;\n };\n}\n\nexport interface UseRemoveTemplateItemsParams {\n templateId?: string;\n onRemoveModalStateChange?: (isOpen: boolean) => void;\n removeSuccessMessage: string;\n removeErrorMessage: string;\n}\n\n/**\n * Custom hook to manage removing items from a quote template\n */\nexport const useRemoveTemplateItems = (\n params: UseRemoveTemplateItemsParams\n): UseRemoveTemplateItemsReturn => {\n const {\n templateId,\n onRemoveModalStateChange,\n removeSuccessMessage,\n removeErrorMessage,\n } = params;\n\n const [isRemoveModalOpen, setIsRemoveModalOpen] = useState(false);\n const [itemsToRemove, setItemsToRemove] = useState<CartItemModel[]>([]);\n const [isRemoving, setIsRemoving] = useState(false);\n const [removeNotificationState, setRemoveNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n\n // Listen for quote template data event (successful removal)\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n () => {\n setItemsToRemove([]);\n setIsRemoving(false);\n setRemoveNotificationState({\n type: 'success',\n message: removeSuccessMessage,\n });\n // Auto-close success notification after delay\n setTimeout(() => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n }, NOTIFICATION_AUTO_DISMISS_DELAY);\n }\n );\n return () => templateDataEvent?.off();\n }, [removeSuccessMessage, onRemoveModalStateChange]);\n\n // Unified handler for removing items (single or multiple)\n const handleRemoveItems = useCallback((items: CartItemModel[]) => {\n if (!items || items.length === 0) {\n return;\n }\n setItemsToRemove(items);\n setRemoveNotificationState({ type: null, message: '' });\n setIsRemoveModalOpen(true);\n }, []);\n\n const handleConfirmRemove = useCallback(async () => {\n if (!templateId || itemsToRemove.length === 0) {\n return;\n }\n\n const uidsToRemove = itemsToRemove.map((item) => item.uid).filter(Boolean) as string[];\n\n if (uidsToRemove.length === 0) {\n return;\n }\n\n setIsRemoving(true);\n setRemoveNotificationState({ type: null, message: '' });\n\n try {\n await removeQuoteTemplateItems({\n templateId,\n itemUids: uidsToRemove,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : removeErrorMessage;\n setRemoveNotificationState({\n type: 'error',\n message: errorMessage,\n });\n setIsRemoving(false);\n }\n }, [templateId, itemsToRemove, removeErrorMessage]);\n\n const handleCancelRemove = useCallback(() => {\n setIsRemoveModalOpen(false);\n setRemoveNotificationState({ type: null, message: '' });\n onRemoveModalStateChange?.(false);\n setItemsToRemove([]);\n }, [onRemoveModalStateChange]);\n\n return {\n handleRemoveItems,\n handleConfirmRemove,\n handleCancelRemove,\n isRemoveModalOpen,\n itemsToRemove,\n isRemoving,\n removeNotificationState,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/compat';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nexport interface UseItemsQuotedTemplateReturn {\n dropdownSelections: Record<string, string | undefined>;\n handleItemDropdownChange: (item: CartItemModel, action: string) => void;\n handleDismissRemoveBanner: () => void;\n}\n\nexport interface UseItemsQuotedTemplateParams {\n handleRemoveItems: (items: CartItemModel[]) => void;\n}\n\n/**\n * Custom hook to manage dropdown selections and item actions for quote template items\n */\nexport const useItemsQuotedTemplate = (\n params: UseItemsQuotedTemplateParams\n): UseItemsQuotedTemplateReturn => {\n const { handleRemoveItems } = params;\n\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string | undefined>\n >({});\n\n const handleDismissRemoveBanner = useCallback(() => {\n // The hook manages its own notification state, but we can add custom dismiss logic if needed\n }, []);\n\n const handleItemDropdownChange = useCallback(\n (item: CartItemModel, action: string) => {\n const cartItem = item;\n\n // Handle remove action\n if (action === 'remove') {\n setDropdownSelections((prev) => ({\n ...prev,\n [cartItem.uid || '']: action,\n }));\n handleRemoveItems([cartItem]);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({ ...prev, [cartItem.uid || '']: '' }));\n return;\n }\n\n // Clear dropdown selection for other actions\n setDropdownSelections((prev) => {\n if (!cartItem.uid || !(cartItem.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[cartItem.uid];\n return next;\n });\n },\n [handleRemoveItems]\n );\n\n return {\n dropdownSelections,\n handleItemDropdownChange,\n handleDismissRemoveBanner,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { updateQuoteTemplateItemQuantities } from '@/quote-management/api/updateQuoteTemplateItemQuantities';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nconst NOTIFICATION_AUTO_DISMISS_DELAY = 3000;\n\nexport interface UseUpdateTemplateQuantitiesReturn {\n quantityChanges: Record<string, number>;\n handleQuantityChange: (item: CartItemModel, newQuantity: number) => void;\n handleUpdate: (e: SubmitEvent) => void;\n handleConfirmUpdate: () => Promise<void>;\n handleCancelUpdate: () => void;\n handleDismissBanner: () => void;\n isUpdateModalOpen: boolean;\n isUpdating: boolean;\n updateNotificationState: {\n type: 'success' | 'error' | null;\n message: string;\n };\n}\n\nexport interface UseUpdateTemplateQuantitiesParams {\n templateId?: string;\n onUpdateModalStateChange?: (isOpen: boolean) => void;\n updateSuccessMessage: string;\n updateErrorMessage: string;\n}\n\n/**\n * Custom hook to manage updating quantities of items in a quote template\n */\nexport const useUpdateTemplateQuantities = (\n params: UseUpdateTemplateQuantitiesParams\n): UseUpdateTemplateQuantitiesReturn => {\n const {\n templateId,\n onUpdateModalStateChange,\n updateSuccessMessage,\n updateErrorMessage,\n } = params;\n\n const [quantityChanges, setQuantityChanges] = useState<Record<string, number>>({});\n const [isUpdateModalOpen, setIsUpdateModalOpen] = useState(false);\n const [isUpdating, setIsUpdating] = useState(false);\n const [updateNotificationState, setUpdateNotificationState] = useState<{\n type: 'success' | 'error' | null;\n message: string;\n }>({ type: null, message: '' });\n\n // Listen for quote template data event (successful update)\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n () => {\n setQuantityChanges({});\n setIsUpdating(false);\n setUpdateNotificationState({\n type: 'success',\n message: updateSuccessMessage,\n });\n // Auto-close success notification after delay\n setTimeout(() => {\n setIsUpdateModalOpen(false);\n setUpdateNotificationState({ type: null, message: '' });\n onUpdateModalStateChange?.(false);\n }, NOTIFICATION_AUTO_DISMISS_DELAY);\n }\n );\n return () => templateDataEvent?.off();\n }, [updateSuccessMessage, onUpdateModalStateChange]);\n\n const handleQuantityChange = useCallback(\n (item: CartItemModel, newQuantity: number) => {\n const cartItem = item;\n if (!cartItem.uid) {\n return;\n }\n const itemUid = cartItem.uid;\n setQuantityChanges((prev) => ({\n ...prev,\n [itemUid]: newQuantity,\n }));\n },\n []\n );\n\n const handleUpdate = useCallback((e: SubmitEvent) => {\n e.preventDefault();\n setUpdateNotificationState({ type: null, message: '' });\n setIsUpdateModalOpen(true);\n }, []);\n\n const handleConfirmUpdate = useCallback(async () => {\n if (!templateId || Object.keys(quantityChanges).length === 0) {\n setIsUpdateModalOpen(false);\n return;\n }\n\n setIsUpdating(true);\n setUpdateNotificationState({ type: null, message: '' });\n\n // Map quantity changes to API format\n const items = Object.entries(quantityChanges).map(([itemId, quantity]) => ({\n itemId,\n quantity,\n }));\n\n try {\n await updateQuoteTemplateItemQuantities({\n templateId,\n items,\n });\n // Success is handled by the event listener\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : updateErrorMessage;\n setUpdateNotificationState({\n type: 'error',\n message: errorMessage,\n });\n setIsUpdating(false);\n }\n }, [templateId, quantityChanges, updateErrorMessage]);\n\n const handleCancelUpdate = useCallback(() => {\n setIsUpdateModalOpen(false);\n setUpdateNotificationState({ type: null, message: '' });\n onUpdateModalStateChange?.(false);\n setQuantityChanges({});\n }, [onUpdateModalStateChange]);\n\n const handleDismissBanner = useCallback(() => {\n setUpdateNotificationState({ type: null, message: '' });\n }, []);\n\n return {\n quantityChanges,\n handleQuantityChange,\n handleUpdate,\n handleConfirmUpdate,\n handleCancelUpdate,\n handleDismissBanner,\n isUpdateModalOpen,\n isUpdating,\n updateNotificationState,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Price, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { CheckWithCircle, WarningFilled } from '@adobe-commerce/elsie/icons';\nimport {\n NegotiableQuoteTemplateModel,\n} from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport {\n QuotePricesSummary,\n ProductListTable,\n ItemsQuoted as ItemsQuotedComponent,\n ConfirmationModal,\n} from '@/quote-management/components';\nimport { LineItemNoteModal } from '@/quote-management/components/LineItemNoteModal';\nimport { addQuoteTemplateLineItemNote } from '@/quote-management/api';\nimport { useRemoveTemplateItems } from '@/quote-management/hooks/useRemoveTemplateItems';\nimport { useItemsQuotedTemplate } from '@/quote-management/hooks/useItemsQuotedTemplate';\nimport { useUpdateTemplateQuantities } from '@/quote-management/hooks/useUpdateTemplateQuantities';\n\nexport interface ItemsQuotedTemplateProps\n extends HTMLAttributes<HTMLDivElement> {\n templateData?: NegotiableQuoteTemplateModel;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n canEdit: boolean;\n dropdownSelections: Record<string, string | undefined>;\n handleItemDropdownChange: (item: CartItemModel, action: string) => void;\n handleQuantityChange: (item: CartItemModel, newQuantity: number) => void;\n handleUpdate: (e: SubmitEvent) => void;\n onItemDropdownChange?: (item: any, action: string) => void;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n prices: NegotiableQuoteTemplateModel['prices'];\n }>;\n };\n}\n\nexport const ItemsQuotedTemplate: Container<ItemsQuotedTemplateProps> = ({\n templateData: initialData,\n slots,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<\n NegotiableQuoteTemplateModel | undefined\n >(initialData);\n const [selectedItem, setSelectedItem] =\n useState<CartItemModel | null>(null);\n const [isLineItemNoteModalOpen, setIsLineItemNoteModalOpen] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [modalErrorMessage, setModalErrorMessage] = useState('');\n const [dropdownSelections, setDropdownSelections] = useState<\n Record<string, string>\n >({});\n\n const dictionary = useText({\n subtotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes:\n 'NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes',\n removeModalTitle: 'NegotiableQuoteTemplate.Manage.removeItemsModal.title',\n removeModalDescription: 'NegotiableQuoteTemplate.Manage.removeItemsModal.description',\n removeModalCancelButton: 'NegotiableQuoteTemplate.Manage.removeItemsModal.cancelButton',\n removeModalConfirmButton: 'NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButton',\n removeModalConfirmButtonRemoving: 'NegotiableQuoteTemplate.Manage.removeItemsModal.confirmButtonRemoving',\n removeSuccessHeading: 'NegotiableQuoteTemplate.Manage.removeItemsModal.successHeading',\n removeSuccessMessage: 'NegotiableQuoteTemplate.Manage.removeItemsModal.successMessage',\n removeErrorHeading: 'NegotiableQuoteTemplate.Manage.removeItemsModal.errorHeading',\n removeErrorMessage: 'NegotiableQuoteTemplate.Manage.removeItemsModal.errorMessage',\n updateModalTitle: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.title',\n updateModalDescription: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.description',\n updateModalCancelButton: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.cancelButton',\n updateModalUpdateButton: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.updateButton',\n updateSuccessHeading: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successHeading',\n updateSuccessMessage: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.successMessage',\n updateErrorHeading: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorHeading',\n updateErrorMessage: 'NegotiableQuoteTemplate.Manage.updateQuantitiesModal.errorMessage',\n errorHeading:\n 'NegotiableQuoteTemplate.Manage.lineItemNoteModal.errorHeading',\n });\n\n // Use the remove template items hook\n const {\n handleRemoveItems,\n handleConfirmRemove,\n handleCancelRemove,\n isRemoveModalOpen,\n isRemoving,\n removeNotificationState,\n } = useRemoveTemplateItems({\n templateId: templateData?.id,\n removeSuccessMessage: dictionary.removeSuccessMessage,\n removeErrorMessage: dictionary.removeErrorMessage,\n });\n\n // Use the items quoted template hook for dropdown and interaction logic\n const {\n dropdownSelections: hookDropdownSelections,\n handleItemDropdownChange: hookHandleItemDropdownChange,\n handleDismissRemoveBanner,\n } = useItemsQuotedTemplate({\n handleRemoveItems,\n });\n\n // Use the update template quantities hook\n const {\n handleQuantityChange,\n handleUpdate,\n handleConfirmUpdate,\n handleCancelUpdate,\n handleDismissBanner,\n isUpdateModalOpen,\n updateNotificationState,\n } = useUpdateTemplateQuantities({\n templateId: templateData?.id,\n updateSuccessMessage: dictionary.updateSuccessMessage,\n updateErrorMessage: dictionary.updateErrorMessage,\n });\n\n useEffect(() => {\n const templateDataEvent = events.on(\n 'quote-management/quote-template-data',\n (payload) => {\n setTemplateData(payload.quoteTemplate);\n setDropdownSelections({});\n },\n { eager: true }\n );\n\n return () => templateDataEvent?.off();\n }, []);\n\n // Combined handler for dropdown selection that handles both remove (via hook) and edit (for line item notes)\n const handleItemDropdownChange = useCallback(\n (item: CartItemModel, action: string) => {\n const templateItem = item;\n \n // Handle edit action - open line item note modal\n if (action === 'edit') {\n setSelectedItem(templateItem);\n setIsLineItemNoteModalOpen(true);\n // Reset dropdown immediately\n setDropdownSelections((prev) => ({\n ...prev,\n [templateItem.uid]: '',\n }));\n return;\n }\n\n // For remove and other actions, delegate to hook handler\n hookHandleItemDropdownChange(item, action);\n },\n [hookHandleItemDropdownChange]\n );\n\n // Merge dropdown selections from hook and local state\n const mergedDropdownSelections = { ...hookDropdownSelections, ...dropdownSelections };\n\n // Handle modal close\n const handleModalClose = useCallback(() => {\n // Clean up dropdown selection for the selected item before clearing it\n /* istanbul ignore else: defensive check - selectedItem should always be truthy when modal is open */\n if (selectedItem) {\n setDropdownSelections((prev) => {\n const next = { ...prev };\n delete next[selectedItem.uid];\n return next;\n });\n }\n setIsLineItemNoteModalOpen(false);\n setSelectedItem(null);\n setIsSubmitting(false);\n setModalErrorMessage('');\n }, [selectedItem]);\n\n // Handle modal confirm - submit note only (quantity is read-only for templates)\n const handleModalConfirm = useCallback(\n async (note: string) => {\n /* istanbul ignore next: defensive guard for async race conditions - unreachable in normal flow as modal only renders with selectedItem and templateData */\n if (!selectedItem || !templateData) return;\n\n setIsSubmitting(true);\n setModalErrorMessage('');\n\n try {\n // Set the line item note\n await addQuoteTemplateLineItemNote({\n templateId: templateData.id,\n itemId: selectedItem.uid,\n note,\n });\n\n // Close modal on success\n handleModalClose();\n } catch (error) {\n console.error('Failed to set template line item note:', error);\n const errorMessage =\n error instanceof Error\n ? error.message\n : 'Unable to update the item. Please try again.';\n setModalErrorMessage(errorMessage);\n setIsSubmitting(false);\n }\n },\n [selectedItem, templateData, handleModalClose]\n );\n\n // Create remove confirmation banner based on notification state\n const removeConfirmationBanner =\n removeNotificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.removeSuccessHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-success-banner\"\n />\n ) : removeNotificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.removeErrorHeading}\n description={removeNotificationState.message}\n onDismiss={handleDismissRemoveBanner}\n data-testid=\"remove-items-error-banner\"\n />\n ) : null;\n\n // Create update quantities confirmation banner based on notification state\n const updateConfirmationBanner =\n updateNotificationState.type === 'success' ? (\n <InLineAlert\n type=\"success\"\n variant=\"primary\"\n icon={<CheckWithCircle />}\n heading={dictionary.updateSuccessHeading}\n description={updateNotificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-success-banner\"\n />\n ) : updateNotificationState.type === 'error' ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.updateErrorHeading}\n description={updateNotificationState.message}\n onDismiss={handleDismissBanner}\n data-testid=\"update-quantities-error-banner\"\n />\n ) : null;\n\n if (!templateData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const removeConfirmationModalProps = isRemoveModalOpen ? {\n open: true,\n title: dictionary.removeModalTitle,\n message: dictionary.removeModalDescription,\n cancelLabel: dictionary.removeModalCancelButton,\n confirmLabel: isRemoving\n ? dictionary.removeModalConfirmButtonRemoving\n : dictionary.removeModalConfirmButton,\n onCancel: handleCancelRemove,\n onConfirm: handleConfirmRemove,\n confirmationBanner: removeConfirmationBanner,\n } : null;\n\n const updateConfirmationModalProps = isUpdateModalOpen ? {\n open: true,\n title: dictionary.updateModalTitle,\n message: dictionary.updateModalDescription,\n cancelLabel: dictionary.updateModalCancelButton,\n confirmLabel: dictionary.updateModalUpdateButton,\n onCancel: handleCancelUpdate,\n onConfirm: handleConfirmUpdate,\n confirmationBanner: updateConfirmationBanner,\n } : null;\n\n // Only define a single confirmation modal\n const confirmationModalProps = removeConfirmationModalProps || updateConfirmationModalProps;\n\n const quotePricesSummaryEntries = [];\n\n templateData.prices.subtotalExcludingTax &&\n quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: (\n <Price\n amount={templateData.prices.subtotalExcludingTax.value}\n currency={templateData.prices.subtotalExcludingTax.currency}\n weight=\"normal\"\n />\n ),\n });\n\n templateData.prices.grandTotal &&\n quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: (\n <Price\n amount={templateData.prices.grandTotal.value}\n currency={templateData.prices.grandTotal.currency}\n />\n ),\n strong: true,\n });\n\n // Create modal error banner\n const modalErrorBanner = modalErrorMessage ? (\n <InLineAlert\n type=\"error\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.errorHeading}\n description={modalErrorMessage}\n onDismiss={() => setModalErrorMessage('')}\n data-testid=\"line-item-note-error-banner\"\n />\n ) : null;\n\n return (\n <>\n <ItemsQuotedComponent\n data-testid=\"items-quoted-template-container\"\n {...props}\n loading={false}\n table={\n <Slot\n name=\"ProductListTable\"\n slot={slots?.ProductListTable}\n context={{\n items: templateData.items,\n canEdit: templateData.canSendForReview,\n dropdownSelections: mergedDropdownSelections,\n handleItemDropdownChange,\n handleQuantityChange,\n handleUpdate,\n }}\n >\n <ProductListTable\n items={templateData.items}\n canEdit={templateData.canSendForReview}\n showActions={templateData.canEditTemplateItems}\n onItemDropdownChange={handleItemDropdownChange}\n onQuantityChange={handleQuantityChange}\n onUpdate={handleUpdate}\n dropdownSelections={mergedDropdownSelections}\n />\n </Slot>\n }\n pricesSummary={\n <Slot\n name=\"QuotePricesSummary\"\n slot={slots?.QuotePricesSummary}\n context={{\n items: templateData.items,\n prices: templateData.prices,\n }}\n >\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n {/* Confirmation Modal for remove/update */}\n {confirmationModalProps && (\n <ConfirmationModal\n {...confirmationModalProps}\n />\n )}\n {/* Line Item Note Modal */}\n {selectedItem && (\n <LineItemNoteModal\n open={isLineItemNoteModalOpen}\n item={selectedItem as any}\n onClose={handleModalClose}\n onConfirm={handleModalConfirm}\n isSubmitting={isSubmitting}\n readOnlyQuantity={true}\n errorBanner={modalErrorBanner || undefined}\n />\n )}\n </>\n );\n};\n"],"names":["NOTIFICATION_AUTO_DISMISS_DELAY","useRemoveTemplateItems","params","templateId","onRemoveModalStateChange","removeSuccessMessage","removeErrorMessage","isRemoveModalOpen","setIsRemoveModalOpen","useState","itemsToRemove","setItemsToRemove","isRemoving","setIsRemoving","removeNotificationState","setRemoveNotificationState","useEffect","templateDataEvent","events","handleRemoveItems","useCallback","items","handleConfirmRemove","uidsToRemove","item","removeQuoteTemplateItems","err","errorMessage","handleCancelRemove","useItemsQuotedTemplate","dropdownSelections","setDropdownSelections","handleDismissRemoveBanner","handleItemDropdownChange","action","cartItem","prev","next","useUpdateTemplateQuantities","onUpdateModalStateChange","updateSuccessMessage","updateErrorMessage","quantityChanges","setQuantityChanges","isUpdateModalOpen","setIsUpdateModalOpen","isUpdating","setIsUpdating","updateNotificationState","setUpdateNotificationState","handleQuantityChange","newQuantity","itemUid","handleUpdate","e","handleConfirmUpdate","itemId","quantity","updateQuoteTemplateItemQuantities","handleCancelUpdate","handleDismissBanner","ItemsQuotedTemplate","initialData","slots","props","templateData","setTemplateData","selectedItem","setSelectedItem","isLineItemNoteModalOpen","setIsLineItemNoteModalOpen","isSubmitting","setIsSubmitting","modalErrorMessage","setModalErrorMessage","dictionary","useText","hookDropdownSelections","hookHandleItemDropdownChange","payload","templateItem","mergedDropdownSelections","handleModalClose","handleModalConfirm","note","addQuoteTemplateLineItemNote","error","removeConfirmationBanner","jsx","InLineAlert","CheckWithCircle","WarningFilled","updateConfirmationBanner","ItemsQuotedComponent","removeConfirmationModalProps","updateConfirmationModalProps","confirmationModalProps","quotePricesSummaryEntries","Price","modalErrorBanner","jsxs","Fragment","Slot","ProductListTable","QuotePricesSummary","ConfirmationModal","LineItemNoteModal"],"mappings":"qwBAcA,MAAMA,GAAkC,IAyB3BC,GACXC,GACiC,CACjC,KAAM,CACJ,WAAAC,EACA,yBAAAC,EACA,qBAAAC,EACA,mBAAAC,CAAA,EACEJ,EAEE,CAACK,EAAmBC,CAAoB,EAAIC,EAAS,EAAK,EAC1D,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C,EAAqB,EAAE,EACxC,cAAY,6BAAA,CAAA,EAEZ,KAEJ,OACE0B,GAAAC,GAAA,CACE,SAAA,CAAAb,EAACK,EAAA,CACC,cAAY,kCACX,GAAG7B,EACJ,QAAS,GACT,MACEwB,EAACc,EAAA,CACC,KAAK,mBACL,KAAMvC,GAAA,YAAAA,EAAO,iBACb,QAAS,CACP,MAAOE,EAAa,MACpB,QAASA,EAAa,iBACtB,mBAAoBgB,EACpB,yBAAAhD,EACA,qBAAAiB,EACA,aAAAG,CAAA,EAGF,SAAAmC,EAACe,GAAA,CACC,MAAOtC,EAAa,MACpB,QAASA,EAAa,iBACtB,YAAaA,EAAa,qBAC1B,qBAAsBhC,EACtB,iBAAkBiB,EAClB,SAAUG,EACV,mBAAoB4B,CAAA,CAAA,CACtB,CAAA,EAGJ,cACEO,EAACc,EAAA,CACC,KAAK,qBACL,KAAMvC,GAAA,YAAAA,EAAO,mBACb,QAAS,CACP,MAAOE,EAAa,MACpB,OAAQA,EAAa,MAAA,EAGvB,SAAAuB,EAACgB,GAAA,CAAmB,QAASP,CAAA,CAA2B,CAAA,CAAA,CAC1D,CAAA,EAIHD,GACCR,EAACiB,GAAA,CACE,GAAGT,CAAA,CAAA,EAIP7B,GACCqB,EAACkB,GAAA,CACC,KAAMrC,EACN,KAAMF,EACN,QAASe,EACT,UAAWC,EACX,aAAAZ,EACA,iBAAkB,GAClB,YAAa4B,IAAoB,MAAA,CAAA,CACnC,EAEJ,CAEJ"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as t,jsxs as n,Fragment as F}from"@dropins/tools/preact-jsx-runtime.js";import{classes as f,VComponent as D}from"@dropins/tools/lib.js";/* empty css */import{Skeleton as te,SkeletonRow as ae,Input as V,InLineAlert as oe,Picker as ne,Price as T,Checkbox as le,Button as E,Table as Z,Accordion as ie,AccordionSection as se,Modal as re,TextArea as ue}from"@dropins/tools/components.js";import{h as R}from"@dropins/tools/preact.js";import{useState as W,useEffect as ce}from"@dropins/tools/preact-hooks.js";import{g as de}from"./dateUtils.js";import{S as me}from"./WarningFilled.js";import{useText as J}from"@dropins/tools/i18n.js";import{useState as A,useEffect as be,useCallback as G}from"@dropins/tools/preact-compat.js";const Qe=({className:q,loading:d,table:o,pricesSummary:u,...i})=>d?t(pe,{}):n("div",{className:f(["quote-management-items-quoted",q]),...i,children:[o&&t(D,{node:o,className:f(["quote-management-items-quoted__table"]),"data-testid":"quote-management-items-quoted__table"}),u&&t(D,{node:u,className:f(["quote-management-items-quoted__prices-summary"]),"data-testid":"quote-management-items-quoted__prices-summary"})]}),pe=()=>t(te,{"data-testid":"items-quoted-skeleton",children:t(ae,{variant:"row",fullWidth:!0,size:"medium",lines:4,multilineGap:"xsmall"})}),Me=({className:q,items:d,canEdit:o,readOnly:u=!1,showActions:i,onItemCheckboxChange:b,onItemDropdownChange:g,onQuantityChange:k,onUpdate:S,dropdownSelections:_,...h})=>{const[I,L]=W({}),[y,p]=W({});ce(()=>{const e={};d.forEach(s=>{e[s.uid]=s.quantity}),L(e),p(e)},[d]);const v=Object.keys(y).some(e=>y[e]!==I[e]),a=J({updateButton:"NegotiableQuote.Manage.productListTable.submitButton",productNameHeader:"NegotiableQuote.Manage.productListTable.headers.productName",skuHeader:"NegotiableQuote.Manage.productListTable.headers.sku",priceHeader:"NegotiableQuote.Manage.productListTable.headers.price",quantityHeader:"NegotiableQuote.Manage.productListTable.headers.quantity",discountHeader:"NegotiableQuote.Manage.productListTable.headers.discount",subtotalHeader:"NegotiableQuote.Manage.productListTable.headers.subtotal",actionsHeader:"NegotiableQuote.Manage.productListTable.headers.actions",editNoteToSeller:"NegotiableQuote.Manage.productListTable.actions.editNoteToSeller",remove:"NegotiableQuote.Manage.productListTable.actions.remove",notesHeader:"NegotiableQuote.Manage.productListTable.notes.header",leftANote:"NegotiableQuote.Manage.productListTable.notes.leftANote",buyer:"NegotiableQuote.Manage.productListTable.notes.buyer",seller:"NegotiableQuote.Manage.productListTable.notes.seller",outOfStock:"NegotiableQuote.Manage.productListTable.outOfStock",outOfStockMessage:"NegotiableQuote.Manage.productListTable.outOfStockMessage"}),w=[{label:a.productNameHeader,key:"productName"},{label:a.skuHeader,key:"sku"},{label:a.priceHeader,key:"price"},{label:a.quantityHeader,key:"quantity"},{label:a.discountHeader,key:"discount"},{label:a.subtotalHeader,key:"subtotal"}];o&&!u&&w.unshift({label:"",key:"checkbox"}),(i??o)&&!u&&w.push({label:a.actionsHeader,key:"actions"});const j=(e,s)=>{const r=e.target.checked;b==null||b(s,r)},P=(e,s)=>{const r=e.target.value;g==null||g(s,r)},B=(e,s)=>{const r=parseInt(e.target.value,10);!isNaN(r)&&r>0&&(p(N=>({...N,[s.uid]:r})),k==null||k(s,r))},O=e=>{e.preventDefault(),S==null||S(e)},c=(e,s)=>e>0?n("div",{className:"quote-management-product-list-table__discount-container",children:[n("span",{className:"quote-management-product-list-table__discount-percent",children:[s,"%"]}),n("span",{className:"quote-management-product-list-table__discount-price",children:["(",t(T,{amount:e}),")"]})]}):void 0,Q=e=>{var N,M;const s=(N=e.configurableOptions)==null?void 0:N.map(m=>n("div",{className:"quote-management-product-list-table__configurable-option",children:[n("span",{className:"quote-management-product-list-table__configurable-option-label",children:[m.optionLabel,":"]}),t("span",{className:"quote-management-product-list-table__configurable-option-value",children:m.valueLabel})]},m.optionLabel)),r=(M=e.bundleOptions)==null?void 0:M.map(m=>n("div",{className:"quote-management-product-list-table__bundle-option",children:[t("span",{className:"quote-management-product-list-table__bundle-option-label",children:m.label}),t("div",{className:"quote-management-product-list-table__bundle-option-values",children:m.values.map(l=>n("span",{className:"quote-management-product-list-table__bundle-option-value",children:[n("span",{className:"quote-management-product-list-table__bundle-option-value-quantity",children:[l.quantity," x"]}),t("span",{className:"quote-management-product-list-table__bundle-option-value-label",children:l.label}),t(T,{className:"quote-management-product-list-table__bundle-option-value-original-price",amount:l.originalPrice.value,currency:l.originalPrice.currency,weight:"normal"})]},l.label))})]},m.label));return n("div",{className:"quote-management-product-list-table__product-name-container",children:[t("span",{className:"quote-management-product-list-table__product-name",children:e.product.name}),s,r]})},$=e=>new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0,timeZone:de()}),H=e=>{var M,m;const s=((M=e.noteFromBuyer)==null?void 0:M.filter(l=>l&&l.note&&l.note.trim()!==""))||[],r=((m=e.noteFromSeller)==null?void 0:m.filter(l=>l&&l.note&&l.note.trim()!==""))||[],N=[...s,...r];return N.length===0?null:n("div",{className:"quote-management-product-list-table__notes-container","data-testid":`item-notes-${e.product.sku}`,children:[t("div",{className:"quote-management-product-list-table__notes-header",children:a.notesHeader}),t("div",{className:"quote-management-product-list-table__notes-list",children:N.map((l,ee)=>n("div",{className:"quote-management-product-list-table__note-item",children:[n("div",{className:"quote-management-product-list-table__note-content",children:[n("strong",{className:"quote-management-product-list-table__note-meta",children:[$(l.createdAt)," (",s.includes(l)?a.buyer:a.seller,")"]})," ",a.leftANote]}),n("div",{className:"quote-management-product-list-table__note-text",children:[l.note," "]})]},l.noteUid||ee))})]})},z=new Set,K=d.flatMap((e,s)=>{var m;const r=H(e);(r||e.outOfStock)&&z.add(s);const N=o?t(V,{className:"quote-management-product-list-table__quantity-input",type:"number",min:"1",value:((m=y[e.uid])==null?void 0:m.toString())||e.quantity.toString(),onChange:l=>B(l,e),disabled:u||!o,"data-testid":`quantity-input-${e.product.sku}`}):t("span",{className:"quote-management-product-list-table__quantity",children:e.quantity});return[{checkbox:t(le,{className:"quote-management-product-list-table__checkbox",name:"itemSelected","data-testid":`item-checkbox-${e.product.sku}`,onChange:l=>j(l,e),value:e.product.sku}),productName:Q(e),sku:t("span",{className:"quote-management-product-list-table__sku",children:e.product.sku}),price:t(T,{className:"quote-management-product-list-table__price",amount:e.prices.originalItemPrice.value,currency:e.prices.originalItemPrice.currency}),quantity:N,discount:e.catalogDiscount?c(e.catalogDiscount.amountOff,e.catalogDiscount.percentOff):void 0,subtotal:t(T,{className:"quote-management-product-list-table__subtotal",amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency}),actions:t(ne,{className:"quote-management-product-list-table__actions","data-testid":`item-dropdown-${e.product.sku}`,name:`item-dropdown-${e.product.sku}`,handleSelect:l=>P(l,e),placeholder:"Select",value:(_==null?void 0:_[e.uid])??"",options:[{text:a.editNoteToSeller,value:"edit"},{text:a.remove,value:"remove"}]}),_rowDetails:n(F,{children:[e.outOfStock&&t("div",{className:"quote-management-product-list-table__out-of-stock-message",children:t(oe,{type:"warning",variant:"primary",icon:t(me,{}),heading:a.outOfStock,description:a.outOfStockMessage})}),r&&t("div",{className:"quote-management-product-list-table__notes-row-wrapper",children:r})]})}]}),U=t(Z,{columns:w,rowData:K,"data-testid":"product-list-table",mobileLayout:"stacked",expandedRows:z}),X=o?R("form",{}):R("div",{}),Y=o?{onSubmit:O,...h}:h,C=t(E,{type:"submit",disabled:u||!o||!v,"data-testid":"product-list-table-submit-button",children:a.updateButton});return n(D,{node:X,className:f(["quote-management-product-list-table-container",q]),"data-testid":"product-list-table-container",...Y,children:[U,t("div",{className:"quote-management-product-list-table-container__submit-container",children:C})]})},Te=({className:q,entries:d,...o})=>{const u=i=>{var g;const b=(g=i.children)==null?void 0:g.map(u);return t("div",{className:"quote-management-quote-prices-summary__entry","data-testid":`quote-prices-summary-entry-${i.id}`,children:b?t(ie,{className:"quote-management-quote-prices-summary__accordion","data-testid":`quote-prices-summary-entry-accordion-${i.id}`,children:t(se,{className:"quote-management-quote-prices-summary__accordion-section",title:i.label,ariaLabelTitle:i.label,secondaryText:i.value,children:b})}):n(F,{children:[t("span",{className:f(["quote-management-quote-prices-summary__label",["quote-management-quote-prices-summary__label--strong",i.strong]]),"data-testid":`quote-prices-summary-entry-label-${i.id}`,children:i.label}),t("span",{className:"quote-management-quote-prices-summary__value","data-testid":`quote-prices-summary-entry-value-${i.id}`,children:i.value})]})},i.id)};return t("div",{className:f(["quote-management-quote-prices-summary",q]),"data-testid":"quote-prices-summary",...o,children:d==null?void 0:d.map(u)})},Se=({className:q,open:d,item:o,onClose:u,onConfirm:i,isSubmitting:b=!1,errorBanner:g,successBanner:k,showCloseButton:S=!0,readOnlyQuantity:_=!1})=>{const[h,I]=A(""),[L,y]=A(o.quantity),[p,v]=A({}),a=J({title:"NegotiableQuote.Manage.lineItemNote.title",productLabel:"NegotiableQuote.Manage.lineItemNote.productLabel",skuLabel:"NegotiableQuote.Manage.lineItemNote.skuLabel",priceLabel:"NegotiableQuote.Manage.lineItemNote.priceLabel",stockLabel:"NegotiableQuote.Manage.lineItemNote.stockLabel",quantityLabel:"NegotiableQuote.Manage.lineItemNote.quantityLabel",discountLabel:"NegotiableQuote.Manage.lineItemNote.discountLabel",subtotalLabel:"NegotiableQuote.Manage.lineItemNote.subtotalLabel",noteLabel:"NegotiableQuote.Manage.lineItemNote.noteLabel",notePlaceholder:"NegotiableQuote.Manage.lineItemNote.notePlaceholder",noteHelper:"NegotiableQuote.Manage.lineItemNote.noteHelper",confirmButton:"NegotiableQuote.Manage.lineItemNote.confirmButton",cancelButton:"NegotiableQuote.Manage.lineItemNote.cancelButton",noteError:"NegotiableQuote.Manage.lineItemNote.noteError",quantityError:"NegotiableQuote.Manage.lineItemNote.quantityError"});be(()=>{var c;if(d){const Q=((c=o.noteFromBuyer)==null?void 0:c.filter(H=>H&&H.note))||[],$=Q.length>0?Q[0].note:"";I($||""),y(o.quantity),v({})}},[d,o.quantity,o.noteFromBuyer]);const w=G(()=>{const c={};if(h.trim()||(c.note=a.noteError),!_&&L<=0&&(c.quantity=a.quantityError),Object.keys(c).length>0){v(c);return}i(h.trim(),L)},[h,L,i,a,_]),x=G(()=>{I(""),y(o.quantity),v({}),u==null||u()},[u,o.quantity]);if(!d)return null;const P=o.discounts&&o.discounts.length>0?o.discounts.map(c=>c.label).join(", "):"-",B=[{label:a.productLabel,key:"productName"},{label:a.priceLabel,key:"price"},{label:a.stockLabel,key:"stock"},{label:a.quantityLabel,key:"quantity"},{label:a.discountLabel,key:"discount"},{label:a.subtotalLabel,key:"subtotal"}],O=[{productName:n("div",{className:"quote-management-line-item-note-modal__product-info",children:[t("div",{className:"quote-management-line-item-note-modal__product-name",children:o.product.name}),n("div",{className:"quote-management-line-item-note-modal__product-sku",children:[a.skuLabel,": ",o.product.sku]})]}),price:t(T,{amount:o.prices.originalItemPrice.value,currency:o.prices.originalItemPrice.currency}),stock:t("span",{className:"quote-management-line-item-note-modal__stock",children:o.stockStatus}),quantity:_?t("span",{className:"quote-management-line-item-note-modal__quantity-readonly",children:o.quantity}):t(V,{name:"quantity",type:"number",min:"1",value:L.toString(),onInput:c=>{const Q=parseInt(c.target.value,10)||0;y(Q),v({...p,quantity:void 0})},disabled:b,error:!!p.quantity,required:!0,"data-testid":"line-item-note-quantity-input",className:"quote-management-line-item-note-modal__quantity-input"}),discount:t("span",{className:"quote-management-line-item-note-modal__discount",children:P}),subtotal:t(T,{amount:o.prices.rowTotal.value,currency:o.prices.rowTotal.currency})}];return n(re,{open:d,size:"medium",title:t(F,{children:a.title}),onClose:x,clickToDismiss:!0,escapeToDismiss:!0,showCloseButton:S,className:f(["quote-management-line-item-note-modal",q]),"data-testid":"line-item-note-modal",children:[g&&t("div",{className:"quote-management-line-item-note-modal__error-banner","data-testid":"line-item-note-modal-error-banner",children:g}),k&&t("div",{className:"quote-management-line-item-note-modal__success-banner","data-testid":"line-item-note-modal-success-banner",children:k}),n("div",{className:"quote-management-line-item-note-modal__content",children:[n("div",{className:"quote-management-line-item-note-modal__details",children:[t(Z,{columns:B,rowData:O,"data-testid":"line-item-note-table",mobileLayout:"stacked",className:"quote-management-line-item-note-modal__details-table"}),p.quantity&&t("div",{className:"quote-management-line-item-note-modal__table-error",children:p.quantity})]}),n("div",{className:"quote-management-line-item-note-modal__form-field",children:[t(ue,{name:"note",placeholder:a.notePlaceholder,rows:4,value:h,onInput:c=>{I(c.target.value),v({...p,note:void 0})},label:a.noteLabel,disabled:b,"data-testid":"line-item-note-textarea"}),!p.note&&t("span",{className:"quote-management-line-item-note-modal__helper-text",children:a.noteHelper}),p.note&&t("span",{className:"quote-management-line-item-note-modal__error-text",children:p.note})]})]}),n("div",{className:"quote-management-line-item-note-modal__actions",children:[t(E,{variant:"secondary",size:"medium",onClick:x,disabled:b,className:"quote-management-line-item-note-modal__cancel-button","data-testid":"line-item-note-cancel-button",children:a.cancelButton}),t(E,{variant:"primary",size:"medium",onClick:w,disabled:b,className:"quote-management-line-item-note-modal__confirm-button","data-testid":"line-item-note-confirm-button",children:a.confirmButton})]})]})};export{Qe as I,Se as L,Me as P,Te as Q};
4
+ //# sourceMappingURL=LineItemNoteModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineItemNoteModal.js","sources":["/@dropins/storefront-quote-management/src/components/ItemsQuoted/ItemsQuoted.tsx","/@dropins/storefront-quote-management/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-quote-management/src/components/QuotePricesSummary/QuotePricesSummary.tsx","/@dropins/storefront-quote-management/src/components/LineItemNoteModal/LineItemNoteModal.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ItemsQuoted/ItemsQuoted.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n table?: VNode;\n pricesSummary?: VNode;\n}\n\nexport const ItemsQuoted: FunctionComponent<ItemsQuotedProps> = ({\n className,\n loading,\n table,\n pricesSummary,\n ...props\n}) => {\n if (loading) {\n return <ItemsQuotedSkeleton />;\n }\n\n return (\n <div className={classes(['quote-management-items-quoted', className])} {...props}>\n {table && (\n <VComponent\n node={table}\n className={classes(['quote-management-items-quoted__table'])}\n data-testid=\"quote-management-items-quoted__table\"\n />\n )}\n {pricesSummary && (\n <VComponent\n node={pricesSummary}\n className={classes(['quote-management-items-quoted__prices-summary'])}\n data-testid=\"quote-management-items-quoted__prices-summary\"\n />\n )}\n </div>\n );\n};\n\nexport const ItemsQuotedSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"items-quoted-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"medium\" lines={4} multilineGap='xsmall' />\n </Skeleton>\n );\n};","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState, useEffect } from 'preact/hooks';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Table,\n Checkbox,\n Picker,\n Price,\n Button,\n Input,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { getUserTimezone } from '@/quote-management/utils/dateUtils';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nimport '@/quote-management/components/ProductListTable/ProductListTable.css';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n items: CartItemModel[];\n canEdit: boolean;\n readOnly?: boolean;\n showActions?: boolean;\n onItemCheckboxChange?: (\n item: CartItemModel,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (item: CartItemModel, action: string) => void;\n onQuantityChange?: (item: CartItemModel, newQuantity: number) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string | undefined>;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n canEdit,\n readOnly = false,\n showActions,\n onItemCheckboxChange,\n onItemDropdownChange,\n onQuantityChange,\n onUpdate,\n dropdownSelections,\n ...props\n}) => {\n // Track original quantities to detect changes\n const [originalQuantities, setOriginalQuantities] = useState<\n Record<string, number>\n >({});\n const [currentQuantities, setCurrentQuantities] = useState<\n Record<string, number>\n >({});\n\n // Initialize quantities when items change\n useEffect(() => {\n const quantities: Record<string, number> = {};\n items.forEach((item) => {\n quantities[item.uid] = item.quantity;\n });\n setOriginalQuantities(quantities);\n setCurrentQuantities(quantities);\n }, [items]);\n\n // Check if any quantities have changed\n const hasQuantityChanges = Object.keys(currentQuantities).some(\n (uid) => currentQuantities[uid] !== originalQuantities[uid]\n );\n\n const dictionary = useText({\n updateButton: 'NegotiableQuote.Manage.productListTable.submitButton',\n productNameHeader:\n 'NegotiableQuote.Manage.productListTable.headers.productName',\n skuHeader: 'NegotiableQuote.Manage.productListTable.headers.sku',\n priceHeader: 'NegotiableQuote.Manage.productListTable.headers.price',\n quantityHeader: 'NegotiableQuote.Manage.productListTable.headers.quantity',\n discountHeader: 'NegotiableQuote.Manage.productListTable.headers.discount',\n subtotalHeader: 'NegotiableQuote.Manage.productListTable.headers.subtotal',\n actionsHeader: 'NegotiableQuote.Manage.productListTable.headers.actions',\n editNoteToSeller:\n 'NegotiableQuote.Manage.productListTable.actions.editNoteToSeller',\n remove: 'NegotiableQuote.Manage.productListTable.actions.remove',\n notesHeader: 'NegotiableQuote.Manage.productListTable.notes.header',\n leftANote: 'NegotiableQuote.Manage.productListTable.notes.leftANote',\n buyer: 'NegotiableQuote.Manage.productListTable.notes.buyer',\n seller: 'NegotiableQuote.Manage.productListTable.notes.seller',\n outOfStock: 'NegotiableQuote.Manage.productListTable.outOfStock',\n outOfStockMessage:\n 'NegotiableQuote.Manage.productListTable.outOfStockMessage',\n });\n\n const columns = [\n {\n label: dictionary.productNameHeader,\n key: 'productName',\n },\n {\n label: dictionary.skuHeader,\n key: 'sku',\n },\n {\n label: dictionary.priceHeader,\n key: 'price',\n },\n {\n label: dictionary.quantityHeader,\n key: 'quantity',\n },\n {\n label: dictionary.discountHeader,\n key: 'discount',\n },\n {\n label: dictionary.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n // Add checkbox column when canEdit (for bulk operations)\n if (canEdit && !readOnly) {\n columns.unshift({\n label: '',\n key: 'checkbox',\n });\n }\n\n // Add actions column when showActions is explicitly true, or when canEdit is true and showActions is not explicitly false\n const shouldShowActions = showActions ?? canEdit;\n if (shouldShowActions && !readOnly) {\n columns.push({\n label: dictionary.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: Event,\n item: CartItemModel\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n onItemCheckboxChange?.(item, isSelected);\n };\n\n const handleItemDropdownChange = (\n event: Event,\n item: CartItemModel\n ) => {\n const action = (event.target as HTMLSelectElement).value;\n onItemDropdownChange?.(item, action);\n };\n\n const handleQuantityChange = (event: Event, item: CartItemModel) => {\n const newQuantity = parseInt((event.target as HTMLInputElement).value, 10);\n if (!isNaN(newQuantity) && newQuantity > 0) {\n setCurrentQuantities((prev) => ({\n ...prev,\n [item.uid]: newQuantity,\n }));\n onQuantityChange?.(item, newQuantity);\n }\n };\n\n const handleUpdate = (event: SubmitEvent) => {\n event.preventDefault();\n onUpdate?.(event);\n };\n\n const discountElement = (amountOff: number, percentOff: number) => {\n return amountOff > 0 ? (\n <div className=\"quote-management-product-list-table__discount-container\">\n <span className=\"quote-management-product-list-table__discount-percent\">\n {percentOff}%\n </span>\n <span className=\"quote-management-product-list-table__discount-price\">\n (<Price amount={amountOff} />)\n </span>\n </div>\n ) : undefined;\n };\n\n const getProductNameContent = (item: CartItemModel) => {\n const configurableOptions = item.configurableOptions?.map((option) => (\n <div\n key={option.optionLabel}\n className=\"quote-management-product-list-table__configurable-option\"\n >\n <span className=\"quote-management-product-list-table__configurable-option-label\">\n {option.optionLabel}:\n </span>\n <span className=\"quote-management-product-list-table__configurable-option-value\">\n {option.valueLabel}\n </span>\n </div>\n ));\n\n const bundleOptions = item.bundleOptions?.map((option) => (\n <div\n key={option.label}\n className=\"quote-management-product-list-table__bundle-option\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-label\">\n {option.label}\n </span>\n <div className=\"quote-management-product-list-table__bundle-option-values\">\n {option.values.map((value) => (\n <span\n key={value.label}\n className=\"quote-management-product-list-table__bundle-option-value\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-value-quantity\">\n {value.quantity} x\n </span>\n <span className=\"quote-management-product-list-table__bundle-option-value-label\">\n {value.label}\n </span>\n <Price\n className=\"quote-management-product-list-table__bundle-option-value-original-price\"\n amount={value.originalPrice.value}\n currency={value.originalPrice.currency}\n weight=\"normal\"\n />\n </span>\n ))}\n </div>\n </div>\n ));\n\n return (\n <div className=\"quote-management-product-list-table__product-name-container\">\n <span className=\"quote-management-product-list-table__product-name\">\n {item.product.name}\n </span>\n {configurableOptions}\n {bundleOptions}\n </div>\n );\n };\n\n const formatNoteTimestamp = (timestamp: string) => {\n const date = new Date(timestamp);\n return date.toLocaleString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit',\n hour12: true,\n timeZone: getUserTimezone(),\n });\n };\n\n const getNotesContent = (item: CartItemModel) => {\n const validNotesFromBuyer = item.noteFromBuyer?.filter(\n (note) => note && note.note && note.note.trim() !== ''\n ) || [];\n\n const validNotesFromSeller = item.noteFromSeller?.filter(\n (note) => note && note.note && note.note.trim() !== ''\n ) || [];\n\n const validNotes = [...validNotesFromBuyer, ...validNotesFromSeller];\n\n if (validNotes.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"quote-management-product-list-table__notes-container\"\n data-testid={`item-notes-${item.product.sku}`}\n >\n <div className=\"quote-management-product-list-table__notes-header\">\n {dictionary.notesHeader}\n </div>\n <div className=\"quote-management-product-list-table__notes-list\">\n {validNotes.map((note, index) => (\n <div\n key={note.noteUid || index}\n className=\"quote-management-product-list-table__note-item\"\n >\n <div className=\"quote-management-product-list-table__note-content\">\n <strong className=\"quote-management-product-list-table__note-meta\">\n {/* TODO: When backend exposes creator_name for notes, replace (Buyer) with the actual name */}\n {formatNoteTimestamp(note.createdAt)} ({validNotesFromBuyer.includes(note) ? dictionary.buyer : dictionary.seller})\n </strong>{' '}\n {dictionary.leftANote}\n </div>\n <div className=\"quote-management-product-list-table__note-text\">\n {note.note}{' '}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n };\n\n const expandedRows = new Set<number>();\n const rowData = items.flatMap((item, index) => {\n const notes = getNotesContent(item);\n if (notes || item.outOfStock) {\n expandedRows.add(index);\n }\n\n const quantityElement = canEdit ? (\n <Input\n className=\"quote-management-product-list-table__quantity-input\"\n type=\"number\"\n min=\"1\"\n value={\n currentQuantities[item.uid]?.toString() || item.quantity.toString()\n }\n onChange={(e) => handleQuantityChange(e, item)}\n disabled={readOnly || !canEdit}\n data-testid={`quantity-input-${item.product.sku}`}\n />\n ) : (\n <span className=\"quote-management-product-list-table__quantity\">\n {item.quantity}\n </span>\n );\n\n const productRow = {\n checkbox: (\n <Checkbox\n className=\"quote-management-product-list-table__checkbox\"\n name=\"itemSelected\"\n data-testid={`item-checkbox-${item.product.sku}`}\n onChange={(e) => handleItemCheckboxChange(e, item)}\n value={item.product.sku}\n />\n ),\n productName: getProductNameContent(item),\n sku: (\n <span className=\"quote-management-product-list-table__sku\">\n {item.product.sku}\n </span>\n ),\n price: (\n <Price\n className=\"quote-management-product-list-table__price\"\n amount={item.prices.originalItemPrice.value}\n currency={item.prices.originalItemPrice.currency}\n />\n ),\n quantity: quantityElement,\n discount: item.catalogDiscount\n ? discountElement(\n item.catalogDiscount.amountOff,\n item.catalogDiscount.percentOff\n )\n : undefined,\n subtotal: (\n <Price\n className=\"quote-management-product-list-table__subtotal\"\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n />\n ),\n actions: (\n <Picker\n className=\"quote-management-product-list-table__actions\"\n data-testid={`item-dropdown-${item.product.sku}`}\n name={`item-dropdown-${item.product.sku}`}\n handleSelect={(e) => handleItemDropdownChange(e, item)}\n placeholder=\"Select\"\n value={dropdownSelections?.[item.uid] ?? ''}\n options={[\n { text: dictionary.editNoteToSeller, value: 'edit' },\n { text: dictionary.remove, value: 'remove' },\n ]}\n />\n ),\n _rowDetails: <>\n {/* If the item is out of stock, show a message */}\n {item.outOfStock && (\n <div className=\"quote-management-product-list-table__out-of-stock-message\">\n <InLineAlert\n type=\"warning\"\n variant=\"primary\"\n icon={<WarningFilled />}\n heading={dictionary.outOfStock}\n description={dictionary.outOfStockMessage}\n />\n </div>\n )}\n {/* If there are notes, create a notes details */}\n {notes && (\n <div className=\"quote-management-product-list-table__notes-row-wrapper\">\n {notes}\n </div>\n )}\n </>\n };\n\n return [productRow];\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n expandedRows={expandedRows}\n />\n );\n\n // if can edit, the wrapper node should use the form element, else use the div element\n const wrapperNode = canEdit ? h('form', {}) : h('div', {});\n const wrapperProps = canEdit\n ? {\n onSubmit: handleUpdate,\n ...props,\n }\n : props;\n\n const submitButton = (\n <Button\n type=\"submit\"\n disabled={readOnly || !canEdit || !hasQuantityChanges}\n data-testid=\"product-list-table-submit-button\"\n >\n {dictionary.updateButton}\n </Button>\n );\n\n return (\n <VComponent\n node={wrapperNode}\n className={classes([\n 'quote-management-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...wrapperProps}\n >\n {table}\n <div className=\"quote-management-product-list-table-container__submit-container\">\n {submitButton}\n </div>\n </VComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/QuotePricesSummary/QuotePricesSummary.css';\nimport { Accordion, AccordionSection } from '@adobe-commerce/elsie/components';\n\ninterface Entry {\n label: string;\n id: string;\n value: VNode;\n strong?: boolean;\n children?: Entry[];\n}\n\nexport interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement> {\n entries?: Entry[];\n}\n\nexport const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps> = ({\n className,\n entries,\n ...props\n}) => {\n const createEntry = (entry: Entry) => {\n const children = entry.children?.map(createEntry);\n return (\n <div key={entry.id} className=\"quote-management-quote-prices-summary__entry\" data-testid={`quote-prices-summary-entry-${entry.id}`}>\n {children ? <Accordion\n className=\"quote-management-quote-prices-summary__accordion\"\n data-testid={`quote-prices-summary-entry-accordion-${entry.id}`}\n >\n <AccordionSection className=\"quote-management-quote-prices-summary__accordion-section\" title={entry.label} ariaLabelTitle={entry.label} secondaryText={entry.value}>\n {children}\n </AccordionSection>\n </Accordion>\n :\n <>\n <span className={classes(['quote-management-quote-prices-summary__label', ['quote-management-quote-prices-summary__label--strong', entry.strong]])} data-testid={`quote-prices-summary-entry-label-${entry.id}`}>{entry.label}</span>\n <span className=\"quote-management-quote-prices-summary__value\" data-testid={`quote-prices-summary-entry-value-${entry.id}`}>{entry.value}</span>\n </>\n }\n </div>\n );\n };\n\n return (\n <div className={classes(['quote-management-quote-prices-summary', className])} data-testid=\"quote-prices-summary\" {...props}>\n {entries?.map(createEntry)}\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n Button,\n TextArea,\n Input,\n Modal,\n Price,\n Table,\n} from '@adobe-commerce/elsie/components';\nimport { CartItemModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/LineItemNoteModal/LineItemNoteModal.css';\n\nexport interface LineItemNoteModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open: boolean;\n item: CartItemModel;\n onClose?: () => void;\n onConfirm: (note: string, quantity: number) => void;\n isSubmitting?: boolean;\n errorBanner?: VNode;\n successBanner?: VNode;\n showCloseButton?: boolean;\n readOnlyQuantity?: boolean;\n}\n\nexport const LineItemNoteModal: FunctionComponent<LineItemNoteModalProps> = ({\n className,\n open,\n item,\n onClose,\n onConfirm,\n isSubmitting = false,\n errorBanner,\n successBanner,\n showCloseButton = true,\n readOnlyQuantity = false,\n}) => {\n const [note, setNote] = useState('');\n const [quantity, setQuantity] = useState(item.quantity);\n const [errors, setErrors] = useState<{ note?: string; quantity?: string }>(\n {}\n );\n\n const dictionary = useText({\n title: 'NegotiableQuote.Manage.lineItemNote.title',\n productLabel: 'NegotiableQuote.Manage.lineItemNote.productLabel',\n skuLabel: 'NegotiableQuote.Manage.lineItemNote.skuLabel',\n priceLabel: 'NegotiableQuote.Manage.lineItemNote.priceLabel',\n stockLabel: 'NegotiableQuote.Manage.lineItemNote.stockLabel',\n quantityLabel: 'NegotiableQuote.Manage.lineItemNote.quantityLabel',\n discountLabel: 'NegotiableQuote.Manage.lineItemNote.discountLabel',\n subtotalLabel: 'NegotiableQuote.Manage.lineItemNote.subtotalLabel',\n noteLabel: 'NegotiableQuote.Manage.lineItemNote.noteLabel',\n notePlaceholder: 'NegotiableQuote.Manage.lineItemNote.notePlaceholder',\n noteHelper: 'NegotiableQuote.Manage.lineItemNote.noteHelper',\n confirmButton: 'NegotiableQuote.Manage.lineItemNote.confirmButton',\n cancelButton: 'NegotiableQuote.Manage.lineItemNote.cancelButton',\n noteError: 'NegotiableQuote.Manage.lineItemNote.noteError',\n quantityError: 'NegotiableQuote.Manage.lineItemNote.quantityError',\n });\n\n // Reset form when modal opens with new item\n useEffect(() => {\n if (open) {\n // Get the most recent valid note from buyer (if exists)\n const validNotes =\n item.noteFromBuyer?.filter((note) => note && note.note) || [];\n const existingNote = validNotes.length > 0 ? validNotes[0].note : '';\n setNote(existingNote || '');\n setQuantity(item.quantity);\n setErrors({});\n }\n }, [open, item.quantity, item.noteFromBuyer]);\n\n const handleConfirm = useCallback(() => {\n const newErrors: { note?: string; quantity?: string } = {};\n\n // Check if the note field is empty\n if (!note.trim()) {\n newErrors.note = dictionary.noteError;\n }\n\n // Only validate quantity if it's editable\n if (!readOnlyQuantity && quantity <= 0) {\n newErrors.quantity = dictionary.quantityError;\n }\n\n if (Object.keys(newErrors).length > 0) {\n setErrors(newErrors);\n return;\n }\n\n onConfirm(note.trim(), quantity);\n }, [note, quantity, onConfirm, dictionary, readOnlyQuantity]);\n\n const handleCancel = useCallback(() => {\n setNote('');\n setQuantity(item.quantity);\n setErrors({});\n onClose?.();\n }, [onClose, item.quantity]);\n\n if (!open) {\n return null;\n }\n\n // Calculate discount display\n const hasDiscount = item.discounts && item.discounts.length > 0;\n const discountDisplay = hasDiscount\n ? item.discounts.map((d) => d.label).join(', ')\n : '-';\n\n // Define table columns\n const columns = [\n {\n label: dictionary.productLabel,\n key: 'productName',\n },\n {\n label: dictionary.priceLabel,\n key: 'price',\n },\n {\n label: dictionary.stockLabel,\n key: 'stock',\n },\n {\n label: dictionary.quantityLabel,\n key: 'quantity',\n },\n {\n label: dictionary.discountLabel,\n key: 'discount',\n },\n {\n label: dictionary.subtotalLabel,\n key: 'subtotal',\n },\n ];\n\n // Define table row data\n const rowData = [\n {\n productName: (\n <div className=\"quote-management-line-item-note-modal__product-info\">\n <div className=\"quote-management-line-item-note-modal__product-name\">\n {item.product.name}\n </div>\n <div className=\"quote-management-line-item-note-modal__product-sku\">\n {dictionary.skuLabel}: {item.product.sku}\n </div>\n </div>\n ),\n price: (\n <Price\n amount={item.prices.originalItemPrice.value}\n currency={item.prices.originalItemPrice.currency}\n />\n ),\n stock: (\n <span className=\"quote-management-line-item-note-modal__stock\">\n {item.stockStatus}\n </span>\n ),\n quantity: readOnlyQuantity ? (\n <span className=\"quote-management-line-item-note-modal__quantity-readonly\">\n {item.quantity}\n </span>\n ) : (\n <Input\n name=\"quantity\"\n type=\"number\"\n min=\"1\"\n value={quantity.toString()}\n onInput={(e: any) => {\n const newQuantity = parseInt(e.target.value, 10) || 0;\n setQuantity(newQuantity);\n setErrors({ ...errors, quantity: undefined });\n }}\n disabled={isSubmitting}\n error={!!errors.quantity}\n required\n data-testid=\"line-item-note-quantity-input\"\n className=\"quote-management-line-item-note-modal__quantity-input\"\n />\n ),\n discount: (\n <span className=\"quote-management-line-item-note-modal__discount\">\n {discountDisplay}\n </span>\n ),\n subtotal: (\n <Price\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n />\n ),\n },\n ];\n\n return (\n <Modal\n open={open}\n size=\"medium\"\n title={<>{dictionary.title}</>}\n onClose={handleCancel}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n className={classes(['quote-management-line-item-note-modal', className])}\n data-testid=\"line-item-note-modal\"\n >\n {errorBanner && (\n <div\n className=\"quote-management-line-item-note-modal__error-banner\"\n data-testid=\"line-item-note-modal-error-banner\"\n >\n {errorBanner}\n </div>\n )}\n\n {successBanner && (\n <div\n className=\"quote-management-line-item-note-modal__success-banner\"\n data-testid=\"line-item-note-modal-success-banner\"\n >\n {successBanner}\n </div>\n )}\n\n <div className=\"quote-management-line-item-note-modal__content\">\n {/* Product Details Table */}\n <div className=\"quote-management-line-item-note-modal__details\">\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"line-item-note-table\"\n mobileLayout=\"stacked\"\n className=\"quote-management-line-item-note-modal__details-table\"\n />\n {errors.quantity && (\n <div className=\"quote-management-line-item-note-modal__table-error\">\n {errors.quantity}\n </div>\n )}\n </div>\n\n {/* Note TextArea */}\n <div className=\"quote-management-line-item-note-modal__form-field\">\n <TextArea\n name=\"note\"\n placeholder={dictionary.notePlaceholder}\n rows={4}\n value={note}\n onInput={(e: any) => {\n setNote(e.target.value);\n setErrors({ ...errors, note: undefined });\n }}\n label={dictionary.noteLabel}\n disabled={isSubmitting}\n data-testid=\"line-item-note-textarea\"\n />\n {!errors.note && (\n <span className=\"quote-management-line-item-note-modal__helper-text\">\n {dictionary.noteHelper}\n </span>\n )}\n {errors.note && (\n <span className=\"quote-management-line-item-note-modal__error-text\">\n {errors.note}\n </span>\n )}\n </div>\n </div>\n\n <div className=\"quote-management-line-item-note-modal__actions\">\n <Button\n variant=\"secondary\"\n size=\"medium\"\n onClick={handleCancel}\n disabled={isSubmitting}\n className=\"quote-management-line-item-note-modal__cancel-button\"\n data-testid=\"line-item-note-cancel-button\"\n >\n {dictionary.cancelButton}\n </Button>\n <Button\n variant=\"primary\"\n size=\"medium\"\n onClick={handleConfirm}\n disabled={isSubmitting}\n className=\"quote-management-line-item-note-modal__confirm-button\"\n data-testid=\"line-item-note-confirm-button\"\n >\n {dictionary.confirmButton}\n </Button>\n </div>\n </Modal>\n );\n};\n"],"names":["ItemsQuoted","className","loading","table","pricesSummary","props","ItemsQuotedSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","ProductListTable","items","canEdit","readOnly","showActions","onItemCheckboxChange","onItemDropdownChange","onQuantityChange","onUpdate","dropdownSelections","originalQuantities","setOriginalQuantities","useState","currentQuantities","setCurrentQuantities","useEffect","quantities","item","hasQuantityChanges","uid","dictionary","useText","columns","handleItemCheckboxChange","event","isSelected","handleItemDropdownChange","action","handleQuantityChange","newQuantity","prev","handleUpdate","discountElement","amountOff","percentOff","Price","getProductNameContent","configurableOptions","_a","option","bundleOptions","_b","value","formatNoteTimestamp","timestamp","getUserTimezone","getNotesContent","validNotesFromBuyer","note","validNotesFromSeller","validNotes","index","expandedRows","rowData","notes","quantityElement","Input","e","Checkbox","Picker","Fragment","InLineAlert","WarningFilled","Table","wrapperNode","h","wrapperProps","submitButton","Button","QuotePricesSummary","entries","createEntry","entry","children","Accordion","AccordionSection","LineItemNoteModal","open","onClose","onConfirm","isSubmitting","errorBanner","successBanner","showCloseButton","readOnlyQuantity","setNote","quantity","setQuantity","errors","setErrors","existingNote","handleConfirm","useCallback","newErrors","handleCancel","discountDisplay","d","Modal","TextArea"],"mappings":"+uBAqBO,MAAMA,GAAmD,CAAC,CAC/D,UAAAC,EACA,QAAAC,EACA,MAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IACMH,IACMI,GAAA,EAAoB,EAI5BC,EAAC,MAAA,CAAI,UAAWC,EAAQ,CAAC,gCAAiCP,CAAS,CAAC,EAAI,GAAGI,EACxE,SAAA,CAAAF,GACCM,EAACC,EAAA,CACC,KAAMP,EACN,UAAWK,EAAQ,CAAC,sCAAsC,CAAC,EAC3D,cAAY,sCAAA,CAAA,EAGfJ,GACCK,EAACC,EAAA,CACC,KAAMN,EACN,UAAWI,EAAQ,CAAC,+CAA+C,CAAC,EACpE,cAAY,+CAAA,CAAA,CACd,EAEJ,EAISF,GAAyC,MAEjDK,GAAA,CAAS,cAAY,wBACpB,SAAAF,EAACG,IAAY,QAAQ,MAAM,UAAW,GAAM,KAAK,SAAS,MAAO,EAAG,aAAa,SAAS,EAC5F,ECXSC,GAA6D,CAAC,CACzE,UAAAZ,EACA,MAAAa,EACA,QAAAC,EACA,SAAAC,EAAW,GACX,YAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,iBAAAC,EACA,SAAAC,EACA,mBAAAC,EACA,GAAGjB,CACL,IAAM,CAEJ,KAAM,CAACkB,EAAoBC,CAAqB,EAAIC,EAElD,CAAA,CAAE,EACE,CAACC,EAAmBC,CAAoB,EAAIF,EAEhD,CAAA,CAAE,EAGJG,GAAU,IAAM,CACd,MAAMC,EAAqC,CAAA,EAC3Cf,EAAM,QAASgB,GAAS,CACtBD,EAAWC,EAAK,G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