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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/LICENSE.md +25 -26
  2. package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +1 -0
  3. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +1 -1
  4. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +1 -1
  5. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
  6. package/api/sendForReview/index.d.ts +1 -1
  7. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +10 -0
  8. package/api.js +10 -47
  9. package/api.js.map +1 -1
  10. package/chunks/AttachedFilesList.js +1 -1
  11. package/chunks/AttachedFilesList.js.map +1 -1
  12. package/chunks/ConfirmationModal.js +1 -1
  13. package/chunks/ConfirmationModal.js.map +1 -1
  14. package/chunks/ItemsQuoted.js +1 -1
  15. package/chunks/ItemsQuoted.js.map +1 -1
  16. package/chunks/ItemsQuotedTemplate.js +1 -1
  17. package/chunks/ItemsQuotedTemplate.js.map +1 -1
  18. package/chunks/LineItemNoteModal.js +4 -0
  19. package/chunks/LineItemNoteModal.js.map +1 -0
  20. package/chunks/NegotiableQuoteFragment.js +1 -0
  21. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  22. package/chunks/NegotiableQuoteTemplateFragment.js +154 -6
  23. package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -1
  24. package/chunks/OrderSummaryLine.js +1 -1
  25. package/chunks/OrderSummaryLine.js.map +1 -1
  26. package/chunks/QuoteTemplateCommentsList.js +1 -1
  27. package/chunks/QuoteTemplateCommentsList.js.map +1 -1
  28. package/chunks/RenameQuoteModal.js +4 -0
  29. package/chunks/RenameQuoteModal.js.map +1 -0
  30. package/chunks/ShippingAddressDisplay.js +1 -1
  31. package/chunks/ShippingAddressDisplay.js.map +1 -1
  32. package/chunks/addQuoteTemplateLineItemNote.js +23 -3
  33. package/chunks/addQuoteTemplateLineItemNote.js.map +1 -1
  34. package/chunks/duplicateNegotiableQuote.js +5 -5
  35. package/chunks/duplicateNegotiableQuote.js.map +1 -1
  36. package/chunks/getQuoteTemplates.js +13 -11
  37. package/chunks/getQuoteTemplates.js.map +1 -1
  38. package/chunks/negotiableQuotes.js +1 -1
  39. package/chunks/openQuoteTemplate.js +29 -8
  40. package/chunks/openQuoteTemplate.js.map +1 -1
  41. package/chunks/state.js +1 -1
  42. package/chunks/state.js.map +1 -1
  43. package/chunks/transform-quote-template.js +1 -1
  44. package/chunks/transform-quote-template.js.map +1 -1
  45. package/chunks/transform-quote.js +1 -1
  46. package/chunks/transform-quote.js.map +1 -1
  47. package/components/LineItemNoteModal/LineItemNoteModal.d.ts +2 -2
  48. package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +5 -2
  49. package/components/ProductListTable/ProductListTable.d.ts +5 -49
  50. package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +30 -0
  51. package/components/ReferenceDocumentFormModal/index.d.ts +11 -0
  52. package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +18 -0
  53. package/components/ReferenceDocumentsList/index.d.ts +11 -0
  54. package/components/index.d.ts +2 -0
  55. package/containers/ItemsQuoted/ItemsQuoted.d.ts +7 -7
  56. package/containers/ItemsQuoted.js +1 -1
  57. package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +5 -1
  58. package/containers/ItemsQuotedTemplate.js +1 -1
  59. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +3 -0
  60. package/containers/ManageNegotiableQuote.js +1 -1
  61. package/containers/ManageNegotiableQuote.js.map +1 -1
  62. package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +46 -5
  63. package/containers/ManageNegotiableQuoteTemplate.js +3 -1
  64. package/containers/ManageNegotiableQuoteTemplate.js.map +1 -1
  65. package/containers/OrderSummary.js +1 -1
  66. package/containers/OrderSummary.js.map +1 -1
  67. package/containers/OrderSummaryLine.js +1 -1
  68. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +1 -1
  69. package/containers/QuoteSummaryList.js +1 -1
  70. package/containers/QuoteSummaryList.js.map +1 -1
  71. package/containers/QuoteTemplatesListTable.js +1 -1
  72. package/containers/QuoteTemplatesListTable.js.map +1 -1
  73. package/containers/QuotesListTable.js +1 -1
  74. package/containers/QuotesListTable.js.map +1 -1
  75. package/containers/RequestNegotiableQuoteForm.js +1 -1
  76. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  77. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +2 -2
  78. package/containers/ShippingAddressDisplay.js +1 -1
  79. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +5 -5
  80. package/data/models/negotiable-quote-model.d.ts +3 -2
  81. package/data/models/negotiable-quote-template-model.d.ts +4 -39
  82. package/data/models/store-config-model.d.ts +2 -0
  83. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +8 -0
  84. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +616 -75
  85. package/data/transforms/__fixtures__/storeConfigData.d.ts +4 -0
  86. package/data/transforms/transform-history.d.ts +15 -0
  87. package/data/transforms/transform-quote-items.d.ts +15 -0
  88. package/hooks/useItemsQuotedTemplate.d.ts +15 -0
  89. package/hooks/useReferenceDocumentLinks.d.ts +34 -0
  90. package/hooks/useRemoveTemplateItems.d.ts +25 -0
  91. package/hooks/useRenameTemplate.d.ts +71 -0
  92. package/hooks/useUpdateTemplateQuantities.d.ts +27 -0
  93. package/i18n/en_US.json.d.ts +93 -6
  94. package/lib/itemFormatters.d.ts +1 -1
  95. package/lib/priceCalculators.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/render.js +3 -3
  98. package/render.js.map +1 -1
  99. package/chunks/LineItemNoteModal2.js +0 -4
  100. package/chunks/LineItemNoteModal2.js.map +0 -1
  101. package/chunks/TabbedContent.js +0 -4
  102. package/chunks/TabbedContent.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport interface ShippingAddress {\n /**\n * The unique string identifier of the address\n */\n uid?: string;\n firstname: string;\n lastname: string;\n company?: string;\n street: string[];\n city: string;\n region?: {\n code: string;\n label: string;\n regionId: number;\n };\n postcode: string;\n country: {\n code: string;\n label: string;\n };\n telephone: string;\n}\n\nexport interface NegotiableQuoteModel {\n uid: string;\n name: string;\n createdAt: string;\n salesRepName: string;\n expirationDate: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n isVirtual: boolean;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName?: string;\n totalQuantity: number;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n }[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n appliedDiscounts?: Discount[];\n appliedTaxes?: Tax[];\n discount?: Currency;\n grandTotal?: Currency;\n grandTotalExcludingTax?: Currency;\n shippingExcludingTax?: Currency;\n shippingIncludingTax?: Currency;\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n totalTax?: Currency;\n };\n items: NegotiableQuoteCartItem[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n lockedForEditing?: boolean;\n canDelete: boolean;\n canClose: boolean;\n canUpdateQuote: boolean;\n readOnly: boolean;\n}\n\nexport interface ConfigurableOption {\n optionLabel: string;\n valueLabel: string;\n}\n\nexport interface BundleOption {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n}\n\nexport interface CustomizableOption {\n type: string;\n label: string;\n values: {\n label: string;\n value: string;\n }[];\n}\n\nexport interface NegotiableQuoteCartItem {\n itemType: string;\n uid: string;\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: Currency;\n };\n };\n };\n image: ItemImage;\n links?: ItemLinks;\n discounted: boolean;\n discountedTotal: Currency;\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n discountPercentage?: number;\n insufficientQuantity?: boolean;\n outOfStock?: boolean;\n stockStatus: string;\n quantity: number;\n prices: {\n regularPrice: Currency;\n priceIncludingTax: Currency;\n originalItemPrice: Currency;\n originalRowTotal: Currency;\n rowTotal: Currency;\n rowTotalIncludingTax: Currency;\n };\n savingsAmount?: Currency;\n configurableOptions?: ConfigurableOption[];\n bundleOptions?: BundleOption[];\n customizableOptions?: CustomizableOption[];\n noteFromBuyer?: ItemNote[];\n noteFromSeller?: ItemNote[];\n}\n\ninterface ItemImage {\n src: string;\n alt: string;\n}\n\ninterface ItemLinks {\n count: number;\n result: string;\n}\n\nexport interface ItemNote {\n createdAt: string;\n creatorId: number;\n creatorType: number;\n negotiableQuoteItemUid: string;\n note: string;\n noteUid: string;\n}\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface Tax {\n amount: Currency;\n label: string;\n}\n\nexport interface Discount {\n amount: Currency;\n label: string;\n coupon?: Coupon;\n}\n\nexport interface Coupon {\n code: string;\n}\n\nexport interface NegotiableQuoteListEntry {\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName: string;\n prices: {\n grandTotal: Currency;\n };\n}\nexport interface NegotiableQuotesListModel {\n items: NegotiableQuoteListEntry[];\n pageInfo: {\n currentPage: number;\n pageSize: number;\n totalPages: number;\n };\n totalCount: number;\n paginationInfo?: PaginationInfo;\n sortFields?: {\n default: string;\n options: Array<{\n label: string;\n value: string;\n }>;\n };\n}\n\nexport interface NegotiableQuoteHistoryEntry {\n author: {\n firstname: string;\n lastname: string;\n };\n changeType: NegotiableQuoteHistoryEntryChangeType;\n changes: {\n commentAdded?: {\n comment: string;\n };\n customChanges?: {\n new_value: string;\n old_value: string;\n title: string;\n };\n expiration?: {\n newExpiration: string;\n oldExpiration: string;\n };\n productsRemoved?: {\n productsRemovedFromCatalog: string[];\n productsRemovedFromQuote?: {\n uid: string;\n name: string;\n sku: string;\n quantity: number;\n }[];\n };\n statuses?: {\n changes: {\n newStatus: string;\n oldStatus: string;\n }[];\n };\n total?: {\n newPrice: Currency;\n oldPrice: Currency;\n };\n };\n createdAt: string;\n uid: string;\n}\n\nexport enum NegotiableQuoteHistoryEntryChangeType {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n CLOSED = 'CLOSED',\n UPDATED_BY_SYSTEM = 'UPDATED_BY_SYSTEM',\n}\n\n// See: https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/quotes/quotes#quote-status\nexport enum NegotiableQuoteStatus {\n NEW = 'NEW', // Currently not returned by the API, but is used to indicate a new quote\n SUBMITTED = 'SUBMITTED',\n PENDING = 'PENDING',\n UPDATED = 'UPDATED',\n OPEN = 'OPEN',\n ORDERED = 'ORDERED',\n CLOSED = 'CLOSED',\n DECLINED = 'DECLINED',\n EXPIRED = 'EXPIRED',\n DRAFT = 'DRAFT',\n}\n\nexport interface PaginationInfo {\n currentPage: number;\n totalCount: number;\n pageSize: number;\n startItem: number;\n endItem: number;\n totalPages: number;\n pageSizeOptions?: number[];\n}\n","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\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 NegotiableQuoteListEntry,\n NegotiableQuoteModel,\n NegotiableQuotesListModel,\n NegotiableQuoteStatus,\n PaginationInfo,\n ShippingAddress,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n// Quote statuses that allow editing/sending for review\nconst EDITABLE_QUOTE_STATUSES = [\n 'DRAFT',\n 'UPDATED',\n 'DECLINED',\n 'EXPIRED',\n 'NEW',\n 'OPEN',\n] as const;\n\n// Helper function to get the total quantity of a quote (number of quote line items or total quantity)\nfunction getTotalQuantity(quote: any) {\n if (!quote.items) return 0;\n\n const config = state.config;\n\n if (config?.quoteSummaryDisplayTotal === 0) return quote.items.length;\n if (config?.quoteSummaryDisplayTotal === 1) return quote.total_quantity;\n // Default to items count if unexpected config value or error returned\n return quote.items.length;\n}\n\n// Helper function to get the image for a cart item component\nfunction getImage(item: any) {\n const config = state.config;\n\n return {\n // Use parent thumbnail if configured, otherwise use own variant. Use the parent thumbnail as a fallback\n src: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.url\n : item.configured_variant?.thumbnail?.url || item.product.thumbnail.url,\n alt: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.label\n : item.configured_variant?.thumbnail?.label ||\n item.product.thumbnail.label,\n };\n}\n\n// Helper function to get downloadable links for a cart item component\nfunction getLinks(item: any) {\n return item.links?.length > 0\n ? {\n count: item.links.length,\n result: item.links.map((link: any) => link.title).join(', '),\n }\n : null;\n}\n\n/**\n * Finds the most applicable price tier for a given quantity\n * @param priceTiers - Array of price tier objects\n * @param quantity - Current item quantity\n * @returns The applicable tier or null if none found\n */\nfunction findApplicablePriceTier(priceTiers: any[], quantity: number) {\n if (!priceTiers?.length) return null;\n\n // Sort price tiers by quantity in descending order to find the highest applicable tier\n const sortedTiers = [...priceTiers].sort(\n (a: any, b: any) => b.quantity - a.quantity\n );\n\n // Find the highest tier where the current quantity meets or exceeds the tier's minimum quantity\n return sortedTiers.find((tier: any) => quantity >= tier.quantity) || null;\n}\n\n// Helper function to check if an item is discounted\nfunction getDiscounted(item: any) {\n const quantity = item.quantity;\n const isConfigurable = item.__typename === 'ConfigurableCartItem';\n\n // Get price tiers and price range based on item type\n const priceTiers = isConfigurable\n ? item.configured_variant?.price_tiers\n : item.product.price_tiers;\n const priceRange = isConfigurable\n ? item.configured_variant?.price_range\n : item.product.price_range;\n\n // Check price tiers first for discount eligibility\n const applicableTier = findApplicablePriceTier(priceTiers, quantity);\n if (applicableTier) {\n return applicableTier.discount.amount_off > 0;\n }\n\n // Fallback to regular price range discount\n return priceRange?.maximum_price.discount.amount_off > 0;\n}\n\n// Helper function to get the discount percentage of an item\nfunction getDiscountPercentage(item: any) {\n const quantity = item.quantity;\n\n // Check price tiers first for discount percentage\n const applicableTier = findApplicablePriceTier(\n item.product.price_tiers,\n quantity\n );\n\n if (applicableTier) {\n return Math.round(applicableTier.discount.percent_off);\n }\n\n // Fallback to product-specific discount percentage\n let percent_off;\n\n if (item.__typename === 'ConfigurableCartItem') {\n percent_off =\n item?.configured_variant?.price_range?.maximum_price?.discount\n ?.percent_off;\n } else if (item.__typename === 'BundleCartItem') {\n return undefined;\n } else {\n percent_off =\n item?.product?.price_range?.maximum_price?.discount?.percent_off;\n }\n\n if (percent_off === 0) {\n return undefined;\n }\n\n return Math.round(percent_off);\n}\n\n// Helper function to get the regular price of an item\nfunction getRegularPrice(item: any) {\n if (item.__typename === 'ConfigurableCartItem') {\n return {\n value:\n item.configured_variant?.price_range?.maximum_price.regular_price.value,\n currency:\n item.configured_variant?.price_range?.maximum_price.regular_price\n .currency,\n };\n }\n return {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n };\n}\n\n// Helper function to get the savings amount of an item\nfunction getSavingsAmount(item: any) {\n let amount_off;\n let currency;\n\n amount_off =\n item?.prices?.original_row_total?.value - item?.prices?.row_total?.value;\n currency = item?.prices?.row_total?.currency;\n\n if (amount_off === 0) {\n return undefined;\n }\n return {\n value: amount_off,\n currency,\n };\n}\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n expirationDate: quote.expiration_date,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n isVirtual: Boolean(quote.is_virtual),\n salesRepName: quote.sales_rep_name,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n totalQuantity: getTotalQuantity(quote),\n comments: quote.comments?.map((comment: any) => {\n const baseComment: any = {\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n text: comment.text,\n };\n\n if (\n Array.isArray(comment.attachments) &&\n comment.attachments.length > 0\n ) {\n baseComment.attachments = comment.attachments.map((a: any) => ({\n name: a.name,\n url: a.url,\n }));\n }\n\n return baseComment;\n }),\n prices: quote.prices && {\n appliedDiscounts: quote.prices.discounts?.map((discount: any) => ({\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n label: discount.label,\n coupon: discount.coupon,\n })),\n appliedTaxes: quote.prices.applied_taxes?.map((tax: any) => ({\n amount: { value: tax.amount.value, currency: tax.amount.currency },\n label: tax.label,\n })),\n discount:\n quote.prices.discounts &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.discounts,\n quote.prices.grand_total.currency\n ),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n grandTotalExcludingTax: quote.prices.grand_total_excluding_tax && {\n value: quote.prices.grand_total_excluding_tax.value,\n currency: quote.prices.grand_total_excluding_tax.currency,\n },\n subtotalExcludingTax: quote.prices.subtotal_excluding_tax && {\n value: quote.prices.subtotal_excluding_tax.value,\n currency: quote.prices.subtotal_excluding_tax.currency,\n },\n subtotalIncludingTax: quote.prices.subtotal_including_tax && {\n value: quote.prices.subtotal_including_tax.value,\n currency: quote.prices.subtotal_including_tax.currency,\n },\n subtotalWithDiscountExcludingTax: quote.prices\n .subtotal_with_discount_excluding_tax && {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n currency: quote.prices.subtotal_with_discount_excluding_tax.currency,\n },\n ...transformShippingPrices(quote),\n totalTax:\n quote.prices.applied_taxes &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.applied_taxes,\n quote.prices.grand_total.currency\n ),\n },\n history: quote.history?.map((history: any) => ({\n uid: history.uid,\n createdAt: history.created_at,\n author: {\n firstname: history.author.firstname,\n lastname: history.author.lastname,\n },\n changeType: history.change_type,\n changes: {\n commentAdded: history.changes?.comment_added && {\n comment: history.changes.comment_added.comment,\n },\n customChanges: history.changes?.custom_changes && {\n new_value: history.changes.custom_changes.new_value,\n old_value: history.changes.custom_changes.old_value,\n title: history.changes.custom_changes.title,\n },\n expiration: history.changes?.expiration && {\n newExpiration: history.changes.expiration.new_expiration,\n oldExpiration: history.changes.expiration.old_expiration,\n },\n productsRemoved: history.changes?.products_removed && {\n productsRemovedFromCatalog:\n history.changes.products_removed.products_removed_from_catalog ||\n [],\n productsRemovedFromQuote:\n history.changes.products_removed.products_removed_from_quote || [],\n },\n statuses: history.changes?.statuses && {\n changes:\n history.changes.statuses.changes?.map((change: any) => ({\n newStatus: change.new_status,\n oldStatus: change.old_status,\n })) || [],\n },\n total: history.changes?.total &&\n history.changes.total.new_price &&\n history.changes.total.old_price && {\n newPrice: {\n value: history.changes.total.new_price.value,\n currency: history.changes.total.new_price.currency,\n },\n oldPrice: {\n value: history.changes.total.old_price.value,\n currency: history.changes.total.old_price.currency,\n },\n },\n },\n })),\n items:\n quote.items?.map((item: any) => ({\n itemType: item.__typename,\n uid: item.uid,\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value:\n item.product.price_range.maximum_price.regular_price.value,\n currency:\n item.product.price_range.maximum_price.regular_price.currency,\n },\n },\n },\n },\n image: getImage(item),\n links: getLinks(item),\n discounted: getDiscounted(item),\n discountedTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts:\n item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n })) ?? [],\n discountPercentage: getDiscountPercentage(item),\n insufficientQuantity:\n (item.__typename === 'ConfigurableCartItem'\n ? item.configured_variant\n : item.product\n ).stock_status === 'IN_STOCK' && !item.is_available,\n outOfStock: item.product.stock_status === 'OUT_OF_STOCK',\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n regularPrice: getRegularPrice(item),\n priceIncludingTax: {\n value: item.prices.price_including_tax.value,\n currency: item.prices.price_including_tax.currency,\n },\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n originalRowTotal: {\n value: item.prices.original_row_total.value,\n currency: item.prices.original_row_total.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n rowTotalIncludingTax: {\n value: item.prices.row_total_including_tax.value,\n currency: item.prices.row_total_including_tax.currency,\n },\n },\n savingsAmount: getSavingsAmount(item),\n noteFromBuyer: item.note_from_buyer?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n noteFromSeller: item.note_from_seller?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n configurableOptions: item.configurable_options?.map((option: any) => ({\n optionLabel: option.option_label,\n valueLabel: option.value_label,\n })),\n bundleOptions: item.bundle_options?.map((option: any) => ({\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n quantity: value.quantity,\n originalPrice: {\n value: value.original_price.value,\n currency: value.original_price.currency,\n },\n price: {\n value: value.priceV2.value,\n currency: value.priceV2.currency,\n },\n })),\n })),\n customizableOptions: item.customizable_options?.map((option: any) => ({\n type: option.type,\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n })),\n })) || [],\n shippingAddresses: quote.shipping_addresses?.map((address: any) => {\n const shippingAddress: ShippingAddress = {\n uid: address.uid,\n firstname: address.firstname,\n lastname: address.lastname,\n company: address.company,\n street: address.street,\n city: address.city,\n postcode: address.postcode,\n country: {\n code: address.country.code,\n label: address.country.label,\n },\n telephone: address.telephone,\n };\n\n if (address.region) {\n shippingAddress.region = {\n code: address.region.code,\n label: address.region.label,\n regionId: address.region.region_id,\n };\n }\n\n return shippingAddress;\n }),\n canCheckout:\n ['UPDATED', 'DECLINED', 'OPEN'].includes(quote.status) &&\n state.permissions.checkoutQuote &&\n quote.shipping_addresses?.length > 0,\n canSendForReview:\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canUpdateQuote:\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canDelete:\n !['PENDING', 'SUBMITTED', 'ORDERED'].includes(quote.status) &&\n state.permissions.deleteQuote,\n canClose: quote.status\n ? !['DRAFT', 'CLOSED', 'ORDERED', 'OPEN'].includes(quote.status)\n : false,\n readOnly:\n (!isQuoteNew &&\n ['ORDERED', 'SUBMITTED', 'CLOSED', 'PENDING'].includes(quote.status)) ||\n !state.permissions.editQuote,\n };\n}\n\nexport function transformQuote(quoteData: any): NegotiableQuoteModel | null {\n if (!quoteData) {\n return null;\n }\n\n return transformSingleQuote(quoteData);\n}\n\n// quote is new if it has a status of SUBMITTED and there is no history entry that\n// has a change_type of UPDATED with a non-empty array of status changes\nfunction isNewQuote(quote: any): boolean {\n return (\n quote.status === 'SUBMITTED' &&\n !(quote.history ?? []).some(\n (history: any) =>\n history.change_type === 'UPDATED' &&\n (history.changes?.statuses?.changes ?? []).length > 0\n )\n );\n}\n\nfunction transformNegotiableQuoteListEntry(\n quote: any\n): NegotiableQuoteListEntry {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n prices: {\n grandTotal: {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n };\n}\n\nexport function transformNegotiableQuotesList(\n quotesData: any\n): NegotiableQuotesListModel | null {\n if (!quotesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n quotesData.items\n ?.filter((quote: any) => quote?.uid)\n .map(transformNegotiableQuoteListEntry) || [],\n pageInfo: {\n currentPage: quotesData.page_info.current_page,\n pageSize: quotesData.page_info.page_size,\n totalPages: quotesData.page_info.total_pages,\n },\n totalCount: quotesData.total_count,\n sortFields: quotesData.sort_fields\n ? {\n default: quotesData.sort_fields.default,\n options: quotesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n\nexport function transformPaginationInfo(\n quotesData: NegotiableQuotesListModel | null\n): PaginationInfo | null {\n if (!quotesData?.pageInfo || !quotesData.totalCount) {\n return null;\n }\n\n const { currentPage, pageSize, totalPages } = quotesData.pageInfo;\n const { totalCount } = quotesData;\n\n const startItem = totalCount > 0 ? (currentPage - 1) * pageSize + 1 : 0;\n const endItem = Math.min(currentPage * pageSize, totalCount);\n\n const pageSizeOptions = [20, 30, 50, 100, 200]; // Default page size options\n\n return {\n currentPage,\n totalCount,\n pageSize,\n startItem,\n endItem,\n totalPages,\n pageSizeOptions,\n };\n}\n\n// TODO: Check if admin has this configuration\nexport const getDefaultPageSizeOptions = () => [20, 30, 50, 100, 200];\n\nexport function calculateTotal(data: any[], currency: string) {\n if (!data?.length)\n return {\n value: 0,\n currency,\n };\n\n return data.reduce(\n (acc: any, item: any) => {\n return {\n value: acc.value + item.amount.value,\n currency: item.amount.currency,\n };\n },\n { value: 0, currency }\n );\n}\n\nexport function transformShippingPrices(quote: any) {\n if (!quote || !quote.shipping_addresses?.length) {\n return {};\n }\n\n const shippingAddress = quote.shipping_addresses[0];\n const selectedShippingMethod = shippingAddress.selected_shipping_method;\n\n if (!selectedShippingMethod) {\n return {};\n }\n\n return {\n shippingIncludingTax: selectedShippingMethod.price_incl_tax && {\n value: selectedShippingMethod.price_incl_tax.value,\n currency: selectedShippingMethod.price_incl_tax.currency,\n },\n shippingExcludingTax: selectedShippingMethod.price_excl_tax && {\n value: selectedShippingMethod.price_excl_tax.value,\n currency: selectedShippingMethod.price_excl_tax.currency,\n },\n };\n}\n"],"names":["NegotiableQuoteStatus","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","EDITABLE_QUOTE_STATUSES","getTotalQuantity","quote","config","state","getImage","item","_b","_a","_d","_c","getLinks","link","findApplicablePriceTier","priceTiers","quantity","a","b","tier","getDiscounted","isConfigurable","priceRange","applicableTier","getDiscountPercentage","percent_off","_h","_g","_f","_e","getRegularPrice","getSavingsAmount","amount_off","currency","transformSingleQuote","isQuoteNew","isNewQuote","comment","baseComment","discount","tax","calculateTotal","transformShippingPrices","history","change","note","option","value","address","shippingAddress","transformQuote","quoteData","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions","data","acc","selectedShippingMethod"],"mappings":"8FAyRO,IAAKA,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,MAAQ,QAVEA,IAAAA,GAAA,CAAA,CAAA,ECvRL,KAAM,CACX,YAAAC,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA,ECWjBC,EAA0B,CAC9B,QACA,UACA,WACA,UACA,MACA,MACF,EAGA,SAASC,EAAiBC,EAAY,CACpC,GAAI,CAACA,EAAM,MAAO,MAAO,GAEzB,MAAMC,EAASC,EAAM,OAErB,OAAID,GAAA,YAAAA,EAAQ,4BAA6B,EAAUD,EAAM,MAAM,QAC3DC,GAAA,YAAAA,EAAQ,4BAA6B,EAAUD,EAAM,eAElDA,EAAM,MAAM,MACrB,CAGA,SAASG,EAASC,EAAW,aAC3B,MAAMH,EAASC,EAAM,OAErB,MAAO,CAEL,IAAKD,GAAA,MAAAA,EAAQ,+BACTG,EAAK,QAAQ,UAAU,MACvBC,GAAAC,EAAAF,EAAK,qBAAL,YAAAE,EAAyB,YAAzB,YAAAD,EAAoC,MAAOD,EAAK,QAAQ,UAAU,IACtE,IAAKH,GAAA,MAAAA,EAAQ,+BACTG,EAAK,QAAQ,UAAU,QACvBG,GAAAC,EAAAJ,EAAK,qBAAL,YAAAI,EAAyB,YAAzB,YAAAD,EAAoC,QACpCH,EAAK,Q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7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,EAElD,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,CAClD,EAXO,CAAA,CAaX"}
