@dropins/storefront-quote-management 0.0.1-alpha18 → 0.0.1-alpha20

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 (106) hide show
  1. package/api/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +13 -0
  2. package/api/acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts +10 -0
  3. package/api/acceptQuoteTemplate/index.d.ts +10 -0
  4. package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +15 -0
  5. package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +10 -0
  6. package/api/addQuoteTemplateLineItemNote/index.d.ts +10 -0
  7. package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +37 -0
  8. package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +10 -0
  9. package/api/addQuoteTemplateShippingAddress/index.d.ts +10 -0
  10. package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +14 -0
  11. package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +10 -0
  12. package/api/cancelQuoteTemplate/index.d.ts +10 -0
  13. package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +31 -0
  14. package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +2 -0
  15. package/api/closeNegotiableQuote/index.d.ts +10 -0
  16. package/api/createQuoteTemplate/createQuoteTemplate.d.ts +4 -0
  17. package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +10 -0
  18. package/api/createQuoteTemplate/index.d.ts +10 -0
  19. package/api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts +15 -0
  20. package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +10 -0
  21. package/api/deleteQuoteTemplate/index.d.ts +10 -0
  22. package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +15 -0
  23. package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +10 -0
  24. package/api/generateQuoteFromTemplate/index.d.ts +10 -0
  25. package/api/getQuoteTemplateData/getQuoteTemplateData.d.ts +4 -0
  26. package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +10 -0
  27. package/api/getQuoteTemplateData/index.d.ts +10 -0
  28. package/api/getQuoteTemplates/getQuoteTemplates.d.ts +34 -0
  29. package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +10 -0
  30. package/api/getQuoteTemplates/index.d.ts +10 -0
  31. package/api/graphql/NegotiableQuoteFragment.d.ts +4 -12
  32. package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +10 -0
  33. package/api/index.d.ts +24 -0
  34. package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +10 -0
  35. package/api/openQuoteTemplate/index.d.ts +10 -0
  36. package/api/openQuoteTemplate/openQuoteTemplate.d.ts +13 -0
  37. package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +10 -0
  38. package/api/removeQuoteTemplateItems/index.d.ts +10 -0
  39. package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +14 -0
  40. package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +10 -0
  41. package/api/renameNegotiableQuote/index.d.ts +10 -0
  42. package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +9 -0
  43. package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +4 -12
  44. package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +4 -12
  45. package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +10 -0
  46. package/api/sendQuoteTemplateForReview/index.d.ts +10 -0
  47. package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +15 -0
  48. package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +4 -12
  49. package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +10 -0
  50. package/api/updateQuantities/index.d.ts +10 -0
  51. package/api/updateQuantities/updateQuantities.d.ts +36 -0
  52. package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +10 -0
  53. package/api/updateQuoteTemplateItemQuantities/index.d.ts +10 -0
  54. package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +20 -0
  55. package/api.js +306 -18
  56. package/api.js.map +1 -1
  57. package/chunks/ItemsQuoted.js +1 -1
  58. package/chunks/ItemsQuoted.js.map +1 -1
  59. package/chunks/NegotiableQuoteFragment.js +1 -0
  60. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  61. package/chunks/OrderSummaryLine.js +1 -1
  62. package/chunks/OrderSummaryLine.js.map +1 -1
  63. package/chunks/fetch-graphql.js +1 -1
  64. package/chunks/fetch-graphql.js.map +1 -1
  65. package/chunks/getQuoteTemplates.js +50 -0
  66. package/chunks/getQuoteTemplates.js.map +1 -0
  67. package/chunks/renameNegotiableQuote.js +104 -0
  68. package/chunks/renameNegotiableQuote.js.map +1 -0
  69. package/chunks/updateQuantities.js +21 -0
  70. package/chunks/updateQuantities.js.map +1 -0
  71. package/chunks/uploadFile.js.map +1 -1
  72. package/components/ProductListTable/ProductListTable.d.ts +1 -0
  73. package/components/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +30 -0
  74. package/components/QuoteTemplatesListTable/index.d.ts +10 -0
  75. package/components/RenameQuoteModal/RenameQuoteModal.d.ts +18 -0
  76. package/components/RenameQuoteModal/index.d.ts +11 -0
  77. package/components/index.d.ts +3 -0
  78. package/containers/ItemsQuoted/ItemsQuoted.d.ts +1 -1
  79. package/containers/ItemsQuoted.js +1 -1
  80. package/containers/ManageNegotiableQuote.js +1 -1
  81. package/containers/ManageNegotiableQuote.js.map +1 -1
  82. package/containers/OrderSummary.js +1 -1
  83. package/containers/OrderSummary.js.map +1 -1
  84. package/containers/OrderSummaryLine.js +1 -1
  85. package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +74 -0
  86. package/containers/QuoteTemplatesListTable/index.d.ts +11 -0
  87. package/containers/QuoteTemplatesListTable.d.ts +3 -0
  88. package/containers/QuoteTemplatesListTable.js +4 -0
  89. package/containers/QuoteTemplatesListTable.js.map +1 -0
  90. package/containers/QuotesListTable.js +1 -1
  91. package/containers/QuotesListTable.js.map +1 -1
  92. package/containers/index.d.ts +3 -2
  93. package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +5 -0
  94. package/data/models/index.d.ts +1 -0
  95. package/data/models/negotiable-quote-model.d.ts +21 -13
  96. package/data/models/negotiable-quote-template-model.d.ts +136 -0
  97. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +5 -0
  98. package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +1604 -0
  99. package/data/transforms/index.d.ts +5 -12
  100. package/data/transforms/transform-quote-template.d.ts +5 -0
  101. package/i18n/en_US.json.d.ts +37 -1
  102. package/package.json +1 -1
  103. package/render.js +4 -4
  104. package/render.js.map +1 -1
  105. package/chunks/sendForReview.js +0 -53
  106. package/chunks/sendForReview.js.map +0 -1
@@ -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","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,GAAA,YAAAA,EAAM,SAAN,YAAAsD,GAAc,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,2]}
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,EAC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AUE,IAAAC,GAAApE,GAAA,YAAAA,EAAM,SAAN,YAAAoE,GAAc,aAAd,YAAAD,GAA0B,QAAA,CAAA,EAEpC,MAAA,CAAA,EAhJD,IAoJX","x_google_ignoreList":[0,1,2]}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{O as u,O as l}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";/* empty css *//* empty css *//* empty css */export{u as OrderSummaryLine,l as default};
3
+ import{O as l,O as n}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";/* empty css */import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css *//* empty css */export{l as OrderSummaryLine,n as default};
4
4
  //# sourceMappingURL=OrderSummaryLine.js.map
