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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/api/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +1 -2
  3. package/api/acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts +0 -1
  4. package/api/acceptQuoteTemplate/index.d.ts +0 -1
  5. package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +1 -2
  6. package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +0 -1
  7. package/api/addQuoteTemplateLineItemNote/index.d.ts +0 -1
  8. package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +1 -2
  9. package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +0 -1
  10. package/api/addQuoteTemplateShippingAddress/index.d.ts +0 -1
  11. package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +1 -2
  12. package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +0 -1
  13. package/api/cancelQuoteTemplate/index.d.ts +0 -1
  14. package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +0 -1
  15. package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +0 -1
  16. package/api/closeNegotiableQuote/index.d.ts +0 -1
  17. package/api/createQuoteTemplate/createQuoteTemplate.d.ts +8 -2
  18. package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +0 -1
  19. package/api/createQuoteTemplate/index.d.ts +0 -1
  20. package/api/deleteQuote/deleteQuote.d.ts +0 -1
  21. package/api/deleteQuote/graphql/DeleteQuoteMutation.d.ts +0 -1
  22. package/api/deleteQuote/index.d.ts +0 -1
  23. package/api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts +0 -1
  24. package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +0 -1
  25. package/api/deleteQuoteTemplate/index.d.ts +0 -1
  26. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +8 -2
  27. package/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.d.ts +0 -1
  28. package/api/duplicateNegotiableQuote/index.d.ts +0 -1
  29. package/api/fetch-graphql/fetch-graphql.d.ts +3 -4
  30. package/api/fetch-graphql/index.d.ts +0 -1
  31. package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +0 -1
  32. package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +0 -1
  33. package/api/generateQuoteFromTemplate/index.d.ts +0 -1
  34. package/api/getQuoteData/getQuoteData.d.ts +1 -2
  35. package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +0 -1
  36. package/api/getQuoteData/index.d.ts +0 -1
  37. package/api/getQuoteTemplateData/getQuoteTemplateData.d.ts +8 -2
  38. package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +0 -1
  39. package/api/getQuoteTemplateData/index.d.ts +0 -1
  40. package/api/getQuoteTemplates/getQuoteTemplates.d.ts +8 -2
  41. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +0 -1
  42. package/api/getQuoteTemplates/index.d.ts +0 -1
  43. package/api/getStoreConfig/getStoreConfig.d.ts +8 -2
  44. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +0 -1
  45. package/api/getStoreConfig/index.d.ts +0 -1
  46. package/api/graphql/NegotiableQuoteAddressFragment.d.ts +0 -1
  47. package/api/graphql/NegotiableQuoteFragment.d.ts +0 -1
  48. package/api/graphql/NegotiableQuoteListFragment.d.ts +0 -1
  49. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +0 -1
  50. package/api/graphql/SearchResultPageInfoFragment.d.ts +0 -1
  51. package/api/graphql/ShippingMethodFragment.d.ts +0 -1
  52. package/api/graphql/SortFieldsFragment.d.ts +0 -1
  53. package/api/index.d.ts +0 -1
  54. package/api/initialize/index.d.ts +0 -1
  55. package/api/initialize/initialize.d.ts +10 -12
  56. package/api/negotiableQuotes/graphql/NegotiableQuotesQuery.d.ts +0 -1
  57. package/api/negotiableQuotes/index.d.ts +0 -1
  58. package/api/negotiableQuotes/negotiableQuotes.d.ts +8 -2
  59. package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +0 -1
  60. package/api/openQuoteTemplate/index.d.ts +0 -1
  61. package/api/openQuoteTemplate/openQuoteTemplate.d.ts +1 -2
  62. package/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.d.ts +0 -1
  63. package/api/removeNegotiableQuoteItems/index.d.ts +0 -1
  64. package/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.d.ts +8 -2
  65. package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +0 -1
  66. package/api/removeQuoteTemplateItems/index.d.ts +0 -1
  67. package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +1 -2
  68. package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +0 -1
  69. package/api/renameNegotiableQuote/index.d.ts +0 -1
  70. package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +8 -2
  71. package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +0 -1
  72. package/api/requestNegotiableQuote/index.d.ts +0 -1
  73. package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +8 -2
  74. package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +0 -1
  75. package/api/sendForReview/index.d.ts +0 -1
  76. package/api/sendForReview/sendForReview.d.ts +8 -2
  77. package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +0 -1
  78. package/api/sendQuoteTemplateForReview/index.d.ts +0 -1
  79. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +1 -2
  80. package/api/setLineItemNote/graphql/SetLineItemNoteMutation.d.ts +0 -1
  81. package/api/setLineItemNote/index.d.ts +0 -1
  82. package/api/setLineItemNote/setLineItemNote.d.ts +8 -2
  83. package/api/setQuoteTemplateExpirationDate/graphql/setQuoteTemplateExpirationDate.d.ts +0 -1
  84. package/api/setQuoteTemplateExpirationDate/index.d.ts +0 -1
  85. package/api/setQuoteTemplateExpirationDate/setQuoteTemplateExpirationDate.d.ts +8 -2
  86. package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +0 -1
  87. package/api/setShippingAddress/index.d.ts +0 -1
  88. package/api/setShippingAddress/setShippingAddress.d.ts +8 -2
  89. package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +0 -1
  90. package/api/updateQuantities/index.d.ts +0 -1
  91. package/api/updateQuantities/updateQuantities.d.ts +8 -2
  92. package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +0 -1
  93. package/api/updateQuoteTemplateItemQuantities/index.d.ts +0 -1
  94. package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +1 -2
  95. package/api/uploadFile/graphql/FinishUploadMutation.d.ts +0 -1
  96. package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +0 -1
  97. package/api/uploadFile/index.d.ts +0 -1
  98. package/api/uploadFile/uploadFile.d.ts +0 -1
  99. package/api.d.ts +1 -1
  100. package/api.js +1 -1
  101. package/api.js.map +1 -1
  102. package/chunks/ShippingAddressDisplay.js +1 -1
  103. package/chunks/components.js +1 -1
  104. package/components/ActionsBar/ActionsBar.d.ts +8 -2
  105. package/components/ActionsBar/index.d.ts +0 -1
  106. package/components/AttachedFilesList/AttachedFilesList.d.ts +8 -2
  107. package/components/AttachedFilesList/index.d.ts +0 -1
  108. package/components/ConfirmationModal/ConfirmationModal.d.ts +8 -2
  109. package/components/ConfirmationModal/index.d.ts +0 -1
  110. package/components/ExpirationDateModal/ExpirationDateModal.d.ts +8 -2
  111. package/components/ExpirationDateModal/index.d.ts +0 -1
  112. package/components/ItemsQuoted/ItemsQuoted.d.ts +8 -2
  113. package/components/ItemsQuoted/index.d.ts +0 -1
  114. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +8 -2
  115. package/components/LineItemNoteModal/index.d.ts +0 -1
  116. package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +8 -2
  117. package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +1 -3
  118. package/components/ManageNegotiableQuote/index.d.ts +0 -1
  119. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +8 -2
  120. package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +1 -3
  121. package/components/ManageNegotiableQuoteTemplate/index.d.ts +0 -1
  122. package/components/OrderSummary/OrderSummary.d.ts +8 -2
  123. package/components/OrderSummary/index.d.ts +0 -1
  124. package/components/OrderSummaryLine/OrderSummaryLine.d.ts +8 -2
  125. package/components/OrderSummaryLine/index.d.ts +0 -1
  126. package/components/ProductListTable/ProductListTable.d.ts +8 -2
  127. package/components/ProductListTable/index.d.ts +0 -1
  128. package/components/QuoteCommentsList/QuoteCommentsList.d.ts +8 -2
  129. package/components/QuoteCommentsList/index.d.ts +0 -1
  130. package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +8 -2
  131. package/components/QuoteHistoryLog/index.d.ts +0 -1
  132. package/components/QuotePricesSummary/QuotePricesSummary.d.ts +8 -2
  133. package/components/QuotePricesSummary/index.d.ts +0 -1
  134. package/components/QuoteSummaryList/QuoteSummaryList.d.ts +8 -2
  135. package/components/QuoteSummaryList/index.d.ts +0 -1
  136. package/components/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +8 -2
  137. package/components/QuoteTemplatesListTable/index.d.ts +0 -1
  138. package/components/QuotesListTable/QuotesListTable.d.ts +8 -2
  139. package/components/QuotesListTable/index.d.ts +0 -1
  140. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +8 -2
  141. package/components/ReferenceDocumentFormModal/index.d.ts +0 -1
  142. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +8 -2
  143. package/components/ReferenceDocumentsList/index.d.ts +0 -1
  144. package/components/RenameQuoteModal/RenameQuoteModal.d.ts +8 -2
  145. package/components/RenameQuoteModal/index.d.ts +0 -1
  146. package/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +8 -2
  147. package/components/RequestNegotiableQuoteForm/index.d.ts +0 -1
  148. package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +8 -2
  149. package/components/ShippingAddressDisplay/index.d.ts +0 -1
  150. package/components/TabbedContent/TabbedContent.d.ts +8 -2
  151. package/components/TabbedContent/index.d.ts +0 -1
  152. package/components/index.d.ts +0 -1
  153. package/containers/ItemsQuoted/ItemsQuoted.d.ts +9 -3
  154. package/containers/ItemsQuoted/index.d.ts +0 -1
  155. package/containers/ItemsQuoted.d.ts +1 -3
  156. package/containers/ItemsQuoted.js +1 -1
  157. package/containers/ItemsQuoted.js.map +1 -1
  158. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +9 -3
  159. package/containers/ItemsQuotedTemplate/index.d.ts +0 -1
  160. package/containers/ItemsQuotedTemplate.d.ts +1 -3
  161. package/containers/ItemsQuotedTemplate.js +1 -1
  162. package/containers/ItemsQuotedTemplate.js.map +1 -1
  163. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +9 -3
  164. package/containers/ManageNegotiableQuote/index.d.ts +0 -1
  165. package/containers/ManageNegotiableQuote.d.ts +1 -3
  166. package/containers/ManageNegotiableQuote.js +3 -1
  167. package/containers/ManageNegotiableQuote.js.map +1 -1
  168. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +9 -3
  169. package/containers/ManageNegotiableQuoteTemplate/index.d.ts +0 -1
  170. package/containers/ManageNegotiableQuoteTemplate.d.ts +1 -3
  171. package/containers/ManageNegotiableQuoteTemplate.js +1 -3
  172. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
  173. package/containers/OrderSummary/OrderSummary.d.ts +9 -3
  174. package/containers/OrderSummary/index.d.ts +0 -1
  175. package/containers/OrderSummary.d.ts +1 -3
  176. package/containers/OrderSummary.js +1 -1
  177. package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +9 -3
  178. package/containers/OrderSummaryLine/index.d.ts +0 -1
  179. package/containers/OrderSummaryLine.d.ts +1 -3
  180. package/containers/OrderSummaryLine.js +1 -1
  181. package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -3
  182. package/containers/QuoteCommentsList/index.d.ts +0 -1
  183. package/containers/QuoteCommentsList.d.ts +1 -3
  184. package/containers/QuoteCommentsList.js +1 -1
  185. package/containers/QuoteCommentsList.js.map +1 -1
  186. package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -3
  187. package/containers/QuoteHistoryLog/index.d.ts +0 -1
  188. package/containers/QuoteHistoryLog.d.ts +1 -3
  189. package/containers/QuoteHistoryLog.js +1 -1
  190. package/containers/QuoteHistoryLog.js.map +1 -1
  191. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +10 -4
  192. package/containers/QuoteSummaryList/index.d.ts +0 -1
  193. package/containers/QuoteSummaryList.d.ts +1 -3
  194. package/containers/QuoteSummaryList.js +1 -1
  195. package/containers/QuoteSummaryList.js.map +1 -1
  196. package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -3
  197. package/containers/QuoteTemplateCommentsList/index.d.ts +0 -1
  198. package/containers/QuoteTemplateCommentsList.d.ts +1 -3
  199. package/containers/QuoteTemplateCommentsList.js +1 -1
  200. package/containers/QuoteTemplateCommentsList.js.map +1 -1
  201. package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -3
  202. package/containers/QuoteTemplateHistoryLog/index.d.ts +0 -1
  203. package/containers/QuoteTemplateHistoryLog.d.ts +1 -3
  204. package/containers/QuoteTemplateHistoryLog.js +1 -1
  205. package/containers/QuoteTemplateHistoryLog.js.map +1 -1
  206. package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +9 -3
  207. package/containers/QuoteTemplatesListTable/index.d.ts +0 -1
  208. package/containers/QuoteTemplatesListTable.d.ts +1 -3
  209. package/containers/QuoteTemplatesListTable.js +1 -1
  210. package/containers/QuotesListTable/QuotesListTable.d.ts +9 -3
  211. package/containers/QuotesListTable/index.d.ts +0 -1
  212. package/containers/QuotesListTable.d.ts +1 -3
  213. package/containers/QuotesListTable.js +1 -1
  214. package/containers/QuotesListTable.js.map +1 -1
  215. package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +9 -3
  216. package/containers/RequestNegotiableQuoteForm/index.d.ts +0 -1
  217. package/containers/RequestNegotiableQuoteForm.d.ts +1 -3
  218. package/containers/RequestNegotiableQuoteForm.js +1 -1
  219. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +9 -3
  220. package/containers/ShippingAddressDisplay/index.d.ts +0 -1
  221. package/containers/ShippingAddressDisplay.d.ts +1 -1
  222. package/containers/index.d.ts +0 -1
  223. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +8 -2
  224. package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +8 -2
  225. package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +8 -2
  226. package/data/models/__fixtures__/negotiableQuotesListModel.d.ts +8 -2
  227. package/data/models/__fixtures__/storeConfigModel.d.ts +8 -2
  228. package/data/models/index.d.ts +0 -1
  229. package/data/models/negotiable-quote-model.d.ts +1 -2
  230. package/data/models/negotiable-quote-template-model.d.ts +8 -2
  231. package/data/models/store-config-model.d.ts +0 -1
  232. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +9 -4
  233. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +0 -1
  234. package/data/transforms/__fixtures__/storeConfigData.d.ts +0 -1
  235. package/data/transforms/index.d.ts +0 -1
  236. package/data/transforms/transform-history.d.ts +8 -2
  237. package/data/transforms/transform-quote-items.d.ts +8 -2
  238. package/data/transforms/transform-quote-template.d.ts +8 -2
  239. package/data/transforms/transform-quote.d.ts +8 -2
  240. package/data/transforms/transform-store-config.d.ts +8 -2
  241. package/hooks/useExpirationDate.d.ts +0 -1
  242. package/hooks/useItemsQuotedTemplate.d.ts +8 -2
  243. package/hooks/useQuoteSummaryData.d.ts +9 -4
  244. package/hooks/useReferenceDocumentLinks.d.ts +8 -2
  245. package/hooks/useRemoveTemplateItems.d.ts +8 -2
  246. package/hooks/useRenameTemplate.d.ts +0 -1
  247. package/hooks/useUpdateTemplateQuantities.d.ts +8 -2
  248. package/lib/configurationTransformers.d.ts +0 -1
  249. package/lib/itemFormatters.d.ts +11 -7
  250. package/lib/priceCalculators.d.ts +14 -13
  251. package/lib/state.d.ts +8 -3
  252. package/package.json +1 -1
  253. package/render/Provider.d.ts +8 -2
  254. package/render/index.d.ts +0 -1
  255. package/render/render.d.ts +9 -4
  256. package/render.d.ts +1 -1
  257. package/types/state.types.d.ts +8 -2
  258. package/utils/dateUtils.d.ts +0 -1
  259. package/utils/fileUtils.d.ts +0 -1
  260. package/utils/mapAuthPermissions.d.ts +8 -2
  261. package/chunks/ItemsQuoted.js +0 -4
  262. package/chunks/ItemsQuoted.js.map +0 -1
  263. package/chunks/ItemsQuotedTemplate.js +0 -4
  264. package/chunks/ItemsQuotedTemplate.js.map +0 -1
  265. package/chunks/QuoteCommentsList.js +0 -4
  266. package/chunks/QuoteCommentsList.js.map +0 -1
  267. package/chunks/QuoteHistoryLog.js +0 -4
  268. package/chunks/QuoteHistoryLog.js.map +0 -1
  269. package/chunks/QuoteTemplateCommentsList.js +0 -4
  270. package/chunks/QuoteTemplateCommentsList.js.map +0 -1
  271. package/chunks/QuoteTemplateHistoryLog.js +0 -4
  272. package/chunks/QuoteTemplateHistoryLog.js.map +0 -1
  273. package/i18n/en_US.json.d.ts +0 -485
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface OrderSummaryLineComponentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {
5
12
  label: VNode | string;
6
13
  price: VNode<HTMLAttributes<HTMLSpanElement>>;
@@ -10,4 +17,3 @@ export interface OrderSummaryLineComponentProps extends Omit<HTMLAttributes<HTML
10
17
  children?: any;
11
18
  }