1
+ {"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-history.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote-items.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport interface ShippingAddress {\n /**\n * The unique string identifier of the address\n */\n uid?: string;\n firstname: string;\n lastname: string;\n company?: string;\n street: string[];\n city: string;\n region?: {\n code: string;\n label: string;\n regionId: number;\n };\n postcode: string;\n country: {\n code: string;\n label: string;\n };\n telephone: string;\n}\n\nexport interface NegotiableQuoteModel {\n uid: string;\n name: string;\n createdAt: string;\n salesRepName: string;\n expirationDate: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n isVirtual: boolean;\n buyer: {\n firstname: string;\n lastname: string;\n };\n email?: string;\n templateName?: string;\n totalQuantity: number;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n }[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n appliedDiscounts?: Discount[];\n appliedTaxes?: Tax[];\n discount?: Currency;\n grandTotal?: Currency;\n grandTotalExcludingTax?: Currency;\n shippingExcludingTax?: Currency;\n shippingIncludingTax?: Currency;\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n totalTax?: Currency;\n };\n items: CartItemModel[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n lockedForEditing?: boolean;\n canDelete: boolean;\n canClose: boolean;\n canUpdateQuote: boolean;\n readOnly: boolean;\n}\n\nexport interface ConfigurableOption {\n optionLabel: string;\n valueLabel: string;\n}\n\nexport interface BundleOption {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n}\n\nexport interface CustomizableOption {\n type: string;\n label: string;\n values: {\n label: string;\n value: string;\n }[];\n}\n\nexport interface CartItemModel {\n itemType: string;\n uid: string;\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: Currency;\n };\n };\n };\n image: ItemImage;\n links?: ItemLinks;\n discounted: boolean;\n discountedTotal: Currency;\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n discountPercentage?: number;\n insufficientQuantity?: boolean;\n outOfStock?: boolean;\n stockStatus: string;\n quantity: number;\n prices: {\n regularPrice: Currency;\n priceIncludingTax: Currency;\n originalItemPrice: Currency;\n originalRowTotal: Currency;\n rowTotal: Currency;\n rowTotalIncludingTax: Currency;\n };\n savingsAmount?: Currency;\n configurableOptions?: ConfigurableOption[];\n bundleOptions?: BundleOption[];\n customizableOptions?: CustomizableOption[];\n noteFromBuyer?: ItemNote[];\n noteFromSeller?: ItemNote[];\n}\n\ninterface ItemImage {\n src: string;\n alt: string;\n}\n\ninterface ItemLinks {\n count: number;\n result: string;\n}\n\nexport interface ItemNote {\n createdAt: string;\n creatorId: number;\n creatorType: number;\n negotiableQuoteItemUid: string;\n note: string;\n noteUid: string;\n}\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface Tax {\n amount: Currency;\n label: string;\n}\n\nexport interface Discount {\n amount: Currency;\n label: string;\n coupon?: Coupon;\n}\n\nexport interface Coupon {\n code: string;\n}\n\nexport interface NegotiableQuoteListEntry {\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName: string;\n prices: {\n grandTotal: Currency;\n };\n}\nexport interface NegotiableQuotesListModel {\n items: NegotiableQuoteListEntry[];\n pageInfo: {\n currentPage: number;\n pageSize: number;\n totalPages: number;\n };\n totalCount: number;\n paginationInfo?: PaginationInfo;\n sortFields?: {\n default: string;\n options: Array<{\n label: string;\n value: string;\n }>;\n };\n}\n\nexport interface NegotiableQuoteHistoryEntry {\n author: {\n firstname: string;\n lastname: string;\n };\n changeType: NegotiableQuoteHistoryEntryChangeType;\n changes: {\n commentAdded?: {\n comment: string;\n };\n customChanges?: {\n new_value: string;\n old_value: string;\n title: string;\n };\n expiration?: {\n newExpiration: string;\n oldExpiration: string;\n };\n productsRemoved?: {\n productsRemovedFromCatalog: string[];\n productsRemovedFromQuote?: {\n uid: string;\n name: string;\n sku: string;\n quantity: number;\n }[];\n };\n statuses?: {\n changes: {\n newStatus: string;\n oldStatus: string;\n }[];\n };\n total?: {\n newPrice: Currency;\n oldPrice: Currency;\n };\n };\n createdAt: string;\n uid: string;\n}\n\nexport enum NegotiableQuoteHistoryEntryChangeType {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n CLOSED = 'CLOSED',\n UPDATED_BY_SYSTEM = 'UPDATED_BY_SYSTEM',\n}\n\n// See: https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/quotes/quotes#quote-status\nexport enum NegotiableQuoteStatus {\n NEW = 'NEW', // Currently not returned by the API, but is used to indicate a new quote\n SUBMITTED = 'SUBMITTED',\n PENDING = 'PENDING',\n UPDATED = 'UPDATED',\n OPEN = 'OPEN',\n ORDERED = 'ORDERED',\n CLOSED = 'CLOSED',\n DECLINED = 'DECLINED',\n EXPIRED = 'EXPIRED',\n DRAFT = 'DRAFT',\n}\n\nexport interface PaginationInfo {\n currentPage: number;\n totalCount: number;\n pageSize: number;\n startItem: number;\n endItem: number;\n totalPages: number;\n pageSizeOptions?: number[];\n}\n","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\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 { NegotiableQuoteHistoryEntry, NegotiableQuoteHistoryEntryChangeType } from '../models/negotiable-quote-model';\n\n/**\n * Transforms a history entry from the API format to the model format\n * @param historyEntry - Raw history entry from API\n * @returns Transformed history entry\n */\nexport function transformHistoryEntry(\n historyEntry: any\n): NegotiableQuoteHistoryEntry {\n return {\n uid: historyEntry.uid,\n createdAt: historyEntry.created_at,\n author: {\n firstname: historyEntry.author.firstname,\n lastname: historyEntry.author.lastname,\n },\n changeType: historyEntry.change_type as NegotiableQuoteHistoryEntryChangeType,\n changes: {\n commentAdded: historyEntry.changes?.comment_added && {\n comment: historyEntry.changes.comment_added.comment,\n },\n customChanges: historyEntry.changes?.custom_changes && {\n new_value: historyEntry.changes.custom_changes.new_value,\n old_value: historyEntry.changes.custom_changes.old_value,\n title: historyEntry.changes.custom_changes.title,\n },\n expiration: historyEntry.changes?.expiration && {\n newExpiration: historyEntry.changes.expiration.new_expiration,\n oldExpiration: historyEntry.changes.expiration.old_expiration,\n },\n productsRemoved: historyEntry.changes?.products_removed && {\n productsRemovedFromCatalog:\n historyEntry.changes.products_removed.products_removed_from_catalog ||\n [],\n productsRemovedFromQuote:\n historyEntry.changes.products_removed.products_removed_from_quote ||\n [],\n },\n statuses: historyEntry.changes?.statuses && {\n changes:\n historyEntry.changes.statuses.changes?.map((change: any) => ({\n newStatus: change?.new_status,\n oldStatus: change?.old_status,\n })) || [],\n },\n total:\n historyEntry.changes?.total &&\n historyEntry.changes.total.new_price &&\n historyEntry.changes.total.old_price && {\n newPrice: {\n value: historyEntry.changes.total.new_price.value,\n currency: historyEntry.changes.total.new_price.currency,\n },\n oldPrice: {\n value: historyEntry.changes.total.old_price.value,\n currency: historyEntry.changes.total.old_price.currency,\n },\n },\n },\n };\n}\n\n/**\n * Transforms an array of history entries from the API format to the model format\n * @param historyEntries - Array of raw history entries from API\n * @returns Array of transformed history entries\n */\nexport function transformHistory(\n historyEntries: any[] | null | undefined\n): NegotiableQuoteHistoryEntry[] | undefined {\n if (!historyEntries) {\n return undefined;\n }\n\n return historyEntries.map(transformHistoryEntry);\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 { CartItemModel } from '../models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n/**\n * Finds the most applicable price tier for a given quantity\n * @param priceTiers - Array of price tier objects\n * @param quantity - Current item quantity\n * @returns The applicable tier or null if none found\n */\nfunction findApplicablePriceTier(priceTiers: any[], quantity: number) {\n if (!priceTiers?.length) return null;\n\n // Sort price tiers by quantity in descending order to find the highest applicable tier\n const sortedTiers = [...priceTiers].sort(\n (a: any, b: any) => b.quantity - a.quantity\n );\n\n // Find the highest tier where the current quantity meets or exceeds the tier's minimum quantity\n return sortedTiers.find((tier: any) => quantity >= tier.quantity) || null;\n}\n\n/**\n * Helper function to get the image for a cart item component\n * @param item - Cart item from API\n * @returns Image object with src and alt\n */\nfunction getImage(item: any) {\n const config = state.config;\n\n return {\n // Use parent thumbnail if configured, otherwise use own variant. Use the parent thumbnail as a fallback\n src: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.url\n : item.configured_variant?.thumbnail?.url || item.product.thumbnail.url,\n alt: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.label\n : item.configured_variant?.thumbnail?.label ||\n item.product.thumbnail.label,\n };\n}\n\n/**\n * Helper function to get downloadable links for a cart item component\n * @param item - Cart item from API\n * @returns Links object with count and result, or null if no links\n */\nfunction getLinks(item: any) {\n return item.links?.length > 0\n ? {\n count: item.links.length,\n result: item.links.map((link: any) => link.title).join(', '),\n }\n : null;\n}\n\n/**\n * Helper function to check if an item is discounted\n * @param item - Cart item from API\n * @returns True if the item has a discount\n */\nfunction getDiscounted(item: any) {\n const quantity = item.quantity;\n const isConfigurable = item.__typename === 'ConfigurableCartItem';\n\n // Get price tiers and price range based on item type\n const priceTiers = isConfigurable\n ? item.configured_variant?.price_tiers\n : item.product.price_tiers;\n const priceRange = isConfigurable\n ? item.configured_variant?.price_range\n : item.product.price_range;\n\n // Check price tiers first for discount eligibility\n const applicableTier = findApplicablePriceTier(priceTiers, quantity);\n if (applicableTier) {\n return applicableTier.discount.amount_off > 0;\n }\n\n // Fallback to regular price range discount\n return (priceRange?.maximum_price?.discount?.amount_off ?? 0) > 0;\n}\n\n/**\n * Helper function to get the discount percentage of an item\n * @param item - Cart item from API\n * @returns Discount percentage rounded to nearest integer, or undefined if no discount\n */\nfunction getDiscountPercentage(item: any) {\n const quantity = item.quantity;\n\n // Check price tiers first for discount percentage\n const applicableTier = findApplicablePriceTier(\n item.product.price_tiers,\n quantity\n );\n\n if (applicableTier) {\n return Math.round(applicableTier.discount.percent_off);\n }\n\n // Fallback to product-specific discount percentage\n let percent_off;\n\n if (item.__typename === 'ConfigurableCartItem') {\n percent_off =\n item?.configured_variant?.price_range?.maximum_price?.discount\n ?.percent_off;\n } else if (item.__typename === 'BundleCartItem') {\n return undefined;\n } else {\n percent_off =\n item?.product?.price_range?.maximum_price?.discount?.percent_off;\n }\n\n if (percent_off === 0) {\n return undefined;\n }\n\n return Math.round(percent_off);\n}\n\n/**\n * Helper function to get the regular price of an item\n * @param item - Cart item from API\n * @returns Regular price object with value and currency\n */\nfunction getRegularPrice(item: any) {\n if (item.__typename === 'ConfigurableCartItem') {\n return {\n value:\n item.configured_variant?.price_range?.maximum_price.regular_price.value,\n currency:\n item.configured_variant?.price_range?.maximum_price.regular_price\n .currency,\n };\n }\n return {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n };\n}\n\n/**\n * Helper function to get the savings amount of an item\n * @param item - Cart item from API\n * @returns Savings amount object with value and currency, or undefined if no savings\n */\nfunction getSavingsAmount(item: any) {\n let amount_off;\n let currency;\n\n amount_off =\n item?.prices?.original_row_total?.value - item?.prices?.row_total?.value;\n currency = item?.prices?.row_total?.currency;\n\n if (amount_off === 0) {\n return undefined;\n }\n return {\n value: amount_off,\n currency,\n };\n}\n\n/**\n * Transforms a single quote item from the API format to the model format\n * @param item - Raw quote item from API\n * @returns Transformed quote item\n */\nexport function transformQuoteItem(item: any): CartItemModel {\n return {\n itemType: item.__typename,\n uid: item.uid,\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value:\n item.product.price_range.maximum_price.regular_price.value,\n currency:\n item.product.price_range.maximum_price.regular_price.currency,\n },\n },\n },\n },\n image: getImage(item),\n links: getLinks(item),\n discounted: getDiscounted(item),\n discountedTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts:\n item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n })) ?? [],\n discountPercentage: getDiscountPercentage(item),\n insufficientQuantity:\n (item.__typename === 'ConfigurableCartItem'\n ? item.configured_variant?.stock_status ?? item.product.stock_status\n : item.product.stock_status\n ) === 'IN_STOCK' && !item.is_available,\n outOfStock: item.product.stock_status === 'OUT_OF_STOCK',\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n regularPrice: getRegularPrice(item),\n priceIncludingTax: {\n value: item.prices.price_including_tax.value,\n currency: item.prices.price_including_tax.currency,\n },\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n originalRowTotal: {\n value: item.prices.original_row_total.value,\n currency: item.prices.original_row_total.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n rowTotalIncludingTax: {\n value: item.prices.row_total_including_tax.value,\n currency: item.prices.row_total_including_tax.currency,\n },\n },\n savingsAmount: getSavingsAmount(item),\n noteFromBuyer: item.note_from_buyer?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n noteFromSeller: item.note_from_seller?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n configurableOptions: item.configurable_options?.map((option: any) => ({\n optionLabel: option.option_label,\n valueLabel: option.value_label,\n })),\n bundleOptions: item.bundle_options?.map((option: any) => ({\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n quantity: value.quantity,\n originalPrice: {\n value: value.original_price.value,\n currency: value.original_price.currency,\n },\n price: {\n value: value.priceV2.value,\n currency: value.priceV2.currency,\n },\n })),\n })),\n customizableOptions: item.customizable_options?.map((option: any) => ({\n type: option.type,\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n })),\n };\n}\n\n/**\n * Transforms an array of quote items from the API format to the model format\n * @param items - Array of raw quote items from API\n * @returns Array of transformed quote items\n */\nexport function transformQuoteItems(\n items: any[] | null | undefined\n): CartItemModel[] {\n if (!items) {\n return [];\n }\n\n return items.map(transformQuoteItem);\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 CartItemModel,\n NegotiableQuoteListEntry,\n NegotiableQuoteModel,\n NegotiableQuotesListModel,\n NegotiableQuoteStatus,\n PaginationInfo,\n ShippingAddress,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\nimport { transformHistory } from './transform-history';\nimport { transformQuoteItems } from './transform-quote-items';\n\n// Quote statuses that allow editing/sending for review\nconst EDITABLE_QUOTE_STATUSES = [\n 'DRAFT',\n 'UPDATED',\n 'DECLINED',\n 'EXPIRED',\n 'NEW',\n 'OPEN',\n] as const;\n\n// Helper function to get the total quantity of a quote (number of quote line items or total quantity)\nfunction getTotalQuantity(quote: any) {\n if (!quote.items) return 0;\n\n const config = state.config;\n\n if (config?.quoteSummaryDisplayTotal === 0) return quote.items.length;\n if (config?.quoteSummaryDisplayTotal === 1) return quote.total_quantity;\n // Default to items count if unexpected config value or error returned\n return quote.items.length;\n}\n\nfunction checkAllItemsHaveStock(items: CartItemModel[]): boolean {\n return items.every((item) => !item.outOfStock && !item.insufficientQuantity);\n}\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n const isGeneratedFromTemplate = Boolean(quote.template_name?.trim());\n const quoteItems = transformQuoteItems(quote.items);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n expirationDate: quote.expiration_date,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n isVirtual: Boolean(quote.is_virtual),\n salesRepName: quote.sales_rep_name,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n email: quote.email,\n templateName: quote.template_name,\n totalQuantity: getTotalQuantity(quote),\n comments: quote.comments?.map((comment: any) => {\n const baseComment: any = {\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n text: comment.text,\n };\n\n if (\n Array.isArray(comment.attachments) &&\n comment.attachments.length > 0\n ) {\n baseComment.attachments = comment.attachments.map((a: any) => ({\n name: a.name,\n url: a.url,\n }));\n }\n\n return baseComment;\n }),\n prices: quote.prices && {\n appliedDiscounts: quote.prices.discounts?.map((discount: any) => ({\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n label: discount.label,\n coupon: discount.coupon,\n })),\n appliedTaxes: quote.prices.applied_taxes?.map((tax: any) => ({\n amount: { value: tax.amount.value, currency: tax.amount.currency },\n label: tax.label,\n })),\n discount:\n quote.prices.discounts &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.discounts,\n quote.prices.grand_total.currency\n ),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n grandTotalExcludingTax: quote.prices.grand_total_excluding_tax && {\n value: quote.prices.grand_total_excluding_tax.value,\n currency: quote.prices.grand_total_excluding_tax.currency,\n },\n subtotalExcludingTax: quote.prices.subtotal_excluding_tax && {\n value: quote.prices.subtotal_excluding_tax.value,\n currency: quote.prices.subtotal_excluding_tax.currency,\n },\n subtotalIncludingTax: quote.prices.subtotal_including_tax && {\n value: quote.prices.subtotal_including_tax.value,\n currency: quote.prices.subtotal_including_tax.currency,\n },\n subtotalWithDiscountExcludingTax: quote.prices\n .subtotal_with_discount_excluding_tax && {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n currency: quote.prices.subtotal_with_discount_excluding_tax.currency,\n },\n ...transformShippingPrices(quote),\n totalTax:\n quote.prices.applied_taxes &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.applied_taxes,\n quote.prices.grand_total.currency\n ),\n },\n history: transformHistory(quote.history),\n items: quoteItems,\n shippingAddresses: quote.shipping_addresses?.map((address: any) => {\n const shippingAddress: ShippingAddress = {\n uid: address.uid,\n firstname: address.firstname,\n lastname: address.lastname,\n company: address.company,\n street: address.street,\n city: address.city,\n postcode: address.postcode,\n country: {\n code: address.country.code,\n label: address.country.label,\n },\n telephone: address.telephone,\n };\n\n if (address.region) {\n shippingAddress.region = {\n code: address.region.code,\n label: address.region.label,\n regionId: address.region.region_id,\n };\n }\n\n return shippingAddress;\n }),\n canCheckout:\n ['UPDATED', 'DECLINED'].includes(quote.status) &&\n state.permissions.checkoutQuote &&\n quote.shipping_addresses?.length > 0 &&\n checkAllItemsHaveStock(quoteItems),\n canSendForReview:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canUpdateQuote:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canDelete:\n !isGeneratedFromTemplate &&\n !['PENDING', 'SUBMITTED', 'ORDERED'].includes(quote.status) &&\n state.permissions.deleteQuote,\n canClose: quote.status\n ? !isGeneratedFromTemplate &&\n !['DRAFT', 'CLOSED', 'ORDERED', 'OPEN'].includes(quote.status)\n : false,\n readOnly:\n isGeneratedFromTemplate ||\n (!isQuoteNew &&\n ['ORDERED', 'SUBMITTED', 'CLOSED', 'PENDING'].includes(quote.status)) ||\n !state.permissions.editQuote,\n };\n}\n\nexport function transformQuote(quoteData: any): NegotiableQuoteModel | null {\n if (!quoteData) {\n return null;\n }\n\n return transformSingleQuote(quoteData);\n}\n\n// quote is new if it has a status of SUBMITTED and there is no history entry that\n// has a change_type of UPDATED with a non-empty array of status changes\nfunction isNewQuote(quote: any): boolean {\n return (\n quote.status === 'SUBMITTED' &&\n !(quote.history ?? []).some(\n (history: any) =>\n history.change_type === 'UPDATED' &&\n (history.changes?.statuses?.changes ?? []).length > 0\n )\n );\n}\n\nfunction transformNegotiableQuoteListEntry(\n quote: any\n): NegotiableQuoteListEntry {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n prices: {\n grandTotal: {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n };\n}\n\nexport function transformNegotiableQuotesList(\n quotesData: any\n): NegotiableQuotesListModel | null {\n if (!quotesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n quotesData.items\n ?.filter((quote: any) => quote?.uid)\n .map(transformNegotiableQuoteListEntry) || [],\n pageInfo: {\n currentPage: quotesData.page_info.current_page,\n pageSize: quotesData.page_info.page_size,\n totalPages: quotesData.page_info.total_pages,\n },\n totalCount: quotesData.total_count,\n sortFields: quotesData.sort_fields\n ? {\n default: quotesData.sort_fields.default,\n options: quotesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n\nexport function transformPaginationInfo(\n quotesData: NegotiableQuotesListModel | null\n): PaginationInfo | null {\n if (!quotesData?.pageInfo || !quotesData.totalCount) {\n return null;\n }\n\n const { currentPage, pageSize, totalPages } = quotesData.pageInfo;\n const { totalCount } = quotesData;\n\n const startItem = totalCount > 0 ? (currentPage - 1) * pageSize + 1 : 0;\n const endItem = Math.min(currentPage * pageSize, totalCount);\n\n const pageSizeOptions = [20, 30, 50, 100, 200]; // Default page size options\n\n return {\n currentPage,\n totalCount,\n pageSize,\n startItem,\n endItem,\n totalPages,\n pageSizeOptions,\n };\n}\n\n// TODO: Check if admin has this configuration\nexport const getDefaultPageSizeOptions = () => [20, 30, 50, 100, 200];\n\nexport function calculateTotal(data: any[], currency: string) {\n if (!data?.length)\n return {\n value: 0,\n currency,\n };\n\n return data.reduce(\n (acc: any, item: any) => {\n return {\n value: acc.value + item.amount.value,\n currency: item.amount.currency,\n };\n },\n { value: 0, currency }\n );\n}\n\nexport function transformShippingPrices(quote: any) {\n if (!quote || !quote.shipping_addresses?.length) {\n return {};\n }\n\n const shippingAddress = quote.shipping_addresses[0];\n const selectedShippingMethod = shippingAddress.selected_shipping_method;\n\n if (!selectedShippingMethod) {\n return {};\n }\n\n return {\n shippingIncludingTax: selectedShippingMethod.price_incl_tax && {\n value: selectedShippingMethod.price_incl_tax.value,\n currency: selectedShippingMethod.price_incl_tax.currency,\n },\n shippingExcludingTax: selectedShippingMethod.price_excl_tax && {\n value: selectedShippingMethod.price_excl_tax.value,\n currency: selectedShippingMethod.price_excl_tax.currency,\n },\n };\n}\n"],"names":["NegotiableQuoteStatus","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformHistoryEntry","historyEntry","_a","_b","_c","_d","_e","_f","change","_g","transformHistory","historyEntries","findApplicablePriceTier","priceTiers","quantity","a","b","tier","getImage","item","config","state","getLinks","link","getDiscounted","isConfigurable","priceRange","applicableTier","getDiscountPercentage","percent_off","_h","getRegularPrice","getSavingsAmount","amount_off","currency","transformQuoteItem","discount","note","option","value","transformQuoteItems","items","EDITABLE_QUOTE_STATUSES","getTotalQuantity","quote","checkAllItemsHaveStock","transformSingleQuote","isQuoteNew","isNewQuote","isGeneratedFromTemplate","quoteItems","comment","baseComment","tax","calculateTotal","transformShippingPrices","address","shippingAddress","transformQuote","quoteData","history","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions","data","acc","selectedShippingMethod"],"mappings":"8FA0RO,IAAKA,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,S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AS,GAAC1C,EAAA0C,EAAM,qBAAN,MAAA1C,EAA0B,QACvC,MAAO,CAAA,EAIT,MAAM0E,EADkBhC,EAAM,mBAAmB,CAAC,EACH,yBAE/C,OAAKgC,EAIE,CACL,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,EAElD,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,CAClD,EAXO,CAAA,CAaX"}
@@ -1,10 +1,10 @@
1
1
  import { FunctionComponent, VNode } from 'preact';