@@ -0,0 +1,74 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+ import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
3
+ import { NegotiableQuoteTemplateListEntry } from '../../data/models';
4
+
5
+ export interface QuoteTemplatesListTableProps extends HTMLAttributes<HTMLDivElement> {
6
+ pageSize?: number;
7
+ showItemRange?: boolean;
8
+ showPageSizePicker?: boolean;
9
+ showPagination?: boolean;
10
+ onPageSizeChange?: (pageSize: number) => void;
11
+ onPageChange?: (page: number) => void;
12
+ slots?: {
13
+ /** Slot for customizing the template ID cell content */
14
+ TemplateId?: SlotProps<{
15
+ template: NegotiableQuoteTemplateListEntry;
16
+ }>;
17
+ /** Slot for customizing the template name cell content */
18
+ Name?: SlotProps<{
19
+ template: NegotiableQuoteTemplateListEntry;
20
+ }>;
21
+ /** Slot for customizing the state cell content */
22
+ State?: SlotProps<{
23
+ template: NegotiableQuoteTemplateListEntry;
24
+ }>;
25
+ /** Slot for customizing the status cell content */
26
+ Status?: SlotProps<{
27
+ template: NegotiableQuoteTemplateListEntry;
28
+ }>;
29
+ /** Slot for customizing the valid until cell content */
30
+ ValidUntil?: SlotProps<{
31
+ template: NegotiableQuoteTemplateListEntry;
32
+ }>;
33
+ /** Slot for customizing the min quote total cell content */
34
+ MinQuoteTotal?: SlotProps<{
35
+ template: NegotiableQuoteTemplateListEntry;
36
+ }>;
37
+ /** Slot for customizing the orders placed cell content */
38
+ OrdersPlaced?: SlotProps<{
39
+ template: NegotiableQuoteTemplateListEntry;
40
+ }>;
41
+ /** Slot for customizing the last ordered cell content */
42
+ LastOrdered?: SlotProps<{
43
+ template: NegotiableQuoteTemplateListEntry;
44
+ }>;
45
+ /** Slot for customizing the actions cell content */
46
+ Actions?: SlotProps<{
47
+ template: NegotiableQuoteTemplateListEntry;
48
+ }>;
49
+ /** Slot for customizing the empty templates message */
50
+ EmptyTemplates?: SlotProps;
51
+ /** Slot for customizing the item range display */
52
+ ItemRange?: SlotProps<{
53
+ startItem: number;
54
+ endItem: number;
55
+ totalCount: number;
56
+ currentPage: number;
57
+ pageSize: number;
58
+ }>;
59
+ /** Slot for customizing the page size picker */
60
+ PageSizePicker?: SlotProps<{
61
+ pageSize: number;
62
+ pageSizeOptions: number[];
63
+ onPageSizeChange?: (pageSize: number) => void;
64
+ }>;
65
+ /** Slot for customizing the pagination */
66
+ Pagination?: SlotProps<{
67
+ currentPage: number;
68
+ totalPages: number;
69
+ onChange?: (page: number) => void;
70
+ }>;
71
+ };
72
+ }
73
+ export declare const QuoteTemplatesListTable: Container<QuoteTemplatesListTableProps>;
74
+ //# sourceMappingURL=QuoteTemplatesListTable.d.ts.map
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
4
+ *
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
+ *******************************************************************/
9
+ export * from './QuoteTemplatesListTable';
10
+ export { QuoteTemplatesListTable as default } from './QuoteTemplatesListTable';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './QuoteTemplatesListTable/index'
2
+ import _default from './QuoteTemplatesListTable/index'
3
+ export default _default
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2025 Adobe
2
+ All Rights Reserved. */
3
+ import{jsxs as I,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:g=[],loading:h=!1,className:v,emptyStateMessage:T,showItemRange:m=!0,itemRangeMessage:d,showPageSizePicker:o=!0,pageSizePickerMessage:S,showPagination:n=!0,paginationMessage:u,...y})=>{const c=B({templateId:"QuoteManagement.QuoteTemplatesListTable.templateId",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:"templateId",label:c.templateId},{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&&g.length===0&&T,f=m&&d,s=o&&S,p=n&&u,b=f||s||p;return I("div",{...y,className:A(["quote-management-quote-templates-list-table",v]),children:[a(C,{columns:z,rowData:g,loading:h,mobileLayout:"none",className:"quote-management-quote-templates-list-table__table"}),P&&a("div",{className:"quote-templates-list-table__empty-state",children:T}),b&&I("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:p&&u}),a("div",{className:"quote-templates-list-table__page-size-picker",children:s&&S})]})]})},se=({pageSize:g,showItemRange:h=!0,showPageSizePicker:v=!0,showPagination:T=!0,onPageSizeChange:m,onPageChange:d,slots:o,...S})=>{const[n,u]=Q(null),[y,c]=Q(!0),z=k()[0],[P,f]=Q(g||z),[s,p]=Q(1);E(()=>{const r=async()=>{try{c(!0);const t=await H({pageSize:P,currentPage:s});u(t)}catch(t){console.error("Failed to fetch quote templates:",t)}finally{c(!1)}},e=$.on("authenticated",t=>{t?r():(u(null),c(!1))},{eager:!0});return()=>{e==null||e.off()}},[P,s]);const b=r=>{f(r),p(1),m==null||m(r)},N=r=>{p(r),d==null||d(r)},M=r=>{const e=r.target,t=e==null?void 0:e.value;t&&b(Number(t))},L=r=>{const e=new Date(r);return isNaN(e.getTime())?"–":e.toLocaleDateString()},_=(r,e)=>r.filter(t=>t==null?void 0:t.uid).map(t=>{var O;return{id:t.id,templateId:a(l,{name:"TemplateId",slot:e==null?void 0:e.TemplateId,context:{template:t},children:a("span",{children: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:((O=t.state)==null?void 0:O.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:L(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:L(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?_(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,x=!!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:I("span",{children:["Items ",i.startItem," to ",i.endItem," of"," ",i.totalCount," total"]})}):void 0,R=i&&i.pageSizeOptions?I(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:M}),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:y,className:S.className,emptyStateMessage:q,showItemRange:h&&x,itemRangeMessage:U,showPageSizePicker:v&&x,pageSizePickerMessage:R,showPagination:T&&x,paginationMessage:D})};export{se as QuoteTemplatesListTable,se as default};
4
+ //# sourceMappingURL=QuoteTemplatesListTable.js.map
@@ -0,0 +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 templateId: VNode;\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 templateId: 'QuoteManagement.QuoteTemplatesListTable.templateId',\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: 'templateId', label: dictionary.templateId },\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 ID cell content */\n TemplateId?: SlotProps<{ template: NegotiableQuoteTemplateListEntry }>;\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 templateId: (\n <Slot\n name=\"TemplateId\"\n slot={slots?.TemplateId}\n context={{ template }}\n >\n <span>{template.id}</span>\n </Slot>\n ),\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":"21BAiDO,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,WAAY,qDACZ,KAAM,+CACN,MAAO,gDACP,OAAQ,iDACR,WAAY,qDACZ,cAAe,wDACf,aAAc,uDACd,YAAa,sDACb,QAAS,iDAAA,CACV,EAEKC,EAAoB,CACxB,CAAE,IAAK,aAAc,MAAOF,EAAW,UAAA,EACvC,CAAE,IAAK,OAAQ,MAAOA,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,OA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QAASA,EAAe,gBAAgB,IACrCG,IAAwB,CACvB,MAAO,OAAOA,CAAI,EAClB,KAAM,OAAOA,CAAI,CAAA,EACnB,EAEF,aAAchB,CAAA,CAAA,EAEhB5B,EAAC,QAAK,SAAA,WAAA,CAAS,CAAA,CAAA,CAAA,EAEf,OAGAZ,EAAoBqD,EACxBzC,EAACsC,EAAA,CACC,KAAK,aACL,KAAMjC,GAAA,YAAAA,EAAO,WACb,QAAS,CACP,YAAaoC,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUf,CAAA,EAGZ,SAAA1B,EAAC6C,EAAA,CACC,YAAaJ,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUf,CAAA,CAAA,CACZ,CAAA,EAEA,OAEJ,OACE1B,EAAC8C,EAAA,CACC,QAAAnE,EACA,QAAAC,EACA,UAAWS,EAAM,UACjB,kBAAAP,EACA,cAAeC,GAAiBa,EAChC,iBAAAZ,EACA,mBAAoBC,GAAsBW,EAC1C,sBAAAV,EACA,eAAgBC,GAAkBS,EAClC,kBAAAR,CAAA,CAAA,CAGN"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsxs as P,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as Q,useEffect as $}from"@dropins/tools/preact-compat.js";import{classes as j,Slot as o}from"@dropins/tools/lib.js";import{Table as G,IllustratedMessage as H,Picker as J,Pagination as K,Button as W,Price as X}from"@dropins/tools/components.js";import{events as Y}from"@dropins/tools/event-bus.js";/* empty css *//* empty css */import"@dropins/tools/preact.js";import{useText as Z}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{g as V}from"../chunks/fetch-graphql.js";import"../chunks/state.js";import{n as q}from"../chunks/negotiableQuotes.js";import"@dropins/tools/fetch-graphql.js";const ee=({rowData:h=[],loading:S=!1,className:N,emptyStateMessage:y,showItemRange:v=!0,itemRangeMessage:d,showPageSizePicker:u=!0,pageSizePickerMessage:i,showPagination:x=!0,paginationMessage:l,...b})=>{const m=Z({quoteName:"QuoteManagement.QuotesListTable.quoteName",created:"QuoteManagement.QuotesListTable.created",createdBy:"QuoteManagement.QuotesListTable.createdBy",status:"QuoteManagement.QuotesListTable.status",lastUpdated:"QuoteManagement.QuotesListTable.lastUpdated",quoteTemplate:"QuoteManagement.QuotesListTable.quoteTemplate",quoteTotal:"QuoteManagement.QuotesListTable.quoteTotal",actions:"QuoteManagement.QuotesListTable.actions"}),p=[{key:"quoteName",label:m.quoteName},{key:"created",label:m.created},{key:"createdBy",label:m.createdBy},{key:"status",label:m.status},{key:"lastUpdated",label:m.lastUpdated},{key:"quoteTemplate",label:m.quoteTemplate},{key:"quoteTotal",label:m.quoteTotal},{key:"actions",label:m.actions}],z=!S&&h.length===0&&y,s=v&&d,f=u&&i,g=x&&l,T=s||f||g;return P("div",{...b,className:j(["quote-management-quotes-list-table",N]),children:[t(G,{columns:p,rowData:h,loading:S,mobileLayout:"none",className:"quote-management-quotes-list-table__table"}),z&&t("div",{className:"quotes-list-table__empty-state",children:y}),T&&P("div",{className:"quotes-list-table__footer",children:[t("div",{className:"quotes-list-table__item-range",children:s&&d}),t("div",{className:"quotes-list-table__pagination",children:g&&l}),t("div",{className:"quotes-list-table__page-size-picker",children:f&&i})]})]})},ye=({pageSize:h,showItemRange:S=!0,showPageSizePicker:N=!0,showPagination:y=!0,onViewQuote:v,onPageSizeChange:d,onPageChange:u,slots:i,...x})=>{const[l,b]=Q(null),[m,p]=Q(!0),z=V()[0],[s,f]=Q(h||z),[g,T]=Q(1);$(()=>{const r=async()=>{try{p(!0);const c=await q({pageSize:s,currentPage:g});b(c)}catch(c){console.error("Failed to fetch quotes:",c)}finally{p(!1)}},e=Y.on("authenticated",c=>{c?r():(b(null),p(!1))},{eager:!0});return()=>{e==null||e.off()}},[s,g]);const k=r=>{f(r),T(1),d==null||d(r)},_=r=>{T(r),u==null||u(r)},A=r=>{const e=r.target,c=e==null?void 0:e.value;c&&k(Number(c))},U=(r,e,c)=>r.filter(a=>a==null?void 0:a.uid).map(a=>{var I,w,B,M;const F=`${a.buyer.firstname} ${a.buyer.lastname}`;return{id:a.uid,quoteName:t(o,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quote:a},children:t("span",{children:a.name})}),created:t(o,{name:"Created",slot:e==null?void 0:e.Created,context:{quote:a},children:t("span",{children:a.createdAt?new Date(a.createdAt).toLocaleDateString():"N/A"})}),createdBy:t(o,{name:"CreatedBy",slot:e==null?void 0:e.CreatedBy,context:{quote:a},children:t("span",{children:F})}),status:t(o,{name:"Status",slot:e==null?void 0:e.Status,context:{quote:a},children:t("span",{children:a.status})}),lastUpdated:t(o,{name:"LastUpdated",slot:e==null?void 0:e.LastUpdated,context:{quote:a},children:t("span",{children:a.updatedAt?new Date(a.updatedAt).toLocaleDateString():"N/A"})}),quoteTemplate:t(o,{name:"QuoteTemplate",slot:e==null?void 0:e.QuoteTemplate,context:{quote:a},children:t("span",{children:a.templateName})}),quoteTotal:t(o,{name:"QuoteTotal",slot:e==null?void 0:e.QuoteTotal,context:{quote:a},children:t(X,{amount:(w=(I=a.prices)==null?void 0:I.grandTotal)==null?void 0:w.value,currency:(M=(B=a.prices)==null?void 0:B.grandTotal)==null?void 0:M.currency})}),actions:t(o,{name:"Actions",slot:e==null?void 0:e.Actions,context:{quote:a,onViewQuote:c},children:t(W,{variant:"tertiary",size:"medium",onClick:()=>c==null?void 0:c(a.uid,a.name,a.status),children:"View"})})}}),C=l!=null&&l.items?U(l.items,i,v):[],n=l==null?void 0:l.paginationInfo,L=!!n,O=t(o,{name:"EmptyQuotes",slot:i==null?void 0:i.EmptyQuotes,context:{quotesData:l},children:t(H,{heading:"No Quotes Found"})}),R=n?t(o,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:n,children:P("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,D=n&&n.pageSizeOptions?P(o,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:k},children:[t("span",{children:"Show "}),t(J,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(r=>({value:String(r),text:String(r)})),handleSelect:A}),t("span",{children:" per page"})]}):void 0,E=n?t(o,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_},children:t(K,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_})}):void 0;return t(ee,{rowData:C,loading:m,className:x.className,emptyStateMessage:O,showItemRange:S&&L,itemRangeMessage:R,showPageSizePicker:N&&L,pageSizePickerMessage:D,showPagination:y&&L,paginationMessage:E})};export{ye as QuotesListTable,ye as default};
3
+ import{jsxs as P,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as Q,useEffect as A}from"@dropins/tools/preact-compat.js";import{classes as H,Slot as o}from"@dropins/tools/lib.js";import{Table as J,IllustratedMessage as K,Picker as W,Pagination as X,Button as Y,Price as Z}from"@dropins/tools/components.js";import{events as U}from"@dropins/tools/event-bus.js";/* empty css *//* empty css */import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";import{useText as q}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{g as V}from"../chunks/fetch-graphql.js";import"../chunks/state.js";import{n as C}from"../chunks/negotiableQuotes.js";import"@dropins/tools/fetch-graphql.js";const ee=({rowData:S=[],loading:f=!1,className:N,emptyStateMessage:y,showItemRange:v=!0,itemRangeMessage:s,showPageSizePicker:p=!0,pageSizePickerMessage:i,showPagination:x=!0,paginationMessage:l,...g})=>{const m=q({quoteName:"QuoteManagement.QuotesListTable.quoteName",created:"QuoteManagement.QuotesListTable.created",createdBy:"QuoteManagement.QuotesListTable.createdBy",status:"QuoteManagement.QuotesListTable.status",lastUpdated:"QuoteManagement.QuotesListTable.lastUpdated",quoteTemplate:"QuoteManagement.QuotesListTable.quoteTemplate",quoteTotal:"QuoteManagement.QuotesListTable.quoteTotal",actions:"QuoteManagement.QuotesListTable.actions"}),h=[{key:"quoteName",label:m.quoteName},{key:"created",label:m.created},{key:"createdBy",label:m.createdBy},{key:"status",label:m.status},{key:"lastUpdated",label:m.lastUpdated},{key:"quoteTemplate",label:m.quoteTemplate},{key:"quoteTotal",label:m.quoteTotal},{key:"actions",label:m.actions}],z=!f&&S.length===0&&y,d=v&&s,b=p&&i,u=x&&l,T=d||b||u;return P("div",{...g,className:H(["quote-management-quotes-list-table",N]),children:[t(J,{columns:h,rowData:S,loading:f,mobileLayout:"none",className:"quote-management-quotes-list-table__table"}),z&&t("div",{className:"quotes-list-table__empty-state",children:y}),T&&P("div",{className:"quotes-list-table__footer",children:[t("div",{className:"quotes-list-table__item-range",children:d&&s}),t("div",{className:"quotes-list-table__pagination",children:u&&l}),t("div",{className:"quotes-list-table__page-size-picker",children:b&&i})]})]})},ye=({pageSize:S,showItemRange:f=!0,showPageSizePicker:N=!0,showPagination:y=!0,onViewQuote:v,onPageSizeChange:s,onPageChange:p,slots:i,...x})=>{const[l,g]=Q(null),[m,h]=Q(!0),z=V()[0],[d,b]=Q(S||z),[u,T]=Q(1);A(()=>{const c=async()=>{try{h(!0);const r=await C({pageSize:d,currentPage:u});g(r)}catch(r){console.error("Failed to fetch quotes:",r)}finally{h(!1)}},e=U.on("authenticated",r=>{r?c():(g(null),h(!1))},{eager:!0});return()=>{e==null||e.off()}},[d,u]),A(()=>{const c=async()=>{try{const r=await C({pageSize:d,currentPage:u});g(r)}catch(r){console.error("Failed to fetch quotes:",r)}},e=U.on("quote-management/quote-renamed",()=>{c()},{eager:!0});return()=>{e==null||e.off()}},[d,u]);const k=c=>{b(c),T(1),s==null||s(c)},_=c=>{T(c),p==null||p(c)},O=c=>{const e=c.target,r=e==null?void 0:e.value;r&&k(Number(r))},R=(c,e,r)=>c.filter(a=>a==null?void 0:a.uid).map(a=>{var w,I,B,M;const G=`${a.buyer.firstname} ${a.buyer.lastname}`;return{id:a.uid,quoteName:t(o,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quote:a},children:t("span",{children:a.name})}),created:t(o,{name:"Created",slot:e==null?void 0:e.Created,context:{quote:a},children:t("span",{children:a.createdAt?new Date(a.createdAt).toLocaleDateString():"N/A"})}),createdBy:t(o,{name:"CreatedBy",slot:e==null?void 0:e.CreatedBy,context:{quote:a},children:t("span",{children:G})}),status:t(o,{name:"Status",slot:e==null?void 0:e.Status,context:{quote:a},children:t("span",{children:a.status})}),lastUpdated:t(o,{name:"LastUpdated",slot:e==null?void 0:e.LastUpdated,context:{quote:a},children:t("span",{children:a.updatedAt?new Date(a.updatedAt).toLocaleDateString():"N/A"})}),quoteTemplate:t(o,{name:"QuoteTemplate",slot:e==null?void 0:e.QuoteTemplate,context:{quote:a},children:t("span",{children:a.templateName})}),quoteTotal:t(o,{name:"QuoteTotal",slot:e==null?void 0:e.QuoteTotal,context:{quote:a},children:t(Z,{amount:(I=(w=a.prices)==null?void 0:w.grandTotal)==null?void 0:I.value,currency:(M=(B=a.prices)==null?void 0:B.grandTotal)==null?void 0:M.currency})}),actions:t(o,{name:"Actions",slot:e==null?void 0:e.Actions,context:{quote:a,onViewQuote:r},children:t(Y,{variant:"tertiary",size:"medium",onClick:()=>r==null?void 0:r(a.uid,a.name,a.status),children:"View"})})}}),D=l!=null&&l.items?R(l.items,i,v):[],n=l==null?void 0:l.paginationInfo,L=!!n,E=t(o,{name:"EmptyQuotes",slot:i==null?void 0:i.EmptyQuotes,context:{quotesData:l},children:t(K,{heading:"No Quotes Found"})}),F=n?t(o,{name:"ItemRange",slot:i==null?void 0:i.ItemRange,context:n,children:P("span",{children:["Items ",n.startItem," to ",n.endItem," of"," ",n.totalCount," total"]})}):void 0,$=n&&n.pageSizeOptions?P(o,{name:"PageSizePicker",slot:i==null?void 0:i.PageSizePicker,context:{pageSize:n.pageSize,pageSizeOptions:n.pageSizeOptions,onPageSizeChange:k},children:[t("span",{children:"Show "}),t(W,{variant:"primary",size:"medium",value:String(n.pageSize),options:n.pageSizeOptions.map(c=>({value:String(c),text:String(c)})),handleSelect:O}),t("span",{children:" per page"})]}):void 0,j=n?t(o,{name:"Pagination",slot:i==null?void 0:i.Pagination,context:{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_},children:t(X,{currentPage:n.currentPage,totalPages:n.totalPages,onChange:_})}):void 0;return t(ee,{rowData:D,loading:m,className:x.className,emptyStateMessage:E,showItemRange:f&&L,itemRangeMessage:F,showPageSizePicker:N&&L,pageSizePickerMessage:$,showPagination:y&&L,paginationMessage:j})};export{ye as QuotesListTable,ye as default};
4
4
  //# sourceMappingURL=QuotesListTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuotesListTable.js","sources":["/@dropins/storefront-quote-management/src/components/QuotesListTable/QuotesListTable.tsx","/@dropins/storefront-quote-management/src/containers/QuotesListTable/QuotesListTable.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/QuotesListTable/QuotesListTable.css';\n\ntype Column = {\n key: string;\n label: string;\n};\n\nexport interface QuotesListTableProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {\n rowData: QuoteRowData[];\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 QuoteRowData = {\n id: string;\n quoteName: VNode;\n created: VNode;\n createdBy: VNode;\n status: VNode;\n lastUpdated: VNode;\n quoteTemplate: VNode;\n quoteTotal: VNode;\n actions: VNode;\n [key: string]: VNode | string | number | undefined;\n};\n\nexport const QuotesListTable: FunctionComponent<QuotesListTableProps> = ({\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 quoteName: 'QuoteManagement.QuotesListTable.quoteName',\n created: 'QuoteManagement.QuotesListTable.created',\n createdBy: 'QuoteManagement.QuotesListTable.createdBy',\n status: 'QuoteManagement.QuotesListTable.status',\n lastUpdated: 'QuoteManagement.QuotesListTable.lastUpdated',\n quoteTemplate: 'QuoteManagement.QuotesListTable.quoteTemplate',\n quoteTotal: 'QuoteManagement.QuotesListTable.quoteTotal',\n actions: 'QuoteManagement.QuotesListTable.actions',\n });\n\n const columns: Column[] = [\n { key: 'quoteName', label: dictionary.quoteName },\n { key: 'created', label: dictionary.created },\n { key: 'createdBy', label: dictionary.createdBy },\n { key: 'status', label: dictionary.status },\n { key: 'lastUpdated', label: dictionary.lastUpdated },\n { key: 'quoteTemplate', label: dictionary.quoteTemplate },\n { key: 'quoteTotal', label: dictionary.quoteTotal },\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(['quote-management-quotes-list-table', className])}\n >\n <Table\n columns={columns}\n rowData={rowData}\n loading={loading}\n mobileLayout=\"none\"\n className=\"quote-management-quotes-list-table__table\"\n />\n {shouldShowEmptyState && (\n <div className=\"quotes-list-table__empty-state\">\n {emptyStateMessage}\n </div>\n )}\n {shouldShowFooter && (\n <div className=\"quotes-list-table__footer\">\n <div className=\"quotes-list-table__item-range\">\n {shouldShowItemRange && itemRangeMessage}\n </div>\n <div className=\"quotes-list-table__pagination\">\n {shouldShowPagination && paginationMessage}\n </div>\n <div className=\"quotes-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 Button,\n IllustratedMessage,\n Picker,\n Pagination,\n type PickerOption,\n} from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n QuotesListTable as QuotesListTableComponent,\n QuoteRowData,\n} from '@/quote-management/components';\nimport { negotiableQuotes } from '@/quote-management/api';\nimport { getDefaultPageSizeOptions } from '@/quote-management/data/transforms';\nimport {\n NegotiableQuotesListModel,\n NegotiableQuoteListEntry,\n} from '@/quote-management/data/models';\n\nexport interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {\n pageSize?: number;\n showItemRange?: boolean;\n showPageSizePicker?: boolean;\n showPagination?: boolean;\n onViewQuote?: (quoteId: string, quoteName: string, status: string) => void;\n onPageSizeChange?: (pageSize: number) => void;\n onPageChange?: (page: number) => void;\n slots?: {\n /** Slot for customizing the quote name cell content */\n QuoteName?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the created date cell content */\n Created?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the created by cell content */\n CreatedBy?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the status cell content */\n Status?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the last updated cell content */\n LastUpdated?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the quote template cell content */\n QuoteTemplate?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the quote total cell content */\n QuoteTotal?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the actions cell content */\n Actions?: SlotProps<{\n quote: NegotiableQuoteListEntry;\n onViewQuote?: (id: string, name: string, status: string) => void;\n }>;\n /** Slot for customizing the empty quotes message */\n EmptyQuotes?: 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 QuotesListTable: Container<QuotesListTableProps> = ({\n pageSize,\n showItemRange = true,\n showPageSizePicker = true,\n showPagination = true,\n onViewQuote,\n onPageSizeChange,\n onPageChange,\n slots,\n ...props\n}) => {\n const [quotesData, setQuotesData] =\n useState<NegotiableQuotesListModel | 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 quotes data when authenticated\n useEffect(() => {\n const fetchQuotes = async () => {\n try {\n setLoading(true);\n const data = await negotiableQuotes({\n pageSize: currentPageSize,\n currentPage,\n });\n setQuotesData(data);\n } catch (error) {\n console.error('Failed to fetch quotes:', 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 fetchQuotes();\n } else {\n setQuotesData(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 data for table component\n const prepareRowData = (\n quotes: NegotiableQuoteListEntry[],\n slots?: QuotesListTableProps['slots'],\n onViewQuote?: (quoteId: string, quoteName: string, status: string) => void\n ): QuoteRowData[] => {\n return quotes\n .filter((quote) => quote?.uid) // Filter out null quotes\n .map((quote) => {\n const createdByName = `${quote.buyer.firstname} ${quote.buyer.lastname}`;\n\n return {\n id: quote.uid,\n quoteName: (\n <Slot name=\"QuoteName\" slot={slots?.QuoteName} context={{ quote }}>\n <span>{quote.name}</span>\n </Slot>\n ),\n created: (\n <Slot name=\"Created\" slot={slots?.Created} context={{ quote }}>\n <span>\n {quote.createdAt\n ? new Date(quote.createdAt).toLocaleDateString()\n : 'N/A'}\n </span>\n </Slot>\n ),\n createdBy: (\n <Slot name=\"CreatedBy\" slot={slots?.CreatedBy} context={{ quote }}>\n <span>{createdByName}</span>\n </Slot>\n ),\n status: (\n <Slot name=\"Status\" slot={slots?.Status} context={{ quote }}>\n <span>{quote.status}</span>\n </Slot>\n ),\n lastUpdated: (\n <Slot\n name=\"LastUpdated\"\n slot={slots?.LastUpdated}\n context={{ quote }}\n >\n <span>\n {quote.updatedAt\n ? new Date(quote.updatedAt).toLocaleDateString()\n : 'N/A'}\n </span>\n </Slot>\n ),\n quoteTemplate: (\n <Slot\n name=\"QuoteTemplate\"\n slot={slots?.QuoteTemplate}\n context={{ quote }}\n >\n <span>{quote.templateName}</span>\n </Slot>\n ),\n quoteTotal: (\n <Slot\n name=\"QuoteTotal\"\n slot={slots?.QuoteTotal}\n context={{ quote }}\n >\n <Price\n amount={quote.prices?.grandTotal?.value}\n currency={quote.prices?.grandTotal?.currency}\n />\n </Slot>\n ),\n actions: (\n <Slot\n name=\"Actions\"\n slot={slots?.Actions}\n context={{ quote, onViewQuote }}\n >\n <Button\n variant=\"tertiary\"\n size=\"medium\"\n onClick={() =>\n onViewQuote?.(quote.uid, quote.name, quote.status)\n }\n >\n View\n </Button>\n </Slot>\n ),\n };\n });\n };\n\n // Prepare data for rendering\n const rowData = quotesData?.items\n ? prepareRowData(quotesData.items, slots, onViewQuote)\n : [];\n\n const paginationInfo = quotesData?.paginationInfo;\n const shouldShowPagination = !!paginationInfo;\n\n // Empty state message\n const emptyStateMessage = (\n <Slot name=\"EmptyQuotes\" slot={slots?.EmptyQuotes} context={{ quotesData }}>\n <IllustratedMessage heading=\"No Quotes 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 <QuotesListTableComponent\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":["QuotesListTable","rowData","loading","className","emptyStateMessage","showItemRange","itemRangeMessage","showPageSizePicker","pageSizePickerMessage","showPagination","paginationMessage","props","dictionary","useText","columns","shouldShowEmptyState","shouldShowItemRange","shouldShowPageSizePicker","shouldShowPagination","shouldShowFooter","jsxs","classes","jsx","Table","pageSize","onViewQuote","onPageSizeChange","onPageChange","slots","quotesData","setQuotesData","useState","setLoading","defaultPageSize","getDefaultPageSizeOptions","currentPageSize","setCurrentPageSize","currentPage","setCurrentPage","useEffect","fetchQuotes","data","negotiableQuotes","error","unsubscribe","events","isAuthenticated","handlePageSizeChange","newPageSize","handlePageChange","newPage","handlePageSizeSelect","event","target","value","prepareRowData","quotes","quote","createdByName","Slot","Price","_b","_a","_d","_c","Button","paginationInfo","IllustratedMessage","Picker","size","Pagination","QuotesListTableComponent"],"mappings":"6zBAgDO,MAAMA,GAA2D,CAAC,CACvE,QAAAC,EAAU,CAAA,EACV,QAAAC,EA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,MAAI,IAC/DA,EAAe,WAAW,QAAA,CAAA,CAC7B,EACF,EACE,OAGE1D,EACJ0D,GAAkBA,EAAe,gBAC/B9C,EAACuC,EAAA,CACC,KAAK,iBACL,KAAM/B,GAAA,YAAAA,EAAO,eACb,QAAS,CACP,SAAUsC,EAAe,SACzB,gBAAiBA,EAAe,gBAChC,iBAAkBnB,CAAA,EAGpB,SAAA,CAAAzB,EAAC,QAAK,SAAA,OAAA,CAAK,EACXA,EAAC8C,EAAA,CACC,QAAQ,UACR,KAAK,SACL,MAAO,OAAOF,EAAe,QAAQ,EACrC,QAASA,EAAe,gBAAgB,IACrCG,IAAwB,CACvB,MAAO,OAAOA,CAAI,EAClB,KAAM,OAAOA,CAAI,CAAA,EACnB,EAEF,aAAclB,CAAA,CAAA,EAEhB7B,EAAC,QAAK,SAAA,WAAA,CAAS,CAAA,CAAA,CAAA,EAEf,OAGAZ,EAAoBwD,EACxB5C,EAACqC,EAAA,CACC,KAAK,aACL,KAAM/B,GAAA,YAAAA,EAAO,WACb,QAAS,CACP,YAAasC,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUjB,CAAA,EAGZ,SAAA3B,EAACgD,EAAA,CACC,YAAaJ,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUjB,CAAA,CAAA,CACZ,CAAA,EAEA,OAEJ,OACE3B,EAACiD,GAAA,CACC,QAAAtE,EACA,QAAAC,EACA,UAAWS,EAAM,UACjB,kBAAAP,EACA,cAAeC,GAAiBa,EAChC,iBAAAZ,EACA,mBAAoBC,GAAsBW,EAC1C,sBAAAV,EACA,eAAgBC,GAAkBS,EAClC,kBAAAR,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"QuotesListTable.js","sources":["/@dropins/storefront-quote-management/src/components/QuotesListTable/QuotesListTable.tsx","/@dropins/storefront-quote-management/src/containers/QuotesListTable/QuotesListTable.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/QuotesListTable/QuotesListTable.css';\n\ntype Column = {\n key: string;\n label: string;\n};\n\nexport interface QuotesListTableProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'loading' | 'children'> {\n rowData: QuoteRowData[];\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 QuoteRowData = {\n id: string;\n quoteName: VNode;\n created: VNode;\n createdBy: VNode;\n status: VNode;\n lastUpdated: VNode;\n quoteTemplate: VNode;\n quoteTotal: VNode;\n actions: VNode;\n [key: string]: VNode | string | number | undefined;\n};\n\nexport const QuotesListTable: FunctionComponent<QuotesListTableProps> = ({\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 quoteName: 'QuoteManagement.QuotesListTable.quoteName',\n created: 'QuoteManagement.QuotesListTable.created',\n createdBy: 'QuoteManagement.QuotesListTable.createdBy',\n status: 'QuoteManagement.QuotesListTable.status',\n lastUpdated: 'QuoteManagement.QuotesListTable.lastUpdated',\n quoteTemplate: 'QuoteManagement.QuotesListTable.quoteTemplate',\n quoteTotal: 'QuoteManagement.QuotesListTable.quoteTotal',\n actions: 'QuoteManagement.QuotesListTable.actions',\n });\n\n const columns: Column[] = [\n { key: 'quoteName', label: dictionary.quoteName },\n { key: 'created', label: dictionary.created },\n { key: 'createdBy', label: dictionary.createdBy },\n { key: 'status', label: dictionary.status },\n { key: 'lastUpdated', label: dictionary.lastUpdated },\n { key: 'quoteTemplate', label: dictionary.quoteTemplate },\n { key: 'quoteTotal', label: dictionary.quoteTotal },\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(['quote-management-quotes-list-table', className])}\n >\n <Table\n columns={columns}\n rowData={rowData}\n loading={loading}\n mobileLayout=\"none\"\n className=\"quote-management-quotes-list-table__table\"\n />\n {shouldShowEmptyState && (\n <div className=\"quotes-list-table__empty-state\">\n {emptyStateMessage}\n </div>\n )}\n {shouldShowFooter && (\n <div className=\"quotes-list-table__footer\">\n <div className=\"quotes-list-table__item-range\">\n {shouldShowItemRange && itemRangeMessage}\n </div>\n <div className=\"quotes-list-table__pagination\">\n {shouldShowPagination && paginationMessage}\n </div>\n <div className=\"quotes-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 Button,\n IllustratedMessage,\n Picker,\n Pagination,\n type PickerOption,\n} from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n QuotesListTable as QuotesListTableComponent,\n QuoteRowData,\n} from '@/quote-management/components';\nimport { negotiableQuotes } from '@/quote-management/api';\nimport { getDefaultPageSizeOptions } from '@/quote-management/data/transforms';\nimport {\n NegotiableQuotesListModel,\n NegotiableQuoteListEntry,\n} from '@/quote-management/data/models';\n\nexport interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {\n pageSize?: number;\n showItemRange?: boolean;\n showPageSizePicker?: boolean;\n showPagination?: boolean;\n onViewQuote?: (quoteId: string, quoteName: string, status: string) => void;\n onPageSizeChange?: (pageSize: number) => void;\n onPageChange?: (page: number) => void;\n slots?: {\n /** Slot for customizing the quote name cell content */\n QuoteName?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the created date cell content */\n Created?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the created by cell content */\n CreatedBy?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the status cell content */\n Status?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the last updated cell content */\n LastUpdated?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the quote template cell content */\n QuoteTemplate?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the quote total cell content */\n QuoteTotal?: SlotProps<{ quote: NegotiableQuoteListEntry }>;\n /** Slot for customizing the actions cell content */\n Actions?: SlotProps<{\n quote: NegotiableQuoteListEntry;\n onViewQuote?: (id: string, name: string, status: string) => void;\n }>;\n /** Slot for customizing the empty quotes message */\n EmptyQuotes?: 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 QuotesListTable: Container<QuotesListTableProps> = ({\n pageSize,\n showItemRange = true,\n showPageSizePicker = true,\n showPagination = true,\n onViewQuote,\n onPageSizeChange,\n onPageChange,\n slots,\n ...props\n}) => {\n const [quotesData, setQuotesData] =\n useState<NegotiableQuotesListModel | 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 quotes data when authenticated\n useEffect(() => {\n const fetchQuotes = async () => {\n try {\n setLoading(true);\n const data = await negotiableQuotes({\n pageSize: currentPageSize,\n currentPage,\n });\n setQuotesData(data);\n } catch (error) {\n console.error('Failed to fetch quotes:', 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 fetchQuotes();\n } else {\n setQuotesData(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 // Listen for quote renamed event to refresh the list\n useEffect(() => {\n const fetchQuotes = async () => {\n try {\n const data = await negotiableQuotes({\n pageSize: currentPageSize,\n currentPage,\n });\n setQuotesData(data);\n } catch (error) {\n console.error('Failed to fetch quotes:', error);\n }\n };\n\n const unsubscribe = events.on(\n 'quote-management/quote-renamed',\n () => {\n // Refetch quotes list to show the updated name\n fetchQuotes();\n },\n { eager: true }\n );\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 data for table component\n const prepareRowData = (\n quotes: NegotiableQuoteListEntry[],\n slots?: QuotesListTableProps['slots'],\n onViewQuote?: (quoteId: string, quoteName: string, status: string) => void\n ): QuoteRowData[] => {\n return quotes\n .filter((quote) => quote?.uid) // Filter out null quotes\n .map((quote) => {\n const createdByName = `${quote.buyer.firstname} ${quote.buyer.lastname}`;\n\n return {\n id: quote.uid,\n quoteName: (\n <Slot name=\"QuoteName\" slot={slots?.QuoteName} context={{ quote }}>\n <span>{quote.name}</span>\n </Slot>\n ),\n created: (\n <Slot name=\"Created\" slot={slots?.Created} context={{ quote }}>\n <span>\n {quote.createdAt\n ? new Date(quote.createdAt).toLocaleDateString()\n : 'N/A'}\n </span>\n </Slot>\n ),\n createdBy: (\n <Slot name=\"CreatedBy\" slot={slots?.CreatedBy} context={{ quote }}>\n <span>{createdByName}</span>\n </Slot>\n ),\n status: (\n <Slot name=\"Status\" slot={slots?.Status} context={{ quote }}>\n <span>{quote.status}</span>\n </Slot>\n ),\n lastUpdated: (\n <Slot\n name=\"LastUpdated\"\n slot={slots?.LastUpdated}\n context={{ quote }}\n >\n <span>\n {quote.updatedAt\n ? new Date(quote.updatedAt).toLocaleDateString()\n : 'N/A'}\n </span>\n </Slot>\n ),\n quoteTemplate: (\n <Slot\n name=\"QuoteTemplate\"\n slot={slots?.QuoteTemplate}\n context={{ quote }}\n >\n <span>{quote.templateName}</span>\n </Slot>\n ),\n quoteTotal: (\n <Slot\n name=\"QuoteTotal\"\n slot={slots?.QuoteTotal}\n context={{ quote }}\n >\n <Price\n amount={quote.prices?.grandTotal?.value}\n currency={quote.prices?.grandTotal?.currency}\n />\n </Slot>\n ),\n actions: (\n <Slot\n name=\"Actions\"\n slot={slots?.Actions}\n context={{ quote, onViewQuote }}\n >\n <Button\n variant=\"tertiary\"\n size=\"medium\"\n onClick={() =>\n onViewQuote?.(quote.uid, quote.name, quote.status)\n }\n >\n View\n </Button>\n </Slot>\n ),\n };\n });\n };\n\n // Prepare data for rendering\n const rowData = quotesData?.items\n ? prepareRowData(quotesData.items, slots, onViewQuote)\n : [];\n\n const paginationInfo = quotesData?.paginationInfo;\n const shouldShowPagination = !!paginationInfo;\n\n // Empty state message\n const emptyStateMessage = (\n <Slot name=\"EmptyQuotes\" slot={slots?.EmptyQuotes} context={{ quotesData }}>\n <IllustratedMessage heading=\"No Quotes 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 <QuotesListTableComponent\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":["QuotesListTable","rowData","loading","className","emptyStateMessage","showItemRange","itemRangeMessage","showPageSizePicker","pageSizePickerMessage","showPagination","paginationMessage","props","dictionary","useText","columns","shouldShowEmptyState","shouldShowItemRange","shouldShowPageSizePicker","shouldShowPagination","shouldShowFooter","jsxs","classes","jsx","Table","pageSize","onViewQuote","onPageSizeChange","onPageChange","slots","quotesData","setQuotesData","useState","setLoading","defaultPageSize","getDefaultPageSizeOptions","currentPageSize","setCurrentPageSize","currentPage","setCurrentPage","useEffect","fetchQuotes","data","negotiableQuotes","error","unsubscribe","events","isAuthenticated","handlePageSizeChange","newPageSize","handlePageChange","newPage","handlePageSizeSelect","event","target","value","prepareRowData","quotes","quote","createdByName","Slot","Price","_b","_a","_d","_c","Button","paginationInfo","IllustratedMessage","Picker","size","Pagination","QuotesListTableComponent"],"mappings":"s2BAgDO,MAAMA,GAA2D,CAAC,CACvE,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,UAAW,4CACX,QAAS,0CACT,UAAW,4CACX,OAAQ,yCACR,YAAa,8CACb,cAAe,gDACf,WAAY,6CACZ,QAAS,yCAAA,CACV,EAEKC,EAAoB,CACxB,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EAAC,OAAA,CAAK,SAAA,CAAA,SACG8C,EAAe,UAAU,OAAKA,EAAe,QAAQ,MAAI,IAC/DA,EAAe,WAAW,QAAA,CAAA,CAC7B,EACF,EACE,OAGE1D,EACJ0D,GAAkBA,EAAe,gBAC/B9C,EAACuC,EAAA,CACC,KAAK,iBACL,KAAM/B,GAAA,YAAAA,EAAO,eACb,QAAS,CACP,SAAUsC,EAAe,SACzB,gBAAiBA,EAAe,gBAChC,iBAAkBnB,CAAA,EAGpB,SAAA,CAAAzB,EAAC,QAAK,SAAA,OAAA,CAAK,EACXA,EAAC8C,EAAA,CACC,QAAQ,UACR,KAAK,SACL,MAAO,OAAOF,EAAe,QAAQ,EACrC,QAASA,EAAe,gBAAgB,IACrCG,IAAwB,CACvB,MAAO,OAAOA,CAAI,EAClB,KAAM,OAAOA,CAAI,CAAA,EACnB,EAEF,aAAclB,CAAA,CAAA,EAEhB7B,EAAC,QAAK,SAAA,WAAA,CAAS,CAAA,CAAA,CAAA,EAEf,OAGAZ,EAAoBwD,EACxB5C,EAACqC,EAAA,CACC,KAAK,aACL,KAAM/B,GAAA,YAAAA,EAAO,WACb,QAAS,CACP,YAAasC,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUjB,CAAA,EAGZ,SAAA3B,EAACgD,EAAA,CACC,YAAaJ,EAAe,YAC5B,WAAYA,EAAe,WAC3B,SAAUjB,CAAA,CAAA,CACZ,CAAA,EAEA,OAEJ,OACE3B,EAACiD,GAAA,CACC,QAAAtE,EACA,QAAAC,EACA,UAAWS,EAAM,UACjB,kBAAAP,EACA,cAAeC,GAAiBa,EAChC,iBAAAZ,EACA,mBAAoBC,GAAsBW,EAC1C,sBAAAV,EACA,eAAgBC,GAAkBS,EAClC,kBAAAR,CAAA,CAAA,CAGN"}
@@ -6,13 +6,14 @@
6
6
  * file in accordance with the terms of the Adobe license agreement
7
7
  * accompanying it.
8
8
  *******************************************************************/
9
- export * from './ItemsQuoted';
9
+ export * from './RequestNegotiableQuoteForm';
10
10
  export * from './ManageNegotiableQuote';
11
+ export * from './ItemsQuoted';
11
12
  export * from './OrderSummary';
12
13
  export * from './OrderSummaryLine';
13
14
  export * from './QuoteCommentsList';
14
15
  export * from './QuoteHistoryLog';
15
16
  export * from './QuotesListTable';
16
- export * from './RequestNegotiableQuoteForm';
17
17
  export * from './ShippingAddressDisplay';
18
+ export * from './QuoteTemplatesListTable';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { NegotiableQuoteTemplatesListModel } from '../negotiable-quote-template-model';
2
+
3
+ export declare const quoteTemplatesListData: NegotiableQuoteTemplatesListModel;
4
+ export declare const emptyQuoteTemplatesListData: NegotiableQuoteTemplatesListModel;
5
+ //# sourceMappingURL=negotiableQuoteTemplatesListModel.d.ts.map
@@ -8,5 +8,6 @@
8
8
  *******************************************************************/
9
9
  export * from './customer-model';
10
10
  export * from './negotiable-quote-model';
11
+ export * from './negotiable-quote-template-model';
11
12
  export * from './store-config-model';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -73,9 +73,26 @@ export interface NegotiableQuoteModel {
73
73
  shippingAddresses?: ShippingAddress[];
74
74
  canCheckout: boolean;
75
75
  canSendForReview: boolean;
76
+ lockedForEditing?: boolean;
76
77
  canDelete: boolean;
78
+ canClose: boolean;
79
+ canUpdateQuote: boolean;
80
+ }
81
+ export interface ConfigurableOption {
82
+ optionLabel: string;
83
+ valueLabel: string;
84
+ }
85
+ export interface BundleOption {
86
+ label: string;
87
+ values: {
88
+ label: string;
89
+ quantity: number;
90
+ originalPrice: Currency;
91
+ price: Currency;
92
+ }[];
77
93
  }
78
94
  export interface NegotiableQuoteCartItem {
95
+ uid: string;
79
96
  product: {
80
97
  uid: string;
81
98
  sku: string;
@@ -105,19 +122,10 @@ export interface NegotiableQuoteCartItem {
105
122
  originalItemPrice: Currency;
106
123
  rowTotal: Currency;
107
124
  };
108
- configurableOptions?: {
109
- optionLabel: string;
110
- valueLabel: string;
111
- }[];
112
- bundleOptions?: {
113
- label: string;
114
- values: {
115
- label: string;
116
- quantity: number;
117
- originalPrice: Currency;
118
- price: Currency;
119
- }[];
120
- }[];
125
+ configurableOptions?: ConfigurableOption[];
126
+ optionLabel: string;
127
+ valueLabel: string;
128
+ bundleOptions?: BundleOption[];
121
129
  noteFromBuyer?: ItemNote[];
122
130
  noteFromSeller?: ItemNote[];
123
131
  }