12
19
  export declare const OrderSummaryLine: FunctionComponent<OrderSummaryLineComponentProps>;
13
- //# sourceMappingURL=OrderSummaryLine.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './OrderSummaryLine';
10
10
  export { OrderSummaryLine as default } from './OrderSummaryLine';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,14 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
11
  import { CartItemModel } from '../../data/models/negotiable-quote-model';
4
-
5
12
  export interface ProductListTableProps extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {
6
13
  items: CartItemModel[];
7
14
  canEdit: boolean;
@@ -14,4 +21,3 @@ export interface ProductListTableProps extends HTMLAttributes<HTMLDivElement | H
14
21
  dropdownSelections?: Record<string, string | undefined>;
15
22
  }
16
23
  export declare const ProductListTable: FunctionComponent<ProductListTableProps>;
17
- //# sourceMappingURL=ProductListTable.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './ProductListTable';
10
10
  export { ProductListTable as default } from './ProductListTable';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface QuoteCommentsListProps extends HTMLAttributes<HTMLUListElement> {
5
12
  comments: Array<{
6
13
  uid: string;
@@ -14,4 +21,3 @@ export interface QuoteCommentsListProps extends HTMLAttributes<HTMLUListElement>
14
21
  }>;
15
22
  }
16
23
  export declare const QuoteCommentsList: FunctionComponent<QuoteCommentsListProps>;