2
2
  import { HTMLAttributes } from 'preact/compat';
3
- import { NegotiableQuoteCartItem } from '../../data/models/negotiable-quote-model';
3
+ import { CartItemModel } from '../../data/models/negotiable-quote-model';
4
4
 
5
5
  export interface LineItemNoteModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
6
6
  open: boolean;
7
- item: NegotiableQuoteCartItem;
7
+ item: CartItemModel;
8
8
  onClose?: () => void;
9
9
  onConfirm: (note: string, quantity: number) => void;
10
10
  isSubmitting?: boolean;
@@ -4,15 +4,18 @@ import { HTMLAttributes } from 'preact/compat';
4
4
  export interface ManageNegotiableQuoteTemplateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
5
  loading?: boolean;
6
6
  templateName: VNode;
7
- templateId: VNode;
7
+ templateStatus: VNode;
8
8
  banner?: VNode;
9
9
  details?: VNode;
10
10
  actionBar?: VNode;
11
11
  referenceDocuments?: VNode;
12
- referenceDocumentsTitle?: VNode;
13
12
  itemsTable: VNode;
13
+ shippingInformationTitle?: VNode;
14
+ shippingInformation?: VNode;
14
15
  commentsTitle: VNode;
15
16
  comments: VNode;
17
+ attachFilesField?: VNode;
18
+ attachedFilesList?: VNode;
16
19
  footer?: VNode;
