@dropins/storefront-quote-management 0.0.1-alpha21 → 0.0.1-alpha23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
  2. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +10 -0
  3. package/api/{getCustomerData → getStoreConfig}/index.d.ts +1 -1
  4. package/api/index.d.ts +1 -1
  5. package/api.js +29 -40
  6. package/api.js.map +1 -1
  7. package/chunks/ChevronDown.js +4 -0
  8. package/chunks/ChevronDown.js.map +1 -0
  9. package/chunks/NegotiableQuoteFragment.js +129 -0
  10. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  11. package/chunks/QuoteHistoryLog.js +1 -1
  12. package/chunks/QuoteHistoryLog.js.map +1 -1
  13. package/chunks/dateUtils.js +4 -0
  14. package/chunks/dateUtils.js.map +1 -0
  15. package/chunks/fetch-graphql.js +1 -1
  16. package/chunks/fetch-graphql.js.map +1 -1
  17. package/chunks/getQuoteTemplates.js +1 -1
  18. package/chunks/negotiableQuotes.js +1 -1
  19. package/chunks/renameNegotiableQuote.js +1 -1
  20. package/chunks/state.js +1 -1
  21. package/chunks/state.js.map +1 -1
  22. package/chunks/updateQuantities.js +2 -2
  23. package/chunks/uploadFile.js +3 -3
  24. package/containers/ManageNegotiableQuote.js +1 -1
  25. package/containers/ManageNegotiableQuote.js.map +1 -1
  26. package/containers/OrderSummary.js +1 -1
  27. package/containers/OrderSummary.js.map +1 -1
  28. package/containers/QuoteHistoryLog.js +1 -1
  29. package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +51 -0
  30. package/{data/transforms/__fixtures__/customerData.d.ts → containers/QuoteSummaryList/index.d.ts} +3 -2
  31. package/containers/QuoteSummaryList.d.ts +3 -0
  32. package/containers/QuoteSummaryList.js +4 -0
  33. package/containers/QuoteSummaryList.js.map +1 -0
  34. package/containers/QuoteTemplatesListTable.js +1 -1
  35. package/containers/QuoteTemplatesListTable.js.map +1 -1
  36. package/containers/RequestNegotiableQuoteForm.js +1 -1
  37. package/containers/index.d.ts +1 -0
  38. package/data/models/__fixtures__/negotiableQuoteModel.d.ts +1 -0
  39. package/data/models/__fixtures__/storeConfigModel.d.ts +5 -0
  40. package/data/models/index.d.ts +0 -1
  41. package/data/models/negotiable-quote-model.d.ts +33 -5
  42. package/data/models/store-config-model.d.ts +5 -2
  43. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +216 -0
  44. package/data/transforms/__fixtures__/storeConfigData.d.ts +31 -0
  45. package/data/transforms/index.d.ts +1 -1
  46. package/data/transforms/transform-store-config.d.ts +4 -0
  47. package/hooks/useQuoteSummaryData.d.ts +10 -0
  48. package/i18n/en_US.json.d.ts +12 -0
  49. package/lib/configurationTransformers.d.ts +27 -0
  50. package/lib/itemFormatters.d.ts +47 -0
  51. package/lib/priceCalculators.d.ts +41 -0
  52. package/lib/state.d.ts +3 -0
  53. package/package.json +1 -1
  54. package/render.js +1 -1
  55. package/render.js.map +1 -1
  56. package/types/state.types.d.ts +6 -0
  57. package/utils/dateUtils.d.ts +6 -0
  58. package/utils/mapAuthPermissions.d.ts +39 -0
  59. package/api/getCustomerData/getCustomerData.d.ts +0 -10
  60. package/api/getCustomerData/graphql/CustomerQuery.d.ts +0 -2
  61. package/api/graphql/CustomerFragment.d.ts +0 -2
  62. package/data/models/__fixtures__/customerModel.d.ts +0 -4
  63. package/data/models/customer-model.d.ts +0 -18
  64. package/data/transforms/transform-customer.d.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"OrderSummary.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg","../../node_modules/@adobe-commerce/elsie/src/icons/ChevronUp.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Coupon.svg","/@dropins/storefront-quote-management/src/components/OrderSummary/OrderSummary.tsx","/@dropins/storefront-quote-management/src/containers/OrderSummary/OrderSummary.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n","import * as React from \"react\";\nconst SvgChevronUp = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M7.74512 14.132L12.0001 9.87701L16.2551 14.132\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronUp;\n","import * as React from \"react\";\nconst SvgCoupon = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z\", fill: \"currentColor\" }));\nexport default SvgCoupon;\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/OrderSummary/OrderSummary.css';\nimport { OrderSummaryLine } from '@/quote-management/containers/OrderSummaryLine/OrderSummaryLine';\nimport {\n Accordion,\n AccordionSection,\n Divider,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, ChevronUp } from '@adobe-commerce/elsie/icons';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useState } from 'preact/compat';\nimport { JSXInternal } from 'preact/src/jsx';\n\nexport interface OrderSummaryLineItem {\n key: string;\n title?: string;\n className?: string;\n sortOrder: number;\n content:\n | string\n | JSXInternal.Element\n | VNode<HTMLAttributes<HTMLDivElement>>\n | OrderSummaryLineItem[]\n | undefined;\n}\n\nexport interface OrderSummaryProps extends HTMLAttributes<HTMLDivElement> {\n variant?: 'primary' | 'secondary';\n heading?: VNode<HTMLAttributes<HTMLDivElement>>;\n subTotal?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n taxIncluded?: boolean;\n taxExcluded?: boolean;\n };\n shipping?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n taxIncluded?: boolean;\n taxExcluded?: boolean;\n };\n discounts?: {\n label: string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n caption?: VNode<HTMLAttributes<HTMLDivElement>>;\n coupon?: VNode<HTMLAttributes<HTMLSpanElement>>;\n }[];\n taxTotal?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n };\n taxesApplied?: {\n label: string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n }[];\n total?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceWithoutTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n };\n totalSaved?: VNode<HTMLAttributes<HTMLSpanElement>>;\n updateLineItems?: (\n lineItems: Array<OrderSummaryLineItem>\n ) => Array<OrderSummaryLineItem>;\n}\n\nexport const OrderSummary: FunctionComponent<OrderSummaryProps> = ({\n className,\n children,\n variant = 'primary',\n heading,\n subTotal,\n shipping,\n discounts,\n taxTotal,\n taxesApplied,\n total,\n totalSaved,\n updateLineItems = (lineItems) => lineItems,\n ...props\n}) => {\n const [showTaxBreakdown, setShowTaxBreakdown] = useState(false);\n\n const translations = useText({\n // Taxes\n taxesBreakdownTitle: 'NegotiableQuote.PriceSummary.taxes.breakdown',\n taxTotal: 'NegotiableQuote.PriceSummary.taxes.total',\n taxTotalOnly: 'NegotiableQuote.PriceSummary.taxes.totalOnly',\n showTaxBreakdown: 'NegotiableQuote.PriceSummary.taxes.showBreakdown',\n hideTaxBreakdown: 'NegotiableQuote.PriceSummary.taxes.hideBreakdown',\n\n // Subtotal\n subtotalLabel: 'NegotiableQuote.PriceSummary.subTotal.label',\n subtotalWithTaxes: 'NegotiableQuote.PriceSummary.subTotal.withTaxes',\n subtotalWithoutTaxes: 'NegotiableQuote.PriceSummary.subTotal.withoutTaxes',\n\n // Shipping\n shippingLabel: 'NegotiableQuote.PriceSummary.shipping.label',\n shippingWithTaxes: 'NegotiableQuote.PriceSummary.shipping.withTaxes',\n shippingWithoutTaxes: 'NegotiableQuote.PriceSummary.shipping.withoutTaxes',\n\n // Total\n totalLabel: 'NegotiableQuote.PriceSummary.total.label',\n totalWithoutTax: 'NegotiableQuote.PriceSummary.total.withoutTax',\n totalSaved: 'NegotiableQuote.PriceSummary.total.saved',\n });\n\n const subTotalContent = subTotal && (\n <OrderSummaryLine\n key={translations.subtotalLabel}\n label={translations.subtotalLabel}\n price={subTotal.price}\n classSuffixes={['subTotal']}\n >\n {subTotal.taxIncluded && (\n <div\n data-testid=\"sub-total-tax-caption\"\n className=\"quote-order-summary__caption\"\n >\n <span>{translations.subtotalWithTaxes}</span>\n </div>\n )}\n\n {subTotal.taxExcluded ? (\n <div\n data-testid=\"sub-total-tax-caption-excluded\"\n className=\"quote-order-summary__caption\"\n >\n <span>\n {subTotal.priceExcludingTax}\n &nbsp;\n {translations.subtotalWithoutTaxes}\n </span>\n </div>\n ) : undefined}\n </OrderSummaryLine>\n );\n\n const shippingContent = shipping && (\n <OrderSummaryLine\n key={translations.shippingLabel}\n label={translations.shippingLabel}\n price={shipping.price}\n classSuffixes={['shipping']}\n >\n {shipping.taxIncluded && (\n <div\n data-testid=\"shipping-tax-caption\"\n className=\"quote-order-summary__caption\"\n >\n <span>{translations.shippingWithTaxes}</span>\n </div>\n )}\n\n {shipping.taxExcluded ? (\n <div\n data-testid=\"shipping-tax-caption-excluded\"\n className=\"quote-order-summary__caption\"\n >\n <span>\n {shipping.priceExcludingTax}\n &nbsp;\n {translations.shippingWithoutTaxes}\n </span>\n </div>\n ) : undefined}\n </OrderSummaryLine>\n );\n\n const discountsContent = discounts && discounts.length > 0 && (\n <>\n {discounts.map((discount) => (\n <OrderSummaryLine\n key={discount.label}\n label={discount.label}\n price={discount.price}\n classSuffixes={['discount']}\n >\n {discount.coupon && (\n <VComponent\n node={discount.coupon}\n className=\"quote-order-summary__coupon__code\"\n />\n )}\n\n {discount.caption && (\n <VComponent\n node={discount.caption}\n className=\"quote-order-summary__caption\"\n />\n )}\n </OrderSummaryLine>\n ))}\n </>\n );\n\n const taxContent =\n taxesApplied && taxesApplied.length > 0 ? (\n /* Show breakdown if provided */\n <Accordion\n data-testid=\"tax-breakdown\"\n className=\"quote-order-summary__taxes\"\n iconOpen={ChevronDown}\n iconClose={ChevronUp}\n >\n <AccordionSection\n ariaLabelTitle={translations.taxesBreakdownTitle}\n title={translations.taxesBreakdownTitle}\n secondaryText={\n !showTaxBreakdown && taxTotal ? (\n <VComponent\n node={taxTotal.price}\n className=\"quote-order-summary__price\"\n />\n ) : undefined\n }\n renderContentWhenClosed={false}\n onStateChange={setShowTaxBreakdown}\n >\n <div className=\"quote-order-summary__appliedTaxes\">\n {taxesApplied.map((tax) => (\n <OrderSummaryLine\n key={tax.label}\n label={tax.label}\n price={tax.price}\n classSuffixes={['taxEntry']}\n labelClassSuffix=\"muted\"\n />\n ))}\n </div>\n\n {taxTotal && (\n <OrderSummaryLine\n label={translations.taxTotal}\n price={taxTotal.price}\n classSuffixes={['taxTotal']}\n labelClassSuffix=\"muted\"\n />\n )}\n </AccordionSection>\n </Accordion>\n ) : (\n taxTotal && (\n <OrderSummaryLine\n label={translations.taxTotalOnly}\n price={taxTotal.price}\n classSuffixes={['taxTotal']}\n testId=\"tax-total-only\"\n />\n )\n );\n\n const lineItems: Array<OrderSummaryLineItem> = [\n {\n key: 'subTotalContent',\n sortOrder: 100,\n content: subTotalContent,\n },\n {\n key: 'shippingContent',\n sortOrder: 200,\n content: shippingContent,\n },\n {\n key: 'discountsContent',\n sortOrder: 600,\n content: discountsContent,\n },\n {\n key: 'taxContent',\n sortOrder: 800,\n content: taxContent,\n },\n ...(total\n ? [\n {\n key: 'totalContent',\n sortOrder: 900,\n content: (\n <OrderSummaryLine\n label={translations.totalLabel}\n price={total.price}\n classSuffixes={['total', 'total--padded']}\n testId=\"total-content\"\n labelClassSuffix=\"bold\"\n />\n ),\n },\n ]\n : []),\n ...(total?.priceWithoutTax\n ? [\n {\n key: 'totalWithoutTaxContent',\n sortOrder: 1000,\n content: (\n <OrderSummaryLine\n label={translations.totalWithoutTax}\n price={total.priceWithoutTax}\n classSuffixes={['totalWithoutTax']}\n testId=\"total-without-tax\"\n labelClassSuffix=\"muted\"\n />\n ),\n },\n ]\n : []),\n ...(totalSaved\n ? [\n {\n key: 'totalSavedContent',\n sortOrder: 1100,\n content: (\n <OrderSummaryLine\n label={translations.totalSaved}\n price={totalSaved}\n classSuffixes={['saved']}\n testId=\"total-saved\"\n labelClassSuffix=\"muted\"\n />\n ),\n },\n ]\n : []),\n ];\n\n const updatedLineItems: Array<OrderSummaryLineItem> = updateLineItems(\n lineItems\n ).sort(\n (currentLine: OrderSummaryLineItem, nextLine: OrderSummaryLineItem) => {\n return currentLine.sortOrder - nextLine.sortOrder;\n }\n );\n\n return (\n <div\n {...props}\n className={classes([\n 'quote-order-summary',\n [`quote-order-summary__${variant}`, variant],\n className,\n ])}\n >\n <div className=\"quote-order-summary__heading\">\n {heading && (\n <VComponent\n node={heading}\n className=\"quote-order-summary__heading-text\"\n />\n )}\n\n <Divider\n variant=\"primary\"\n className=\"quote-order-summary__divider-primary\"\n />\n </div>\n\n <div className=\"quote-order-summary__content\">\n {updatedLineItems.map((line: OrderSummaryLineItem) => {\n if (Array.isArray(line.content)) {\n return (\n <Accordion\n key={line.key}\n className={line.className}\n actionIconPosition={'right'}\n iconOpen={ChevronDown}\n iconClose={ChevronUp}\n >\n <AccordionSection\n defaultOpen={false}\n title={line.title}\n renderContentWhenClosed={false}\n >\n {line.content.map((innerLine) => {\n return innerLine.content;\n })}\n </AccordionSection>\n </Accordion>\n );\n }\n return line.content;\n })}\n </div>\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 {\n OrderSummary as OrderSummaryComponent,\n OrderSummaryLineItem,\n} from '@/quote-management/components';\nimport {\n NegotiableQuoteModel,\n QuoteDisplayAmount,\n} from '@/quote-management/data/models';\nimport { state } from '@/quote-management/lib/state';\nimport { Icon, Price } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Coupon } from '@adobe-commerce/elsie/icons';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\n\nexport interface OrderSummaryProps extends HTMLAttributes<HTMLDivElement> {\n showTotalSaved?: boolean;\n updateLineItems?: (\n lineItems: Array<OrderSummaryLineItem>\n ) => Array<OrderSummaryLineItem>;\n}\n\nexport const OrderSummary: Container<\n OrderSummaryProps,\n NegotiableQuoteModel | null\n> = ({\n children,\n initialData = null,\n showTotalSaved,\n updateLineItems = (lineItems) => lineItems,\n ...props\n}) => {\n const [data, setData] = useState<NegotiableQuoteModel | null>(initialData);\n const isVirtual = data?.isVirtual;\n\n const { quoteDisplaySettings } = state.config;\n\n const isZeroTax = Boolean(quoteDisplaySettings?.zeroTax);\n\n const isTaxIncludedInSubtotal =\n quoteDisplaySettings?.subtotal === QuoteDisplayAmount.TAX_INCLUDED;\n const isTaxIncludedAndExcludedInSubtotal =\n quoteDisplaySettings.subtotal ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED;\n\n const isTaxIncludedInShipping =\n quoteDisplaySettings?.shipping === QuoteDisplayAmount.TAX_INCLUDED;\n const isTaxIncludedAndExcludedInShipping =\n quoteDisplaySettings.shipping ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED;\n\n useEffect(() => {\n const dataEvent = events.on(\n 'quote-management/quote-data',\n (payload) => {\n setData(payload.quote as NegotiableQuoteModel);\n },\n { eager: true }\n );\n\n return () => {\n dataEvent?.off();\n };\n }, []);\n\n const translations = useText({\n free: 'NegotiableQuote.PriceSummary.total.free',\n orderSummary: 'NegotiableQuote.PriceSummary.orderSummary',\n taxToBeDetermined: 'NegotiableQuote.PriceSummary.taxToBeDetermined',\n });\n\n if (!Object.keys(data ?? {}).length) {\n return null;\n }\n\n return (\n <OrderSummaryComponent\n {...props}\n data-testid=\"quote-order-summary\"\n heading={<div>{translations.orderSummary}</div>}\n updateLineItems={updateLineItems}\n subTotal={{\n taxIncluded: isTaxIncludedInSubtotal && !isZeroTax,\n taxExcluded: isTaxIncludedAndExcludedInSubtotal,\n priceExcludingTax: (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalExcludingTax?.value}\n currency={data?.prices?.subtotalExcludingTax?.currency}\n />\n ),\n price:\n (!isZeroTax && isTaxIncludedInSubtotal) ||\n (!isZeroTax && isTaxIncludedAndExcludedInSubtotal) ? (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalIncludingTax?.value}\n currency={data?.prices?.subtotalIncludingTax?.currency}\n />\n ) : (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalExcludingTax?.value}\n currency={data?.prices?.subtotalExcludingTax?.currency}\n />\n ),\n }}\n shipping={{\n taxIncluded: isTaxIncludedInShipping && !isZeroTax,\n taxExcluded: isTaxIncludedAndExcludedInShipping,\n priceExcludingTax: (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingExcludingTax?.value}\n currency={data?.prices?.shippingExcludingTax?.currency}\n />\n ),\n price:\n (!isZeroTax && isTaxIncludedInShipping) ||\n (!isZeroTax && isTaxIncludedAndExcludedInShipping) ? (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingIncludingTax?.value}\n currency={data?.prices?.shippingIncludingTax?.currency}\n />\n ) : (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingExcludingTax?.value}\n currency={data?.prices?.shippingExcludingTax?.currency}\n />\n ),\n }}\n discounts={data?.prices?.appliedDiscounts?.map((discount) => {\n return {\n label: discount.label,\n price: (\n <Price\n data-testid=\"summary-discount-total\"\n amount={-discount.amount.value}\n currency={discount.amount.currency}\n sale={true}\n />\n ),\n coupon: discount?.coupon ? (\n <span>\n <Icon source={Coupon} size=\"16\" />\n {discount?.coupon?.code}\n </span>\n ) : undefined,\n };\n })}\n taxTotal={\n isVirtual && !data?.prices?.appliedTaxes?.length\n ? {\n price: (\n <span data-testid=\"tax-total-tbd\">\n {translations.taxToBeDetermined}\n </span>\n ),\n }\n : {\n price: (\n <Price\n data-testid=\"tax-total-actual\"\n amount={data?.prices?.totalTax?.value}\n currency={data?.prices?.totalTax?.currency}\n />\n ),\n }\n }\n taxesApplied={\n isVirtual\n ? undefined\n : quoteDisplaySettings?.fullSummary\n ? data?.prices?.appliedTaxes?.map((tax: any) => ({\n label: tax.label,\n price: (\n <Price\n data-testid=\"applied-taxes\"\n amount={tax.amount.value}\n currency={tax.amount.currency}\n />\n ),\n }))\n : undefined\n }\n total={{\n price:\n data?.prices?.grandTotal?.value === 0 ? (\n <span data-testid=\"total-including-tax\">{translations.free}</span>\n ) : (\n <Price\n data-testid=\"total-including-tax-actual\"\n amount={data?.prices?.grandTotal?.value}\n currency={data?.prices?.grandTotal?.currency}\n />\n ),\n priceWithoutTax: quoteDisplaySettings?.grandTotal ? (\n data?.prices?.grandTotalExcludingTax?.value === 0 ? (\n <span data-testid=\"total-excluding-tax\">{translations.free}</span>\n ) : (\n <Price\n data-testid=\"total-excluding-tax\"\n amount={data?.prices?.grandTotalExcludingTax?.value}\n currency={data?.prices?.grandTotalExcludingTax?.currency}\n />\n )\n ) : undefined,\n }}\n totalSaved={\n showTotalSaved ? (\n <Price\n amount={data?.prices?.discount?.value}\n currency={data?.prices?.grandTotal?.currency}\n />\n ) : undefined\n }\n />\n );\n};\n"],"names":["SvgChevronDown","props","React","SvgChevronUp","SvgCoupon","OrderSummary","className","children","variant","heading","subTotal","shipping","discounts","taxTotal","taxesApplied","total","totalSaved","updateLineItems","lineItems","showTaxBreakdown","setShowTaxBreakdown","useState","translations","useText","subTotalContent","jsxs","OrderSummaryLine","jsx","shippingContent","discountsContent","Fragment","discount","VComponent","taxContent","Accordion","ChevronDown","ChevronUp","AccordionSection","tax","updatedLineItems","currentLine","nextLine","classes","Divider","line","innerLine","initialData","showTotalSaved","data","setData","isVirtual","quoteDisplaySettings","state","isZeroTax","isTaxIncludedInSubtotal","QuoteDisplayAmount","isTaxIncludedAndExcludedInSubtotal","isTaxIncludedInShipping","isTaxIncludedAndExcludedInShipping","useEffect","dataEvent","events","payload","OrderSummaryComponent","Price","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","_l","_k","_n","_m","_p","_o","_r","_q","_t","_s","_v","_u","_x","_w","_z","_y","Icon","Coupon","_B","_A","_D","_C","_F","_E","_H","_G","_J","_I","_L","_K","_N","_M","_P","_O","_R","_Q","_T","_S","_V","_U","_X","_W"],"mappings":"o2BACA,MAAMA,GAAkBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,kDAAmD,OAAQ,eAAgB,YAAa,IAAK,cAAe,SAAU,eAAgB,OAAO,CAAE,CAAC,ECAtXC,GAAgBF,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,iDAAkD,OAAQ,eAAgB,YAAa,IAAK,cAAe,SAAU,eAAgB,OAAO,CAAE,CAAC,ECAnXE,GAAaH,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,quEAAsuE,KAAM,cAAc,CAAE,CAAC,ECyE3/EG,GAAqD,CAAC,CACjE,UAAAC,EACA,SAAAC,EACA,QAAAC,EAAU,UACV,QAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,MAAAC,EACA,WAAAC,EACA,gBAAAC,EAAmB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AA,CAAA,EAhJD,IAoJX","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"OrderSummary.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronUp.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Coupon.svg","/@dropins/storefront-quote-management/src/components/OrderSummary/OrderSummary.tsx","/@dropins/storefront-quote-management/src/containers/OrderSummary/OrderSummary.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronUp = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M7.74512 14.132L12.0001 9.87701L16.2551 14.132\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronUp;\n","import * as React from \"react\";\nconst SvgCoupon = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z\", fill: \"currentColor\" }));\nexport default SvgCoupon;\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/OrderSummary/OrderSummary.css';\nimport { OrderSummaryLine } from '@/quote-management/containers/OrderSummaryLine/OrderSummaryLine';\nimport {\n Accordion,\n AccordionSection,\n Divider,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, ChevronUp } from '@adobe-commerce/elsie/icons';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useState } from 'preact/compat';\nimport { JSXInternal } from 'preact/src/jsx';\n\nexport interface OrderSummaryLineItem {\n key: string;\n title?: string;\n className?: string;\n sortOrder: number;\n content:\n | string\n | JSXInternal.Element\n | VNode<HTMLAttributes<HTMLDivElement>>\n | OrderSummaryLineItem[]\n | undefined;\n}\n\nexport interface OrderSummaryProps extends HTMLAttributes<HTMLDivElement> {\n variant?: 'primary' | 'secondary';\n heading?: VNode<HTMLAttributes<HTMLDivElement>>;\n subTotal?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n taxIncluded?: boolean;\n taxExcluded?: boolean;\n };\n shipping?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n taxIncluded?: boolean;\n taxExcluded?: boolean;\n };\n discounts?: {\n label: string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n caption?: VNode<HTMLAttributes<HTMLDivElement>>;\n coupon?: VNode<HTMLAttributes<HTMLSpanElement>>;\n }[];\n taxTotal?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n };\n taxesApplied?: {\n label: string;\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n }[];\n total?: {\n price: VNode<HTMLAttributes<HTMLSpanElement>>;\n priceWithoutTax?: VNode<HTMLAttributes<HTMLSpanElement>>;\n };\n totalSaved?: VNode<HTMLAttributes<HTMLSpanElement>>;\n updateLineItems?: (\n lineItems: Array<OrderSummaryLineItem>\n ) => Array<OrderSummaryLineItem>;\n}\n\nexport const OrderSummary: FunctionComponent<OrderSummaryProps> = ({\n className,\n children,\n variant = 'primary',\n heading,\n subTotal,\n shipping,\n discounts,\n taxTotal,\n taxesApplied,\n total,\n totalSaved,\n updateLineItems = (lineItems) => lineItems,\n ...props\n}) => {\n const [showTaxBreakdown, setShowTaxBreakdown] = useState(false);\n\n const translations = useText({\n // Taxes\n taxesBreakdownTitle: 'NegotiableQuote.PriceSummary.taxes.breakdown',\n taxTotal: 'NegotiableQuote.PriceSummary.taxes.total',\n taxTotalOnly: 'NegotiableQuote.PriceSummary.taxes.totalOnly',\n showTaxBreakdown: 'NegotiableQuote.PriceSummary.taxes.showBreakdown',\n hideTaxBreakdown: 'NegotiableQuote.PriceSummary.taxes.hideBreakdown',\n\n // Subtotal\n subtotalLabel: 'NegotiableQuote.PriceSummary.subTotal.label',\n subtotalWithTaxes: 'NegotiableQuote.PriceSummary.subTotal.withTaxes',\n subtotalWithoutTaxes: 'NegotiableQuote.PriceSummary.subTotal.withoutTaxes',\n\n // Shipping\n shippingLabel: 'NegotiableQuote.PriceSummary.shipping.label',\n shippingWithTaxes: 'NegotiableQuote.PriceSummary.shipping.withTaxes',\n shippingWithoutTaxes: 'NegotiableQuote.PriceSummary.shipping.withoutTaxes',\n\n // Total\n totalLabel: 'NegotiableQuote.PriceSummary.total.label',\n totalWithoutTax: 'NegotiableQuote.PriceSummary.total.withoutTax',\n totalSaved: 'NegotiableQuote.PriceSummary.total.saved',\n });\n\n const subTotalContent = subTotal && (\n <OrderSummaryLine\n key={translations.subtotalLabel}\n label={translations.subtotalLabel}\n price={subTotal.price}\n classSuffixes={['subTotal']}\n >\n {subTotal.taxIncluded && (\n <div\n data-testid=\"sub-total-tax-caption\"\n className=\"quote-order-summary__caption\"\n >\n <span>{translations.subtotalWithTaxes}</span>\n </div>\n )}\n\n {subTotal.taxExcluded ? (\n <div\n data-testid=\"sub-total-tax-caption-excluded\"\n className=\"quote-order-summary__caption\"\n >\n <span>\n {subTotal.priceExcludingTax}\n &nbsp;\n {translations.subtotalWithoutTaxes}\n </span>\n </div>\n ) : undefined}\n </OrderSummaryLine>\n );\n\n const shippingContent = shipping && (\n <OrderSummaryLine\n key={translations.shippingLabel}\n label={translations.shippingLabel}\n price={shipping.price}\n classSuffixes={['shipping']}\n >\n {shipping.taxIncluded && (\n <div\n data-testid=\"shipping-tax-caption\"\n className=\"quote-order-summary__caption\"\n >\n <span>{translations.shippingWithTaxes}</span>\n </div>\n )}\n\n {shipping.taxExcluded ? (\n <div\n data-testid=\"shipping-tax-caption-excluded\"\n className=\"quote-order-summary__caption\"\n >\n <span>\n {shipping.priceExcludingTax}\n &nbsp;\n {translations.shippingWithoutTaxes}\n </span>\n </div>\n ) : undefined}\n </OrderSummaryLine>\n );\n\n const discountsContent = discounts && discounts.length > 0 && (\n <>\n {discounts.map((discount) => (\n <OrderSummaryLine\n key={discount.label}\n label={discount.label}\n price={discount.price}\n classSuffixes={['discount']}\n >\n {discount.coupon && (\n <VComponent\n node={discount.coupon}\n className=\"quote-order-summary__coupon__code\"\n />\n )}\n\n {discount.caption && (\n <VComponent\n node={discount.caption}\n className=\"quote-order-summary__caption\"\n />\n )}\n </OrderSummaryLine>\n ))}\n </>\n );\n\n const taxContent =\n taxesApplied && taxesApplied.length > 0 ? (\n /* Show breakdown if provided */\n <Accordion\n data-testid=\"tax-breakdown\"\n className=\"quote-order-summary__taxes\"\n iconOpen={ChevronDown}\n iconClose={ChevronUp}\n >\n <AccordionSection\n ariaLabelTitle={translations.taxesBreakdownTitle}\n title={translations.taxesBreakdownTitle}\n secondaryText={\n !showTaxBreakdown && taxTotal ? (\n <VComponent\n node={taxTotal.price}\n className=\"quote-order-summary__price\"\n />\n ) : undefined\n }\n renderContentWhenClosed={false}\n onStateChange={setShowTaxBreakdown}\n >\n <div className=\"quote-order-summary__appliedTaxes\">\n {taxesApplied.map((tax) => (\n <OrderSummaryLine\n key={tax.label}\n label={tax.label}\n price={tax.price}\n classSuffixes={['taxEntry']}\n labelClassSuffix=\"muted\"\n />\n ))}\n </div>\n\n {taxTotal && (\n <OrderSummaryLine\n label={translations.taxTotal}\n price={taxTotal.price}\n classSuffixes={['taxTotal']}\n labelClassSuffix=\"muted\"\n />\n )}\n </AccordionSection>\n </Accordion>\n ) : (\n taxTotal && (\n <OrderSummaryLine\n label={translations.taxTotalOnly}\n price={taxTotal.price}\n classSuffixes={['taxTotal']}\n testId=\"tax-total-only\"\n />\n )\n );\n\n const lineItems: Array<OrderSummaryLineItem> = [\n {\n key: 'subTotalContent',\n sortOrder: 100,\n content: subTotalContent,\n },\n {\n key: 'shippingContent',\n sortOrder: 200,\n content: shippingContent,\n },\n {\n key: 'discountsContent',\n sortOrder: 600,\n content: discountsContent,\n },\n {\n key: 'taxContent',\n sortOrder: 800,\n content: taxContent,\n },\n ...(total\n ? [\n {\n key: 'totalContent',\n sortOrder: 900,\n content: (\n <OrderSummaryLine\n label={translations.totalLabel}\n price={total.price}\n classSuffixes={['total', 'total--padded']}\n testId=\"total-content\"\n labelClassSuffix=\"bold\"\n />\n ),\n },\n ]\n : []),\n ...(total?.priceWithoutTax\n ? [\n {\n key: 'totalWithoutTaxContent',\n sortOrder: 1000,\n content: (\n <OrderSummaryLine\n label={translations.totalWithoutTax}\n price={total.priceWithoutTax}\n classSuffixes={['totalWithoutTax']}\n testId=\"total-without-tax\"\n labelClassSuffix=\"muted\"\n />\n ),\n },\n ]\n : []),\n ...(totalSaved\n ? [\n {\n key: 'totalSavedContent',\n sortOrder: 1100,\n content: (\n <OrderSummaryLine\n label={translations.totalSaved}\n price={totalSaved}\n classSuffixes={['saved']}\n testId=\"total-saved\"\n labelClassSuffix=\"muted\"\n />\n ),\n },\n ]\n : []),\n ];\n\n const updatedLineItems: Array<OrderSummaryLineItem> = updateLineItems(\n lineItems\n ).sort(\n (currentLine: OrderSummaryLineItem, nextLine: OrderSummaryLineItem) => {\n return currentLine.sortOrder - nextLine.sortOrder;\n }\n );\n\n return (\n <div\n {...props}\n className={classes([\n 'quote-order-summary',\n [`quote-order-summary__${variant}`, variant],\n className,\n ])}\n >\n <div className=\"quote-order-summary__heading\">\n {heading && (\n <VComponent\n node={heading}\n className=\"quote-order-summary__heading-text\"\n />\n )}\n\n <Divider\n variant=\"primary\"\n className=\"quote-order-summary__divider-primary\"\n />\n </div>\n\n <div className=\"quote-order-summary__content\">\n {updatedLineItems.map((line: OrderSummaryLineItem) => {\n if (Array.isArray(line.content)) {\n return (\n <Accordion\n key={line.key}\n className={line.className}\n actionIconPosition={'right'}\n iconOpen={ChevronDown}\n iconClose={ChevronUp}\n >\n <AccordionSection\n defaultOpen={false}\n title={line.title}\n renderContentWhenClosed={false}\n >\n {line.content.map((innerLine) => {\n return innerLine.content;\n })}\n </AccordionSection>\n </Accordion>\n );\n }\n return line.content;\n })}\n </div>\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 {\n OrderSummary as OrderSummaryComponent,\n OrderSummaryLineItem,\n} from '@/quote-management/components';\nimport {\n NegotiableQuoteModel,\n QuoteDisplayAmount,\n} from '@/quote-management/data/models';\nimport { state } from '@/quote-management/lib/state';\nimport { Icon, Price } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Coupon } from '@adobe-commerce/elsie/icons';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\n\nexport interface OrderSummaryProps extends HTMLAttributes<HTMLDivElement> {\n showTotalSaved?: boolean;\n updateLineItems?: (\n lineItems: Array<OrderSummaryLineItem>\n ) => Array<OrderSummaryLineItem>;\n}\n\nexport const OrderSummary: Container<\n OrderSummaryProps,\n NegotiableQuoteModel | null\n> = ({\n children,\n initialData = null,\n showTotalSaved,\n updateLineItems = (lineItems) => lineItems,\n ...props\n}) => {\n const [data, setData] = useState<NegotiableQuoteModel | null>(initialData);\n const isVirtual = data?.isVirtual;\n\n const { quoteDisplaySettings } = state.config;\n\n const isZeroTax = Boolean(quoteDisplaySettings?.zeroTax);\n\n const isTaxIncludedInSubtotal =\n quoteDisplaySettings?.subtotal === QuoteDisplayAmount.TAX_INCLUDED;\n const isTaxIncludedAndExcludedInSubtotal =\n quoteDisplaySettings?.subtotal ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED;\n\n const isTaxIncludedInShipping =\n quoteDisplaySettings?.shipping === QuoteDisplayAmount.TAX_INCLUDED;\n const isTaxIncludedAndExcludedInShipping =\n quoteDisplaySettings?.shipping ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED;\n\n useEffect(() => {\n const dataEvent = events.on(\n 'quote-management/quote-data',\n (payload) => {\n setData(payload.quote as NegotiableQuoteModel);\n },\n { eager: true }\n );\n\n return () => {\n dataEvent?.off();\n };\n }, []);\n\n const translations = useText({\n free: 'NegotiableQuote.PriceSummary.total.free',\n orderSummary: 'NegotiableQuote.PriceSummary.orderSummary',\n taxToBeDetermined: 'NegotiableQuote.PriceSummary.taxToBeDetermined',\n });\n\n if (!Object.keys(data ?? {}).length) {\n return null;\n }\n\n return (\n <OrderSummaryComponent\n {...props}\n data-testid=\"quote-order-summary\"\n heading={<div>{translations.orderSummary}</div>}\n updateLineItems={updateLineItems}\n subTotal={{\n taxIncluded: isTaxIncludedInSubtotal && !isZeroTax,\n taxExcluded: isTaxIncludedAndExcludedInSubtotal,\n priceExcludingTax: (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalExcludingTax?.value}\n currency={data?.prices?.subtotalExcludingTax?.currency}\n />\n ),\n price:\n (!isZeroTax && isTaxIncludedInSubtotal) ||\n (!isZeroTax && isTaxIncludedAndExcludedInSubtotal) ? (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalIncludingTax?.value}\n currency={data?.prices?.subtotalIncludingTax?.currency}\n />\n ) : (\n <Price\n data-testid=\"subtotal\"\n amount={data?.prices?.subtotalExcludingTax?.value}\n currency={data?.prices?.subtotalExcludingTax?.currency}\n />\n ),\n }}\n shipping={{\n taxIncluded: isTaxIncludedInShipping && !isZeroTax,\n taxExcluded: isTaxIncludedAndExcludedInShipping,\n priceExcludingTax: (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingExcludingTax?.value}\n currency={data?.prices?.shippingExcludingTax?.currency}\n />\n ),\n price:\n (!isZeroTax && isTaxIncludedInShipping) ||\n (!isZeroTax && isTaxIncludedAndExcludedInShipping) ? (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingIncludingTax?.value}\n currency={data?.prices?.shippingIncludingTax?.currency}\n />\n ) : (\n <Price\n data-testid=\"shipping\"\n amount={data?.prices?.shippingExcludingTax?.value}\n currency={data?.prices?.shippingExcludingTax?.currency}\n />\n ),\n }}\n discounts={data?.prices?.appliedDiscounts?.map((discount) => {\n return {\n label: discount.label,\n price: (\n <Price\n data-testid=\"summary-discount-total\"\n amount={-discount.amount.value}\n currency={discount.amount.currency}\n sale={true}\n />\n ),\n coupon: discount?.coupon ? (\n <span>\n <Icon source={Coupon} size=\"16\" />\n {discount?.coupon?.code}\n </span>\n ) : undefined,\n };\n })}\n taxTotal={\n isVirtual && !data?.prices?.appliedTaxes?.length\n ? {\n price: (\n <span data-testid=\"tax-total-tbd\">\n {translations.taxToBeDetermined}\n </span>\n ),\n }\n : {\n price: (\n <Price\n data-testid=\"tax-total-actual\"\n amount={data?.prices?.totalTax?.value}\n currency={data?.prices?.totalTax?.currency}\n />\n ),\n }\n }\n taxesApplied={\n isVirtual\n ? undefined\n : quoteDisplaySettings?.fullSummary\n ? data?.prices?.appliedTaxes?.map((tax: any) => ({\n label: tax.label,\n price: (\n <Price\n data-testid=\"applied-taxes\"\n amount={tax.amount.value}\n currency={tax.amount.currency}\n />\n ),\n }))\n : undefined\n }\n total={{\n price:\n data?.prices?.grandTotal?.value === 0 ? (\n <span data-testid=\"total-including-tax\">{translations.free}</span>\n ) : (\n <Price\n data-testid=\"total-including-tax-actual\"\n amount={data?.prices?.grandTotal?.value}\n currency={data?.prices?.grandTotal?.currency}\n />\n ),\n priceWithoutTax: quoteDisplaySettings?.grandTotal ? (\n data?.prices?.grandTotalExcludingTax?.value === 0 ? (\n <span data-testid=\"total-excluding-tax\">{translations.free}</span>\n ) : (\n <Price\n data-testid=\"total-excluding-tax\"\n amount={data?.prices?.grandTotalExcludingTax?.value}\n currency={data?.prices?.grandTotalExcludingTax?.currency}\n />\n )\n ) : undefined,\n }}\n totalSaved={\n showTotalSaved ? (\n <Price\n amount={data?.prices?.discount?.value}\n currency={data?.prices?.grandTotal?.currency}\n />\n ) : undefined\n }\n />\n );\n};\n"],"names":["SvgChevronUp","props","React","SvgCoupon","OrderSummary","className","children","variant","heading","subTotal","shipping","discounts","taxTotal","taxesApplied","total","totalSaved","updateLineItems","lineItems","showTaxBreakdown","setShowTaxBreakdown","useState","translations","useText","subTotalContent","jsxs","OrderSummaryLine","jsx","shippingContent","discountsContent","Fragment","discount","VComponent","taxContent","Accordion","ChevronDown","ChevronUp","AccordionSection","tax","updatedLineItems","currentLine","nextLine","classes","Divider","line","innerLine","initialData","showTotalSaved","data","setData","isVirtual","quoteDisplaySettings","state","isZeroTax","isTaxIncludedInSubtotal","QuoteDisplayAmount","isTaxIncludedAndExcludedInSubtotal","isTaxIncludedInShipping","isTaxIncludedAndExcludedInShipping","useEffect","dataEvent","events","payload","OrderSummaryComponent","Price","_b","_a","_d","_c","_f","_e","_h","_g","_j","_i","_l","_k","_n","_m","_p","_o","_r","_q","_t","_s","_v","_u","_x","_w","_z","_y","Icon","Coupon","_B","_A","_D","_C","_F","_E","_H","_G","_J","_I","_L","_K","_N","_M","_P","_O","_R","_Q","_T","_S","_V","_U","_X","_W"],"mappings":"k5BACA,MAAMA,GAAgBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,iDAAkD,OAAQ,eAAgB,YAAa,IAAK,cAAe,SAAU,eAAgB,OAAO,CAAE,CAAC,ECAnXC,GAAaF,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,quEAAsuE,KAAM,cAAc,CAAE,CAAC,ECyE3/EE,GAAqD,CAAC,CACjE,UAAAC,EACA,SAAAC,EACA,QAAAC,EAAU,UACV,QAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,MAAAC,EACA,WAAAC,EACA,gBAAAC,EAAmBC,GAAcA,EACjC,GAAGhB,CACL,IAAM,CACJ,KAAM,CAACiB,EAAkBC,CAAmB,EAAIC,GAAS,EAAK,EAExDC,EAAeC,GAAQ,CAE3B,oBAAqB,+CACrB,SAAU,2CACV,aAAc,+CACd,iBAAkB,mDAClB,iBAAkB,mDAGlB,cAAe,8CACf,kBAAmB,kDACnB,qBAAsB,qDAGtB,cAAe,8CACf,kBAAmB,kDACnB,qBAAsB,q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,aAAd,YAAAD,GAA0B,SAAU,EAClC1E,EAAC,OAAA,CAAK,cAAY,sBAAuB,SAAAL,EAAa,IAAA,CAAK,EAE3DK,EAACqC,EAAA,CACC,cAAY,6BACZ,QAAQuC,IAAAC,GAAAxD,GAAA,YAAAA,EAAM,SAAN,YAAAwD,GAAc,aAAd,YAAAD,GAA0B,MAClC,UAAUE,IAAAC,GAAA1D,GAAA,YAAAA,EAAM,SAAN,YAAA0D,GAAc,aAAd,YAAAD,GAA0B,QAAA,CAAA,EAG1C,gBAAiBtD,GAAA,MAAAA,EAAsB,aACrCwD,IAAAC,GAAA5D,GAAA,YAAAA,EAAM,SAAN,YAAA4D,GAAc,yBAAd,YAAAD,GAAsC,SAAU,EAC9ChF,EAAC,OAAA,CAAK,cAAY,sBAAuB,SAAAL,EAAa,KAAK,EAE3DK,EAACqC,EAAA,CACC,cAAY,sBACZ,QAAQ6C,IAAAC,GAAA9D,GAAA,YAAAA,EAAM,SAAN,YAAA8D,GAAc,yBAAd,YAAAD,GAAsC,MAC9C,UAAUE,IAAAC,GAAAhE,GAAA,YAAAA,EAAM,SAAN,YAAAgE,GAAc,yBAAd,YAAAD,GAAsC,QAAA,CAAA,EAGlD,MAAA,EAEN,WACEhE,EACEpB,EAACqC,EAAA,CACC,QAAQiD,IAAAC,GAAAlE,GAAA,YAAAA,EAAM,SAAN,YAAAkE,GAAc,WAAd,YAAAD,GAAwB,MAChC,UAAUE,IAAAC,GAAApE,GAAA,YAAAA,EAAM,SAAN,YAAAoE,GAAc,aAAd,YAAAD,GAA0B,QAAA,CAAA,EAEpC,MAAA,CAAA,EAhJD,IAoJX","x_google_ignoreList":[0,1]}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{Q as s,Q}from"../chunks/QuoteHistoryLog.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/i18n.js";export{s as QuoteHistoryLog,Q as default};