17
- //# sourceMappingURL=QuoteCommentsList.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteCommentsList';
10
10
  export { QuoteCommentsList as default } from './QuoteCommentsList';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface HistoryEntry {
5
12
  uid: string;
6
13
  createdAt: string;
@@ -74,4 +81,3 @@ export interface QuoteHistoryLogProps extends HTMLAttributes<HTMLDivElement> {
74
81
  salesRepName: string;
75
82
  }
76
83
  export declare const QuoteHistoryLog: FunctionComponent<QuoteHistoryLogProps>;
77
- //# sourceMappingURL=QuoteHistoryLog.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteHistoryLog';
10
10
  export { QuoteHistoryLog as default } from './QuoteHistoryLog';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  interface Entry {
5
12
  label: string;
6
13
  id: string;
@@ -13,4 +20,3 @@ export interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement>
13
20
  }
14
21
  export declare const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps>;
15
22
  export {};
16
- //# sourceMappingURL=QuotePricesSummary.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuotePricesSummary';
10
10
  export { QuotePricesSummary as default } from './QuotePricesSummary';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface QuoteSummaryListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
12
  heading?: VNode | null;
6
13
  footer?: VNode | null;
@@ -10,4 +17,3 @@ export interface QuoteSummaryListProps extends Omit<HTMLAttributes<HTMLDivElemen
10
17
  variant?: 'primary' | 'secondary';
11
18
  }