17
20
  }
18
21
  export declare const ManageNegotiableQuoteTemplate: FunctionComponent<ManageNegotiableQuoteTemplateProps>;
@@ -1,59 +1,15 @@
1
1
  import { FunctionComponent } from 'preact';
2
2
  import { HTMLAttributes } from 'preact/compat';
3
+ import { CartItemModel } from '../../data/models/negotiable-quote-model';
3
4
 
4
- export interface ProductListTableItem {
5
- uid: string;
6
- product: {
7
- name: string;
8
- sku: string;
9
- };
10
- prices: {
11
- originalItemPrice: {
12
- value: number;
13
- currency: string;
14
- };
15
- rowTotal: {
16
- value: number;
17
- currency: string;
18
- };
19
- };
20
- quantity: number;
21
- catalogDiscount?: {
22
- amountOff: number;
23
- percentOff: number;
24
- };
25
- configurableOptions?: Array<{
26
- optionLabel: string;
27
- valueLabel: string;
28
- }>;
29
- bundleOptions?: Array<{
30
- label: string;
31
- values: Array<{
32
- label: string;
33
- quantity: number;
34
- originalPrice: {
35
- value: number;
36
- currency: string;
37
- };
38
- }>;
39
- }>;
40
- noteFromBuyer?: Array<{
41
- createdAt: string;
42
- creatorId: number;
43
- creatorType: number;
44
- negotiableQuoteItemUid: string;
45
- note: string;
46
- noteUid: string;
47
- }>;
48
- }
49
5
  export interface ProductListTableProps extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {
50
- items: ProductListTableItem[];
6
+ items: CartItemModel[];
51
7
  canEdit: boolean;
52
8
  readOnly?: boolean;
53
9
  showActions?: boolean;
54
- onItemCheckboxChange?: (item: ProductListTableItem, isSelected: boolean) => void;
55
- onItemDropdownChange?: (item: ProductListTableItem, action: string) => void;
56
- onQuantityChange?: (item: ProductListTableItem, newQuantity: number) => void;
10
+ onItemCheckboxChange?: (item: CartItemModel, isSelected: boolean) => void;
11
+ onItemDropdownChange?: (item: CartItemModel, action: string) => void;
12
+ onQuantityChange?: (item: CartItemModel, newQuantity: number) => void;
57
13
  onUpdate?: (e: SubmitEvent) => void;
58
14
  dropdownSelections?: Record<string, string | undefined>;
59
15
  }