3
+ import{Q,Q as f}from"../chunks/QuoteHistoryLog.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import"../chunks/dateUtils.js";/* empty css */import"@dropins/tools/i18n.js";export{Q as QuoteHistoryLog,f as default};
4
4
  //# sourceMappingURL=QuoteHistoryLog.js.map
@@ -0,0 +1,51 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+ import { ImageProps } from '@dropins/tools/types/elsie/src/components';
3
+ import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
4
+ import { NegotiableQuoteCartItem as NegotiableQuoteItemModel } from '../../data/models';
5
+
6
+ export interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {
7
+ hideHeading?: boolean;
8
+ hideFooter?: boolean;
9
+ routeProduct?: (item: NegotiableQuoteItemModel) => string;
10
+ showMaxItems?: boolean;
11
+ attributesToHide?: SwitchableAttributes[];
12
+ slots?: {
13
+ Heading?: SlotProps<{
14
+ count: number;
15
+ quoteId: string;
16
+ }>;
17
+ Footer?: SlotProps<{
18
+ item: NegotiableQuoteItemModel;
19
+ }>;
20
+ Thumbnail?: SlotProps<{
21
+ item: NegotiableQuoteItemModel;
22
+ defaultImageProps: ImageProps;
23
+ }>;
24
+ ProductAttributes?: SlotProps<{
25
+ item: NegotiableQuoteItemModel;
26
+ }>;
27
+ QuoteSummaryFooter?: SlotProps<{
28
+ displayMaxItems: boolean;
29
+ }>;
30
+ QuoteItem?: SlotProps;
31
+ ItemTitle?: SlotProps<{
32
+ item: NegotiableQuoteItemModel;
33
+ }>;
34
+ ItemPrice?: SlotProps<{
35
+ item: NegotiableQuoteItemModel;
36
+ }>;
37
+ ItemTotal?: SlotProps<{
38
+ item: NegotiableQuoteItemModel;
39
+ }>;
40
+ ItemSku?: SlotProps<{
41
+ item: NegotiableQuoteItemModel;
42
+ }>;
43
+ };
44
+ accordion?: boolean;
45
+ variant?: 'primary' | 'secondary';
46
+ showDiscount?: boolean;
47
+ showSavings?: boolean;
48
+ }
49
+ export type SwitchableAttributes = 'name' | 'image' | 'configurations' | 'warning' | 'alert' | 'sku' | 'price' | 'quantity' | 'total' | 'totalDiscount' | 'totalExcludingTax';
50
+ export declare const QuoteSummaryList: Container<QuoteSummaryListProps>;
51
+ //# sourceMappingURL=QuoteSummaryList.d.ts.map
@@ -6,5 +6,6 @@
6
6
  * file in accordance with the terms of the Adobe license agreement