12
19
  export declare const QuoteSummaryList: FunctionComponent<QuoteSummaryListProps>;
13
- //# sourceMappingURL=QuoteSummaryList.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuoteSummaryList';
10
10
  export { QuoteSummaryList as default } from './QuoteSummaryList';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface QuoteTemplatesListTableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {
5
12
  rowData: QuoteTemplateRowData[];
6
13
  loading?: boolean;
@@ -26,4 +33,3 @@ export type QuoteTemplateRowData = {
26
33
  [key: string]: VNode | string | number | undefined;
27
34
  };
28
35
  export declare const QuoteTemplatesListTable: FunctionComponent<QuoteTemplatesListTableProps>;
29
- //# sourceMappingURL=QuoteTemplatesListTable.d.ts.map
@@ -7,4 +7,3 @@
7
7
  * accompanying it.
8
8
  *******************************************************************/
9
9
  export * from './QuoteTemplatesListTable';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface QuotesListTableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {
5
12
  rowData: QuoteRowData[];
6
13
  loading?: boolean;
@@ -26,4 +33,3 @@ export type QuoteRowData = {
26
33
  [key: string]: VNode | string | number | undefined;
27
34
  };
28
35
  export declare const QuotesListTable: FunctionComponent<QuotesListTableProps>;
29
- //# sourceMappingURL=QuotesListTable.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './QuotesListTable';
10
10
  export { QuotesListTable as default } from './QuotesListTable';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, HTMLAttributes } from 'preact/compat';
2
10
  import { VNode } from 'preact';
3
-
4
11
  export interface ReferenceDocument {
5
12
  uid?: string;
6
13
  name: string;
@@ -27,4 +34,3 @@ export interface ReferenceDocumentFormModalProps extends Omit<HTMLAttributes<HTM
27
34
  onClose?: () => void;
28
35
  }
29
36
  export declare const ReferenceDocumentFormModal: FunctionComponent<ReferenceDocumentFormModalProps>;
30
- //# sourceMappingURL=ReferenceDocumentFormModal.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './ReferenceDocumentFormModal';
10
10
  export { ReferenceDocumentFormModal as default } from './ReferenceDocumentFormModal';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface ReferenceDocument {
5
12
  uid?: string;
6
13
  name: string;
@@ -15,4 +22,3 @@ export interface ReferenceDocumentsListProps extends HTMLAttributes<HTMLDivEleme
15
22
  onRemove?: (document: ReferenceDocument) => void;
16
23
  }
17
24
  export declare const ReferenceDocumentsList: FunctionComponent<ReferenceDocumentsListProps>;
18
- //# sourceMappingURL=ReferenceDocumentsList.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './ReferenceDocumentsList';
10
10
  export { ReferenceDocumentsList as default } from './ReferenceDocumentsList';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface RenameQuoteModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
5
12
  open: boolean;
6
13
  quoteName: string;
@@ -15,4 +22,3 @@ export interface RenameQuoteModalProps extends Omit<HTMLAttributes<HTMLDivElemen
15
22
  onClose?: () => void;
16
23
  }