@@ -0,0 +1,30 @@
1
+ import { FunctionComponent, HTMLAttributes } from 'preact/compat';
2
+ import { VNode } from 'preact';
3
+
4
+ export interface ReferenceDocument {
5
+ uid?: string;
6
+ name: string;
7
+ identifier?: string;
8
+ url: string;
9
+ }
10
+ export interface ReferenceDocumentFormModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
11
+ open: boolean;
12
+ document?: ReferenceDocument;
13
+ /**
14
+ * Optional error message string. If provided, automatically creates an InLineAlert error banner.
15
+ * If both errorMessage and errorBanner are provided, errorBanner takes precedence.
16
+ */
17
+ errorMessage?: string;
18
+ /**
19
+ * Optional custom error banner VNode. Provides full control over error banner rendering.
20
+ * If both errorMessage and errorBanner are provided, errorBanner takes precedence.
21
+ */
22
+ errorBanner?: VNode;
23
+ successBanner?: VNode;
24
+ showCloseButton?: boolean;
25
+ isSubmitting?: boolean;
26
+ onSave: (document: ReferenceDocument) => void;
27
+ onClose?: () => void;
28
+ }
29
+ export declare const ReferenceDocumentFormModal: FunctionComponent<ReferenceDocumentFormModalProps>;
30
+ //# sourceMappingURL=ReferenceDocumentFormModal.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ReferenceDocumentFormModal';
10
+ export { ReferenceDocumentFormModal as default } from './ReferenceDocumentFormModal';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface ReferenceDocument {
5
+ uid?: string;
6
+ name: string;
7
+ identifier?: string;
8
+ url: string;
9
+ }
10
+ export interface ReferenceDocumentsListProps extends HTMLAttributes<HTMLDivElement> {
11
+ documents: ReferenceDocument[];
12
+ isEditable?: boolean;
13
+ onAdd?: () => void;
14
+ onEdit?: (document: ReferenceDocument) => void;
15
+ onRemove?: (document: ReferenceDocument) => void;
16
+ }
17
+ export declare const ReferenceDocumentsList: FunctionComponent<ReferenceDocumentsListProps>;
18
+ //# sourceMappingURL=ReferenceDocumentsList.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './ReferenceDocumentsList';
10
+ export { ReferenceDocumentsList as default } from './ReferenceDocumentsList';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -27,4 +27,6 @@ export * from './ConfirmationModal';
27
27
  export * from './RenameQuoteModal';
