@dropins/storefront-quote-management 0.0.1-alpha26 → 0.0.1-alpha28
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.
- package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +1 -1
- package/api/initialize/initialize.d.ts +1 -0
- package/api.js +22 -226
- package/api.js.map +1 -1
- package/chunks/ItemsQuoted.js +1 -1
- package/chunks/ItemsQuoted.js.map +1 -1
- package/chunks/ItemsQuotedTemplate.js +4 -0
- package/chunks/ItemsQuotedTemplate.js.map +1 -0
- package/chunks/NegotiableQuoteTemplateFragment.js +190 -0
- package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -0
- package/chunks/OrderSummaryLine.js +1 -1
- package/chunks/OrderSummaryLine.js.map +1 -1
- package/chunks/QuoteCommentsList.js +1 -1
- package/chunks/QuoteCommentsList.js.map +1 -1
- package/chunks/QuoteCommentsList3.js +4 -0
- package/chunks/QuoteCommentsList3.js.map +1 -0
- package/chunks/QuoteHistoryLog.js +1 -1
- package/chunks/QuoteHistoryLog.js.map +1 -1
- package/chunks/QuoteHistoryLog3.js +4 -0
- package/chunks/QuoteHistoryLog3.js.map +1 -0
- package/chunks/QuotePricesSummary.js +4 -0
- package/chunks/QuotePricesSummary.js.map +1 -0
- package/chunks/QuoteTemplateCommentsList.js +4 -0
- package/chunks/QuoteTemplateCommentsList.js.map +1 -0
- package/chunks/QuoteTemplateHistoryLog.js +4 -0
- package/chunks/QuoteTemplateHistoryLog.js.map +1 -0
- package/chunks/TabbedContent.js +4 -0
- package/chunks/TabbedContent.js.map +1 -0
- package/chunks/dateUtils.js +1 -1
- package/chunks/dateUtils.js.map +1 -1
- package/chunks/getQuoteTemplates.js +2 -2
- package/chunks/getQuoteTemplates.js.map +1 -1
- package/chunks/negotiableQuotes.js +1 -1
- package/chunks/negotiableQuotes.js.map +1 -1
- package/chunks/removeNegotiableQuoteItems.js +3 -3
- package/chunks/removeNegotiableQuoteItems.js.map +1 -1
- package/chunks/renameNegotiableQuote.js +17 -9
- package/chunks/renameNegotiableQuote.js.map +1 -1
- package/chunks/sendQuoteTemplateForReview.js +15 -0
- package/chunks/sendQuoteTemplateForReview.js.map +1 -0
- package/chunks/state.js +1 -1
- package/chunks/state.js.map +1 -1
- package/chunks/transform-quote-template.js +4 -0
- package/chunks/transform-quote-template.js.map +1 -0
- package/chunks/transform-quote.js +4 -0
- package/chunks/transform-quote.js.map +1 -0
- package/chunks/uploadFile.js +1 -1
- package/chunks/uploadFile.js.map +1 -1
- package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +1 -1
- package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +22 -0
- package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +4 -0
- package/components/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/components/ProductListTable/ProductListTable.d.ts +41 -5
- package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +70 -2
- package/components/index.d.ts +1 -0
- package/containers/ItemsQuoted.js +1 -1
- package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +19 -0
- package/containers/ItemsQuotedTemplate/index.d.ts +11 -0
- package/containers/ItemsQuotedTemplate.d.ts +3 -0
- package/containers/ItemsQuotedTemplate.js +4 -0
- package/containers/ItemsQuotedTemplate.js.map +1 -0
- package/containers/ManageNegotiableQuote.js +1 -1
- package/containers/ManageNegotiableQuote.js.map +1 -1
- package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +63 -0
- package/containers/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/containers/ManageNegotiableQuoteTemplate.d.ts +3 -0
- package/containers/ManageNegotiableQuoteTemplate.js +4 -0
- package/containers/ManageNegotiableQuoteTemplate.js.map +1 -0
- package/containers/OrderSummary.js +1 -1
- package/containers/OrderSummary.js.map +1 -1
- package/containers/OrderSummaryLine.js +1 -1
- package/containers/QuoteCommentsList.js +1 -1
- package/containers/QuoteHistoryLog.js +1 -1
- package/containers/QuoteSummaryList.js +1 -1
- package/containers/QuoteSummaryList.js.map +1 -1
- package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -0
- package/containers/QuoteTemplateCommentsList/index.d.ts +11 -0
- package/containers/QuoteTemplateCommentsList.d.ts +3 -0
- package/containers/QuoteTemplateCommentsList.js +4 -0
- package/containers/QuoteTemplateCommentsList.js.map +1 -0
- package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -0
- package/containers/QuoteTemplateHistoryLog/index.d.ts +11 -0
- package/containers/QuoteTemplateHistoryLog.d.ts +3 -0
- package/containers/QuoteTemplateHistoryLog.js +4 -0
- package/containers/QuoteTemplateHistoryLog.js.map +1 -0
- package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +2 -0
- package/containers/QuoteTemplatesListTable.js +1 -1
- package/containers/QuoteTemplatesListTable.js.map +1 -1
- package/containers/QuotesListTable.js +1 -1
- package/containers/QuotesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/index.d.ts +4 -0
- package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +4 -0
- package/data/models/negotiable-quote-template-model.d.ts +3 -2
- package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +6 -0
- package/i18n/en_US.json.d.ts +48 -4
- package/package.json +1 -1
- package/render.js +2 -3
- package/render.js.map +1 -1
- package/types/state.types.d.ts +2 -0
- package/utils/dateUtils.d.ts +7 -2
- package/chunks/fetch-graphql.js +0 -4
- package/chunks/fetch-graphql.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemsQuoted.js","sources":["/@dropins/storefront-quote-management/src/components/ItemsQuoted/ItemsQuoted.tsx","/@dropins/storefront-quote-management/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-quote-management/src/components/QuotePricesSummary/QuotePricesSummary.tsx","/@dropins/storefront-quote-management/src/components/ConfirmationModal/ConfirmationModal.tsx","/@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 { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ItemsQuoted/ItemsQuoted.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n table?: VNode;\n pricesSummary?: VNode;\n}\n\nexport const ItemsQuoted: FunctionComponent<ItemsQuotedProps> = ({\n className,\n loading,\n table,\n pricesSummary,\n ...props\n}) => {\n if (loading) {\n return <ItemsQuotedSkeleton />;\n }\n\n return (\n <div className={classes(['quote-management-items-quoted', className])} {...props}>\n {table && (\n <VComponent\n node={table}\n className={classes(['quote-management-items-quoted__table'])}\n data-testid=\"quote-management-items-quoted__table\"\n />\n )}\n {pricesSummary && (\n <VComponent\n node={pricesSummary}\n className={classes(['quote-management-items-quoted__prices-summary'])}\n data-testid=\"quote-management-items-quoted__prices-summary\"\n />\n )}\n </div>\n );\n};\n\nexport const ItemsQuotedSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"items-quoted-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"medium\" lines={4} multilineGap='xsmall' />\n </Skeleton>\n );\n};","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState, useEffect } from 'preact/hooks';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Table,\n Checkbox,\n Picker,\n Price,\n Button,\n Input,\n} from '@adobe-commerce/elsie/components';\nimport '@/quote-management/components/ProductListTable/ProductListTable.css';\nimport { NegotiableQuoteCartItem } from '@/quote-management/data/models/negotiable-quote-model';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n items: NegotiableQuoteCartItem[];\n canEdit: boolean;\n readOnly?: boolean;\n onItemCheckboxChange?: (\n item: NegotiableQuoteCartItem,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: NegotiableQuoteCartItem,\n action: string\n ) => void;\n onQuantityChange?: (\n item: NegotiableQuoteCartItem,\n newQuantity: number\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string | undefined>;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n canEdit,\n readOnly = false,\n onItemCheckboxChange,\n onItemDropdownChange,\n onQuantityChange,\n onUpdate,\n dropdownSelections,\n ...props\n}) => {\n // Track original quantities to detect changes\n const [originalQuantities, setOriginalQuantities] = useState<\n Record<string, number>\n >({});\n const [currentQuantities, setCurrentQuantities] = useState<\n Record<string, number>\n >({});\n\n // Initialize quantities when items change\n useEffect(() => {\n const quantities: Record<string, number> = {};\n items.forEach((item) => {\n quantities[item.uid] = item.quantity;\n });\n setOriginalQuantities(quantities);\n setCurrentQuantities(quantities);\n }, [items]);\n\n // Check if any quantities have changed\n const hasQuantityChanges = Object.keys(currentQuantities).some(\n (uid) => currentQuantities[uid] !== originalQuantities[uid]\n );\n\n const dictionary = useText({\n updateButton: 'NegotiableQuote.Manage.productListTable.submitButton',\n productNameHeader:\n 'NegotiableQuote.Manage.productListTable.headers.productName',\n skuHeader: 'NegotiableQuote.Manage.productListTable.headers.sku',\n priceHeader: 'NegotiableQuote.Manage.productListTable.headers.price',\n quantityHeader: 'NegotiableQuote.Manage.productListTable.headers.quantity',\n discountHeader: 'NegotiableQuote.Manage.productListTable.headers.discount',\n subtotalHeader: 'NegotiableQuote.Manage.productListTable.headers.subtotal',\n actionsHeader: 'NegotiableQuote.Manage.productListTable.headers.actions',\n editNoteToSeller:\n 'NegotiableQuote.Manage.productListTable.actions.editNoteToSeller',\n remove: 'NegotiableQuote.Manage.productListTable.actions.remove',\n });\n\n const columns = [\n {\n label: dictionary.productNameHeader,\n key: 'productName',\n },\n {\n label: dictionary.skuHeader,\n key: 'sku',\n },\n {\n label: dictionary.priceHeader,\n key: 'price',\n },\n {\n label: dictionary.quantityHeader,\n key: 'quantity',\n },\n {\n label: dictionary.discountHeader,\n key: 'discount',\n },\n {\n label: dictionary.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit && !readOnly) {\n columns.unshift({\n label: '',\n key: 'checkbox',\n });\n columns.push({\n label: dictionary.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: Event,\n item: NegotiableQuoteCartItem\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n onItemCheckboxChange?.(item, isSelected);\n };\n\n const handleItemDropdownChange = (\n event: Event,\n item: NegotiableQuoteCartItem\n ) => {\n const action = (event.target as HTMLSelectElement).value;\n onItemDropdownChange?.(item, action);\n };\n\n const handleQuantityChange = (\n event: Event,\n item: NegotiableQuoteCartItem\n ) => {\n const newQuantity = parseInt((event.target as HTMLInputElement).value, 10);\n if (!isNaN(newQuantity) && newQuantity > 0) {\n setCurrentQuantities((prev) => ({\n ...prev,\n [item.uid]: newQuantity,\n }));\n onQuantityChange?.(item, newQuantity);\n }\n };\n\n const handleUpdate = (event: SubmitEvent) => {\n event.preventDefault();\n onUpdate?.(event);\n };\n\n const discountElement = (amountOff: number, percentOff: number) => {\n return amountOff > 0 ? (\n <div className=\"quote-management-product-list-table__discount-container\">\n <span className=\"quote-management-product-list-table__discount-percent\">\n {percentOff}%\n </span>\n <span className=\"quote-management-product-list-table__discount-price\">\n (<Price amount={amountOff} />)\n </span>\n </div>\n ) : undefined;\n };\n\n const getProductNameContent = (item: NegotiableQuoteCartItem) => {\n const configurableOptions = item.configurableOptions?.map((option) => (\n <div\n key={option.optionLabel}\n className=\"quote-management-product-list-table__configurable-option\"\n >\n <span className=\"quote-management-product-list-table__configurable-option-label\">\n {option.optionLabel}:\n </span>\n <span className=\"quote-management-product-list-table__configurable-option-value\">\n {option.valueLabel}\n </span>\n </div>\n ));\n\n const bundleOptions = item.bundleOptions?.map((option) => (\n <div\n key={option.label}\n className=\"quote-management-product-list-table__bundle-option\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-label\">\n {option.label}\n </span>\n <div className=\"quote-management-product-list-table__bundle-option-values\">\n {option.values.map((value) => (\n <span\n key={value.label}\n className=\"quote-management-product-list-table__bundle-option-value\"\n >\n <span className=\"quote-management-product-list-table__bundle-option-value-quantity\">\n {value.quantity} x\n </span>\n <span className=\"quote-management-product-list-table__bundle-option-value-label\">\n {value.label}\n </span>\n <Price\n className=\"quote-management-product-list-table__bundle-option-value-original-price\"\n amount={value.originalPrice.value}\n currency={value.originalPrice.currency}\n weight=\"normal\"\n />\n </span>\n ))}\n </div>\n </div>\n ));\n\n return (\n <div className=\"quote-management-product-list-table__product-name-container\">\n <span className=\"quote-management-product-list-table__product-name\">\n {item.product.name}\n </span>\n {configurableOptions}\n {bundleOptions}\n </div>\n );\n };\n\n const rowData = items.map((item) => {\n const quantityElement = canEdit ? (\n <Input\n className=\"quote-management-product-list-table__quantity-input\"\n type=\"number\"\n min=\"1\"\n value={\n currentQuantities[item.uid]?.toString() || item.quantity.toString()\n }\n onChange={(e) => handleQuantityChange(e, item)}\n disabled={readOnly || !canEdit}\n data-testid={`quantity-input-${item.product.sku}`}\n />\n ) : (\n <span className=\"quote-management-product-list-table__quantity\">\n {item.quantity}\n </span>\n );\n\n return {\n checkbox: (\n <Checkbox\n className=\"quote-management-product-list-table__checkbox\"\n name=\"itemSelected\"\n data-testid={`item-checkbox-${item.product.sku}`}\n onChange={(e) => handleItemCheckboxChange(e, item)}\n value={item.product.sku}\n />\n ),\n productName: getProductNameContent(item),\n sku: (\n <span className=\"quote-management-product-list-table__sku\">\n {item.product.sku}\n </span>\n ),\n price: (\n <Price\n className=\"quote-management-product-list-table__price\"\n amount={item.prices.originalItemPrice.value}\n currency={item.prices.originalItemPrice.currency}\n />\n ),\n quantity: quantityElement,\n discount: discountElement(\n item.catalogDiscount.amountOff,\n item.catalogDiscount.percentOff\n ),\n subtotal: (\n <Price\n className=\"quote-management-product-list-table__subtotal\"\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n />\n ),\n actions: (\n <Picker\n className=\"quote-management-product-list-table__actions\"\n data-testid={`item-dropdown-${item.product.sku}`}\n name={`item-dropdown-${item.product.sku}`}\n handleSelect={(e) => handleItemDropdownChange(e, item)}\n placeholder=\"Select\"\n value={dropdownSelections?.[item.uid] ?? ''}\n options={[\n { text: dictionary.editNoteToSeller, value: 'edit' },\n { text: dictionary.remove, value: 'remove' },\n ]}\n />\n ),\n };\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n />\n );\n\n // if can edit, the wrapper node should use the form element, else use the div element\n const wrapperNode = canEdit ? h('form', {}) : h('div', {});\n const wrapperProps = canEdit\n ? {\n onSubmit: handleUpdate,\n ...props,\n }\n : props;\n\n const submitButton = (\n <Button\n type=\"submit\"\n disabled={readOnly || !canEdit || !hasQuantityChanges}\n data-testid=\"product-list-table-submit-button\"\n >\n {dictionary.updateButton}\n </Button>\n );\n\n return (\n <VComponent\n node={wrapperNode}\n className={classes([\n 'quote-management-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...wrapperProps}\n >\n {table}\n <div className=\"quote-management-product-list-table-container__submit-container\">\n {submitButton}\n </div>\n </VComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/QuotePricesSummary/QuotePricesSummary.css';\nimport { Accordion, AccordionSection } from '@adobe-commerce/elsie/components';\n\ninterface Entry {\n label: string;\n id: string;\n value: VNode;\n strong?: boolean;\n children?: Entry[];\n}\n\nexport interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement> {\n entries?: Entry[];\n}\n\nexport const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps> = ({\n className,\n entries,\n ...props\n}) => {\n const createEntry = (entry: Entry) => {\n const children = entry.children?.map(createEntry);\n return (\n <div key={entry.id} className=\"quote-management-quote-prices-summary__entry\" data-testid={`quote-prices-summary-entry-${entry.id}`}>\n {children ? <Accordion\n className=\"quote-management-quote-prices-summary__accordion\"\n data-testid={`quote-prices-summary-entry-accordion-${entry.id}`}\n >\n <AccordionSection className=\"quote-management-quote-prices-summary__accordion-section\" title={entry.label} ariaLabelTitle={entry.label} secondaryText={entry.value}>\n {children}\n </AccordionSection>\n </Accordion>\n :\n <>\n <span className={classes(['quote-management-quote-prices-summary__label', ['quote-management-quote-prices-summary__label--strong', entry.strong]])} data-testid={`quote-prices-summary-entry-label-${entry.id}`}>{entry.label}</span>\n <span className=\"quote-management-quote-prices-summary__value\" data-testid={`quote-prices-summary-entry-value-${entry.id}`}>{entry.value}</span>\n </>\n }\n </div>\n );\n };\n\n return (\n <div className={classes(['quote-management-quote-prices-summary', className])} data-testid=\"quote-prices-summary\" {...props}>\n {entries?.map(createEntry)}\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Modal } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/ConfirmationModal/ConfirmationModal.css';\n\nexport interface ConfirmationModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open?: boolean;\n title?: VNode | string;\n message?: VNode | string;\n cancelLabel?: VNode | string;\n confirmLabel?: VNode | string;\n onCancel?: () => void;\n onConfirm?: () => void;\n onClose?: () => void;\n showCloseButton?: boolean;\n confirmationBanner?: VNode | null;\n}\n\nexport const ConfirmationModal: FunctionComponent<ConfirmationModalProps> = ({\n open = false,\n title,\n message,\n cancelLabel,\n confirmLabel,\n onCancel,\n onConfirm,\n onClose,\n showCloseButton,\n confirmationBanner,\n ...props\n}) => {\n const dictionary = useText({\n cancel: 'ConfirmationModal.cancel',\n confirm: 'ConfirmationModal.confirm',\n });\n\n if (!open) {\n return null;\n }\n\n const { className, ...restProps } = props;\n\n return (\n <Modal\n {...restProps}\n size={'medium'}\n onClose={onClose || onCancel}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n data-testid=\"confirmation-modal\"\n className={className}\n >\n <div className=\"confirmation-modal__content\">\n {confirmationBanner && (\n <div\n className=\"confirmation-modal__banner\"\n data-testid=\"confirmation-modal-banner\"\n >\n {confirmationBanner}\n </div>\n )}\n {title && (\n <div\n className=\"confirmation-modal__title\"\n data-testid=\"confirmation-modal-title\"\n >\n {title}\n </div>\n )}\n {message && (\n <div\n className=\"confirmation-modal__message\"\n data-testid=\"confirmation-modal-message\"\n >\n {message}\n </div>\n )}\n <div\n className=\"confirmation-modal__actions\"\n data-testid=\"confirmation-modal-actions\"\n >\n {onCancel && (\n <Button\n variant=\"secondary\"\n onClick={onCancel}\n data-testid=\"confirmation-modal-cancel\"\n >\n {cancelLabel ?? dictionary.cancel}\n </Button>\n )}\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n data-testid=\"confirmation-modal-confirm\"\n >\n {confirmLabel ?? dictionary.confirm}\n </Button>\n </div>\n </div>\n </Modal>\n );\n};\n","/********************************************************************\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 { ProductListTable } from '@/quote-management/components/ProductListTable/ProductListTable';\nimport {\n NegotiableQuoteModel,\n NegotiableQuoteCartItem,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { QuotePricesSummary } from '@/quote-management/components/QuotePricesSummary';\nimport { ItemsQuoted as ItemsQuotedComponent } from '@/quote-management/components/ItemsQuoted';\nimport { Price, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { CheckWithCircle, WarningFilled } from '@adobe-commerce/elsie/icons';\nimport { ConfirmationModal } from '@/quote-management/components/ConfirmationModal';\nimport { updateQuantities } from '@/quote-management/api/updateQuantities';\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: NegotiableQuoteCartItem,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: NegotiableQuoteCartItem,\n action: string\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n onRemoveItemsRef?: (\n handler: (items: NegotiableQuoteCartItem[]) => 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: NegotiableQuoteCartItem,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: NegotiableQuoteCartItem,\n action: string\n ) => void;\n onQuantityChange?: (\n item: NegotiableQuoteCartItem,\n newQuantity: number\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string>;\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 onUpdate,\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 [isModalOpen, setIsModalOpen] = useState(false);\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<NegotiableQuoteCartItem[]>(\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\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 setIsModalOpen(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: NegotiableQuoteCartItem[]) => {\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 handleItemDropdownChangeInternal = (\n item: NegotiableQuoteCartItem,\n action: string\n ) => {\n if (action === 'remove') {\n setDropdownSelections((prev) => ({\n ...prev,\n [item.uid]: action,\n }));\n handleRemoveItems([item]); // Use unified handler\n onItemDropdownChange?.(item, action);\n return;\n }\n\n onItemDropdownChange?.(item, action);\n\n setDropdownSelections((prev) => {\n if (!(item.uid in prev)) {\n return prev;\n }\n const next = { ...prev };\n delete next[item.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 if (!quoteData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const canEdit = Boolean(quoteData.canUpdateQuote);\n\n const handleQuantityChange = (\n item: NegotiableQuoteCartItem,\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 setIsModalOpen(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 setIsModalOpen(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 setIsModalOpen(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 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 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: handleItemDropdownChangeInternal,\n onQuantityChange: handleQuantityChange,\n onUpdate,\n dropdownSelections,\n }}\n >\n <ProductListTable\n items={quoteData.items}\n canEdit={canEdit}\n readOnly={quoteData.readOnly}\n onItemCheckboxChange={onItemCheckboxChange}\n onItemDropdownChange={handleItemDropdownChangeInternal}\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={isModalOpen}\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 </>\n );\n};\n"],"names":["ItemsQuoted","className","loading","table","pricesSummary","props","ItemsQuotedSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","ProductListTable","items","canEdit","readOnly","onItemCheckboxChange","onItemDropdownChange","onQuantityChange","onUpdate","dropdownSelections","originalQuantities","setOriginalQuantities","useState","currentQuantities","setCurrentQuantities","useEffect","quantities","item","hasQuantityChanges","uid","dictionary","useText","columns","handleItemCheckboxChange","event","isSelected","handleItemDropdownChange","action","handleQuantityChange","newQuantity","prev","handleUpdate","discountElement","amountOff","percentOff","Price","getProductNameContent","configurableOptions","_a","option","bundleOptions","_b","value","rowData","quantityElement","Input","e","Checkbox","Picker","Table","wrapperNode","h","wrapperProps","submitButton","Button","QuotePricesSummary","entries","createEntry","entry","children","Accordion","AccordionSection","Fragment","ConfirmationModal","open","title","message","cancelLabel","confirmLabel","onCancel","onConfirm","onClose","showCloseButton","confirmationBanner","restProps","Modal","NOTIFICATION_AUTO_DISMISS_DELAY","initialData","onRemoveItemsRef","onRemoveModalStateChange","slots","quoteData","setQuoteData","quantityChanges","setQuantityChanges","isModalOpen","setIsModalOpen","notificationState","setNotificationState","isRemoveModalOpen","setIsRemoveModalOpen","itemsToRemove","setItemsToRemove","isRemoving","setIsRemoving","removeNotificationState","setRemoveNotificationState","setDropdownSelections","quoteDataEvent","events","data","quantitiesUpdatedEvent","itemsRemovedEvent","handleRemoveItems","useCallback","handleDismissRemoveBanner","handleItemDropdownChangeInternal","next","handleConfirmRemove","uidsToRemove","removeNegotiableQuoteItems","err","errorMessage","failedItem","handleCancelRemove","cancelledItem","ItemsQuotedComponent","handleConfirmUpdate","quoteItemUid","quantity","updateQuantities","handleCancelUpdate","handleDismissBanner","quotePricesSummaryEntries","InLineA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,EAAwB,QACrC,UAAWU,EACX,cAAY,2BAAA,CAAA,EAEZ,KAEN,OACE9G,EAAAmE,GAAA,CACE,SAAA,CAAAjE,EAACuH,GAAA,CACC,cAAY,yBACX,GAAG3H,EACJ,QAAS,GACT,MACEI,EAACmI,GAAA,CACC,KAAK,mBACL,KAAMhD,GAAA,YAAAA,EAAO,iBACb,QAAS,CACP,MAAOC,EAAU,MACjB,QAAA9E,EACA,SAAU8E,EAAU,SACpB,qBAAA5E,EACA,qBAAsBqG,EACtB,iBAAkB9E,EAClB,SAAApB,EACA,mBAAAC,CAAA,EAGF,SAAAZ,EAACI,GAAA,CACC,MAAOgF,EAAU,MACjB,QAAA9E,EACA,SAAU8E,EAAU,SACpB,qBAAA5E,EACA,qBAAsBqG,EACtB,iBAAkB9E,EAClB,SAAUG,EACV,mBAAAtB,CAAA,CAAA,CACF,CAAA,EAGJ,cACEZ,EAACmI,GAAA,CACC,KAAK,qBACL,KAAMhD,GAAA,YAAAA,EAAO,mBACb,QAAS,CACP,MAAOC,EAAU,MACjB,OAAQA,EAAU,MAAA,EAGpB,SAAApF,EAAC0D,GAAA,CAAmB,QAASoE,CAAA,CAA2B,CAAA,CAAA,CAC1D,CAAA,EAKJ9H,EAACkE,GAAA,CACC,KAAMsB,EACN,MAAOjE,EAAW,WAClB,QAASA,EAAW,iBACpB,YAAaA,EAAW,kBACxB,aAAcA,EAAW,kBACzB,SAAUqG,GACV,UAAWJ,GACX,mBAAA5C,GACA,cAAY,yBAAA,CAAA,EAId5E,EAACkE,GAAA,CACC,KAAM0B,EACN,MAAOrE,EAAW,iBAClB,QAASA,EAAW,uBACpB,YAAaA,EAAW,wBACxB,aACEyE,EACIzE,EAAW,iCACXA,EAAW,yBAEjB,SAAU8F,EACV,UAAWN,EACX,mBAAoBmB,GACpB,cAAY,oBAAA,CAAA,CACd,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ItemsQuoted.js","sources":["/@dropins/storefront-quote-management/src/components/ConfirmationModal/ConfirmationModal.tsx","/@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 { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Modal } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/ConfirmationModal/ConfirmationModal.css';\n\nexport interface ConfirmationModalProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n open?: boolean;\n title?: VNode | string;\n message?: VNode | string;\n cancelLabel?: VNode | string;\n confirmLabel?: VNode | string;\n onCancel?: () => void;\n onConfirm?: () => void;\n onClose?: () => void;\n showCloseButton?: boolean;\n confirmationBanner?: VNode | null;\n}\n\nexport const ConfirmationModal: FunctionComponent<ConfirmationModalProps> = ({\n open = false,\n title,\n message,\n cancelLabel,\n confirmLabel,\n onCancel,\n onConfirm,\n onClose,\n showCloseButton,\n confirmationBanner,\n ...props\n}) => {\n const dictionary = useText({\n cancel: 'ConfirmationModal.cancel',\n confirm: 'ConfirmationModal.confirm',\n });\n\n if (!open) {\n return null;\n }\n\n const { className, ...restProps } = props;\n\n return (\n <Modal\n {...restProps}\n size={'medium'}\n onClose={onClose || onCancel}\n clickToDismiss={true}\n escapeToDismiss={true}\n showCloseButton={showCloseButton}\n data-testid=\"confirmation-modal\"\n className={className}\n >\n <div className=\"confirmation-modal__content\">\n {confirmationBanner && (\n <div\n className=\"confirmation-modal__banner\"\n data-testid=\"confirmation-modal-banner\"\n >\n {confirmationBanner}\n </div>\n )}\n {title && (\n <div\n className=\"confirmation-modal__title\"\n data-testid=\"confirmation-modal-title\"\n >\n {title}\n </div>\n )}\n {message && (\n <div\n className=\"confirmation-modal__message\"\n data-testid=\"confirmation-modal-message\"\n >\n {message}\n </div>\n )}\n <div\n className=\"confirmation-modal__actions\"\n data-testid=\"confirmation-modal-actions\"\n >\n {onCancel && (\n <Button\n variant=\"secondary\"\n onClick={onCancel}\n data-testid=\"confirmation-modal-cancel\"\n >\n {cancelLabel ?? dictionary.cancel}\n </Button>\n )}\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n data-testid=\"confirmation-modal-confirm\"\n >\n {confirmLabel ?? dictionary.confirm}\n </Button>\n </div>\n </div>\n </Modal>\n );\n};\n","/********************************************************************\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 { NegotiableQuoteModel, NegotiableQuoteCartItem } from '@/quote-management/data/models/negotiable-quote-model';\nimport { ProductListTable, ProductListTableItem, QuotePricesSummary, ItemsQuoted as ItemsQuotedComponent } from '@/quote-management/components';\nimport { CheckWithCircle, WarningFilled } from '@adobe-commerce/elsie/icons';\nimport { ConfirmationModal } from '@/quote-management/components/ConfirmationModal';\nimport { updateQuantities } from '@/quote-management/api/updateQuantities';\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: NegotiableQuoteCartItem,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: NegotiableQuoteCartItem,\n action: string\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n onRemoveItemsRef?: (\n handler: (items: NegotiableQuoteCartItem[]) => 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: NegotiableQuoteCartItem,\n isSelected: boolean\n ) => void;\n onItemDropdownChange?: (\n item: NegotiableQuoteCartItem,\n action: string\n ) => void;\n onQuantityChange?: (\n item: NegotiableQuoteCartItem,\n newQuantity: number\n ) => void;\n onUpdate?: (e: SubmitEvent) => void;\n dropdownSelections?: Record<string, string>;\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 onUpdate,\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 [isModalOpen, setIsModalOpen] = useState(false);\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<NegotiableQuoteCartItem[]>(\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\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 setIsModalOpen(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: NegotiableQuoteCartItem[]) => {\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: ProductListTableItem,\n action: string\n ) => {\n const cartItem = item as NegotiableQuoteCartItem;\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 return;\n }\n\n onItemDropdownChange?.(cartItem, action);\n\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 if (!quoteData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const canEdit = Boolean(quoteData.canUpdateQuote);\n\n const handleQuantityChange = (\n item: ProductListTableItem,\n newQuantity: number\n ) => {\n setQuantityChanges((prev) => ({\n ...prev,\n [(item as NegotiableQuoteCartItem).uid]: newQuantity,\n }));\n };\n\n const handleUpdate = (e: SubmitEvent) => {\n e.preventDefault();\n setNotificationState({ type: null, message: '' });\n setIsModalOpen(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 setIsModalOpen(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 setIsModalOpen(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 that converts ProductListTableItem back to NegotiableQuoteCartItem\n const handleItemCheckboxChange = onItemCheckboxChange\n ? (item: ProductListTableItem, isSelected: boolean) => {\n onItemCheckboxChange(item as NegotiableQuoteCartItem, 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 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,\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={isModalOpen}\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 </>\n );\n};\n"],"names":["ConfirmationModal","open","title","message","cancelLabel","confirmLabel","onCancel","onConfirm","onClose","showCloseButton","confirmationBanner","props","dictionary","useText","className","restProps","jsx","Modal","jsxs","Button","NOTIFICATION_AUTO_DISMISS_DELAY","ItemsQuoted","initialData","onItemCheckboxChange","onItemDropdownChange","onUpdate","onRemoveItemsRef","onRemoveModalStateChange","slots","quoteData","setQuoteData","useState","quantityChanges","setQuantityChanges","isModalOpen","setIsModalOpen","notificationState","setNotificationState","isRemoveModalOpen","setIsRemoveModalOpen","itemsToRemove","setItemsToRemove","isRemoving","setIsRemoving","removeNotificationState","setRemoveNotificationState","dropdownSelections","setDropdownSelections","useEffect","quoteDataEvent","events","data","quantitiesUpdatedEvent","itemsRemovedEvent","handleRemoveItems","useCallback","items","handleDismissRemoveBanner","handleItemDropdownChange","item","action","cartItem","prev","next","handleConfirmRemove","uidsToRemove","removeNegotiableQuoteItems","err","errorMessage","failedItem","handleCancelRemove","cancelledItem","ItemsQuotedComponent","canEdit","handleQuantityChange","newQuantity","handleUpdate","handleConfirmUpdate","quoteItemUid","quantity","updateQuantities","handleCancelUpdate","handleDismissBanner","quotePricesSummaryEntries","Price","InLineAlert","CheckWithCircle","WarningFilled","handleItemCheckboxChange","isSelected","removeConfirmationBanner","Fragment","Slot","ProductListTable","QuotePricesSummary"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AA4C,EACA,SAAU5C,EAAU,SACpB,qBAAAN,EACA,qBAAsBmC,EACtB,iBAAkBgB,EAClB,SAAAjD,EACA,mBAAAqB,CAAA,EAGF,SAAA9B,EAAC6E,GAAA,CACC,MAAOhE,EAAU,MACjB,QAAA4C,EACA,qBAAsBe,GACtB,SAAU3D,EAAU,SACpB,qBAAsB6B,EACtB,iBAAkBgB,EAClB,SAAUE,GACV,mBAAA9B,CAAA,CAAA,CACF,CAAA,EAGJ,cACE9B,EAAC4E,EAAA,CACC,KAAK,qBACL,KAAMhE,GAAA,YAAAA,EAAO,mBACb,QAAS,CACP,MAAOC,EAAU,MACjB,OAAQA,EAAU,MAAA,EAGpB,SAAAb,EAAC8E,GAAA,CAAmB,QAASX,CAAA,CAA2B,CAAA,CAAA,CAC1D,CAAA,EAKJnE,EAAChB,EAAA,CACC,KAAMkC,EACN,MAAOtB,EAAW,WAClB,QAASA,EAAW,iBACpB,YAAaA,EAAW,kBACxB,aAAcA,EAAW,kBACzB,SAAUqE,GACV,UAAWJ,GACX,mBAAAnE,GACA,cAAY,yBAAA,CAAA,EAIdM,EAAChB,EAAA,CACC,KAAMsC,EACN,MAAO1B,EAAW,iBAClB,QAASA,EAAW,uBACpB,YAAaA,EAAW,wBACxB,aACE8B,EACI9B,EAAW,iCACXA,EAAW,yBAEjB,SAAU0D,GACV,UAAWN,GACX,mBAAoB0B,GACpB,cAAY,oBAAA,CAAA,CACd,EACF,CAEJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as d,useEffect as g}from"@dropins/tools/preact-compat.js";import{Slot as u}from"@dropins/tools/lib.js";import{events as T}from"@dropins/tools/event-bus.js";import{Price as m}from"@dropins/tools/components.js";/* empty css */import{I as n,Q as b,P as x}from"./QuotePricesSummary.js";/* empty css *//* empty css *//* empty css */import{useText as f}from"@dropins/tools/i18n.js";const N=({templateData:c,slots:a,...l})=>{const[e,s]=d(c),i=f({subtotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes"});if(g(()=>{const o=T.on("quote-management/quote-template-data",p=>{s(p.quoteTemplate)},{eager:!0});return()=>o==null?void 0:o.off()},[]),!e)return t(n,{loading:!0});const r=[];return e.prices.subtotalExcludingTax&&r.push({label:i.subtotal,id:"subtotal",value:t(m,{amount:e.prices.subtotalExcludingTax.value,currency:e.prices.subtotalExcludingTax.currency,weight:"normal"})}),e.prices.grandTotal&&r.push({label:i.grandTotal,id:"total",value:t(m,{amount:e.prices.grandTotal.value,currency:e.prices.grandTotal.currency}),strong:!0}),t(n,{"data-testid":"items-quoted-template-container",...l,loading:!1,table:t(u,{name:"ProductListTable",slot:a==null?void 0:a.ProductListTable,context:{items:e.items,canEdit:!1},children:t(x,{items:e.items,canEdit:!1})}),pricesSummary:t(u,{name:"QuotePricesSummary",slot:a==null?void 0:a.QuotePricesSummary,context:{items:e.items,prices:e.prices},children:t(b,{entries:r})})})};export{N as I};
|
|
4
|
+
//# sourceMappingURL=ItemsQuotedTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemsQuotedTemplate.js","sources":["/@dropins/storefront-quote-management/src/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Price } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { QuotePricesSummary, ProductListTable, ItemsQuoted as ItemsQuotedComponent } from '@/quote-management/components';\n\nexport interface ItemsQuotedTemplateProps extends HTMLAttributes<HTMLDivElement> {\n templateData?: NegotiableQuoteTemplateModel;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n canEdit: boolean;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteTemplateModel['items'];\n prices: NegotiableQuoteTemplateModel['prices'];\n }>;\n }\n}\n\nexport const ItemsQuotedTemplate: Container<ItemsQuotedTemplateProps> = ({\n templateData: initialData,\n slots,\n ...props\n}) => {\n const [templateData, setTemplateData] = useState<NegotiableQuoteTemplateModel | undefined>(initialData);\n\n const dictionary = useText({\n subtotal: 'NegotiableQuoteTemplate.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal: 'NegotiableQuoteTemplate.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes: 'NegotiableQuoteTemplate.Manage.quotePricesSummary.appliedTaxes',\n });\n\n useEffect(() => {\n const templateDataEvent = events.on('quote-management/quote-template-data', (payload) => {\n setTemplateData(payload.quoteTemplate);\n }, { eager: true });\n\n return () => templateDataEvent?.off();\n }, []);\n\n if (!templateData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const quotePricesSummaryEntries = [];\n\n templateData.prices.subtotalExcludingTax && quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: <Price amount={templateData.prices.subtotalExcludingTax.value} currency={templateData.prices.subtotalExcludingTax.currency} weight='normal' />,\n });\n\n templateData.prices.grandTotal && quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: <Price amount={templateData.prices.grandTotal.value} currency={templateData.prices.grandTotal.currency} />,\n strong: true,\n })\n\n return (\n <ItemsQuotedComponent data-testid=\"items-quoted-template-container\" {...props} loading={false}\n table={\n <Slot name=\"ProductListTable\" slot={slots?.ProductListTable}\n context={{\n items: templateData.items,\n canEdit: false,\n }}>\n\n <ProductListTable items={templateData.items} canEdit={false} />\n </Slot>\n }\n pricesSummary={<Slot name=\"QuotePricesSummary\" slot={slots?.QuotePricesSummary} context={{\n items: templateData.items,\n prices: templateData.prices,\n }}>\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n );\n};\n"],"names":["ItemsQuotedTemplate","initialData","slots","props","templateData","setTemplateData","useState","dictionary","useText","useEffect","templateDataEvent","events","payload","jsx","ItemsQuotedComponent","quotePricesSummaryEntries","Price","Slot","ProductListTable","QuotePricesSummary"],"mappings":"whBA+BO,MAAMA,EAA2D,CAAC,CACvE,aAAcC,EACd,MAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAmDL,CAAW,EAEhGM,EAAaC,EAAQ,CACzB,SAAU,0EACV,WAAY,4EACZ,aAAc,gEAAA,CACf,EAUD,GARAC,EAAU,IAAM,CACd,MAAMC,EAAoBC,EAAO,GAAG,uCAAyCC,GAAY,CACvFP,EAAgBO,EAAQ,aAAa,CACvC,EAAG,CAAE,MAAO,GAAM,EAElB,MAAO,IAAMF,GAAA,YAAAA,EAAmB,KAClC,EAAG,CAAA,CAAE,EAED,CAACN,EACH,OAAOS,EAACC,EAAA,CAAqB,QAAS,EAAA,CAAM,EAG9C,MAAMC,EAA4B,CAAA,EAElC,OAAAX,EAAa,OAAO,sBAAwBW,EAA0B,KAAK,CACzE,MAAOR,EAAW,SAClB,GAAI,WACJ,MAAOM,EAACG,EAAA,CAAM,OAAQZ,EAAa,OAAO,qBAAqB,MAAO,SAAUA,EAAa,OAAO,qBAAqB,SAAU,OAAO,QAAA,CAAS,CAAA,CACpJ,EAEDA,EAAa,OAAO,YAAcW,EAA0B,KAAK,CAC/D,MAAOR,EAAW,WAClB,GAAI,QACJ,MAAOM,EAACG,EAAA,CAAM,OAAQZ,EAAa,OAAO,WAAW,MAAO,SAAUA,EAAa,OAAO,WAAW,QAAA,CAAU,EAC/G,OAAQ,EAAA,CACT,EAGCS,EAACC,EAAA,CAAqB,cAAY,kCAAmC,GAAGX,EAAO,QAAS,GACtF,MACEU,EAACI,EAAA,CAAK,KAAK,mBAAmB,KAAMf,GAAA,YAAAA,EAAO,iBACzC,QAAS,CACP,MAAOE,EAAa,MACpB,QAAS,EAAA,EAGX,WAACc,EAAA,CAAiB,MAAOd,EAAa,MAAO,QAAS,EAAA,CAAO,CAAA,CAAA,EAGjE,gBAAgBa,EAAA,CAAK,KAAK,qBAAqB,KAAMf,GAAA,YAAAA,EAAO,mBAAoB,QAAS,CACvF,MAAOE,EAAa,MACpB,OAAQA,EAAa,MAAA,EAErB,SAAAS,EAACM,EAAA,CAAmB,QAASJ,EAA2B,CAAA,CAC1D,CAAA,CAAA,CAIN"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const e=`
|
|
4
|
+
fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {
|
|
5
|
+
# uid
|
|
6
|
+
template_id
|
|
7
|
+
name
|
|
8
|
+
# created_at
|
|
9
|
+
# updated_at
|
|
10
|
+
status
|
|
11
|
+
# sales_rep_name
|
|
12
|
+
expiration_date
|
|
13
|
+
buyer {
|
|
14
|
+
firstname
|
|
15
|
+
lastname
|
|
16
|
+
}
|
|
17
|
+
comments {
|
|
18
|
+
uid
|
|
19
|
+
created_at
|
|
20
|
+
author {
|
|
21
|
+
firstname
|
|
22
|
+
lastname
|
|
23
|
+
}
|
|
24
|
+
text
|
|
25
|
+
attachments {
|
|
26
|
+
name
|
|
27
|
+
url
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
items {
|
|
31
|
+
uid
|
|
32
|
+
product {
|
|
33
|
+
name
|
|
34
|
+
sku
|
|
35
|
+
uid
|
|
36
|
+
stock_status
|
|
37
|
+
}
|
|
38
|
+
prices {
|
|
39
|
+
price {
|
|
40
|
+
currency
|
|
41
|
+
value
|
|
42
|
+
}
|
|
43
|
+
original_item_price {
|
|
44
|
+
currency
|
|
45
|
+
value
|
|
46
|
+
}
|
|
47
|
+
row_total {
|
|
48
|
+
currency
|
|
49
|
+
value
|
|
50
|
+
}
|
|
51
|
+
catalog_discount {
|
|
52
|
+
amount_off
|
|
53
|
+
percent_off
|
|
54
|
+
}
|
|
55
|
+
discounts {
|
|
56
|
+
label
|
|
57
|
+
value
|
|
58
|
+
amount {
|
|
59
|
+
currency
|
|
60
|
+
value
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
quantity
|
|
65
|
+
note_from_buyer {
|
|
66
|
+
created_at
|
|
67
|
+
creator_id
|
|
68
|
+
creator_type
|
|
69
|
+
# negotiable_quote_template_item_uid
|
|
70
|
+
note
|
|
71
|
+
note_uid
|
|
72
|
+
}
|
|
73
|
+
note_from_seller {
|
|
74
|
+
created_at
|
|
75
|
+
creator_id
|
|
76
|
+
creator_type
|
|
77
|
+
# negotiable_quote_template_item_uid
|
|
78
|
+
note
|
|
79
|
+
note_uid
|
|
80
|
+
}
|
|
81
|
+
... on ConfigurableCartItem {
|
|
82
|
+
configurable_options {
|
|
83
|
+
option_label
|
|
84
|
+
value_label
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
... on BundleCartItem {
|
|
88
|
+
bundle_options {
|
|
89
|
+
label
|
|
90
|
+
values {
|
|
91
|
+
label
|
|
92
|
+
quantity
|
|
93
|
+
original_price {
|
|
94
|
+
currency
|
|
95
|
+
value
|
|
96
|
+
}
|
|
97
|
+
priceV2 {
|
|
98
|
+
currency
|
|
99
|
+
value
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
history {
|
|
106
|
+
uid
|
|
107
|
+
created_at
|
|
108
|
+
author {
|
|
109
|
+
firstname
|
|
110
|
+
lastname
|
|
111
|
+
}
|
|
112
|
+
change_type
|
|
113
|
+
changes {
|
|
114
|
+
comment_added {
|
|
115
|
+
comment
|
|
116
|
+
}
|
|
117
|
+
custom_changes {
|
|
118
|
+
new_value
|
|
119
|
+
old_value
|
|
120
|
+
title
|
|
121
|
+
}
|
|
122
|
+
statuses {
|
|
123
|
+
changes {
|
|
124
|
+
new_status
|
|
125
|
+
old_status
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
expiration {
|
|
129
|
+
new_expiration
|
|
130
|
+
old_expiration
|
|
131
|
+
}
|
|
132
|
+
total {
|
|
133
|
+
new_price {
|
|
134
|
+
currency
|
|
135
|
+
value
|
|
136
|
+
}
|
|
137
|
+
old_price {
|
|
138
|
+
currency
|
|
139
|
+
value
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
prices {
|
|
145
|
+
subtotal_excluding_tax {
|
|
146
|
+
currency
|
|
147
|
+
value
|
|
148
|
+
}
|
|
149
|
+
subtotal_including_tax {
|
|
150
|
+
currency
|
|
151
|
+
value
|
|
152
|
+
}
|
|
153
|
+
subtotal_with_discount_excluding_tax {
|
|
154
|
+
currency
|
|
155
|
+
value
|
|
156
|
+
}
|
|
157
|
+
applied_taxes {
|
|
158
|
+
amount {
|
|
159
|
+
currency
|
|
160
|
+
value
|
|
161
|
+
}
|
|
162
|
+
label
|
|
163
|
+
}
|
|
164
|
+
grand_total {
|
|
165
|
+
currency
|
|
166
|
+
value
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
shipping_addresses {
|
|
170
|
+
uid
|
|
171
|
+
firstname
|
|
172
|
+
lastname
|
|
173
|
+
company
|
|
174
|
+
street
|
|
175
|
+
city
|
|
176
|
+
region {
|
|
177
|
+
code
|
|
178
|
+
label
|
|
179
|
+
region_id
|
|
180
|
+
}
|
|
181
|
+
postcode
|
|
182
|
+
country {
|
|
183
|
+
code
|
|
184
|
+
label
|
|
185
|
+
}
|
|
186
|
+
telephone
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`;export{e as N};
|
|
190
|
+
//# sourceMappingURL=NegotiableQuoteTemplateFragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NegotiableQuoteTemplateFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n # uid\n template_id\n name\n # created_at\n # updated_at\n status\n # sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n uid\n product {\n name\n sku\n uid\n stock_status\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n note_from_buyer {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n`;\n"],"names":["NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAmD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as i,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as
|
|
3
|
+
import{jsx as i,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as p,VComponent as _}from"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css *//* empty css */const g=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>i(y,{...a,label:o,price:e,classSuffixes:t,labelClassSuffix:r,testId:m,children:s}),y=({label:o,price:e,classSuffixes:t=[],labelClassSuffix:r,testId:m,children:s,...a})=>{const n="quote-order-summary__label",c="quote-order-summary__price";return u("div",{...a,...m?{"data-testid":m}:{},className:p(["quote-order-summary__entry",...t.map(d=>`quote-order-summary__${d}`)]),children:[i("span",{className:p([n,...r?[`${n}--${r}`]:[]]),children:o}),i(_,{node:e,className:p([c,...r?[`${c}--${r}`]:[]])}),s]})};export{g as O};
|
|
4
4
|
//# sourceMappingURL=OrderSummaryLine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderSummaryLine.js","sources":["/@dropins/storefront-quote-management/src/containers/OrderSummaryLine/OrderSummaryLine.tsx","/@dropins/storefront-quote-management/src/components/OrderSummaryLine/OrderSummaryLine.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { VNode } from 'preact';\nimport { OrderSummaryLine as OrderSummaryLineComponent } from '@/quote-management/components';\n\nexport interface OrderSummaryLineProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: Container<OrderSummaryLineProps> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n return (\n <OrderSummaryLineComponent\n {...props}\n label={label}\n price={price}\n classSuffixes={classSuffixes}\n labelClassSuffix={labelClassSuffix}\n testId={testId}\n >\n {children}\n </OrderSummaryLineComponent>\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 '@/quote-management/components/OrderSummaryLine/OrderSummaryLine.css';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nexport interface OrderSummaryLineComponentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: FunctionComponent<\n OrderSummaryLineComponentProps\n> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n const labelClass = 'quote-order-summary__label';\n const priceClass = 'quote-order-summary__price';\n return (\n <div\n {...props}\n {...(testId ? { 'data-testid': testId } : {})}\n className={classes([\n 'quote-order-summary__entry',\n ...classSuffixes.map(\n (classSuffix) => `quote-order-summary__${classSuffix}`\n ),\n ])}\n >\n <span\n className={classes([\n labelClass,\n ...(labelClassSuffix ? [`${labelClass}--${labelClassSuffix}`] : []),\n ])}\n >\n {label}\n </span>\n\n <VComponent\n node={price}\n className={classes([\n priceClass,\n ...(labelClassSuffix ? [`${priceClass}--${labelClassSuffix}`] : []),\n ])}\n />\n\n {children}\n </div>\n );\n};\n"],"names":["OrderSummaryLine","label","price","classSuffixes","labelClassSuffix","testId","children","props","jsx","OrderSummaryLineComponent","labelClass","priceClass","jsxs","classes","classSuffix","VComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrderSummaryLine.js","sources":["/@dropins/storefront-quote-management/src/containers/OrderSummaryLine/OrderSummaryLine.tsx","/@dropins/storefront-quote-management/src/components/OrderSummaryLine/OrderSummaryLine.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { VNode } from 'preact';\nimport { OrderSummaryLine as OrderSummaryLineComponent } from '@/quote-management/components';\n\nexport interface OrderSummaryLineProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: Container<OrderSummaryLineProps> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n return (\n <OrderSummaryLineComponent\n {...props}\n label={label}\n price={price}\n classSuffixes={classSuffixes}\n labelClassSuffix={labelClassSuffix}\n testId={testId}\n >\n {children}\n </OrderSummaryLineComponent>\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 '@/quote-management/components/OrderSummaryLine/OrderSummaryLine.css';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nexport interface OrderSummaryLineComponentProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {\n label: VNode | string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n classSuffixes?: Array<string>;\n labelClassSuffix?: string;\n testId?: string;\n children?: any;\n}\n\nexport const OrderSummaryLine: FunctionComponent<\n OrderSummaryLineComponentProps\n> = ({\n label,\n price,\n classSuffixes = [],\n labelClassSuffix,\n testId,\n children,\n ...props\n}) => {\n const labelClass = 'quote-order-summary__label';\n const priceClass = 'quote-order-summary__price';\n return (\n <div\n {...props}\n {...(testId ? { 'data-testid': testId } : {})}\n className={classes([\n 'quote-order-summary__entry',\n ...classSuffixes.map(\n (classSuffix) => `quote-order-summary__${classSuffix}`\n ),\n ])}\n >\n <span\n className={classes([\n labelClass,\n ...(labelClassSuffix ? [`${labelClass}--${labelClassSuffix}`] : []),\n ])}\n >\n {label}\n </span>\n\n <VComponent\n node={price}\n className={classes([\n priceClass,\n ...(labelClassSuffix ? [`${priceClass}--${labelClassSuffix}`] : []),\n ])}\n />\n\n {children}\n </div>\n );\n};\n"],"names":["OrderSummaryLine","label","price","classSuffixes","labelClassSuffix","testId","children","props","jsx","OrderSummaryLineComponent","labelClass","priceClass","jsxs","classes","classSuffix","VComponent"],"mappings":"2aAwBO,MAAMA,EAAqD,CAAC,CACjE,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAEIC,EAACC,EAAA,CACE,GAAGF,EACJ,MAAAN,EACA,MAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,OAAAC,EAEC,SAAAC,CAAA,CAAA,ECnBMN,EAET,CAAC,CACH,MAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAA,EAChB,iBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMG,EAAa,6BACbC,EAAa,6BACnB,OACEC,EAAC,MAAA,CACE,GAAGL,EACH,GAAIF,EAAS,CAAE,cAAeA,CAAA,EAAW,CAAA,EAC1C,UAAWQ,EAAQ,CACjB,6BACA,GAAGV,EAAc,IACdW,GAAgB,wBAAwBA,CAAW,EAAA,CACtD,CACD,EAED,SAAA,CAAAN,EAAC,OAAA,CACC,UAAWK,EAAQ,CACjBH,EACA,GAAIN,EAAmB,CAAC,GAAGM,CAAU,KAAKN,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,EAEA,SAAAH,CAAA,CAAA,EAGHO,EAACO,EAAA,CACC,KAAMb,EACN,UAAWW,EAAQ,CACjBF,EACA,GAAIP,EAAmB,CAAC,GAAGO,CAAU,KAAKP,CAAgB,EAAE,EAAI,CAAA,CAAC,CAClE,CAAA,CAAA,EAGFE,CAAA,CAAA,CAAA,CAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as
|
|
3
|
+
import{jsx as e,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as i,VComponent as m}from"@dropins/tools/lib.js";/* empty css */import{useText as d}from"@dropins/tools/i18n.js";const g=({className:o,comments:a,...s})=>{const n=d({emptyState:"NegotiableQuote.Manage.quoteComments.emptyState",by:"NegotiableQuote.Manage.quoteComments.by"});return!a||a.length===0?e("ul",{...s,className:i(["quote-management-quote-comments-list","quote-management-quote-comments-list--empty",o]),"data-testid":"quote-comments-list",children:e("li",{className:"quote-management-quote-comments-list__empty-state","data-testid":"quote-comments-empty-state",children:n.emptyState})}):e("ul",{...s,className:i(["quote-management-quote-comments-list",o]),"data-testid":"quote-comments-list",children:a.map(t=>u("li",{className:"quote-management-quote-comments-list__item","data-testid":`quote-comment-${t.uid}`,children:[u("div",{className:"quote-management-quote-comments-list__header",children:[e(m,{className:"quote-management-quote-comments-list__date",node:t.createdAt,"data-testid":`quote-comment-date-${t.uid}`}),e("span",{className:"quote-management-quote-comments-list__by",children:n.by}),e(m,{className:"quote-management-quote-comments-list__author",node:t.author,"data-testid":`quote-comment-author-${t.uid}`})]}),e(m,{className:"quote-management-quote-comments-list__text",node:t.text,"data-testid":`quote-comment-text-${t.uid}`})]},t.uid))})};export{g as Q};
|
|
4
4
|
//# sourceMappingURL=QuoteCommentsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuoteCommentsList.js","sources":["/@dropins/storefront-quote-management/src/components/QuoteCommentsList/QuoteCommentsList.tsx"
|
|
1
|
+
{"version":3,"file":"QuoteCommentsList.js","sources":["/@dropins/storefront-quote-management/src/components/QuoteCommentsList/QuoteCommentsList.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/QuoteCommentsList/QuoteCommentsList.css';\n\nexport interface QuoteCommentsListProps\n extends HTMLAttributes<HTMLUListElement> {\n comments: Array<{\n uid: string;\n createdAt: VNode;\n author: VNode;\n text: VNode;\n }>;\n}\n\nexport const QuoteCommentsList: FunctionComponent<QuoteCommentsListProps> = ({\n className,\n comments,\n ...props\n}) => {\n const dictionary = useText({\n emptyState: 'NegotiableQuote.Manage.quoteComments.emptyState',\n by: 'NegotiableQuote.Manage.quoteComments.by',\n });\n\n if (!comments || comments.length === 0) {\n return (\n <ul\n {...props}\n className={classes([\n 'quote-management-quote-comments-list',\n 'quote-management-quote-comments-list--empty',\n className,\n ])}\n data-testid=\"quote-comments-list\"\n >\n <li\n className=\"quote-management-quote-comments-list__empty-state\"\n data-testid=\"quote-comments-empty-state\"\n >\n {dictionary.emptyState}\n </li>\n </ul>\n );\n }\n\n return (\n <ul\n {...props}\n className={classes(['quote-management-quote-comments-list', className])}\n data-testid=\"quote-comments-list\"\n >\n {comments.map((comment) => (\n <li\n key={comment.uid}\n className=\"quote-management-quote-comments-list__item\"\n data-testid={`quote-comment-${comment.uid}`}\n >\n <div className=\"quote-management-quote-comments-list__header\">\n <VComponent\n className=\"quote-management-quote-comments-list__date\"\n node={comment.createdAt}\n data-testid={`quote-comment-date-${comment.uid}`}\n />\n <span className=\"quote-management-quote-comments-list__by\">\n {dictionary.by}\n </span>\n <VComponent\n className=\"quote-management-quote-comments-list__author\"\n node={comment.author}\n data-testid={`quote-comment-author-${comment.uid}`}\n />\n </div>\n <VComponent\n className=\"quote-management-quote-comments-list__text\"\n node={comment.text}\n data-testid={`quote-comment-text-${comment.uid}`}\n />\n </li>\n ))}\n </ul>\n );\n};\n"],"names":["QuoteCommentsList","className","comments","props","dictionary","useText","jsx","classes","comment","jsxs","VComponent"],"mappings":"sNAyBO,MAAMA,EAA+D,CAAC,CAC3E,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,WAAY,kDACZ,GAAI,yCAAA,CACL,EAED,MAAI,CAACH,GAAYA,EAAS,SAAW,EAEjCI,EAAC,KAAA,CACE,GAAGH,EACJ,UAAWI,EAAQ,CACjB,uCACA,8CACAN,CAAA,CACD,EACD,cAAY,sBAEZ,SAAAK,EAAC,KAAA,CACC,UAAU,oDACV,cAAY,6BAEX,SAAAF,EAAW,UAAA,CAAA,CACd,CAAA,EAMJE,EAAC,KAAA,CACE,GAAGH,EACJ,UAAWI,EAAQ,CAAC,uCAAwCN,CAAS,CAAC,EACtE,cAAY,sBAEX,SAAAC,EAAS,IAAKM,GACbC,EAAC,KAAA,CAEC,UAAU,6CACV,cAAa,iBAAiBD,EAAQ,GAAG,GAEzC,SAAA,CAAAC,EAAC,MAAA,CAAI,UAAU,+CACb,SAAA,CAAAH,EAACI,EAAA,CACC,UAAU,6CACV,KAAMF,EAAQ,UACd,cAAa,sBAAsBA,EAAQ,GAAG,EAAA,CAAA,EAEhDF,EAAC,OAAA,CAAK,UAAU,2CACb,WAAW,GACd,EACAA,EAACI,EAAA,CACC,UAAU,+CACV,KAAMF,EAAQ,OACd,cAAa,wBAAwBA,EAAQ,GAAG,EAAA,CAAA,CAClD,EACF,EACAF,EAACI,EAAA,CACC,UAAU,6CACV,KAAMF,EAAQ,KACd,cAAa,sBAAsBA,EAAQ,GAAG,EAAA,CAAA,CAChD,CAAA,EAvBKA,EAAQ,GAAA,CAyBhB,CAAA,CAAA,CAGP"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as o,jsxs as i}from"@dropins/tools/preact-jsx-runtime.js";import{useState as f,useEffect as d}from"@dropins/tools/preact-compat.js";import{Q as c}from"./QuoteCommentsList.js";import{events as p}from"@dropins/tools/event-bus.js";import{f as l}from"./dateUtils.js";const C=({quoteData:s,...a})=>{var r;const[e,n]=f(s);if(d(()=>{const t=p.on("quote-management/quote-data",u=>{n(u.quote)},{eager:!0});return()=>t==null?void 0:t.off()},[]),!e)return null;const m=(r=e==null?void 0:e.comments)==null?void 0:r.map(t=>({uid:t.uid,createdAt:o("span",{children:l(t.createdAt,"long")}),author:i("span",{children:[t.author.firstname," ",t.author.lastname]}),text:o("p",{children:t.text})}));return o(c,{"data-testid":"quote-comments-list-container",...a,comments:m||[]})};export{C as Q};
|
|
4
|
+
//# sourceMappingURL=QuoteCommentsList3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuoteCommentsList3.js","sources":["/@dropins/storefront-quote-management/src/containers/QuoteCommentsList/QuoteCommentsList.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { QuoteCommentsList as QuoteCommentsListComponent } from '@/quote-management/components/QuoteCommentsList';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\n\nexport interface QuoteCommentsListProps\n extends HTMLAttributes<HTMLUListElement> {\n quoteData?: NegotiableQuoteModel;\n}\n\nexport const QuoteCommentsList: Container<QuoteCommentsListProps> = ({\n quoteData: initialData,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n initialData\n );\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n if (!quoteData) {\n return null;\n }\n\n // Format comments data\n const formattedComments = quoteData?.comments?.map((comment) => ({\n uid: comment.uid,\n createdAt: <span>{formattedDate(comment.createdAt, 'long')}</span>,\n author: (\n <span>\n {comment.author.firstname} {comment.author.lastname}\n </span>\n ),\n text: <p>{comment.text}</p>,\n }));\n\n return (\n <QuoteCommentsListComponent\n data-testid=\"quote-comments-list-container\"\n {...props}\n comments={formattedComments || []}\n />\n );\n};\n"],"names":["QuoteCommentsList","initialData","props","quoteData","setQuoteData","useState","useEffect","quoteDataEvent","events","data","formattedComments","_a","comment","jsx","QuoteCommentsListComponent"],"mappings":"kRAqBO,MAAMA,EAAuD,CAAC,CACnE,UAAWC,EACX,GAAGC,CACL,IAAM,OACJ,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAChCJ,CAAA,EAgBF,GAbAK,EAAU,IAAM,CACd,MAAMC,EAAiBC,EAAO,GAC5B,8BACCC,GAA0C,CACzCL,EAAaK,EAAK,KAAK,CACzB,EACA,CACE,MAAO,EAAA,CACT,EAEF,MAAO,IAAMF,GAAA,YAAAA,EAAgB,KAC/B,EAAG,CAAA,CAAE,EAED,CAACJ,EACH,OAAO,KAIT,MAAMO,GAAoBC,EAAAR,GAAA,YAAAA,EAAW,WAAX,YAAAQ,EAAqB,IAAKC,IAAa,CAC/D,IAAKA,EAAQ,IACb,UAAWC,EAAC,OAAA,CAAM,WAAcD,EAAQ,UAAW,MAAM,EAAE,EAC3D,SACG,OAAA,CACE,SAAA,CAAAA,EAAQ,OAAO,UAAU,IAAEA,EAAQ,OAAO,QAAA,EAC7C,EAEF,KAAMC,EAAC,IAAA,CAAG,SAAAD,EAAQ,IAAA,CAAK,CAAA,IAGzB,OACEC,EAACC,EAAA,CACC,cAAY,gCACX,GAAGZ,EACJ,SAAUQ,GAAqB,CAAA,CAAC,CAAA,CAGtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as d,jsx as
|
|
3
|
+
import{jsxs as d,jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as R}from"@dropins/tools/lib.js";import{f as c}from"./dateUtils.js";/* empty css */import{useText as $}from"@dropins/tools/i18n.js";const H=({className:g,children:q,history:x,items:y,buyer:n,salesRepName:D,...F})=>{const t=$({quoteCreated:"historyLog.changeTypes.created",quoteUpdated:"historyLog.changeTypes.updated",statusChanged:"historyLog.changeTypes.statusChanged",commentAdded:"historyLog.changeTypes.commentAdded",expirationChanged:"historyLog.changeTypes.expirationChanged",buyerNoteAdded:"historyLog.noteTypes.buyerNoteAdded",sellerNoteAdded:"historyLog.noteTypes.sellerNoteAdded",buyerLabel:"historyLog.authorLabels.buyer",sellerLabel:"historyLog.authorLabels.seller",commentDetail:"historyLog.changeDetails.comment",statusChangedFromTo:"historyLog.changeDetails.statusChangedFromTo",statusSetTo:"historyLog.changeDetails.statusSetTo",expirationChangedFromTo:"historyLog.changeDetails.expirationChangedFromTo",expirationSetTo:"historyLog.changeDetails.expirationSetTo",totalChangedFromTo:"historyLog.changeDetails.totalChangedFromTo",customChange:"historyLog.changeDetails.customChange",productsRemovedFromCatalog:"historyLog.changeDetails.productsRemovedFromCatalog",productsRemovedFromQuote:"historyLog.changeDetails.productsRemovedFromQuote",noDetailsAvailable:"historyLog.changeDetails.noDetailsAvailable",emptyState:"historyLog.emptyState",never:"dateUtils.never"}),w=e=>{switch(e){case"CREATED":return t.quoteCreated;case"UPDATED":return t.quoteUpdated;case"STATUS_CHANGED":return t.statusChanged;case"COMMENT_ADDED":return t.commentAdded;case"EXPIRATION_CHANGED":return t.expirationChanged;default:return e.replace(/_/g," ").toLowerCase().replace(/\b\w/g,o=>o.toUpperCase())}},E=e=>{var a,m,p,u,i,v,T,C,L,N,_,f;const o=[];if((a=e==null?void 0:e.commentAdded)!=null&&a.comment&&o.push(t.commentDetail.replace("{comment}",e.commentAdded.comment)),(m=e==null?void 0:e.statuses)!=null&&m.changes&&e.statuses.changes.forEach(r=>{r.oldStatus&&r.newStatus?o.push(t.statusChangedFromTo.replace("{oldStatus}",r.oldStatus).replace("{newStatus}",r.newStatus)):r.newStatus&&o.push(t.statusSetTo.replace("{newStatus}",r.newStatus))}),(p=e==null?void 0:e.expiration)!=null&&p.newExpiration&&((u=e==null?void 0:e.expiration)!=null&&u.oldExpiration)){const r=c(e.expiration.newExpiration),l=c(e.expiration.oldExpiration);o.push(t.expirationChangedFromTo.replace("{oldExpiration}",l).replace("{newExpiration}",r))}else if((i=e==null?void 0:e.expiration)!=null&&i.newExpiration){const r=c(e.expiration.newExpiration);o.push(t.expirationSetTo.replace("{newExpiration}",r))}if((v=e==null?void 0:e.total)!=null&&v.newPrice&&((T=e==null?void 0:e.total)!=null&&T.oldPrice)){const r=`${e.total.newPrice.currency} ${e.total.newPrice.value}`,l=`${e.total.oldPrice.currency} ${e.total.oldPrice.value}`;o.push(t.totalChangedFromTo.replace("{oldTotal}",l).replace("{newTotal}",r))}if((C=e==null?void 0:e.customChanges)!=null&&C.title&&((L=e==null?void 0:e.customChanges)!=null&&L.old_value)&&((N=e==null?void 0:e.customChanges)!=null&&N.new_value)&&o.push(t.customChange.replace("{title}",e.customChanges.title).replace("{oldValue}",e.customChanges.old_value).replace("{newValue}",e.customChanges.new_value)),(_=e==null?void 0:e.productsRemoved)!=null&&_.productsRemovedFromCatalog&&e.productsRemoved.productsRemovedFromCatalog.length>0&&o.push(t.productsRemovedFromCatalog.replace("{products}",e.productsRemoved.productsRemovedFromCatalog.join(", "))),(f=e==null?void 0:e.productsRemoved)!=null&&f.productsRemovedFromQuote&&e.productsRemoved.productsRemovedFromQuote.length>0){const r=e.productsRemoved.productsRemovedFromQuote.map(l=>l.name||l.sku||l.uid).join(", ");o.push(t.productsRemovedFromQuote.replace("{products}",r))}return o.length>0?o:[t.noDetailsAvailable]},S=(()=>{const e=[],o=(a,m,p,u)=>{a&&Array.isArray(a)&&a.forEach(i=>{i&&i.note&&i.note.trim()&&e.push({...i,type:m,productName:u.product.name,productSku:u.product.sku,authorName:p})})};return y&&y.forEach(a=>{o(a.noteFromBuyer,"buyer",`${n.firstname} ${n.lastname} ${t.buyerLabel}`,a),o(a.noteFromSeller,"seller",`${D} ${t.sellerLabel}`,a)}),e})(),A=(x||[]).map(e=>({...e,entryType:"history"})),b=S.map(e=>({...e,entryType:"note"})),h=[...A,...b];return d("div",{...F,className:R(["quote-management-quote-history-log",g]),children:[h.length>0?s("div",{className:"quote-management-quote-history-log__entries",children:h.map((e,o)=>d("div",{className:"quote-management-quote-history-log__entry",children:[d("div",{className:"quote-management-quote-history-log__entry-header",children:[d("div",{className:"quote-management-quote-history-log__entry-meta",children:[s("span",{className:"quote-management-quote-history-log__entry-date",children:c(e.createdAt,"long")}),s("span",{className:"quote-management-quote-history-log__entry-author",children:e.entryType==="history"?`by ${e.author.firstname} ${e.author.lastname} ${e.author.firstname===n.firstname&&e.author.lastname===n.lastname?t.buyerLabel:t.sellerLabel}`:`by ${e.authorName}`})]}),s("div",{className:"quote-management-quote-history-log__entry-type",children:e.entryType==="history"?w(e.changeType):e.type==="buyer"?t.buyerNoteAdded:t.sellerNoteAdded})]}),s("div",{className:"quote-management-quote-history-log__entry-changes",children:e.entryType==="history"?E(e.changes).map((a,m)=>s("div",{className:"quote-management-quote-history-log__entry-change",children:a},m)):d("div",{className:"quote-management-quote-history-log__entry-change",children:[d("div",{children:[e.productName,"(",e.productSku,")"]}),d("div",{children:['"',e.note,'"']})]})})]},e.entryType==="history"?e.uid:`${e.noteUid}-${o}`))}):s("div",{className:"quote-management-quote-history-log__empty",children:t.emptyState}),q]})};export{H as Q};
|
|
4
4
|
//# sourceMappingURL=QuoteHistoryLog.js.map
|