17
24
  export declare const RenameQuoteModal: FunctionComponent<RenameQuoteModalProps>;
18
- //# sourceMappingURL=RenameQuoteModal.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './RenameQuoteModal';
10
10
  export { RenameQuoteModal as default } from './RenameQuoteModal';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,13 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface RequestNegotiableQuoteFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 'title'> {
5
12
  title: VNode;
6
13
  banner?: VNode;
@@ -13,4 +20,3 @@ export interface RequestNegotiableQuoteFormProps extends Omit<HTMLAttributes<HTM
13
20
  onSubmit: (e: Event) => void;
14
21
  }
15
22
  export declare const RequestNegotiableQuoteForm: FunctionComponent<RequestNegotiableQuoteFormProps>;
16
- //# sourceMappingURL=RequestNegotiableQuoteForm.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './RequestNegotiableQuoteForm';
10
10
  export { RequestNegotiableQuoteForm as default } from './RequestNegotiableQuoteForm';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,14 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
11
  import { ShippingAddress } from '../../data/models/negotiable-quote-model';
4
-
5
12
  export interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
6
13
  shippingAddress?: ShippingAddress;
7
14
  loading?: boolean;
@@ -9,4 +16,3 @@ export interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDiv
9
16
  }
10
17
  export declare const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps>;
11
18
  export declare const ShippingAddressDisplaySkeleton: FunctionComponent;
12
- //# sourceMappingURL=ShippingAddressDisplay.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export { ShippingAddressDisplay, ShippingAddressDisplaySkeleton } from './ShippingAddressDisplay';
10
10
  export type { ShippingAddressDisplayProps } from './ShippingAddressDisplay';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,16 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { FunctionComponent, VNode } from 'preact';
2
10
  import { HTMLAttributes } from 'preact/compat';
3
-
4
11
  export interface TabbedContentProps extends HTMLAttributes<HTMLDivElement> {
5
12
  tabs: Map<string, string>;
6
13
  tabsContent: Map<string, VNode>;
7
14
  defaultActiveTab?: string;
8
15
  }
9
16
  export declare const TabbedContent: FunctionComponent<TabbedContentProps>;
10
- //# sourceMappingURL=TabbedContent.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './TabbedContent';
10
10
  export { TabbedContent as default } from './TabbedContent';
11
- //# sourceMappingURL=index.d.ts.map
@@ -30,4 +30,3 @@ export * from './ManageNegotiableQuoteTemplate';
30
30
  export * from './LineItemNoteModal';
31
31
  export * from './ReferenceDocumentFormModal';
32
32
  export * from './ReferenceDocumentsList';
33
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,14 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container, SlotProps } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteModel, CartItemModel } from '../../data/models/negotiable-quote-model';
4
-
5
12
  export interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {
6
13
  quoteData?: NegotiableQuoteModel;
7
14
  onItemCheckboxChange?: (item: CartItemModel, isSelected: boolean) => void;
@@ -27,4 +34,3 @@ export interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {
27
34
  };
28
35
  }