28
28
  export * from './ManageNegotiableQuoteTemplate';
29
29
  export * from './LineItemNoteModal';
30
+ export * from './ReferenceDocumentFormModal';
31
+ export * from './ReferenceDocumentsList';
30
32
  //# sourceMappingURL=index.d.ts.map
@@ -1,22 +1,22 @@
1
1
  import { HTMLAttributes } from 'preact/compat';
2
2
  import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
3
- import { NegotiableQuoteModel, NegotiableQuoteCartItem } from '../../data/models/negotiable-quote-model';
3
+ import { NegotiableQuoteModel, CartItemModel } from '../../data/models/negotiable-quote-model';
4
4
 
5
5
  export interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {
6
6
  quoteData?: NegotiableQuoteModel;
7
- onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;
8
- onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;
7
+ onItemCheckboxChange?: (item: CartItemModel, isSelected: boolean) => void;
8
+ onItemDropdownChange?: (item: CartItemModel, action: string) => void;
9
9
  onUpdate?: (e: SubmitEvent) => void;
10
- onRemoveItemsRef?: (handler: (items: NegotiableQuoteCartItem[]) => void) => void;
10
+ onRemoveItemsRef?: (handler: (items: CartItemModel[]) => void) => void;
11
11
  onRemoveModalStateChange?: (isOpen: boolean) => void;
12
12
  slots?: {
13
13
  ProductListTable?: SlotProps<{
14
14
  items: NegotiableQuoteModel['items'];
15
15
  canEdit: boolean;
16
16
  readOnly?: boolean;
17
- onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;
18
- onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;
19
- onQuantityChange?: (item: NegotiableQuoteCartItem, newQuantity: number) => void;
17
+ onItemCheckboxChange?: (item: CartItemModel, isSelected: boolean) => void;
18
+ onItemDropdownChange?: (item: CartItemModel, action: string) => void;
19
+ onQuantityChange?: (item: CartItemModel, newQuantity: number) => void;
20
20
  onUpdate?: (e: SubmitEvent) => void;
21
21
  dropdownSelections?: Record<string, string | undefined>;
22
22
  }>;
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{I as q,I as v}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";/* empty css */import"../chunks/LineItemNoteModal2.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../chunks/dateUtils.js";import"@dropins/tools/i18n.js";import"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import"../chunks/state.js";import"../chunks/setLineItemNote.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/CheckWithCircle.js";import"../chunks/WarningFilled.js";export{q as ItemsQuoted,v as default};
3
+ import{I as q,I as v}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";/* empty css */import"../chunks/LineItemNoteModal.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../chunks/dateUtils.js";import"../chunks/WarningFilled.js";import"@dropins/tools/i18n.js";import"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import"../chunks/state.js";import"../chunks/setLineItemNote.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/CheckWithCircle.js";export{q as ItemsQuoted,v as default};
4
4
  //# sourceMappingURL=ItemsQuoted.js.map
@@ -1,6 +1,7 @@
1
1
  import { HTMLAttributes } from 'preact/compat';
2
2
  import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
3
3
  import { NegotiableQuoteTemplateModel } from '../../data/models/negotiable-quote-template-model';
4
+ import { CartItemModel } from '../../data/models/negotiable-quote-model';
4
5
 
5
6
  export interface ItemsQuotedTemplateProps extends HTMLAttributes<HTMLDivElement> {
6
7
  templateData?: NegotiableQuoteTemplateModel;
@@ -8,8 +9,11 @@ export interface ItemsQuotedTemplateProps extends HTMLAttributes<HTMLDivElement>
8
9
  ProductListTable?: SlotProps<{
9
10
  items: NegotiableQuoteTemplateModel['items'];
10
11
  canEdit: boolean;
12
+ dropdownSelections: Record<string, string | undefined>;
13
+ handleItemDropdownChange: (item: CartItemModel, action: string) => void;
14
+ handleQuantityChange: (item: CartItemModel, newQuantity: number) => void;
15
+ handleUpdate: (e: SubmitEvent) => void;
11
16
  onItemDropdownChange?: (item: any, action: string) => void;
12
- dropdownSelections?: Record<string, string>;
13
17
  }>;
14
18
  QuotePricesSummary?: SlotProps<{
15
19
  items: NegotiableQuoteTemplateModel['items'];
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{I as k,I as n}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";/* empty css */import"../chunks/LineItemNoteModal2.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../chunks/dateUtils.js";import"@dropins/tools/i18n.js";/* empty css *//* empty css */import"../chunks/state.js";import"../chunks/addQuoteTemplateLineItemNote.js";import"../chunks/transform-quote-template.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteTemplateFragment.js";import"../chunks/WarningFilled.js";export{k as ItemsQuotedTemplate,n as default};
3
+ import{I as q,I as v}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";/* empty css */import"../chunks/LineItemNoteModal.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import"../chunks/dateUtils.js";import"../chunks/WarningFilled.js";import"@dropins/tools/i18n.js";import"../chunks/ConfirmationModal.js";/* empty css *//* empty css */import"../chunks/state.js";import"../chunks/addQuoteTemplateLineItemNote.js";import"../chunks/transform-quote-template.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/NegotiableQuoteTemplateFragment.js";import"../chunks/CheckWithCircle.js";export{q as ItemsQuotedTemplate,v as default};
4
4
  //# sourceMappingURL=ItemsQuotedTemplate.js.map
@@ -30,6 +30,9 @@ export interface ManageNegotiableQuoteProps extends HTMLAttributes<HTMLDivElemen
30
30
  Banner?: SlotProps<{
31
31
  quoteData?: NegotiableQuoteModel;
32
32
  }>;
33
+ DuplicateQuoteWarningBanner?: SlotProps<{
34
+ outOfStockWarning?: boolean;
35
+ }>;
33
36
  Details?: SlotProps<{
34
37
  quoteData?: NegotiableQuoteModel;
35
38
  }>;