7
7
  * accompanying it.
8
8
  *******************************************************************/
9
- export declare const customer: any;
10
- //# sourceMappingURL=customerData.d.ts.map
9
+ export * from './QuoteSummaryList';
10
+ export { QuoteSummaryList as default } from './QuoteSummaryList';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './QuoteSummaryList/index'
2
+ import _default from './QuoteSummaryList/index'
3
+ export default _default
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as i,jsxs as _,Fragment as C}from"@dropins/tools/preact-jsx-runtime.js";import*as Q from"@dropins/tools/preact-compat.js";import{useState as N,useEffect as oe,useCallback as ce}from"@dropins/tools/preact-compat.js";import{Divider as j,Skeleton as ue,SkeletonRow as le,Price as q,Image as se,Button as de,CartList as me,Accordion as ge,AccordionSection as ye,CartItem as he}from"@dropins/tools/components.js";import{classes as v,VComponent as A,Slot as s}from"@dropins/tools/lib.js";/* empty css *//* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css *//* empty css */import{Q as b,s as pe}from"../chunks/state.js";import{events as fe}from"@dropins/tools/event-bus.js";import{S as ve}from"../chunks/ChevronDown.js";import{useText as _e}from"@dropins/tools/i18n.js";const be=e=>Q.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},Q.createElement("g",{id:"Large"},Q.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),Q.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},Q.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),F=({className:e,children:n,heading:t,footer:a,products:o,outOfStockMessage:r,loading:l=!0,variant:d="primary",...m})=>i("div",{...m,className:v(["quote-management-quote-summary-list",e,`quote-management-quote-summary-list__background--${d}`]),children:l?i(xe,{}):_(C,{children:[(t||r)&&_("div",{"data-testid":"quote-summary-list-heading-wrapper",className:v(["quote-management-quote-summary-list__heading",["quote-management-quote-summary-list__heading--full-width",!o]]),children:[t&&_(C,{children:[i(A,{node:t,className:"quote-management-quote-summary-list__heading-text"}),i(j,{variant:"primary",className:v(["quote-management-quote-summary-list__heading-divider"])})]}),r&&i(A,{node:r,className:"quote-management-quote-summary-list__out-of-stock-message"})]}),i("div",{className:v(["quote-management-quote-summary-list__content"]),children:o}),a&&_(C,{children:[i(j,{variant:"primary",className:v(["quote-management-quote-summary-list__footer-divider"])}),i(A,{node:a,className:"quote-management-quote-summary-list__footer-text"})]})]})}),xe=()=>i(ue,{"data-testid":"quote-summary-list-skeleton",className:"quote-management-quote-summary-list__skeleton",rowGap:"medium",children:i(le,{variant:"row",size:"xlarge",fullWidth:!0,lines:3,multilineGap:"small"})}),Ie=()=>{const[e,n]=N(void 0),[t,a]=N(!0);return oe(()=>{const o=fe.on("quote-management/quote-data",r=>{const{quote:l}=r;l&&(n(l),a(!1))},{eager:!0});return()=>o==null?void 0:o.off()},[]),{quoteData:e,loading:t}},B=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===b.TAX_INCLUDED?e.discounted?{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.priceIncludingTax.value,currency:e.prices.priceIncludingTax.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:e.prices.regularPrice.value,currency:e.prices.regularPrice.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},z=e=>{var n,t;return{amount:(n=e.savingsAmount)==null?void 0:n.value,currency:(t=e.savingsAmount)==null?void 0:t.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},G=(e,n)=>{var o,r,l,d,m,x,I,E,c,p,f,P;const t={"aria-label":n.dictionary.regularPrice},a=e.discounted?{}:null;return((o=n.quoteDisplaySettings)==null?void 0:o.price)===b.TAX_INCLUDED||((r=n.quoteDisplaySettings)==null?void 0:r.price)===b.TAX_INCLUDED_AND_EXCLUDED?(t.amount=(l=e.prices.rowTotalIncludingTax)==null?void 0:l.value,t.currency=(d=e.prices.rowTotalIncludingTax)==null?void 0:d.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="including-tax-item-total",a&&(t.amount=(m=e.prices.originalRowTotal)==null?void 0:m.value,t.currency=(x=e.prices.originalRowTotal)==null?void 0:x.currency,a.amount=(I=e.prices.rowTotalIncludingTax)==null?void 0:I.value,a.currency=(E=e.prices.rowTotalIncludingTax)==null?void 0:E.currency,a.sale=!0,a["aria-label"]=n.dictionary.discountedPrice,a["data-testid"]="discount-total")):(t.amount=(c=e.prices.originalRowTotal)==null?void 0:c.value,t.currency=(p=e.prices.originalRowTotal)==null?void 0:p.currency,t.variant=e.discounted?"strikethrough":"default",t["data-testid"]="regular-item-total",a&&(a.amount=(f=e.discountedTotal)==null?void 0:f.value,a.currency=(P=e.discountedTotal)==null?void 0:P.currency,a.sale=!0,a["aria-label"]=n.dictionary.discountedPrice,a["data-testid"]="discount-total")),{totalProps:t,discountProps:a}},Te=e=>{const n=e==null?void 0:e.map(a=>({label:a.label,value:a.values.map(o=>o.label).join(", ")})),t={};return n==null||n.forEach(a=>{t[a.label]=a.value}),Object.keys(t).length>0?t:null},Se=e=>{const n=e==null?void 0:e.map(a=>({label:a.optionLabel,value:a.valueLabel})),t={};return n==null||n.forEach(a=>{t[a.label]=a.value}),Object.keys(t).length>0?t:null},Qe=e=>{const n=e==null?void 0:e.map(a=>({label:a.label,type:a.type,values:a.values.map(o=>({label:o.label,value:o.value}))})),t={};return n==null||n.forEach(a=>{var o;switch(a.type){case"field":case"area":case"date_time":t[a.label]=a.values[0].value;break;case"radio":case"drop_down":t[a.label]=a.values[0].label;break;case"multiple":case"checkbox":t[a.label]=a.values.reduce((r,l)=>r?`${r}, ${l.label}`:l.label,"");break;case"file":{const r=new DOMParser,l=a.values[0].value,m=((o=r.parseFromString(l,"text/html").querySelector("a"))==null?void 0:o.textContent)||"";t[a.label]=m;break}}}),t},qe=4,V=(e,n,t)=>{var r;if(t.attributesToHide.includes("image"))return;const a={loading:n<qe?"eager":"lazy",src:e.image.src,alt:e.image.alt,width:"300",height:"300",params:{width:300}},o=i(se,{"data-testid":"quote-summary-list-item-image",...a});return i(s,{name:"Thumbnail",slot:(r=t.slots)==null?void 0:r.Thumbnail,context:{item:e,defaultImageProps:a},children:t.routeProduct?i("a",{href:t.routeProduct(e),children:o}):o})},W=(e,n)=>{if(!n.attributesToHide.includes("name"))return i("span",{"data-testid":"quote-summary-list-item-title",children:n.routeProduct?i("a",{href:n.routeProduct(e),children:e.product.name}):e.product.name})},Y=e=>i("span",{"data-testid":"quote-summary-list-item-sku",children:e.product.sku}),H=(e,n)=>{var t;return i(s,{name:"ProductAttributes",slot:(t=n.slots)==null?void 0:t.ProductAttributes,context:{item:e}})},J=(e,n)=>{if(n.attributesToHide.includes("configurations"))return;const t={...Te(e.bundleOptions),...Se(e.configurableOptions),...Qe(e.customizableOptions),...e.links&&e.links.count?e.links.count>1?{[n.dictionary.files.replace("{count}",e.links.count.toString())]:e.links.result}:{[n.dictionary.file.replace("{count}",e.links.count.toString())]:e.links.result}:null};if(Object.keys(t).length!==0)return t},K=(e,n)=>{var t;return((t=n.quoteDisplaySettings)==null?void 0:t.price)===b.TAX_INCLUDED_AND_EXCLUDED?i(q,{amount:e.prices.rowTotal.value,currency:e.prices.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":n.dictionary.regularPrice}):void 0},je=({hideHeading:e,hideFooter:n,routeProduct:t,showMaxItems:a=!0,attributesToHide:o=[],slots:r,accordion:l=!1,variant:d="primary",showDiscount:m,showSavings:x,...I})=>{const{quoteData:c,loading:p}=Ie(),[f,P]=N(a),{quoteDisplaySettings:g,quoteSummaryMaxItems:Z}=pe.config,w=Z||5,y=_e({discountedPrice:"NegotiableQuote.QuoteSummaryList.discountedPrice",discountPercentage:"NegotiableQuote.QuoteSummaryList.discountPercentage",editQuote:"NegotiableQuote.QuoteSummaryList.editQuote",file:"NegotiableQuote.QuoteSummaryList.file",files:"NegotiableQuote.QuoteSummaryList.files",heading:"NegotiableQuote.QuoteSummaryList.heading",listOfQuoteItems:"NegotiableQuote.QuoteSummaryList.listOfQuoteItems",regularPrice:"NegotiableQuote.QuoteSummaryList.regularPrice",savingsAmount:"NegotiableQuote.QuoteSummaryList.savingsAmount",viewMore:"NegotiableQuote.QuoteSummaryList.viewMore"}),ee=ce(()=>{P(h=>!h)},[]),T={attributesToHide:o,routeProduct:t,slots:r,dictionary:y,quoteDisplaySettings:g},L={dictionary:y,quoteDisplaySettings:g},O=h=>i(s,{name:"Footer",slot:r==null?void 0:r.Footer,context:{item:h}}),te=h=>c!=null&&c.totalQuantity?c.items.filter(h).map((u,X)=>{const{totalProps:ne,discountProps:$}=G(u,L),ie=i(he,{loading:p,"data-testid":`quote-summary-list-item-entry-${u.uid}`,image:V(u,X,T),title:i(s,{name:"ItemTitle",slot:r==null?void 0:r.ItemTitle,context:{item:u},children:W(u,T)}),sku:o.includes("sku")?void 0:i(s,{name:"ItemSku",slot:r==null?void 0:r.ItemSku,context:{item:u},children:Y(u)}),price:o.includes("price")?void 0:i(s,{name:"ItemPrice",slot:r==null?void 0:r.ItemPrice,context:{item:u},slotTag:"span",children:i(q,{...B(u,L)})}),quantity:o.includes("quantity")?void 0:u.quantity,total:_(C,{children:[o.includes("total")?void 0:i(s,{name:"ItemTotal",slot:r==null?void 0:r.ItemTotal,context:{item:u},children:i(q,{...ne})}),o.includes("totalDiscount")?void 0:$&&i(s,{name:"ItemTotal",slot:r==null?void 0:r.ItemTotal,context:{item:u},children:i(q,{...$})})]}),attributes:H(u,T),configurations:J(u,T),totalExcludingTax:o.includes("totalExcludingTax")?void 0:K(u,T),taxIncluded:(g==null?void 0:g.price)===b.TAX_INCLUDED,taxExcluded:!o.includes("totalExcludingTax")&&(g==null?void 0:g.price)===b.TAX_INCLUDED_AND_EXCLUDED,discount:m&&u.discounted&&u.discountPercentage!==void 0?i("div",{"data-testid":"item-discount-percentage",children:y.discountPercentage.replace("{discount}",u.discountPercentage.toString())}):void 0,savings:x&&u.discounted&&u.savingsAmount!==void 0?_("div",{children:[i("span",{children:i(q,{...z(u)})})," ",y.savingsAmount]}):void 0,footer:O(u)},u.uid);return i(s,{name:"CartItem",slot:r==null?void 0:r.QuoteItem,context:{item:u,index:X,loading:p,attributesToHide:o,quoteDisplaySettings:g,showDiscount:m,showSavings:x,dictionary:y,getImage:V,getTitle:W,getSku:Y,getPriceProps:B,getTotalPriceProps:G,getProductAttributes:H,getConfigurations:J,getTotalExcludingTax:K,getFooter:O,getSavingsAmount:z},children:ie},u.uid)}):null,M=i(s,{name:"Heading",slot:r==null?void 0:r.Heading,context:{count:(c==null?void 0:c.totalQuantity)??0,quoteId:c==null?void 0:c.uid},children:i("div",{"data-testid":"default-quote-summary-list-heading",children:y.heading.replace("({count})",c!=null&&c.totalQuantity?`(${c==null?void 0:c.totalQuantity.toString()})`:"")})}),D=M.props.children.props.children,k=te(h=>!h.outOfStock&&!h.insufficientQuantity),S=(c==null?void 0:c.items.length)||0,ae=f?Math.min(S,w):S,re=S>ae,R=c!=null&&c.totalQuantity&&k?i(s,{name:"Footer",slot:r==null?void 0:r.QuoteSummaryFooter,context:{displayMaxItems:f},"data-testid":"quote-summary-list-footer-slot",className:"quote-management-quote-summary-list-footer",children:re?i(de,{className:"quote-management-quote-summary-list-footer__action",onClick:ee,"data-testid":"view-more-items-button",variant:"tertiary",children:y.viewMore}):null}):null,U=c!=null&&c.totalQuantity?i(me,{"data-testid":"quote-summary-list",children:k==null?void 0:k.slice(0,f?Math.min(S,w):S)}):null;return l?i(ge,{"data-testid":"quote-summary-list-accordion",className:v(["quote-management-quote-summary-list-accordion",`quote-management-quote-summary-list__background--${d}`]),iconOpen:be,iconClose:ve,children:i(ye,{title:D,ariaLabelTitle:D,"data-testid":"quote-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:i(F,{...I,"aria-expanded":!0,"aria-label":y.listOfQuoteItems,className:"quote-management-quote-summary-list-accordion__list",footer:n?void 0:R,products:U,outOfStockMessage:void 0,loading:p,variant:d})})}):i(F,{...I,heading:e?void 0:M,footer:n?void 0:R,products:U,outOfStockMessage:void 0,loading:p,variant:d})};export{je as QuoteSummaryList,je as default};
4
+ //# sourceMappingURL=QuoteSummaryList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuoteSummaryList.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronRight.svg","/@dropins/storefront-quote-management/src/components/QuoteSummaryList/QuoteSummaryList.tsx","/@dropins/storefront-quote-management/src/hooks/useQuoteSummaryData.ts","/@dropins/storefront-quote-management/src/lib/priceCalculators.ts","/@dropins/storefront-quote-management/src/lib/configurationTransformers.ts","/@dropins/storefront-quote-management/src/lib/itemFormatters.tsx","/@dropins/storefront-quote-management/src/containers/QuoteSummaryList/QuoteSummaryList.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronRight = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Chevron_right_Base\", \"data-name\": \"Icon \\\\u2013 Chevron right \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Chevron_right_icon\", \"data-name\": \"Chevron right icon\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", id: \"chevron\", d: \"M199.75,367.5l4.255,-4.255-4.255,-4.255\", transform: \"translate(-189.25 -351.0)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgChevronRight;\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, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Divider,\n Skeleton,\n SkeletonRow,\n} from '@adobe-commerce/elsie/components';\nimport '@/quote-management/components/QuoteSummaryList/QuoteSummaryList.css';\n\nexport interface QuoteSummaryListProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n heading?: VNode | null;\n footer?: VNode | null;\n products?: VNode | null;\n outOfStockMessage?: VNode | null;\n loading?: boolean;\n variant?: 'primary' | 'secondary';\n}\n\nexport const QuoteSummaryList: FunctionComponent<QuoteSummaryListProps> = ({\n className,\n children,\n heading,\n footer,\n products,\n outOfStockMessage,\n loading = true,\n variant = 'primary',\n ...props\n}) => {\n return (\n <div\n {...props}\n className={classes([\n 'quote-management-quote-summary-list',\n className,\n `quote-management-quote-summary-list__background--${variant}`,\n ])}\n >\n {loading ? (\n <QuoteSummaryListSkeleton />\n ) : (\n <>\n {(heading || outOfStockMessage) && (\n <div\n data-testid=\"quote-summary-list-heading-wrapper\"\n className={classes([\n 'quote-management-quote-summary-list__heading',\n [\n 'quote-management-quote-summary-list__heading--full-width',\n !products,\n ],\n ])}\n >\n {heading && (\n <>\n <VComponent\n node={heading}\n className=\"quote-management-quote-summary-list__heading-text\"\n />\n <Divider\n variant=\"primary\"\n className={classes([\n 'quote-management-quote-summary-list__heading-divider',\n ])}\n />\n </>\n )}\n\n {outOfStockMessage && (\n <VComponent\n node={outOfStockMessage}\n className=\"quote-management-quote-summary-list__out-of-stock-message\"\n />\n )}\n </div>\n )}\n <div\n className={classes([\n 'quote-management-quote-summary-list__content',\n ])}\n >\n {products}\n </div>\n\n {footer && (\n <>\n <Divider\n variant=\"primary\"\n className={classes([\n 'quote-management-quote-summary-list__footer-divider',\n ])}\n />\n <VComponent\n node={footer}\n className=\"quote-management-quote-summary-list__footer-text\"\n />\n </>\n )}\n </>\n )}\n </div>\n );\n};\n\nconst QuoteSummaryListSkeleton: FunctionComponent = () => {\n return (\n <Skeleton\n data-testid=\"quote-summary-list-skeleton\"\n className=\"quote-management-quote-summary-list__skeleton\"\n rowGap=\"medium\"\n >\n <SkeletonRow\n variant=\"row\"\n size=\"xlarge\"\n fullWidth={true}\n lines={3}\n multilineGap=\"small\"\n />\n </Skeleton>\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 { useEffect, useState } from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models';\n\n/**\n * Custom hook to manage quote summary data and loading state\n */\nexport const useQuoteSummaryData = () => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(\n undefined\n );\n const [loading, setLoading] = useState<boolean>(true);\n\n useEffect(() => {\n const quoteDataEvent = events.on(\n 'quote-management/quote-data',\n (payload: { quote: NegotiableQuoteModel }) => {\n const { quote } = payload;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n }\n },\n {\n eager: true,\n }\n );\n return () => quoteDataEvent?.off();\n }, []);\n\n return {\n quoteData,\n loading,\n };\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { PriceProps } from '@adobe-commerce/elsie/components';\nimport {\n NegotiableQuoteCartItem as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\n\nexport interface PriceCalculatorOptions {\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get price props for an item\n */\nexport const getPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n return options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n ? item.discounted\n ? {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.priceIncludingTax.value,\n currency: item.prices.priceIncludingTax.currency,\n style: { font: 'inherit' },\n 'data-testid': 'including-tax-item-price',\n }\n : {\n amount: item.prices.regularPrice.value,\n currency: item.prices.regularPrice.currency,\n style: { font: 'inherit' },\n 'data-testid': 'regular-item-price',\n };\n};\n\n/**\n * Get savings amount props for an item\n */\nexport const getSavingsAmount = (item: NegotiableQuoteItemModel) => {\n return {\n amount: item.savingsAmount?.value,\n currency: item.savingsAmount?.currency,\n style: { font: 'inherit' },\n 'data-testid': 'item-savings-amount',\n };\n};\n\n/**\n * Calculate total price props and discount props for an item\n */\nexport const getTotalPriceProps = (\n item: NegotiableQuoteItemModel,\n options: PriceCalculatorOptions\n) => {\n const totalProps: PriceProps & { 'data-testid'?: string } = {\n 'aria-label': options.dictionary.regularPrice,\n };\n const discountProps: (PriceProps & { 'data-testid'?: string }) | null =\n item.discounted ? {} : null;\n\n if (\n options.quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED ||\n options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n ) {\n totalProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n totalProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'including-tax-item-total';\n\n if (discountProps) {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n\n discountProps['amount'] = item.prices.rowTotalIncludingTax?.value;\n discountProps['currency'] = item.prices.rowTotalIncludingTax?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n } else {\n totalProps['amount'] = item.prices.originalRowTotal?.value;\n totalProps['currency'] = item.prices.originalRowTotal?.currency;\n totalProps['variant'] = item.discounted ? 'strikethrough' : 'default';\n totalProps['data-testid'] = 'regular-item-total';\n\n if (discountProps) {\n discountProps['amount'] = item.discountedTotal?.value;\n discountProps['currency'] = item.discountedTotal?.currency;\n discountProps['sale'] = true;\n discountProps['aria-label'] = options.dictionary.discountedPrice;\n discountProps['data-testid'] = 'discount-total';\n }\n }\n\n return {\n totalProps,\n discountProps,\n };\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\n/**\n * Helper function to transform bundle options data to be ready for a CartItem SDK component\n */\nexport const transformBundleOptions = (data: any) => {\n const bundle = data?.map((option: any) => ({\n label: option.label,\n value: option.values.map((value: any) => value.label).join(', '),\n }));\n\n const bundleOptions: { [key: string]: any } = {};\n\n bundle?.forEach((option: any) => {\n bundleOptions[option.label] = option.value;\n });\n\n return Object.keys(bundleOptions).length > 0 ? bundleOptions : null;\n};\n\n/**\n * Helper function to transform configurable options data to be ready for a CartItem SDK component\n */\nexport const transformConfigurableOptions = (data: any) => {\n const configurable = data?.map((option: any) => ({\n label: option.optionLabel,\n value: option.valueLabel,\n }));\n\n const configurableOptions: { [key: string]: any } = {};\n\n configurable?.forEach((option: any) => {\n configurableOptions[option.label] = option.value;\n });\n\n return Object.keys(configurableOptions).length > 0\n ? configurableOptions\n : null;\n};\n\n/**\n * Helper function to transform customizable options data to be ready for a CartItem SDK component\n */\nexport const transformCustomizableOptions = (data: any) => {\n const transformedOptions = data?.map((option: any) => ({\n label: option.label,\n type: option.type,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n }));\n\n const result: { [key: string]: any } = {};\n\n transformedOptions?.forEach((option: any) => {\n switch (option.type) {\n case 'field':\n case 'area':\n case 'date_time':\n result[option.label] = option.values[0].value;\n break;\n case 'radio':\n case 'drop_down':\n result[option.label] = option.values[0].label;\n break;\n case 'multiple':\n case 'checkbox':\n result[option.label] = (option.values as Array<any>).reduce(\n (previous, current) => {\n if (previous) return `${previous}, ${current.label}`;\n return current.label;\n },\n ''\n );\n break;\n case 'file': {\n const parser = new DOMParser();\n const fileAnchorElementHtml = option.values[0].value;\n const doc = parser.parseFromString(fileAnchorElementHtml, 'text/html');\n const anchorText = doc.querySelector('a')?.textContent || '';\n result[option.label] = anchorText;\n break;\n }\n }\n });\n\n return result;\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { Image, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport {\n NegotiableQuoteCartItem as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\nimport { SwitchableAttributes } from '@/quote-management/containers/QuoteSummaryList/QuoteSummaryList';\nimport {\n transformBundleOptions,\n transformConfigurableOptions,\n transformCustomizableOptions,\n} from './configurationTransformers';\n\nconst EAGER_LOAD_THRESHOLD = 4;\n\nexport interface ItemFormatterOptions {\n attributesToHide: SwitchableAttributes[];\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n slots?: {\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n dictionary: Record<string, string>;\n quoteDisplaySettings?: StoreConfigModel['quoteDisplaySettings'];\n}\n\n/**\n * Get image component for an item\n */\nexport const getImage = (\n item: NegotiableQuoteItemModel,\n index: number,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('image')) {\n return undefined;\n }\n\n const defaultImageProps: ImageProps = {\n loading: index < EAGER_LOAD_THRESHOLD ? 'eager' : 'lazy',\n src: item.image.src,\n alt: item.image.alt,\n width: '300',\n height: '300',\n params: { width: 300 },\n };\n\n const imageComponent = (\n <Image\n data-testid=\"quote-summary-list-item-image\"\n {...defaultImageProps}\n />\n );\n return (\n <Slot\n name=\"Thumbnail\"\n slot={options.slots?.Thumbnail}\n context={{ item, defaultImageProps }}\n >\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{imageComponent}</a>\n ) : (\n imageComponent\n )}\n </Slot>\n );\n};\n\n/**\n * Get title component for an item\n */\nexport const getTitle = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('name')) {\n return undefined;\n }\n\n return (\n <span data-testid=\"quote-summary-list-item-title\">\n {options.routeProduct ? (\n <a href={options.routeProduct(item)}>{item.product.name}</a>\n ) : (\n item.product.name\n )}\n </span>\n );\n};\n\n/**\n * Get SKU component for an item\n */\nexport const getSku = (item: NegotiableQuoteItemModel) => {\n return (\n <span data-testid=\"quote-summary-list-item-sku\">{item.product.sku}</span>\n );\n};\n\n/**\n * Get product attributes slot for an item\n */\nexport const getProductAttributes = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return (\n <Slot\n name=\"ProductAttributes\"\n slot={options.slots?.ProductAttributes}\n context={{ item }}\n />\n );\n};\n\n/**\n * Get configurations for an item (bundle, configurable, customizable options)\n */\nexport const getConfigurations = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n if (options.attributesToHide.includes('configurations')) {\n return undefined;\n }\n\n const configuration = {\n ...transformBundleOptions(item.bundleOptions),\n ...transformConfigurableOptions(item.configurableOptions),\n ...transformCustomizableOptions(item.customizableOptions),\n ...(item.links && item.links.count\n ? item.links.count > 1\n ? {\n [options.dictionary.files.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : {\n [options.dictionary.file.replace(\n '{count}',\n item.links.count.toString()\n )]: item.links.result,\n }\n : null),\n };\n\n if (Object.keys(configuration).length === 0) {\n return undefined;\n }\n\n return configuration;\n};\n\n/**\n * Get total excluding tax component for an item\n */\nexport const getTotalExcludingTax = (\n item: NegotiableQuoteItemModel,\n options: ItemFormatterOptions\n) => {\n return options.quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED ? (\n <Price\n amount={item.prices.rowTotal.value}\n currency={item.prices.rowTotal.currency}\n data-testid=\"excluding-tax-total\"\n aria-label={options.dictionary.regularPrice}\n />\n ) : undefined;\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { HTMLAttributes, useCallback, useState } from 'preact/compat';\n\nimport {\n Accordion,\n AccordionSection,\n Button,\n CartItem,\n CartList,\n ImageProps,\n Price,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, ChevronRight } from '@adobe-commerce/elsie/icons';\nimport { Container, Slot, SlotProps, classes } from '@adobe-commerce/elsie/lib';\n\nimport { QuoteSummaryList as QuoteSummaryListComponent } from '@/quote-management/components';\nimport {\n NegotiableQuoteCartItem as NegotiableQuoteItemModel,\n QuoteDisplayAmount,\n} from '@/quote-management/data/models';\nimport { state } from '@/quote-management/lib/state';\nimport { useQuoteSummaryData } from '@/quote-management/hooks/useQuoteSummaryData';\nimport {\n getPriceProps,\n getSavingsAmount,\n getTotalPriceProps,\n} from '@/quote-management/lib/priceCalculators';\nimport {\n getImage,\n getTitle,\n getSku,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n} from '@/quote-management/lib/itemFormatters';\n\nexport interface QuoteSummaryListProps extends HTMLAttributes<HTMLDivElement> {\n hideHeading?: boolean;\n hideFooter?: boolean;\n routeProduct?: (item: NegotiableQuoteItemModel) => string;\n showMaxItems?: boolean;\n attributesToHide?: SwitchableAttributes[];\n slots?: {\n Heading?: SlotProps<{ count: number; quoteId: string }>;\n Footer?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n Thumbnail?: SlotProps<{\n item: NegotiableQuoteItemModel;\n defaultImageProps: ImageProps;\n }>;\n ProductAttributes?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n QuoteSummaryFooter?: SlotProps<{\n displayMaxItems: boolean;\n }>;\n QuoteItem?: SlotProps;\n ItemTitle?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemPrice?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemTotal?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n ItemSku?: SlotProps<{ item: NegotiableQuoteItemModel }>;\n };\n accordion?: boolean;\n variant?: 'primary' | 'secondary';\n showDiscount?: boolean;\n showSavings?: boolean;\n}\n\n// Attributes that can be hidden or shown\nexport type SwitchableAttributes =\n | 'name'\n | 'image'\n | 'configurations'\n | 'warning'\n | 'alert'\n | 'sku'\n | 'price'\n | 'quantity'\n | 'total'\n | 'totalDiscount'\n | 'totalExcludingTax';\n\nexport const QuoteSummaryList: Container<QuoteSummaryListProps> = ({\n hideHeading,\n hideFooter,\n routeProduct,\n showMaxItems = true,\n attributesToHide = [],\n slots,\n accordion = false,\n variant = 'primary',\n showDiscount,\n showSavings,\n ...props\n}) => {\n const CART_SUMMARY_MAX_ITEMS = 5;\n\n const { quoteData, loading } = useQuoteSummaryData();\n const [displayMaxItems, setDisplayMaxItems] = useState<boolean>(showMaxItems);\n\n const { quoteDisplaySettings, quoteSummaryMaxItems } = state.config;\n const maxItems = quoteSummaryMaxItems || CART_SUMMARY_MAX_ITEMS;\n\n const dictionary = useText({\n discountedPrice: 'NegotiableQuote.QuoteSummaryList.discountedPrice',\n discountPercentage: 'NegotiableQuote.QuoteSummaryList.discountPercentage',\n editQuote: 'NegotiableQuote.QuoteSummaryList.editQuote',\n file: 'NegotiableQuote.QuoteSummaryList.file',\n files: 'NegotiableQuote.QuoteSummaryList.files',\n heading: 'NegotiableQuote.QuoteSummaryList.heading',\n listOfQuoteItems: 'NegotiableQuote.QuoteSummaryList.listOfQuoteItems',\n regularPrice: 'NegotiableQuote.QuoteSummaryList.regularPrice',\n savingsAmount: 'NegotiableQuote.QuoteSummaryList.savingsAmount',\n viewMore: 'NegotiableQuote.QuoteSummaryList.viewMore',\n });\n\n // Display max items\n const handleMaxItemsView = useCallback(() => {\n setDisplayMaxItems((prev) => !prev);\n }, []);\n\n // Options for item formatters\n const formatterOptions = {\n attributesToHide,\n routeProduct,\n slots,\n dictionary,\n quoteDisplaySettings,\n };\n\n // Options for price calculators\n const calculatorOptions = {\n dictionary,\n quoteDisplaySettings,\n };\n\n const getFooter = (item: NegotiableQuoteItemModel) => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ item }} />;\n };\n\n // Re-usable function to get a filtered list of cart items\n const getCartItemEntries = (\n filterCallback: (item: NegotiableQuoteItemModel) => boolean\n ) => {\n return quoteData?.totalQuantity\n ? quoteData.items.filter(filterCallback).map((item, index) => {\n const { totalProps, discountProps } = getTotalPriceProps(\n item,\n calculatorOptions\n );\n\n const defaultCartItem = (\n <CartItem\n loading={loading}\n key={item.uid}\n data-testid={`quote-summary-list-item-entry-${item.uid}`}\n image={getImage(item, index, formatterOptions)}\n title={\n <Slot\n name=\"ItemTitle\"\n slot={slots?.ItemTitle}\n context={{ item }}\n >\n {getTitle(item, formatterOptions)}\n </Slot>\n }\n sku={\n attributesToHide.includes('sku') ? undefined : (\n <Slot name=\"ItemSku\" slot={slots?.ItemSku} context={{ item }}>\n {getSku(item)}\n </Slot>\n )\n }\n price={\n attributesToHide.includes('price') ? undefined : (\n <Slot\n name=\"ItemPrice\"\n slot={slots?.ItemPrice}\n context={{ item }}\n slotTag=\"span\"\n >\n <Price {...getPriceProps(item, calculatorOptions)} />\n </Slot>\n )\n }\n quantity={\n attributesToHide.includes('quantity')\n ? undefined\n : item.quantity\n }\n total={\n <>\n {attributesToHide.includes('total') ? undefined : (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...totalProps} />\n </Slot>\n )}\n {attributesToHide.includes('totalDiscount')\n ? undefined\n : discountProps && (\n <Slot\n name=\"ItemTotal\"\n slot={slots?.ItemTotal}\n context={{ item }}\n >\n <Price {...discountProps} />\n </Slot>\n )}\n </>\n }\n attributes={getProductAttributes(item, formatterOptions)}\n configurations={getConfigurations(item, formatterOptions)}\n totalExcludingTax={\n attributesToHide.includes('totalExcludingTax')\n ? undefined\n : getTotalExcludingTax(item, formatterOptions)\n }\n taxIncluded={\n quoteDisplaySettings?.price === QuoteDisplayAmount.TAX_INCLUDED\n }\n taxExcluded={\n !attributesToHide.includes('totalExcludingTax') &&\n quoteDisplaySettings?.price ===\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED\n }\n discount={\n showDiscount &&\n item.discounted &&\n item.discountPercentage !== undefined ? (\n <div data-testid=\"item-discount-percentage\">\n {dictionary.discountPercentage.replace(\n '{discount}',\n item.discountPercentage.toString()\n )}\n </div>\n ) : undefined\n }\n savings={\n showSavings &&\n item.discounted &&\n item.savingsAmount !== undefined ? (\n <div>\n <span>\n <Price {...getSavingsAmount(item)} />\n </span>\n &nbsp;\n {dictionary.savingsAmount}\n </div>\n ) : undefined\n }\n footer={getFooter(item)}\n />\n );\n\n return (\n <Slot\n key={item.uid}\n name=\"CartItem\"\n slot={slots?.QuoteItem}\n context={{\n item,\n index,\n loading,\n attributesToHide,\n quoteDisplaySettings,\n showDiscount,\n showSavings,\n dictionary,\n getImage,\n getTitle,\n getSku,\n getPriceProps,\n getTotalPriceProps,\n getProductAttributes,\n getConfigurations,\n getTotalExcludingTax,\n getFooter,\n getSavingsAmount,\n }}\n >\n {defaultCartItem}\n </Slot>\n );\n })\n : null;\n };\n\n const heading = (\n <Slot\n name=\"Heading\"\n slot={slots?.Heading}\n context={{\n count: quoteData?.totalQuantity ?? 0,\n quoteId: quoteData?.uid!,\n }}\n >\n <div data-testid=\"default-quote-summary-list-heading\">\n {dictionary.heading.replace(\n '({count})',\n quoteData?.totalQuantity\n ? `(${quoteData?.totalQuantity.toString()})`\n : ''\n )}\n </div>\n </Slot>\n );\n\n // Heading Section text for screen reader\n const headingSection = heading.props.children.props.children;\n\n // Main Product Entries\n const mainProductEntries = getCartItemEntries(\n (item) => !item.outOfStock && !item.insufficientQuantity\n );\n\n const totalLineItems = quoteData?.items.length || 0;\n const numOfVisibleItems = displayMaxItems\n ? Math.min(totalLineItems, maxItems)\n : totalLineItems;\n\n const hasHiddenItems = totalLineItems > numOfVisibleItems;\n\n const footerActions =\n quoteData?.totalQuantity && mainProductEntries ? (\n <Slot\n name=\"Footer\"\n slot={slots?.QuoteSummaryFooter}\n context={{ displayMaxItems }}\n data-testid=\"quote-summary-list-footer-slot\"\n className=\"quote-management-quote-summary-list-footer\"\n >\n {hasHiddenItems ? (\n <Button\n className=\"quote-management-quote-summary-list-footer__action\"\n onClick={handleMaxItemsView}\n data-testid=\"view-more-items-button\"\n variant=\"tertiary\"\n >\n {dictionary.viewMore}\n </Button>\n ) : null}\n </Slot>\n ) : null;\n\n const productEntries = quoteData?.totalQuantity ? (\n <CartList data-testid=\"quote-summary-list\">\n {mainProductEntries?.slice(\n 0,\n displayMaxItems ? Math.min(totalLineItems, maxItems) : totalLineItems\n )}\n </CartList>\n ) : null;\n\n return accordion ? (\n <Accordion\n data-testid=\"quote-summary-list-accordion\"\n className={classes([\n `quote-management-quote-summary-list-accordion`,\n `quote-management-quote-summary-list__background--${variant}`,\n ])}\n iconOpen={ChevronRight}\n iconClose={ChevronDown}\n >\n <AccordionSection\n title={headingSection}\n ariaLabelTitle={headingSection}\n data-testid=\"quote-summary-list-accordion__section\"\n open={true}\n renderContentWhenClosed={true}\n >\n <QuoteSummaryListComponent\n {...props}\n aria-expanded={true}\n aria-label={dictionary.listOfQuoteItems}\n className={`quote-management-quote-summary-list-accordion__list`}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n </AccordionSection>\n </Accordion>\n ) : (\n <QuoteSummaryListComponent\n {...props}\n heading={hideHeading ? undefined : heading}\n footer={hideFooter ? undefined : footerActions}\n products={productEntries}\n outOfStockMessage={undefined}\n loading={loading}\n variant={variant}\n />\n );\n};\n"],"names":["SvgChevronRight","props","React","QuoteSummaryList","className","children","heading","footer","products","outOfStockMessage","loading","variant","jsx","classes","QuoteSummaryListSkeleton","jsxs","Fragment","VComponent","Divider","Skeleton","SkeletonRow","useQuoteSummaryData","quoteData","setQuoteData","useState","setLoading","useEffect","quoteDataEvent","events","payload","quote","getPriceProps","item","options","_a","QuoteDisplayAmount","getSavingsAmount","_b","getTotalPriceProps","totalProps","discountProps","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","transformBundleOptions","data","bundle","option","value","bundleOptions","transformConfigurableOptions","configurable","configurableOptions","transformCustomizableOptions","transformedOptions","result","previous","current","parser","fileAnchorElementHtml","anchorText","EAGER_LOAD_THRESHOLD","getImage","index","defaultImageProps","imageComponent","Image","Slot","getTitle","getSku","getProductAttributes","getConfigurations","configuration","getTotalExcludingTax","Price","hideHeading","hideFooter","routeProduct","showMaxItems","attributesToHide","slots","accordion","showDiscount","showSavings","displayMaxItems","setDisplayMaxItems","quoteDisplaySettings","quoteSummaryMaxItems","state","maxItems","dictionary","useText","handleMaxItemsView","useCallback","prev","formatterOptions","calculatorOptions","getFooter","getCartItemEntries","filterCallback","defaultCartItem","CartItem","headingSection","mainProductEntries","totalLineItems","numOfVisibleItems","hasHiddenItems","footerActions","Button","productEntries","CartList","Accordion","ChevronRight","ChevronDown","AccordionSection","QuoteSummaryListComponent"],"mappings":"q8BACA,MAAMA,GAAmBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,0BAA2B,YAAa,0CAA2C,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,CAAK,EAAoBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAO,EAAoBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,CAAC,CAAE,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,qBAAsB,YAAa,sBAAwCA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,UAAW,EAAG,0CAA2C,UAAW,4BAA6B,KAAM,OAAQ,OAAQ,cAAc,CAAE,CAAC,CAAC,CAAC,EC4BnxBC,EAA6D,CAAC,CACzE,UAAAC,EACA,SAAAC,EACA,QAAAC,EACA,OAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,QAAAC,EAAU,GACV,QAAAC,EAAU,UACV,GAAGV,CACL,IAEIW,EAAC,MAAA,CACE,GAAGX,EACJ,UAAWY,EAAQ,CACjB,sCACAT,EACA,oDAAoDO,CAAO,EAAA,CAC5D,EAEA,SAAAD,EACCE,EAACE,GAAA,CAAA,CAAyB,EAE1BC,EAAAC,EAAA,CACI,SAAA,EAAAV,GAAWG,IACXM,EAAC,MAAA,CACC,cAAY,qCACZ,UAAWF,EAAQ,CACj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AAA,CAC5D,EACD,SAAU4G,GACV,UAAWC,GAEX,SAAA5G,EAAC6G,GAAA,CACC,MAAOZ,EACP,eAAgBA,EAChB,cAAY,wCACZ,KAAM,GACN,wBAAyB,GAEzB,SAAAjG,EAAC8G,EAAA,CACE,GAAGzH,EACJ,gBAAe,GACf,aAAYgG,EAAW,iBACvB,UAAW,sDACX,OAAQd,EAAa,OAAY+B,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAA1G,EACA,QAAAC,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EAGFC,EAAC8G,EAAA,CACE,GAAGzH,EACJ,QAASiF,EAAc,OAAY5E,EACnC,OAAQ6E,EAAa,OAAY+B,EACjC,SAAUE,EACV,kBAAmB,OACnB,QAAA1G,EACA,QAAAC,CAAA,CAAA,CAGN","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsxs as v,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as Q,useEffect as E}from"@dropins/tools/preact-compat.js";import{classes as A,Slot as l}from"@dropins/tools/lib.js";import{Table as C,IllustratedMessage as F,Picker as j,Pagination as G,Price as V}from"@dropins/tools/components.js";import{events as $}from"@dropins/tools/event-bus.js";/* empty css *//* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{useText as B}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{g as k}from"../chunks/fetch-graphql.js";import"../chunks/state.js";import{g as H}from"../chunks/getQuoteTemplates.js";import"@dropins/tools/fetch-graphql.js";const J=({rowData:p=[],loading:h=!1,className:y,emptyStateMessage:S,showItemRange:u=!0,itemRangeMessage:d,showPageSizePicker:o=!0,pageSizePickerMessage:T,showPagination:n=!0,paginationMessage:m,...z})=>{const c=B({name:"QuoteManagement.QuoteTemplatesListTable.name",state:"QuoteManagement.QuoteTemplatesListTable.state",status:"QuoteManagement.QuoteTemplatesListTable.status",validUntil:"QuoteManagement.QuoteTemplatesListTable.validUntil",minQuoteTotal:"QuoteManagement.QuoteTemplatesListTable.minQuoteTotal",ordersPlaced:"QuoteManagement.QuoteTemplatesListTable.ordersPlaced",lastOrdered:"QuoteManagement.QuoteTemplatesListTable.lastOrdered",actions:"QuoteManagement.QuoteTemplatesListTable.actions"}),x=[{key:"name",label:c.name},{key:"state",label:c.state},{key:"status",label:c.status},{key:"validUntil",label:c.validUntil},{key:"minQuoteTotal",label:c.minQuoteTotal},{key:"ordersPlaced",label:c.ordersPlaced},{key:"lastOrdered",label:c.lastOrdered},{key:"actions",label:c.actions}],P=!h&&p.length===0&&S,f=u&&d,s=o&&T,g=n&&m,b=f||s||g;return v("div",{...z,className:A(["quote-management-quote-templates-list-table",y]),children:[a(C,{columns:x,rowData:p,loading:h,mobileLayout:"none",className:"quote-management-quote-templates-list-table__table"}),P&&a("div",{className:"quote-templates-list-table__empty-state",children:S}),b&&v("div",{className:"quote-templates-list-table__footer",children:[a("div",{className:"quote-templates-list-table__item-range",children:f&&d}),a("div",{className:"quote-templates-list-table__pagination",children:g&&m}),a("div",{className:"quote-templates-list-table__page-size-picker",children:s&&T})]})]})},se=({pageSize:p,showItemRange:h=!0,showPageSizePicker:y=!0,showPagination:S=!0,onPageSizeChange:u,onPageChange:d,slots:o,...T})=>{const[n,m]=Q(null),[z,c]=Q(!0),x=k()[0],[P,f]=Q(p||x),[s,g]=Q(1);E(()=>{const r=async()=>{try{c(!0);const t=await H({pageSize:P,currentPage:s});m(t)}catch(t){console.error("Failed to fetch quote templates:",t)}finally{c(!1)}},e=$.on("authenticated",t=>{t?r():(m(null),c(!1))},{eager:!0});return()=>{e==null||e.off()}},[P,s]);const b=r=>{f(r),g(1),u==null||u(r)},N=r=>{g(r),d==null||d(r)},_=r=>{const e=r.target,t=e==null?void 0:e.value;t&&b(Number(t))},O=r=>{const e=new Date(r);return isNaN(e.getTime())?"–":e.toLocaleDateString()},M=(r,e)=>r.filter(t=>t==null?void 0:t.uid).map(t=>{var L;return{id:t.id,name:a(l,{name:"Name",slot:e==null?void 0:e.Name,context:{template:t},children:a("span",{children:t.name})}),state:a(l,{name:"State",slot:e==null?void 0:e.State,context:{template:t},children:a("span",{style:{textTransform:"capitalize"},children:((L=t.state)==null?void 0:L.replace(/_/g," "))||"-"})}),status:a(l,{name:"Status",slot:e==null?void 0:e.Status,context:{template:t},children:a("span",{children:t.status})}),validUntil:a(l,{name:"ValidUntil",slot:e==null?void 0:e.ValidUntil,context:{template:t},children:a("span",{children:O(t.expirationDate)})}),minQuoteTotal:a(l,{name:"MinQuoteTotal",slot:e==null?void 0:e.MinQuoteTotal,context:{template:t},children:a(V,{amount:t.prices.minNegotiatedGrandTotal.value,currency:t.prices.minNegotiatedGrandTotal.currency})}),ordersPlaced:a(l,{name:"OrdersPlaced",slot:e==null?void 0:e.OrdersPlaced,context:{template:t},children:a("span",{children:t.ordersPlaced})}),lastOrdered:a(l,{name:"LastOrdered",slot:e==null?void 0:e.LastOrdered,context:{template:t},children:a("span",{children:O(t.lastOrderedAt)})}),actions:a(l,{name:"Actions",slot:e==null?void 0:e.Actions,context:{template:t},children:a("span",{})})}}),w=n!=null&&n.items?M(n.items,o):[],i=n!=null&&n.pageInfo?{currentPage:n.pageInfo.currentPage,pageSize:n.pageInfo.pageSize,totalPages:n.pageInfo.totalPages,totalCount:n.totalCount,startItem:(n.pageInfo.currentPage-1)*n.pageInfo.pageSize+1,endItem:Math.min(n.pageInfo.currentPage*n.pageInfo.pageSize,n.totalCount),pageSizeOptions:k()}:void 0,I=!!i,q=a(l,{name:"EmptyTemplates",slot:o==null?void 0:o.EmptyTemplates,context:{templatesData:n},children:a(F,{heading:"No Quote Templates Found"})}),U=i?a(l,{name:"ItemRange",slot:o==null?void 0:o.ItemRange,context:i,children:v("span",{children:["Items ",i.startItem," to ",i.endItem," of"," ",i.totalCount," total"]})}):void 0,R=i&&i.pageSizeOptions?v(l,{name:"PageSizePicker",slot:o==null?void 0:o.PageSizePicker,context:{pageSize:i.pageSize,pageSizeOptions:i.pageSizeOptions,onPageSizeChange:b},children:[a("span",{children:"Show "}),a(j,{variant:"primary",size:"medium",value:String(i.pageSize),options:i.pageSizeOptions.map(r=>({value:String(r),text:String(r)})),handleSelect:_}),a("span",{children:" per page"})]}):void 0,D=i?a(l,{name:"Pagination",slot:o==null?void 0:o.Pagination,context:{currentPage:i.currentPage,totalPages:i.totalPages,onChange:N},children:a(G,{currentPage:i.currentPage,totalPages:i.totalPages,onChange:N})}):void 0;return a(J,{rowData:w,loading:z,className:T.className,emptyStateMessage:q,showItemRange:h&&I,itemRangeMessage:U,showPageSizePicker:y&&I,pageSizePickerMessage:R,showPagination:S&&I,paginationMessage:D})};export{se as QuoteTemplatesListTable,se as default};
3
+ import{jsxs as v,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as Q,useEffect as A}from"@dropins/tools/preact-compat.js";import{classes as F,Slot as c}from"@dropins/tools/lib.js";import{Table as j,IllustratedMessage as D,Picker as G,Pagination as V,Price as $}from"@dropins/tools/components.js";import{events as B}from"@dropins/tools/event-bus.js";/* empty css *//* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{useText as C}from"@dropins/tools/i18n.js";import{f as L}from"../chunks/dateUtils.js";/* empty css *//* empty css *//* empty css */import{g as _}from"../chunks/fetch-graphql.js";import"../chunks/state.js";import{g as H}from"../chunks/getQuoteTemplates.js";import"@dropins/tools/fetch-graphql.js";const J=({rowData:g=[],loading:h=!1,className:y,emptyStateMessage:T,showItemRange:m=!0,itemRangeMessage:d,showPageSizePicker:i=!0,pageSizePickerMessage:S,showPagination:l=!0,paginationMessage:u,...x})=>{const o=C({name:"QuoteManagement.QuoteTemplatesListTable.name",state:"QuoteManagement.QuoteTemplatesListTable.state",status:"QuoteManagement.QuoteTemplatesListTable.status",validUntil:"QuoteManagement.QuoteTemplatesListTable.validUntil",minQuoteTotal:"QuoteManagement.QuoteTemplatesListTable.minQuoteTotal",ordersPlaced:"QuoteManagement.QuoteTemplatesListTable.ordersPlaced",lastOrdered:"QuoteManagement.QuoteTemplatesListTable.lastOrdered",actions:"QuoteManagement.QuoteTemplatesListTable.actions"}),z=[{key:"name",label:o.name},{key:"state",label:o.state},{key:"status",label:o.status},{key:"validUntil",label:o.validUntil},{key:"minQuoteTotal",label:o.minQuoteTotal},{key:"ordersPlaced",label:o.ordersPlaced},{key:"lastOrdered",label:o.lastOrdered},{key:"actions",label:o.actions}],f=!h&&g.length===0&&T,P=m&&d,s=i&&S,p=l&&u,b=P||s||p;return v("div",{...x,className:F(["quote-management-quote-templates-list-table",y]),children:[a(j,{columns:z,rowData:g,loading:h,mobileLayout:"none",className:"quote-management-quote-templates-list-table__table"}),f&&a("div",{className:"quote-templates-list-table__empty-state",children:T}),b&&v("div",{className:"quote-templates-list-table__footer",children:[a("div",{className:"quote-templates-list-table__item-range",children:P&&d}),a("div",{className:"quote-templates-list-table__pagination",children:p&&u}),a("div",{className:"quote-templates-list-table__page-size-picker",children:s&&S})]})]})},pe=({pageSize:g,showItemRange:h=!0,showPageSizePicker:y=!0,showPagination:T=!0,onPageSizeChange:m,onPageChange:d,slots:i,...S})=>{const[l,u]=Q(null),[x,o]=Q(!0),z=_()[0],[f,P]=Q(g||z),[s,p]=Q(1);A(()=>{const r=async()=>{try{o(!0);const t=await H({pageSize:f,currentPage:s});u(t)}catch(t){console.error("Failed to fetch quote templates:",t)}finally{o(!1)}},e=B.on("authenticated",t=>{t?r():(u(null),o(!1))},{eager:!0});return()=>{e==null||e.off()}},[f,s]);const b=r=>{P(r),p(1),m==null||m(r)},N=r=>{p(r),d==null||d(r)},I=r=>{const e=r.target,t=e==null?void 0:e.value;t&&b(Number(t))},M=(r,e)=>r.filter(t=>t==null?void 0:t.uid).map(t=>{var k;return{id:t.id,name:a(c,{name:"Name",slot:e==null?void 0:e.Name,context:{template:t},children:a("span",{children:t.name})}),state:a(c,{name:"State",slot:e==null?void 0:e.State,context:{template:t},children:a("span",{style:{textTransform:"capitalize"},children:((k=t.state)==null?void 0:k.replace(/_/g," "))||"-"})}),status:a(c,{name:"Status",slot:e==null?void 0:e.Status,context:{template:t},children:a("span",{children:t.status})}),validUntil:a(c,{name:"ValidUntil",slot:e==null?void 0:e.ValidUntil,context:{template:t},children:a("span",{children:L(t.expirationDate)})}),minQuoteTotal:a(c,{name:"MinQuoteTotal",slot:e==null?void 0:e.MinQuoteTotal,context:{template:t},children:a($,{amount:t.prices.minNegotiatedGrandTotal.value,currency:t.prices.minNegotiatedGrandTotal.currency})}),ordersPlaced:a(c,{name:"OrdersPlaced",slot:e==null?void 0:e.OrdersPlaced,context:{template:t},children:a("span",{children:t.ordersPlaced})}),lastOrdered:a(c,{name:"LastOrdered",slot:e==null?void 0:e.LastOrdered,context:{template:t},children:a("span",{children:L(t.lastOrderedAt)})}),actions:a(c,{name:"Actions",slot:e==null?void 0:e.Actions,context:{template:t},children:a("span",{})})}}),q=l!=null&&l.items?M(l.items,i):[],n=l!=null&&l.paginationInfo?{...l.paginationInfo,pageSizeOptions:_()}:void 0,O=!!n,w=a(c,{name:"EmptyTemplates",slot:i==null?void 0:i.EmptyTemplates,context:{templatesData:l},children:a(D,{heading:"No Quote Templates Found"})}),U=n?a(c,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:n,children:v("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,R=n&&n.pageSizeOptions?v(c,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:b},children:[a("span",{children:"Show "}),a(G,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(r=>({value:String(r),text:String(r)})),handleSelect:I}),a("span",{children:" per page"})]}):void 0,E=n?a(c,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:N},children:a(V,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:N})}):void 0;return a(J,{rowData:q,loading:x,className:S.className,emptyStateMessage:w,showItemRange:h&&O,itemRangeMessage:U,showPageSizePicker:y&&O,pageSizePickerMessage:R,showPagination:T&&O,paginationMessage:E})};export{pe as QuoteTemplatesListTable,pe as default};
4
4
  //# sourceMappingURL=QuoteTemplatesListTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuoteTemplatesListTable.js","sources":["/@dropins/storefront-quote-management/src/components/QuoteTemplatesListTable/QuoteTemplatesListTable.tsx","/@dropins/storefront-quote-management/src/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.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 } from '@adobe-commerce/elsie/lib';\nimport { Table } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/QuoteTemplatesListTable/QuoteTemplatesListTable.css';\n\ntype Column = {\n key: string;\n label: string;\n};\n\nexport interface QuoteTemplatesListTableProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {\n rowData: QuoteTemplateRowData[];\n loading?: boolean;\n className?: string;\n emptyStateMessage?: VNode;\n showItemRange?: boolean;\n itemRangeMessage?: VNode;\n showPageSizePicker?: boolean;\n pageSizePickerMessage?: VNode;\n showPagination?: boolean;\n paginationMessage?: VNode;\n}\n\nexport type QuoteTemplateRowData = {\n id: string;\n name: VNode;\n state: VNode;\n status: VNode;\n validUntil: VNode;\n minQuoteTotal: VNode;\n ordersPlaced: VNode;\n lastOrdered: VNode;\n actions: VNode;\n [key: string]: VNode | string | number | undefined;\n};\n\nexport const QuoteTemplatesListTable: FunctionComponent<\n QuoteTemplatesListTableProps\n> = ({\n rowData = [],\n loading = false,\n className,\n emptyStateMessage,\n showItemRange = true,\n itemRangeMessage,\n showPageSizePicker = true,\n pageSizePickerMessage,\n showPagination = true,\n paginationMessage,\n ...props\n}) => {\n const dictionary = useText({\n name: 'QuoteManagement.QuoteTemplatesListTable.name',\n state: 'QuoteManagement.QuoteTemplatesListTable.state',\n status: 'QuoteManagement.QuoteTemplatesListTable.status',\n validUntil: 'QuoteManagement.QuoteTemplatesListTable.validUntil',\n minQuoteTotal: 'QuoteManagement.QuoteTemplatesListTable.minQuoteTotal',\n ordersPlaced: 'QuoteManagement.QuoteTemplatesListTable.ordersPlaced',\n lastOrdered: 'QuoteManagement.QuoteTemplatesListTable.lastOrdered',\n actions: 'QuoteManagement.QuoteTemplatesListTable.actions',\n });\n\n const columns: Column[] = [\n { key: 'name', label: dictionary.name },\n { key: 'state', label: dictionary.state },\n { key: 'status', label: dictionary.status },\n { key: 'validUntil', label: dictionary.validUntil },\n { key: 'minQuoteTotal', label: dictionary.minQuoteTotal },\n { key: 'ordersPlaced', label: dictionary.ordersPlaced },\n { key: 'lastOrdered', label: dictionary.lastOrdered },\n { key: 'actions', label: dictionary.actions },\n ];\n\n // Check if we should show empty state\n const shouldShowEmptyState =\n !loading && rowData.length === 0 && emptyStateMessage;\n\n // Show item range if requested and message is provided\n const shouldShowItemRange = showItemRange && itemRangeMessage;\n\n // Show page size picker if requested and message is provided\n const shouldShowPageSizePicker = showPageSizePicker && pageSizePickerMessage;\n\n // Show pagination if requested and message is provided\n const shouldShowPagination = showPagination && paginationMessage;\n\n // Show footer if any pagination element should be shown\n const shouldShowFooter =\n shouldShowItemRange || shouldShowPageSizePicker || shouldShowPagination;\n\n return (\n <div\n {...props}\n className={classes([\n 'quote-management-quote-templates-list-table',\n className,\n ])}\n >\n <Table\n columns={columns}\n rowData={rowData}\n loading={loading}\n mobileLayout=\"none\"\n className=\"quote-management-quote-templates-list-table__table\"\n />\n {shouldShowEmptyState && (\n <div className=\"quote-templates-list-table__empty-state\">\n {emptyStateMessage}\n </div>\n )}\n {shouldShowFooter && (\n <div className=\"quote-templates-list-table__footer\">\n <div className=\"quote-templates-list-table__item-range\">\n {shouldShowItemRange && itemRangeMessage}\n </div>\n <div className=\"quote-templates-list-table__pagination\">\n {shouldShowPagination && paginationMessage}\n </div>\n <div className=\"quote-templates-list-table__page-size-picker\">\n {shouldShowPageSizePicker && pageSizePickerMessage}\n </div>\n </div>\n )}\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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport {\n Price,\n IllustratedMessage,\n Picker,\n Pagination,\n type PickerOption,\n} from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n QuoteTemplatesListTable as QuoteTemplatesListTableComponent,\n QuoteTemplateRowData,\n} from '@/quote-management/components';\nimport { getQuoteTemplates } from '@/quote-management/api';\nimport { getDefaultPageSizeOptions } from '@/quote-management/data/transforms';\nimport {\n NegotiableQuoteTemplatesListModel,\n NegotiableQuoteTemplateListEntry,\n} from '@/quote-management/data/models';\n\nexport interface QuoteTemplatesListTableProps\n extends HTMLAttributes<HTMLDivElement> {\n pageSize?: number;\n showItemRange?: boolean;\n showPageSizePicker?: boolean;\n showPagination?: boolean;\n onPageSizeChange?: (pageSize: number) => void;\n onPageChange?: (page: number) => void;\n slots?: {\n /** Slot for customizing the template name cell content */\n Name?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the state cell content */\n State?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the status cell content */\n Status?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the valid until cell content */\n ValidUntil?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the min quote total cell content */\n MinQuoteTotal?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the orders placed cell content */\n OrdersPlaced?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the last ordered cell content */\n LastOrdered?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the actions cell content */\n Actions?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the empty templates message */\n EmptyTemplates?: SlotProps;\n /** Slot for customizing the item range display */\n ItemRange?: SlotProps<{\n startItem: number;\n endItem: number;\n totalCount: number;\n currentPage: number;\n pageSize: number;\n }>;\n /** Slot for customizing the page size picker */\n PageSizePicker?: SlotProps<{\n pageSize: number;\n pageSizeOptions: number[];\n onPageSizeChange?: (pageSize: number) => void;\n }>;\n /** Slot for customizing the pagination */\n Pagination?: SlotProps<{\n currentPage: number;\n totalPages: number;\n onChange?: (page: number) => void;\n }>;\n };\n}\n\nexport const QuoteTemplatesListTable: Container<\n QuoteTemplatesListTableProps\n> = ({\n pageSize,\n showItemRange = true,\n showPageSizePicker = true,\n showPagination = true,\n onPageSizeChange,\n onPageChange,\n slots,\n ...props\n}) => {\n const [templatesData, setTemplatesData] =\n useState<NegotiableQuoteTemplatesListModel | null>(null);\n const [loading, setLoading] = useState(true);\n\n // Default to first page size option if no pageSize prop provided\n const defaultPageSize = getDefaultPageSizeOptions()[0];\n const [currentPageSize, setCurrentPageSize] = useState(\n pageSize || defaultPageSize\n );\n const [currentPage, setCurrentPage] = useState(1);\n\n // Fetch quote templates data when authenticated\n useEffect(() => {\n const fetchTemplates = async () => {\n try {\n setLoading(true);\n const data = await getQuoteTemplates({\n pageSize: currentPageSize,\n currentPage,\n });\n setTemplatesData(data);\n } catch (error) {\n console.error('Failed to fetch quote templates:', error);\n } finally {\n setLoading(false);\n }\n };\n\n // Listen for authentication events\n const unsubscribe = events.on(\n 'authenticated',\n (isAuthenticated) => {\n if (isAuthenticated) {\n fetchTemplates();\n } else {\n setTemplatesData(null);\n setLoading(false);\n }\n },\n { eager: true }\n ); // eager: true means it fires immediately with current state\n\n return () => {\n unsubscribe?.off();\n };\n }, [currentPageSize, currentPage]);\n\n // Handle page size change\n const handlePageSizeChange = (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setCurrentPage(1); // Reset to page 1 when page size changes\n onPageSizeChange?.(newPageSize); // Also call parent callback\n };\n\n // Handle page change\n const handlePageChange = (newPage: number) => {\n setCurrentPage(newPage);\n onPageChange?.(newPage); // Also call parent callback\n };\n\n // Handle page size picker selection\n const handlePageSizeSelect = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const value = target?.value;\n if (value) {\n handlePageSizeChange(Number(value));\n }\n };\n\n // Helper function to format dates, returning \"–\" for invalid dates\n const formattedDate = (dateString: string): string => {\n const date = new Date(dateString);\n return isNaN(date.getTime()) ? '–' : date.toLocaleDateString();\n };\n\n // Prepare transformed quote template data for table component\n const prepareRowData = (\n templates: NegotiableQuoteTemplateListEntry[],\n slots?: QuoteTemplatesListTableProps['slots']\n ): QuoteTemplateRowData[] => {\n return templates\n .filter((template) => template?.uid) // Filter out null templates\n .map((template) => {\n return {\n id: template.id,\n name: (\n <Slot name=\"Name\" slot={slots?.Name} context={{ template }}>\n <span>{template.name}</span>\n </Slot>\n ),\n state: (\n <Slot name=\"State\" slot={slots?.State} context={{ template }}>\n <span style={{ textTransform: 'capitalize' }}>\n {template.state?.replace(/_/g, ' ') || '-'}\n </span>\n </Slot>\n ),\n status: (\n <Slot name=\"Status\" slot={slots?.Status} context={{ template }}>\n <span>{template.status}</span>\n </Slot>\n ),\n validUntil: (\n <Slot\n name=\"ValidUntil\"\n slot={slots?.ValidUntil}\n context={{ template }}\n >\n <span>{formattedDate(template.expirationDate)}</span>\n </Slot>\n ),\n minQuoteTotal: (\n <Slot\n name=\"MinQuoteTotal\"\n slot={slots?.MinQuoteTotal}\n context={{ template }}\n >\n <Price\n amount={template.prices.minNegotiatedGrandTotal.value}\n currency={template.prices.minNegotiatedGrandTotal.currency}\n />\n </Slot>\n ),\n ordersPlaced: (\n <Slot\n name=\"OrdersPlaced\"\n slot={slots?.OrdersPlaced}\n context={{ template }}\n >\n <span>{template.ordersPlaced}</span>\n </Slot>\n ),\n lastOrdered: (\n <Slot\n name=\"LastOrdered\"\n slot={slots?.LastOrdered}\n context={{ template }}\n >\n <span>{formattedDate(template.lastOrderedAt)}</span>\n </Slot>\n ),\n actions: (\n <Slot name=\"Actions\" slot={slots?.Actions} context={{ template }}>\n <span />\n </Slot>\n ),\n };\n });\n };\n\n // Prepare data for rendering\n const rowData = templatesData?.items\n ? prepareRowData(templatesData.items, slots)\n : [];\n\n // Calculate pagination info from pageInfo\n const paginationInfo = templatesData?.pageInfo\n ? {\n currentPage: templatesData.pageInfo.currentPage,\n pageSize: templatesData.pageInfo.pageSize,\n totalPages: templatesData.pageInfo.totalPages,\n totalCount: templatesData.totalCount,\n startItem:\n (templatesData.pageInfo.currentPage - 1) *\n templatesData.pageInfo.pageSize +\n 1,\n endItem: Math.min(\n templatesData.pageInfo.currentPage * templatesData.pageInfo.pageSize,\n templatesData.totalCount\n ),\n pageSizeOptions: getDefaultPageSizeOptions(),\n }\n : undefined;\n\n const shouldShowPagination = !!paginationInfo;\n\n // Empty state message\n const emptyStateMessage = (\n <Slot\n name=\"EmptyTemplates\"\n slot={slots?.EmptyTemplates}\n context={{ templatesData }}\n >\n <IllustratedMessage heading=\"No Quote Templates Found\" />\n </Slot>\n );\n\n // Item range message\n const itemRangeMessage = paginationInfo ? (\n <Slot name=\"ItemRange\" slot={slots?.ItemRange} context={paginationInfo}>\n <span>\n Items {paginationInfo.startItem} to {paginationInfo.endItem} of{' '}\n {paginationInfo.totalCount} total\n </span>\n </Slot>\n ) : undefined;\n\n // Prepare page size picker message for component\n const pageSizePickerMessage =\n paginationInfo && paginationInfo.pageSizeOptions ? (\n <Slot\n name=\"PageSizePicker\"\n slot={slots?.PageSizePicker}\n context={{\n pageSize: paginationInfo.pageSize,\n pageSizeOptions: paginationInfo.pageSizeOptions,\n onPageSizeChange: handlePageSizeChange,\n }}\n >\n <span>Show </span>\n <Picker\n variant=\"primary\"\n size=\"medium\"\n value={String(paginationInfo.pageSize)}\n options={paginationInfo.pageSizeOptions.map(\n (size): PickerOption => ({\n value: String(size),\n text: String(size),\n })\n )}\n handleSelect={handlePageSizeSelect}\n />\n <span> per page</span>\n </Slot>\n ) : undefined;\n\n // Prepare pagination message for component\n const paginationMessage = paginationInfo ? (\n <Slot\n name=\"Pagination\"\n slot={slots?.Pagination}\n context={{\n currentPage: paginationInfo.currentPage,\n totalPages: paginationInfo.totalPages,\n onChange: handlePageChange,\n }}\n >\n <Pagination\n currentPage={paginationInfo.currentPage}\n totalPages={paginationInfo.totalPages}\n onChange={handlePageChange}\n />\n </Slot>\n ) : undefined;\n\n return (\n <QuoteTemplatesListTableComponent\n rowData={rowData}\n loading={loading}\n className={props.className as string}\n emptyStateMessage={emptyStateMessage}\n showItemRange={showItemRange && shouldShowPagination}\n itemRangeMessage={itemRangeMessage}\n showPageSizePicker={showPageSizePicker && shouldShowPagination}\n pageSizePickerMessage={pageSizePickerMessage}\n showPagination={showPagination && shouldShowPagination}\n paginationMessage={paginationMessage}\n />\n );\n};\n"],"names":["QuoteTemplatesListTable","rowData","loading","className","emptyStateMessage","showItemRange","itemRangeMessage","showPageSizePicker","pageSizePickerMessage","showPagination","paginationMessage","props","dictionary","useText","columns","shouldShowEmptyState","shouldShowItemRange","shouldShowPageSizePicker","shouldShowPagination","shouldShowFooter","jsxs","classes","jsx","Table","pageSize","onPageSizeChange","onPageChange","slots","templatesData","setTemplatesData","useState","setLoading","defaultPageSize","getDefaultPageSizeOptions","currentPageSize","setCurrentPageSize","currentPage","setCurrentPage","useEffect","fetchTemplates","data","getQuoteTemplates","error","unsubscribe","events","isAuthenticated","handlePageSizeChange","newPageSize","handlePageChange","newPage","handlePageSizeSelect","event","target","value","formattedDate","dateString","date","prepareRowData","templates","template","Slot","_a","Price","paginationInfo","IllustratedMessage","Picker","size","Pagination","QuoteTemplatesListTableComponent"],"mappings":"21BAgDO,MAAMA,EAET,CAAC,CACH,QAAAC,EAAU,CAAA,EACV,QAAAC,EAAU,GACV,UAAAC,EACA,kBAAAC,EACA,cAAAC,EAAgB,GAChB,iBAAAC,EACA,mBAAAC,EAAqB,GACrB,sBAAAC,EACA,eAAAC,EAAiB,GACjB,kBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,KAAM,+CACN,MAAO,gDACP,OAAQ,iDACR,WAAY,qDACZ,cAAe,wDACf,aAAc,uDACd,YAAa,sDACb,QAAS,iDAAA,CACV,EAEKC,EAAoB,CACxB,CAAE,IAAK,OAAQ,MAAOF,EAAW,IAAA,EACjC,CAAE,IAAK,QAAS,MAAOA,EAAW,KAAA,EAClC,CAAE,IAAK,SAAU,MAAOA,EAAW,MAAA,EACnC,CAAE,IAAK,aAAc,MAAOA,EAAW,UAAA,EACvC,CAAE,IAAK,gBAAiB,MAAOA,EAAW,aAAA,EAC1C,CAAE,IAAK,eAAgB,MAAOA,EAAW,YAAA,EACzC,CAAE,IAAK,cAAe,MAAOA,EAAW,WAAA,EACxC,CAAE,IAAK,UAAW,MAAOA,EAAW,OAAA,CAAQ,EAIxCG,EACJ,CAACb,GAAWD,EAAQ,SAAW,GAAKG,EAGhCY,EAAsBX,GAAiBC,EAGvCW,EAA2BV,GAAsBC,EAGjDU,EAAuBT,GAAkBC,EAGzCS,EACJH,GAAuBC,GAA4BC,EAErD,OACEE,EAAC,MAAA,CACE,GAAGT,EACJ,UAAWU,EAAQ,CACjB,8CACAlB,CAAA,CACD,EAED,SAAA,CAAAmB,EAACC,EAAA,CACC,QAAAT,EACA,QAAAb,EACA,QAAAC,EACA,aAAa,OACb,UAAU,oDAAA,CAAA,EAEXa,GACCO,EAAC,MAAA,CAAI,UAAU,0CACZ,SAAAlB,EACH,EAEDe,GACCC,EAA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BW,EAC1C,sBAAAV,EACA,eAAgBC,GAAkBS,EAClC,kBAAAR,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"QuoteTemplatesListTable.js","sources":["/@dropins/storefront-quote-management/src/components/QuoteTemplatesListTable/QuoteTemplatesListTable.tsx","/@dropins/storefront-quote-management/src/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.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 } from '@adobe-commerce/elsie/lib';\nimport { Table } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/quote-management/components/QuoteTemplatesListTable/QuoteTemplatesListTable.css';\n\ntype Column = {\n key: string;\n label: string;\n};\n\nexport interface QuoteTemplatesListTableProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {\n rowData: QuoteTemplateRowData[];\n loading?: boolean;\n className?: string;\n emptyStateMessage?: VNode;\n showItemRange?: boolean;\n itemRangeMessage?: VNode;\n showPageSizePicker?: boolean;\n pageSizePickerMessage?: VNode;\n showPagination?: boolean;\n paginationMessage?: VNode;\n}\n\nexport type QuoteTemplateRowData = {\n id: string;\n name: VNode;\n state: VNode;\n status: VNode;\n validUntil: VNode;\n minQuoteTotal: VNode;\n ordersPlaced: VNode;\n lastOrdered: VNode;\n actions: VNode;\n [key: string]: VNode | string | number | undefined;\n};\n\nexport const QuoteTemplatesListTable: FunctionComponent<\n QuoteTemplatesListTableProps\n> = ({\n rowData = [],\n loading = false,\n className,\n emptyStateMessage,\n showItemRange = true,\n itemRangeMessage,\n showPageSizePicker = true,\n pageSizePickerMessage,\n showPagination = true,\n paginationMessage,\n ...props\n}) => {\n const dictionary = useText({\n name: 'QuoteManagement.QuoteTemplatesListTable.name',\n state: 'QuoteManagement.QuoteTemplatesListTable.state',\n status: 'QuoteManagement.QuoteTemplatesListTable.status',\n validUntil: 'QuoteManagement.QuoteTemplatesListTable.validUntil',\n minQuoteTotal: 'QuoteManagement.QuoteTemplatesListTable.minQuoteTotal',\n ordersPlaced: 'QuoteManagement.QuoteTemplatesListTable.ordersPlaced',\n lastOrdered: 'QuoteManagement.QuoteTemplatesListTable.lastOrdered',\n actions: 'QuoteManagement.QuoteTemplatesListTable.actions',\n });\n\n const columns: Column[] = [\n { key: 'name', label: dictionary.name },\n { key: 'state', label: dictionary.state },\n { key: 'status', label: dictionary.status },\n { key: 'validUntil', label: dictionary.validUntil },\n { key: 'minQuoteTotal', label: dictionary.minQuoteTotal },\n { key: 'ordersPlaced', label: dictionary.ordersPlaced },\n { key: 'lastOrdered', label: dictionary.lastOrdered },\n { key: 'actions', label: dictionary.actions },\n ];\n\n // Check if we should show empty state\n const shouldShowEmptyState =\n !loading && rowData.length === 0 && emptyStateMessage;\n\n // Show item range if requested and message is provided\n const shouldShowItemRange = showItemRange && itemRangeMessage;\n\n // Show page size picker if requested and message is provided\n const shouldShowPageSizePicker = showPageSizePicker && pageSizePickerMessage;\n\n // Show pagination if requested and message is provided\n const shouldShowPagination = showPagination && paginationMessage;\n\n // Show footer if any pagination element should be shown\n const shouldShowFooter =\n shouldShowItemRange || shouldShowPageSizePicker || shouldShowPagination;\n\n return (\n <div\n {...props}\n className={classes([\n 'quote-management-quote-templates-list-table',\n className,\n ])}\n >\n <Table\n columns={columns}\n rowData={rowData}\n loading={loading}\n mobileLayout=\"none\"\n className=\"quote-management-quote-templates-list-table__table\"\n />\n {shouldShowEmptyState && (\n <div className=\"quote-templates-list-table__empty-state\">\n {emptyStateMessage}\n </div>\n )}\n {shouldShowFooter && (\n <div className=\"quote-templates-list-table__footer\">\n <div className=\"quote-templates-list-table__item-range\">\n {shouldShowItemRange && itemRangeMessage}\n </div>\n <div className=\"quote-templates-list-table__pagination\">\n {shouldShowPagination && paginationMessage}\n </div>\n <div className=\"quote-templates-list-table__page-size-picker\">\n {shouldShowPageSizePicker && pageSizePickerMessage}\n </div>\n </div>\n )}\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 { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport {\n Price,\n IllustratedMessage,\n Picker,\n Pagination,\n type PickerOption,\n} from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n QuoteTemplatesListTable as QuoteTemplatesListTableComponent,\n QuoteTemplateRowData,\n} from '@/quote-management/components';\nimport { getQuoteTemplates } from '@/quote-management/api';\nimport { getDefaultPageSizeOptions } from '@/quote-management/data/transforms';\nimport {\n NegotiableQuoteTemplatesListModel,\n NegotiableQuoteTemplateListEntry,\n} from '@/quote-management/data/models';\nimport { formattedDate } from '@/quote-management/utils/dateUtils';\n\nexport interface QuoteTemplatesListTableProps\n extends HTMLAttributes<HTMLDivElement> {\n pageSize?: number;\n showItemRange?: boolean;\n showPageSizePicker?: boolean;\n showPagination?: boolean;\n onPageSizeChange?: (pageSize: number) => void;\n onPageChange?: (page: number) => void;\n slots?: {\n /** Slot for customizing the template name cell content */\n Name?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the state cell content */\n State?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the status cell content */\n Status?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the valid until cell content */\n ValidUntil?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the min quote total cell content */\n MinQuoteTotal?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the orders placed cell content */\n OrdersPlaced?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the last ordered cell content */\n LastOrdered?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the actions cell content */\n Actions?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\n /** Slot for customizing the empty templates message */\n EmptyTemplates?: SlotProps;\n /** Slot for customizing the item range display */\n ItemRange?: SlotProps<{\n startItem: number;\n endItem: number;\n totalCount: number;\n currentPage: number;\n pageSize: number;\n }>;\n /** Slot for customizing the page size picker */\n PageSizePicker?: SlotProps<{\n pageSize: number;\n pageSizeOptions: number[];\n onPageSizeChange?: (pageSize: number) => void;\n }>;\n /** Slot for customizing the pagination */\n Pagination?: SlotProps<{\n currentPage: number;\n totalPages: number;\n onChange?: (page: number) => void;\n }>;\n };\n}\n\nexport const QuoteTemplatesListTable: Container<\n QuoteTemplatesListTableProps\n> = ({\n pageSize,\n showItemRange = true,\n showPageSizePicker = true,\n showPagination = true,\n onPageSizeChange,\n onPageChange,\n slots,\n ...props\n}) => {\n const [templatesData, setTemplatesData] =\n useState<NegotiableQuoteTemplatesListModel | null>(null);\n const [loading, setLoading] = useState(true);\n\n // Default to first page size option if no pageSize prop provided\n const defaultPageSize = getDefaultPageSizeOptions()[0];\n const [currentPageSize, setCurrentPageSize] = useState(\n pageSize || defaultPageSize\n );\n const [currentPage, setCurrentPage] = useState(1);\n\n // Fetch quote templates data when authenticated\n useEffect(() => {\n const fetchTemplates = async () => {\n try {\n setLoading(true);\n const data = await getQuoteTemplates({\n pageSize: currentPageSize,\n currentPage,\n });\n setTemplatesData(data);\n } catch (error) {\n console.error('Failed to fetch quote templates:', error);\n } finally {\n setLoading(false);\n }\n };\n\n // Listen for authentication events\n const unsubscribe = events.on(\n 'authenticated',\n (isAuthenticated) => {\n if (isAuthenticated) {\n fetchTemplates();\n } else {\n setTemplatesData(null);\n setLoading(false);\n }\n },\n { eager: true }\n ); // eager: true means it fires immediately with current state\n\n return () => {\n unsubscribe?.off();\n };\n }, [currentPageSize, currentPage]);\n\n // Handle page size change\n const handlePageSizeChange = (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setCurrentPage(1); // Reset to page 1 when page size changes\n onPageSizeChange?.(newPageSize); // Also call parent callback\n };\n\n // Handle page change\n const handlePageChange = (newPage: number) => {\n setCurrentPage(newPage);\n onPageChange?.(newPage); // Also call parent callback\n };\n\n // Handle page size picker selection\n const handlePageSizeSelect = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const value = target?.value;\n if (value) {\n handlePageSizeChange(Number(value));\n }\n };\n\n // Prepare transformed quote template data for table component\n const prepareRowData = (\n templates: NegotiableQuoteTemplateListEntry[],\n slots?: QuoteTemplatesListTableProps['slots']\n ): QuoteTemplateRowData[] => {\n return templates\n .filter((template) => template?.uid) // Filter out null templates\n .map((template) => {\n return {\n id: template.id,\n name: (\n <Slot name=\"Name\" slot={slots?.Name} context={{ template }}>\n <span>{template.name}</span>\n </Slot>\n ),\n state: (\n <Slot name=\"State\" slot={slots?.State} context={{ template }}>\n <span style={{ textTransform: 'capitalize' }}>\n {template.state?.replace(/_/g, ' ') || '-'}\n </span>\n </Slot>\n ),\n status: (\n <Slot name=\"Status\" slot={slots?.Status} context={{ template }}>\n <span>{template.status}</span>\n </Slot>\n ),\n validUntil: (\n <Slot\n name=\"ValidUntil\"\n slot={slots?.ValidUntil}\n context={{ template }}\n >\n <span>{formattedDate(template.expirationDate)}</span>\n </Slot>\n ),\n minQuoteTotal: (\n <Slot\n name=\"MinQuoteTotal\"\n slot={slots?.MinQuoteTotal}\n context={{ template }}\n >\n <Price\n amount={template.prices.minNegotiatedGrandTotal.value}\n currency={template.prices.minNegotiatedGrandTotal.currency}\n />\n </Slot>\n ),\n ordersPlaced: (\n <Slot\n name=\"OrdersPlaced\"\n slot={slots?.OrdersPlaced}\n context={{ template }}\n >\n <span>{template.ordersPlaced}</span>\n </Slot>\n ),\n lastOrdered: (\n <Slot\n name=\"LastOrdered\"\n slot={slots?.LastOrdered}\n context={{ template }}\n >\n <span>{formattedDate(template.lastOrderedAt)}</span>\n </Slot>\n ),\n actions: (\n <Slot name=\"Actions\" slot={slots?.Actions} context={{ template }}>\n <span />\n </Slot>\n ),\n };\n });\n };\n\n // Prepare data for rendering\n const rowData = templatesData?.items\n ? prepareRowData(templatesData.items, slots)\n : [];\n\n // Use pagination info directly from API response, merging in pageSizeOptions if needed\n const paginationInfo = templatesData?.paginationInfo\n ? {\n ...templatesData.paginationInfo,\n pageSizeOptions: getDefaultPageSizeOptions(),\n }\n : undefined;\n\n const shouldShowPagination = !!paginationInfo;\n\n // Empty state message\n const emptyStateMessage = (\n <Slot\n name=\"EmptyTemplates\"\n slot={slots?.EmptyTemplates}\n context={{ templatesData }}\n >\n <IllustratedMessage heading=\"No Quote Templates Found\" />\n </Slot>\n );\n\n // Item range message\n const itemRangeMessage = paginationInfo ? (\n <Slot name=\"ItemRange\" slot={slots?.ItemRange} context={paginationInfo}>\n <span>\n Items {paginationInfo.startItem} to {paginationInfo.endItem} of{' '}\n {paginationInfo.totalCount} total\n </span>\n </Slot>\n ) : undefined;\n\n // Prepare page size picker message for component\n const pageSizePickerMessage =\n paginationInfo && paginationInfo.pageSizeOptions ? (\n <Slot\n name=\"PageSizePicker\"\n slot={slots?.PageSizePicker}\n context={{\n pageSize: paginationInfo.pageSize,\n pageSizeOptions: paginationInfo.pageSizeOptions,\n onPageSizeChange: handlePageSizeChange,\n }}\n >\n <span>Show </span>\n <Picker\n variant=\"primary\"\n size=\"medium\"\n value={String(paginationInfo.pageSize)}\n options={paginationInfo.pageSizeOptions.map(\n (size): PickerOption => ({\n value: String(size),\n text: String(size),\n })\n )}\n handleSelect={handlePageSizeSelect}\n />\n <span> per page</span>\n </Slot>\n ) : undefined;\n\n // Prepare pagination message for component\n const paginationMessage = paginationInfo ? (\n <Slot\n name=\"Pagination\"\n slot={slots?.Pagination}\n context={{\n currentPage: paginationInfo.currentPage,\n totalPages: paginationInfo.totalPages,\n onChange: handlePageChange,\n }}\n >\n <Pagination\n currentPage={paginationInfo.currentPage}\n totalPages={paginationInfo.totalPages}\n onChange={handlePageChange}\n />\n </Slot>\n ) : undefined;\n\n return (\n <QuoteTemplatesListTableComponent\n rowData={rowData}\n loading={loading}\n className={props.className as string}\n emptyStateMessage={emptyStateMessage}\n showItemRange={showItemRange && shouldShowPagination}\n itemRangeMessage={itemRangeMessage}\n showPageSizePicker={showPageSizePicker && shouldShowPagination}\n pageSizePickerMessage={pageSizePickerMessage}\n showPagination={showPagination && shouldShowPagination}\n paginationMessage={paginationMessage}\n />\n );\n};\n"],"names":["QuoteTemplatesListTable","rowData","loading","className","emptyStateMessage","showItemRange","itemRangeMessage","showPageSizePicker","pageSizePickerMessage","showPagination","paginationMessage","props","dictionary","useText","columns","shouldShowEmptyState","shouldShowItemRange","shouldShowPageSizePicker","shouldShowPagination","shouldShowFooter","jsxs","classes","jsx","Table","pageSize","onPageSizeChange","onPageChange","slots","templatesData","setTemplatesData","useState","setLoading","defaultPageSize","getDefaultPageSizeOptions","currentPageSize","setCurrentPageSize","currentPage","setCurrentPage","useEffect","fetchTemplates","data","getQuoteTemplates","error","unsubscribe","events","isAuthenticated","handlePageSizeChange","newPageSize","handlePageChange","newPage","handlePageSizeSelect","event","target","value","prepareRowData","templates","template","Slot","_a","formattedDate","Price","paginationInfo","IllustratedMessage","Picker","size","Pagination","QuoteTemplatesListTableComponent"],"mappings":"s4BAgDO,MAAMA,EAET,CAAC,CACH,QAAAC,EAAU,CAAA,EACV,QAAAC,EAAU,GACV,UAAAC,EACA,kBAAAC,EACA,cAAAC,EAAgB,GAChB,iBAAAC,EACA,mBAAAC,EAAqB,GACrB,sBAAAC,EACA,eAAAC,EAAiB,GACjB,kBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,KAAM,+CACN,MAAO,gDACP,OAAQ,iDACR,WAAY,qDACZ,cAAe,wDACf,aAAc,uDACd,YAAa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