29
36
  export declare const ItemsQuoted: Container<ItemsQuotedProps>;
30
- //# sourceMappingURL=ItemsQuoted.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './ItemsQuoted';
10
10
  export { ItemsQuoted as default } from './ItemsQuoted';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './ItemsQuoted/index'
2
- import _default from './ItemsQuoted/index'
3
- export default _default
1
+ export * from './ItemsQuoted/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{I as l,I as x}from"../chunks/ItemsQuoted.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/components.js";import"../chunks/components.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../api.js";import"@dropins/tools/fetch-graphql.js";export{l as ItemsQuoted,x as default};
3
+ import{jsx as n,jsxs as ye,Fragment as be}from"@dropins/tools/preact-jsx-runtime.js";import{useState as r,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";import{I as X,c as Z,d as D,l as Qe,P as ve,C as R,L as Ne}from"../chunks/components.js";import{updateQuantities as ee,setLineItemNote as Te,removeNegotiableQuoteItems as Ie}from"../api.js";import{useText as he}from"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";const qe=3e3,Be=({quoteData:te,onItemCheckboxChange:I,onItemDropdownChange:g,onRemoveItemsRef:b,onRemoveModalStateChange:d,slots:p,...ae})=>{const[s,h]=r(te),[F,q]=r({}),[u,j]=r(null),[se,Q]=r(!1),[oe,A]=r(!1),[k,B]=r(""),[v,l]=r({type:null,message:""}),[ne,x]=r(!1),[f,S]=r([]),[ie,C]=r(!1),[N,m]=r({type:null,message:""}),[_,c]=r({}),[re,U]=r(!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),m({type:"success",message:o.removeSuccessMessage}),setTimeout(()=>{x(!1),m({type:null,message:""}),d==null||d(!1)},qe)});return()=>t==null?void 0:t.off()},[o.removeSuccessMessage,d]);const O=H(t=>{!t||t.length===0||(S(t),m({type:null,message:""}),x(!0))},[]);T(()=>{b==null||b(O)},[O,b]);const W=()=>{m({type:null,message:""})},w=(t,e)=>{const a=t;if(e==="edit"){j(a),A(!0),c(i=>({...i,[a.uid]:""}));return}if(e==="remove"){c(i=>({...i,[a.uid]:e})),O([a]),g==null||g(a,e),c(i=>({...i,[a.uid]:""}));return}e&&(g==null||g(a,e)),c(i=>{if(!(a.uid in i))return i;const M={...i};return delete M[a.uid],M})},ue=async()=>{if(!s||f.length===0)return;const t=f.map(e=>e.uid);C(!0),m({type:null,message:""});try{await Ie({quoteUid:s.uid,quoteItemUids:t})}catch(e){const a=e instanceof Error?e.message:o.removeErrorMessage;if(m({type:"error",message:a}),f.length===1){const i=f[0];c(M=>{if(!(i.uid in M))return M;const J={...M};return delete J[i.uid],J})}C(!1)}},le=()=>{if(x(!1),m({type:null,message:""}),d==null||d(!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 ee({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 i=a instanceof Error?a.message:"Unable to update the item. Please try again.";B(i),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)},de=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 ee({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)}},me=()=>{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(Z,{}),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(Z,{}),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(R,{open:se,title:o.modalTitle,message:o.modalDescription,cancelLabel:o.modalCancelButton,confirmLabel:o.modalUpdateButton,onCancel:me,onConfirm:de,confirmationBanner:ge,"data-testid":"update-quantities-modal"}),n(R,{open:ne,title:o.removeModalTitle,message:o.removeModalDescription,cancelLabel:o.removeModalCancelButton,confirmLabel:ie?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:re,errorBanner:Me||void 0})]})};Be.displayName="ItemsQuoted";export{Be as ItemsQuoted,Be as default};
4
4
  //# sourceMappingURL=ItemsQuoted.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ItemsQuoted.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
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":"wrBAkCA,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,EAA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AAK,mBACL,KAAMrF,GAAA,YAAAA,EAAO,iBACb,QAAS,CACP,MAAOE,EAAU,MACjB,QAAA8D,EACA,SAAU9D,EAAU,SACpB,qBAAAN,EACA,qBAAsB6C,EACtB,iBAAkBwB,EAClB,SAAUE,EACV,mBAAA1C,CAAA,EAGF,SAAAqC,EAACwB,GAAA,CACC,MAAOpF,EAAU,MACjB,QAAA8D,EACA,qBAAsBe,GACtB,SAAU7E,EAAU,SACpB,qBAAsBuC,EACtB,iBAAkBwB,EAClB,SAAUE,EACV,mBAAA1C,CAAA,CAAA,CACF,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"}
@@ -1,8 +1,15 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
1
9
  import { HTMLAttributes } from 'preact/compat';
2
- import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
10
+ import { Container, SlotProps } from '@dropins/tools/lib';
3
11
  import { NegotiableQuoteTemplateModel } from '../../data/models/negotiable-quote-template-model';
4
12
  import { CartItemModel } from '../../data/models/negotiable-quote-model';
5
-
6
13
  export interface ItemsQuotedTemplateProps extends HTMLAttributes<HTMLDivElement> {
7
14
  templateData?: NegotiableQuoteTemplateModel;
8
15
  slots?: {
@@ -22,4 +29,3 @@ export interface ItemsQuotedTemplateProps extends HTMLAttributes<HTMLDivElement>
22
29
  };
23
30
  }
24
31
  export declare const ItemsQuotedTemplate: Container<ItemsQuotedTemplateProps>;
25
- //# sourceMappingURL=ItemsQuotedTemplate.d.ts.map
@@ -8,4 +8,3 @@
8
8
  *******************************************************************/
9
9
  export * from './ItemsQuotedTemplate';
10
10
  export { ItemsQuotedTemplate as default } from './ItemsQuotedTemplate';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1 @@
1
- export * from './ItemsQuotedTemplate/index'
2
- import _default from './ItemsQuotedTemplate/index'
3
- export default _default
1
+ export * from './ItemsQuotedTemplate/index';
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{I as u,I as x}from"../chunks/ItemsQuotedTemplate.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/components.js";import"../chunks/components.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../api.js";import"@dropins/tools/fetch-graphql.js";export{u as ItemsQuotedTemplate,x as default};
3
+ import{jsx as n,jsxs as ie,Fragment as le}from"@dropins/tools/preact-jsx-runtime.js";import{useState as d,useEffect as O,useCallback as u}from"@dropins/tools/preact-compat.js";import{Slot as Y}from"@dropins/tools/lib.js";import{events as H}from"@dropins/tools/event-bus.js";import{InLineAlert as B,Price as $}from"@dropins/tools/components.js";import{c as z,d as U,I as G,l as me,P as de,C as ue,L as ce}from"../chunks/components.js";import{removeQuoteTemplateItems as pe,updateQuoteTemplateItemQuantities as ge,addQuoteTemplateLineItemNote as Me}from"../api.js";import{useText as fe}from"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";const ve=3e3,Te=Q=>{const{templateId:r,onRemoveModalStateChange:a,removeSuccessMessage:e,removeErrorMessage:T}=Q,[i,g]=d(!1),[M,l]=d([]),[m,o]=d(!1),[I,s]=d({type:null,message:""});O(()=>{const c=H.on("quote-management/quote-template-data",()=>{l([]),o(!1),s({type:"success",message:e}),setTimeout(()=>{g(!1),s({type:null,message:""}),a==null||a(!1)},ve)});return()=>c==null?void 0:c.off()},[e,a]);const N=u(c=>{!c||c.length===0||(l(c),s({type:null,message:""}),g(!0))},[]),S=u(async()=>{if(!r||M.length===0)return;const c=M.map(y=>y.uid).filter(Boolean);if(c.length!==0){o(!0),s({type:null,message:""});try{await pe({templateId:r,itemUids:c})}catch(y){const p=y instanceof Error?y.message:T;s({type:"error",message:p}),o(!1)}}},[r,M,T]),t=u(()=>{g(!1),s({type:null,message:""}),a==null||a(!1),l([])},[a]);return{handleRemoveItems:N,handleConfirmRemove:S,handleCancelRemove:t,isRemoveModalOpen:i,itemsToRemove:M,isRemoving:m,removeNotificationState:I}},Ie=Q=>{const{handleRemoveItems:r}=Q,[a,e]=d({}),T=u(()=>{},[]),i=u(M=>{const l=M.uid||"";e(m=>{if(!(l in m))return m;const o={...m};return delete o[l],o})},[]),g=u((M,l)=>{const m=M;if(l==="remove"){e(o=>({...o,[m.uid||""]:l})),r([m]);return}e(o=>{if(!m.uid||!(m.uid in o))return o;const I={...o};return delete I[m.uid],I})},[r]);return{dropdownSelections:a,handleItemDropdownChange:g,handleDismissRemoveBanner:T,clearDropdownSelection:i}},ye=3e3,he=Q=>{const{templateId:r,onUpdateModalStateChange:a,updateSuccessMessage:e,updateErrorMessage:T}=Q,[i,g]=d({}),[M,l]=d(!1),[m,o]=d(!1),[I,s]=d({type:null,message:""});O(()=>{const p=H.on("quote-management/quote-template-data",()=>{g({}),o(!1),s({type:"success",message:e}),setTimeout(()=>{l(!1),s({type:null,message:""}),a==null||a(!1)},ye)});return()=>p==null?void 0:p.off()},[e,a]);const N=u((p,h)=>{const b=p;if(!b.uid)return;const C=b.uid;g(E=>({...E,[C]:h}))},[]),S=u(p=>{p.preventDefault(),s({type:null,message:""}),l(!0)},[]),t=u(async()=>{if(!r||Object.keys(i).length===0){l(!1);return}o(!0),s({type:null,message:""});const p=Object.entries(i).map(([h,b])=>({itemId:h,quantity:b}));try{await ge({templateId:r,items:p})}catch(h){const b=h instanceof Error?h.message:T;s({type:"error",message:b}),o(!1)}},[r,i,T]),c=u(()=>{l(!1),s({type:null,message:""}),a==null||a(!1),g({})},[a]),y=u(()=>{s({type:null,message:""})},[]);return{quantityChanges:i,handleQuantityChange:N,handleUpdate:S,handleConfirmUpdate:t,handleCancelUpdate:c,handleDismissBanner:y,isUpdateModalOpen:M,isUpdating:m,updateNotificationState:I}},be=({templateData:Q,slots:r,...a})=>{const[e,T]=d(Q),[i,g]=d(null),[M,l]=d(!1),[m,o]=d(!1),[I,s]=d(""),[N,S]=d({}),t=fe({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:c,handleConfirmRemove:y,handleCancelRemove:p,isRemoveModalOpen:h,isRemoving:b,removeNotificationState:C,itemsToRemove:E}=Te({templateId:e==null?void 0:e.id,removeSuccessMessage:t.removeSuccessMessage,removeErrorMessage:t.removeErrorMessage}),{dropdownSelections:J,handleItemDropdownChange:P,handleDismissRemoveBanner:q,clearDropdownSelection:L}=Ie({handleRemoveItems:c}),{handleQuantityChange:A,handleUpdate:F,handleConfirmUpdate:K,handleCancelUpdate:V,handleDismissBanner:k,isUpdateModalOpen:X,updateNotificationState:D}=he({templateId:e==null?void 0:e.id,updateSuccessMessage:t.updateSuccessMessage,updateErrorMessage:t.updateErrorMessage});O(()=>{const f=H.on("quote-management/quote-template-data",v=>{T(v.quoteTemplate),S({})},{eager:!0});return()=>f==null?void 0:f.off()},[]);const Z=u(()=>{E.forEach(f=>{L(f)}),p()},[E,L,p]),_=u((f,v)=>{const R=f;if(v==="edit"){g(R),l(!0),S(re=>({...re,[R.uid]:v}));return}P(f,v)},[P]),j={...J,...N},w=u(()=>{i&&S(f=>{const v={...f};return delete v[i.uid],v}),l(!1),g(null),o(!1),s("")},[i]),ee=u(async f=>{if(!(!i||!e)){o(!0),s("");try{await Me({templateId:e.id,itemId:i.uid,note:f}),w()}catch(v){console.error("Failed to set template line item note:",v);const R=v instanceof Error?v.message:"Unable to update the item. Please try again.";s(R),o(!1)}}},[i,e,w]),te=C.type==="success"?n(B,{type:"success",variant:"primary",icon:n(z,{}),heading:t.removeSuccessHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-success-banner"}):C.type==="error"?n(B,{type:"error",variant:"primary",icon:n(U,{}),heading:t.removeErrorHeading,description:C.message,onDismiss:q,"data-testid":"remove-items-error-banner"}):null,ae=D.type==="success"?n(B,{type:"success",variant:"primary",icon:n(z,{}),heading:t.updateSuccessHeading,description:D.message,onDismiss:k,"data-testid":"update-quantities-success-banner"}):D.type==="error"?n(B,{type:"error",variant:"primary",icon:n(U,{}),heading:t.updateErrorHeading,description:D.message,onDismiss:k,"data-testid":"update-quantities-error-banner"}):null;if(!e)return n(G,{loading:!0});const oe=h?{open:!0,title:t.removeModalTitle,message:t.removeModalDescription,cancelLabel:t.removeModalCancelButton,confirmLabel:b?t.removeModalConfirmButtonRemoving:t.removeModalConfirmButton,onCancel:Z,onConfirm:y,confirmationBanner:te}:null,ne=X?{open:!0,title:t.updateModalTitle,message:t.updateModalDescription,cancelLabel:t.updateModalCancelButton,confirmLabel:t.updateModalUpdateButton,onCancel:V,onConfirm:K,confirmationBanner:ae}:null,W=oe||ne,x=[];e.prices.subtotalExcludingTax&&x.push({label:t.subtotal,id:"subtotal",value:n($,{amount:e.prices.subtotalExcludingTax.value,currency:e.prices.subtotalExcludingTax.currency,weight:"normal"})}),e.prices.grandTotal&&x.push({label:t.grandTotal,id:"total",value:n($,{amount:e.prices.grandTotal.value,currency:e.prices.grandTotal.currency}),strong:!0});const se=I?n(B,{type:"error",variant:"primary",icon:n(U,{}),heading:t.errorHeading,description:I,onDismiss:()=>s(""),"data-testid":"line-item-note-error-banner"}):null;return ie(le,{children:[n(G,{"data-testid":"items-quoted-template-container",...a,loading:!1,table:n(Y,{name:"ProductListTable",slot:r==null?void 0:r.ProductListTable,context:{items:e.items,canEdit:e.canSendForReview,dropdownSelections:j,handleItemDropdownChange:_,handleQuantityChange:A,handleUpdate:F},children:n(de,{items:e.items,canEdit:e.canSendForReview,showActions:e.canEditTemplateItems,onItemDropdownChange:_,onQuantityChange:A,onUpdate:F,dropdownSelections:j})}),pricesSummary:n(Y,{name:"QuotePricesSummary",slot:r==null?void 0:r.QuotePricesSummary,context:{items:e.items,prices:e.prices},children:n(me,{entries:x})})}),W&&n(ue,{...W}),i&&n(ce,{open:M,item:i,onClose:w,onConfirm:ee,isSubmitting:m,readOnlyQuantity:!0,errorBanner:se||void 0})]})};be.displayName="ItemsQuotedTemplate";export{be as ItemsQuotedTemplate,be as default};
4
4
  //# sourceMappingURL=ItemsQuotedTemplate.js.map