@dropins/storefront-quote-management 0.0.1-alpha12 → 0.0.1-alpha14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/getQuoteData/getQuoteData.d.ts +10 -0
- package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +2 -0
- package/api/getQuoteData/index.d.ts +10 -0
- package/api/graphql/NegotiableQuoteFragment.d.ts +1 -1
- package/api/graphql/NegotiableQuoteListFragment.d.ts +1 -1
- package/api/index.d.ts +3 -0
- package/api/initialize/initialize.d.ts +1 -0
- package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -6
- package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +18 -0
- package/api/sendForReview/index.d.ts +10 -0
- package/api/sendForReview/sendForReview.d.ts +8 -0
- package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +18 -0
- package/api/setShippingAddress/index.d.ts +2 -0
- package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
- package/api.js +37 -4
- package/api.js.map +1 -1
- package/chunks/NegotiableQuoteFragment.js +167 -0
- package/chunks/NegotiableQuoteFragment.js.map +1 -0
- package/chunks/WarningFilled.js +4 -0
- package/chunks/WarningFilled.js.map +1 -0
- package/chunks/negotiableQuotes.js +12 -1
- package/chunks/negotiableQuotes.js.map +1 -1
- package/chunks/requestNegotiableQuote.js +3 -83
- package/chunks/requestNegotiableQuote.js.map +1 -1
- package/chunks/sendForReview.js +21 -0
- package/chunks/sendForReview.js.map +1 -0
- package/chunks/transform-quote.js +1 -1
- package/chunks/transform-quote.js.map +1 -1
- package/components/ActionsBar/ActionsBar.d.ts +14 -0
- package/components/ActionsBar/index.d.ts +11 -0
- package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
- package/components/ItemsQuoted/index.d.ts +11 -0
- package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +20 -0
- package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
- package/components/ManageNegotiableQuote/index.d.ts +11 -0
- package/components/OrderSummary/OrderSummary.d.ts +67 -0
- package/components/OrderSummary/index.d.ts +11 -0
- package/components/OrderSummaryLine/OrderSummaryLine.d.ts +13 -0
- package/components/OrderSummaryLine/index.d.ts +11 -0
- package/components/ProductListTable/ProductListTable.d.ts +13 -0
- package/components/ProductListTable/index.d.ts +11 -0
- package/components/QuotePricesSummary/QuotePricesSummary.d.ts +16 -0
- package/components/QuotePricesSummary/index.d.ts +11 -0
- package/components/QuoteSummaryList/QuoteSummaryList.d.ts +13 -0
- package/components/QuoteSummaryList/index.d.ts +11 -0
- package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +12 -0
- package/components/ShippingAddressDisplay/index.d.ts +11 -0
- package/components/TabbedContent/TabbedContent.d.ts +10 -0
- package/components/TabbedContent/index.d.ts +11 -0
- package/components/index.d.ts +19 -1
- package/containers/ItemsQuoted/ItemsQuoted.d.ts +25 -0
- package/containers/ItemsQuoted/index.d.ts +11 -0
- package/containers/ItemsQuoted.d.ts +3 -0
- package/containers/ItemsQuoted.js +4 -0
- package/containers/ItemsQuoted.js.map +1 -0
- package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +56 -0
- package/containers/ManageNegotiableQuote/index.d.ts +11 -0
- package/containers/ManageNegotiableQuote.d.ts +3 -0
- package/containers/ManageNegotiableQuote.js +4 -0
- package/containers/ManageNegotiableQuote.js.map +1 -0
- package/containers/QuotesListTable/QuotesListTable.d.ts +9 -9
- package/containers/QuotesListTable.js +1 -1
- package/containers/QuotesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/index.d.ts +2 -0
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +7 -0
- package/data/models/customer-model.d.ts +1 -0
- package/data/models/negotiable-quote-model.d.ts +100 -34
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +248 -2
- package/i18n/en_US.json.d.ts +94 -0
- package/lib/state.d.ts +1 -0
- package/package.json +1 -1
- package/render.js +5 -3
- package/render.js.map +1 -1
- package/types/state.types.d.ts +1 -0
|
@@ -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 { ShippingAddressDisplay, ShippingAddressDisplaySkeleton } from './ShippingAddressDisplay';
|
|
10
|
+
export type { ShippingAddressDisplayProps } from './ShippingAddressDisplay';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
|
|
4
|
+
export interface TabbedContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
tabs: Map<string, string>;
|
|
6
|
+
tabsContent: Map<string, VNode>;
|
|
7
|
+
defaultActiveTab?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TabbedContent: FunctionComponent<TabbedContentProps>;
|
|
10
|
+
//# sourceMappingURL=TabbedContent.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 './TabbedContent';
|
|
10
|
+
export { TabbedContent as default } from './TabbedContent';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
package/components/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
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 './ActionsBar';
|
|
10
|
+
export * from './ItemsQuoted';
|
|
11
|
+
export * from './ManageNegotiableQuote';
|
|
12
|
+
export * from './OrderSummary';
|
|
13
|
+
export * from './OrderSummaryLine';
|
|
14
|
+
export * from './ProductListTable';
|
|
15
|
+
export * from './QuotePricesSummary';
|
|
16
|
+
export * from './QuoteSummaryList';
|
|
2
17
|
export * from './QuotesListTable';
|
|
18
|
+
export * from './ShippingAddressDisplay';
|
|
19
|
+
export * from './RequestNegotiableQuoteForm';
|
|
20
|
+
export * from './TabbedContent';
|
|
3
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { NegotiableQuoteModel, NegotiableQuoteCartItem } from '../../data/models/negotiable-quote-model';
|
|
4
|
+
|
|
5
|
+
export interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
quoteData?: NegotiableQuoteModel;
|
|
7
|
+
onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;
|
|
8
|
+
onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;
|
|
9
|
+
onUpdate?: (e: SubmitEvent) => void;
|
|
10
|
+
slots?: {
|
|
11
|
+
ProductListTable?: SlotProps<{
|
|
12
|
+
items: NegotiableQuoteModel['items'];
|
|
13
|
+
canEdit: boolean;
|
|
14
|
+
onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;
|
|
15
|
+
onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;
|
|
16
|
+
onUpdate?: (e: SubmitEvent) => void;
|
|
17
|
+
}>;
|
|
18
|
+
QuotePricesSummary?: SlotProps<{
|
|
19
|
+
items: NegotiableQuoteModel['items'];
|
|
20
|
+
prices: NegotiableQuoteModel['prices'];
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const ItemsQuoted: Container<ItemsQuotedProps>;
|
|
25
|
+
//# sourceMappingURL=ItemsQuoted.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 './ItemsQuoted';
|
|
10
|
+
export { ItemsQuoted as default } from './ItemsQuoted';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as e,jsxs as s,Fragment as E}from"@dropins/tools/preact-jsx-runtime.js";import{useState as O,useEffect as j}from"@dropins/tools/preact-compat.js";import{classes as g,VComponent as v,Slot as f}from"@dropins/tools/lib.js";import{h as x}from"@dropins/tools/preact.js";import{Skeleton as A,SkeletonRow as D,Picker as z,Price as b,Checkbox as F,Button as G,Table as R,Accordion as V,AccordionSection as W}from"@dropins/tools/components.js";/* empty css */import{useText as S}from"@dropins/tools/i18n.js";import{events as J}from"@dropins/tools/event-bus.js";const Q=({className:d,loading:c,table:u,pricesSummary:n,...a})=>c?e(K,{}):s("div",{className:g(["quote-management-items-quoted",d]),...a,children:[u&&e(v,{node:u,className:g(["quote-management-items-quoted__table"]),"data-testid":"quote-management-items-quoted__table"}),n&&e(v,{node:n,className:g(["quote-management-items-quoted__prices-summary"]),"data-testid":"quote-management-items-quoted__prices-summary"})]}),K=()=>e(A,{"data-testid":"items-quoted-skeleton",children:e(D,{variant:"row",fullWidth:!0,size:"medium",lines:4,multilineGap:"xsmall"})}),X=({className:d,items:c,canEdit:u,onItemCheckboxChange:n,onItemDropdownChange:a,onUpdate:i,...o})=>{const l=S({updateButton:"NegotiableQuote.Manage.productListTable.submitButton",productNameHeader:"NegotiableQuote.Manage.productListTable.headers.productName",skuHeader:"NegotiableQuote.Manage.productListTable.headers.sku",priceHeader:"NegotiableQuote.Manage.productListTable.headers.price",quantityHeader:"NegotiableQuote.Manage.productListTable.headers.quantity",discountHeader:"NegotiableQuote.Manage.productListTable.headers.discount",subtotalHeader:"NegotiableQuote.Manage.productListTable.headers.subtotal",actionsHeader:"NegotiableQuote.Manage.productListTable.headers.actions",editNoteToSeller:"NegotiableQuote.Manage.productListTable.actions.editNoteToSeller",remove:"NegotiableQuote.Manage.productListTable.actions.remove"}),p=[{label:l.productNameHeader,key:"productName"},{label:l.skuHeader,key:"sku"},{label:l.priceHeader,key:"price"},{label:l.quantityHeader,key:"quantity"},{label:l.discountHeader,key:"discount"},{label:l.subtotalHeader,key:"subtotal"}];u&&(p.unshift({label:"",key:"checkbox"}),p.push({label:l.actionsHeader,key:"actions"}));const q=(t,r)=>{const N=t.target.checked;n==null||n(r,N)},_=(t,r)=>{const N=t.target.value;a==null||a(r,N)},h=t=>{t.preventDefault(),i==null||i(t)},L=(t,r)=>t>0?s("div",{className:"quote-management-product-list-table__discount-container",children:[s("span",{className:"quote-management-product-list-table__discount-percent",children:[r,"%"]}),s("span",{className:"quote-management-product-list-table__discount-price",children:["(",e(b,{amount:t}),")"]})]}):void 0,P=t=>{var T,k;const r=(T=t.configurableOptions)==null?void 0:T.map(m=>s("div",{className:"quote-management-product-list-table__configurable-option",children:[s("span",{className:"quote-management-product-list-table__configurable-option-label",children:[m.optionLabel,":"]}),e("span",{className:"quote-management-product-list-table__configurable-option-value",children:m.valueLabel})]},m.optionLabel)),N=(k=t.bundleOptions)==null?void 0:k.map(m=>s("div",{className:"quote-management-product-list-table__bundle-option",children:[e("span",{className:"quote-management-product-list-table__bundle-option-label",children:m.label}),e("div",{className:"quote-management-product-list-table__bundle-option-values",children:m.values.map(y=>s("span",{className:"quote-management-product-list-table__bundle-option-value",children:[s("span",{className:"quote-management-product-list-table__bundle-option-value-quantity",children:[y.quantity," x"]}),e("span",{className:"quote-management-product-list-table__bundle-option-value-label",children:y.label}),e(b,{className:"quote-management-product-list-table__bundle-option-value-original-price",amount:y.originalPrice.value,currency:y.originalPrice.currency,weight:"normal"})]},y.label))})]},m.label));return s("div",{className:"quote-management-product-list-table__product-name-container",children:[e("span",{className:"quote-management-product-list-table__product-name",children:t.product.name}),r,N]})},H=c.map(t=>({checkbox:e(F,{className:"quote-management-product-list-table__checkbox",name:"itemSelected","data-testid":`item-checkbox-${t.product.sku}`,onChange:r=>q(r,t),value:t.product.sku}),productName:P(t),sku:e("span",{className:"quote-management-product-list-table__sku",children:t.product.sku}),price:e(b,{className:"quote-management-product-list-table__price",amount:t.prices.originalItemPrice.value,currency:t.prices.originalItemPrice.currency}),quantity:e("span",{className:"quote-management-product-list-table__quantity",children:t.quantity}),discount:L(t.catalogDiscount.amountOff,t.catalogDiscount.percentOff),subtotal:e(b,{className:"quote-management-product-list-table__subtotal",amount:t.prices.rowTotal.value,currency:t.prices.rowTotal.currency}),actions:e(z,{className:"quote-management-product-list-table__actions","data-testid":`item-dropdown-${t.product.sku}`,name:`item-dropdown-${t.product.sku}`,onChange:r=>_(r,t),placeholder:"Select",options:[{text:l.editNoteToSeller,value:"edit"},{text:l.remove,value:"remove"}],value:t.product.sku})})),M=e(R,{columns:p,rowData:H,"data-testid":"product-list-table",mobileLayout:"stacked"}),$=u?x("form",{}):x("div",{}),w=u?{onSubmit:h,...o}:o,B=u?e(G,{type:"submit","data-testid":"product-list-table-submit-button",children:l.updateButton}):void 0;return s(v,{node:$,className:g(["quote-management-product-list-table-container",d]),"data-testid":"product-list-table-container",...w,children:[M,e("div",{className:"quote-management-product-list-table-container__submit-container",children:B})]})},Y=({className:d,entries:c,...u})=>{const n=a=>{var o;const i=(o=a.children)==null?void 0:o.map(n);return e("div",{className:"quote-management-quote-prices-summary__entry","data-testid":`quote-prices-summary-entry-${a.id}`,children:i?e(V,{className:"quote-management-quote-prices-summary__accordion","data-testid":`quote-prices-summary-entry-accordion-${a.id}`,children:e(W,{className:"quote-management-quote-prices-summary__accordion-section",title:a.label,ariaLabelTitle:a.label,secondaryText:a.value,children:i})}):s(E,{children:[e("span",{className:g(["quote-management-quote-prices-summary__label",["quote-management-quote-prices-summary__label--strong",a.strong]]),"data-testid":`quote-prices-summary-entry-label-${a.id}`,children:a.label}),e("span",{className:"quote-management-quote-prices-summary__value","data-testid":`quote-prices-summary-entry-value-${a.id}`,children:a.value})]})},a.id)};return e("div",{className:g(["quote-management-quote-prices-summary",d]),"data-testid":"quote-prices-summary",...u,children:c==null?void 0:c.map(n)})},ue=({quoteData:d,onItemCheckboxChange:c,onItemDropdownChange:u,onUpdate:n,slots:a,...i})=>{const[o,l]=O(d),p=S({subtotal:"NegotiableQuote.Manage.quotePricesSummary.subtotal.excludingTax",grandTotal:"NegotiableQuote.Manage.quotePricesSummary.grandTotal.includingTax",appliedTaxes:"NegotiableQuote.Manage.quotePricesSummary.appliedTaxes"});if(j(()=>{const _=J.on("quote-management/quote-data",h=>{l(h.quote)},{eager:!0});return()=>_==null?void 0:_.off()},[]),!o)return e(Q,{loading:!0});const q=[];return o.prices.subtotalExcludingTax&&q.push({label:p.subtotal,id:"subtotal",value:e(b,{amount:o.prices.subtotalExcludingTax.value,currency:o.prices.subtotalExcludingTax.currency,weight:"normal"})}),o.prices.grandTotal&&q.push({label:p.grandTotal,id:"total",value:e(b,{amount:o.prices.grandTotal.value,currency:o.prices.grandTotal.currency}),strong:!0}),e(Q,{"data-testid":"items-quoted-container",...i,loading:!1,table:e(f,{name:"ProductListTable",slot:a==null?void 0:a.ProductListTable,context:{items:o.items,canEdit:!0,onItemCheckboxChange:c,onItemDropdownChange:u,onUpdate:n},children:e(X,{items:o.items,canEdit:!0,onItemCheckboxChange:c,onItemDropdownChange:u,onUpdate:n})}),pricesSummary:e(f,{name:"QuotePricesSummary",slot:a==null?void 0:a.QuotePricesSummary,context:{items:o.items,prices:o.prices},children:e(Y,{entries:q})})})};export{ue as ItemsQuoted,ue as default};
|
|
4
|
+
//# sourceMappingURL=ItemsQuoted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemsQuoted.js","sources":["/@dropins/storefront-quote-management/src/components/ItemsQuoted/ItemsQuoted.tsx","/@dropins/storefront-quote-management/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-quote-management/src/components/QuotePricesSummary/QuotePricesSummary.tsx","/@dropins/storefront-quote-management/src/containers/ItemsQuoted/ItemsQuoted.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ItemsQuoted/ItemsQuoted.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n table?: VNode;\n pricesSummary?: VNode;\n}\n\nexport const ItemsQuoted: FunctionComponent<ItemsQuotedProps> = ({\n className,\n loading,\n table,\n pricesSummary,\n ...props\n}) => {\n if (loading) {\n return <ItemsQuotedSkeleton />;\n }\n\n return (\n <div className={classes(['quote-management-items-quoted', className])} {...props}>\n {table && (\n <VComponent\n node={table}\n className={classes(['quote-management-items-quoted__table'])}\n data-testid=\"quote-management-items-quoted__table\"\n />\n )}\n {pricesSummary && (\n <VComponent\n node={pricesSummary}\n className={classes(['quote-management-items-quoted__prices-summary'])}\n data-testid=\"quote-management-items-quoted__prices-summary\"\n />\n )}\n </div>\n );\n};\n\nexport const ItemsQuotedSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"items-quoted-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"medium\" lines={4} multilineGap='xsmall' />\n </Skeleton>\n );\n};","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { Table, Checkbox, Picker, Price, Button } from '@adobe-commerce/elsie/components';\nimport '@/quote-management/components/ProductListTable/ProductListTable.css';\nimport { NegotiableQuoteCartItem } from '@/quote-management/data/models/negotiable-quote-model';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n items: NegotiableQuoteCartItem[];\n canEdit: boolean;\n onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;\n onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;\n onUpdate?: (e: SubmitEvent) => void;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n canEdit,\n onItemCheckboxChange,\n onItemDropdownChange,\n onUpdate,\n ...props\n}) => {\n\n const dictionary = useText({\n updateButton: 'NegotiableQuote.Manage.productListTable.submitButton',\n productNameHeader: 'NegotiableQuote.Manage.productListTable.headers.productName',\n skuHeader: 'NegotiableQuote.Manage.productListTable.headers.sku',\n priceHeader: 'NegotiableQuote.Manage.productListTable.headers.price',\n quantityHeader: 'NegotiableQuote.Manage.productListTable.headers.quantity',\n discountHeader: 'NegotiableQuote.Manage.productListTable.headers.discount',\n subtotalHeader: 'NegotiableQuote.Manage.productListTable.headers.subtotal',\n actionsHeader: 'NegotiableQuote.Manage.productListTable.headers.actions',\n editNoteToSeller: 'NegotiableQuote.Manage.productListTable.actions.editNoteToSeller',\n remove: 'NegotiableQuote.Manage.productListTable.actions.remove',\n });\n\n const columns = [\n {\n label: dictionary.productNameHeader,\n key: 'productName',\n },\n {\n label: dictionary.skuHeader,\n key: 'sku',\n },\n {\n label: dictionary.priceHeader,\n key: 'price',\n },\n {\n label: dictionary.quantityHeader,\n key: 'quantity',\n },\n {\n label: dictionary.discountHeader,\n key: 'discount',\n },\n {\n label: dictionary.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit) {\n columns.unshift({\n label: '',\n key: 'checkbox',\n });\n columns.push({\n label: dictionary.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (event: Event, item: NegotiableQuoteCartItem) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n onItemCheckboxChange?.(item, isSelected);\n };\n\n const handleItemDropdownChange = (event: Event, item: NegotiableQuoteCartItem) => {\n const action = (event.target as HTMLSelectElement).value;\n onItemDropdownChange?.(item, action);\n };\n\n const handleUpdate = (event: SubmitEvent) => {\n event.preventDefault();\n onUpdate?.(event);\n };\n\n const discountElement = (amountOff: number, percentOff: number) => {\n return amountOff > 0 ?\n <div className=\"quote-management-product-list-table__discount-container\">\n <span className=\"quote-management-product-list-table__discount-percent\">{percentOff}%</span>\n <span className=\"quote-management-product-list-table__discount-price\">(<Price amount={amountOff} />)</span>\n </div>\n : undefined;\n };\n\n const getProductNameContent = (item: NegotiableQuoteCartItem) => {\n const configurableOptions = item.configurableOptions?.map((option) =>\n <div key={option.optionLabel} className=\"quote-management-product-list-table__configurable-option\">\n <span className=\"quote-management-product-list-table__configurable-option-label\">{option.optionLabel}:</span>\n <span className=\"quote-management-product-list-table__configurable-option-value\">{option.valueLabel}</span>\n </div>);\n\n const bundleOptions = item.bundleOptions?.map((option) =>\n <div key={option.label} className=\"quote-management-product-list-table__bundle-option\">\n <span className=\"quote-management-product-list-table__bundle-option-label\">{option.label}</span>\n <div className=\"quote-management-product-list-table__bundle-option-values\">\n {option.values.map((value) =>\n <span key={value.label} className=\"quote-management-product-list-table__bundle-option-value\">\n <span className=\"quote-management-product-list-table__bundle-option-value-quantity\">{value.quantity} x</span>\n <span className=\"quote-management-product-list-table__bundle-option-value-label\">{value.label}</span>\n <Price className=\"quote-management-product-list-table__bundle-option-value-original-price\"\n amount={value.originalPrice.value}\n currency={value.originalPrice.currency}\n weight=\"normal\"\n />\n </span>\n )}\n </div>\n </div>);\n\n return (\n <div className=\"quote-management-product-list-table__product-name-container\">\n <span className=\"quote-management-product-list-table__product-name\">{item.product.name}</span>\n {configurableOptions}\n {bundleOptions}\n </div>\n )\n };\n\n const rowData = items.map((item) => {\n return {\n checkbox: <Checkbox className=\"quote-management-product-list-table__checkbox\" name=\"itemSelected\" data-testid={`item-checkbox-${item.product.sku}`} onChange={(e) => handleItemCheckboxChange(e, item)} value={item.product.sku} />,\n productName: getProductNameContent(item),\n sku: <span className=\"quote-management-product-list-table__sku\">{item.product.sku}</span>,\n price: <Price className=\"quote-management-product-list-table__price\" amount={item.prices.originalItemPrice.value} currency={item.prices.originalItemPrice.currency} />,\n quantity: <span className=\"quote-management-product-list-table__quantity\">{item.quantity}</span>,\n discount: discountElement(item.catalogDiscount.amountOff, item.catalogDiscount.percentOff),\n subtotal: <Price className=\"quote-management-product-list-table__subtotal\" amount={item.prices.rowTotal.value} currency={item.prices.rowTotal.currency} />,\n actions: <Picker\n className=\"quote-management-product-list-table__actions\"\n data-testid={`item-dropdown-${item.product.sku}`}\n name={`item-dropdown-${item.product.sku}`}\n onChange={(e) => handleItemDropdownChange(e, item)}\n placeholder=\"Select\"\n options={[{ text: dictionary.editNoteToSeller, value: 'edit' }, { text: dictionary.remove, value: 'remove' }]}\n value={item.product.sku}\n />,\n }\n });\n\n const table = <Table columns={columns} rowData={rowData} data-testid=\"product-list-table\" mobileLayout='stacked' />\n\n // if can edit, the wrapper node should use the form element, else use the div element\n const wrapperNode = canEdit ? h('form', {}) : h('div', {});\n const wrapperProps = canEdit ? {\n onSubmit: handleUpdate,\n ...props,\n } : props;\n\n const submitButton = canEdit ? <Button type=\"submit\" data-testid=\"product-list-table-submit-button\">{dictionary.updateButton}</Button> : undefined;\n\n return (\n <VComponent\n node={wrapperNode}\n className={classes(['quote-management-product-list-table-container', className])}\n data-testid=\"product-list-table-container\"\n {...wrapperProps}\n >\n {table}\n <div className=\"quote-management-product-list-table-container__submit-container\">\n {submitButton}\n </div>\n </VComponent>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n \nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/QuotePricesSummary/QuotePricesSummary.css';\nimport { Accordion, AccordionSection } from '@adobe-commerce/elsie/components';\n\ninterface Entry {\n label: string;\n id: string;\n value: VNode;\n strong?: boolean;\n children?: Entry[];\n}\n\nexport interface QuotePricesSummaryProps extends HTMLAttributes<HTMLDivElement> {\n entries?: Entry[];\n}\n\nexport const QuotePricesSummary: FunctionComponent<QuotePricesSummaryProps> = ({\n className,\n entries,\n ...props\n}) => {\n const createEntry = (entry: Entry) => {\n const children = entry.children?.map(createEntry);\n return (\n <div key={entry.id} className=\"quote-management-quote-prices-summary__entry\" data-testid={`quote-prices-summary-entry-${entry.id}`}>\n {children ? <Accordion\n className=\"quote-management-quote-prices-summary__accordion\"\n data-testid={`quote-prices-summary-entry-accordion-${entry.id}`}\n >\n <AccordionSection className=\"quote-management-quote-prices-summary__accordion-section\" title={entry.label} ariaLabelTitle={entry.label} secondaryText={entry.value}>\n {children}\n </AccordionSection>\n </Accordion>\n :\n <>\n <span className={classes(['quote-management-quote-prices-summary__label', ['quote-management-quote-prices-summary__label--strong', entry.strong]])} data-testid={`quote-prices-summary-entry-label-${entry.id}`}>{entry.label}</span>\n <span className=\"quote-management-quote-prices-summary__value\" data-testid={`quote-prices-summary-entry-value-${entry.id}`}>{entry.value}</span>\n </>\n }\n </div>\n );\n };\n\n return (\n <div className={classes(['quote-management-quote-prices-summary', className])} data-testid=\"quote-prices-summary\" {...props}>\n {entries?.map(createEntry)}\n </div>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useEffect, useState } from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { ProductListTable } from '@/quote-management/components/ProductListTable/ProductListTable';\nimport { NegotiableQuoteModel, NegotiableQuoteCartItem } from '@/quote-management/data/models/negotiable-quote-model';\nimport { events } from '@adobe-commerce/event-bus';\nimport { QuotePricesSummary } from '@/quote-management/components/QuotePricesSummary';\nimport { ItemsQuoted as ItemsQuotedComponent } from '@/quote-management/components/ItemsQuoted';\nimport { Price } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ItemsQuotedProps extends HTMLAttributes<HTMLDivElement> {\n quoteData?: NegotiableQuoteModel;\n onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;\n onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;\n onUpdate?: (e: SubmitEvent) => void;\n slots?: {\n ProductListTable?: SlotProps<{\n items: NegotiableQuoteModel['items'];\n canEdit: boolean;\n onItemCheckboxChange?: (item: NegotiableQuoteCartItem, isSelected: boolean) => void;\n onItemDropdownChange?: (item: NegotiableQuoteCartItem, action: string) => void;\n onUpdate?: (e: SubmitEvent) => void;\n }>;\n QuotePricesSummary?: SlotProps<{\n items: NegotiableQuoteModel['items'];\n prices: NegotiableQuoteModel['prices'];\n }>;\n }\n}\n\nexport const ItemsQuoted: Container<ItemsQuotedProps> = ({\n quoteData: initialData,\n onItemCheckboxChange,\n onItemDropdownChange,\n onUpdate,\n slots,\n ...props\n}) => {\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(initialData);\n\n const dictionary = useText({\n subtotal: 'NegotiableQuote.Manage.quotePricesSummary.subtotal.excludingTax',\n grandTotal: 'NegotiableQuote.Manage.quotePricesSummary.grandTotal.includingTax',\n appliedTaxes: 'NegotiableQuote.Manage.quotePricesSummary.appliedTaxes',\n });\n\n useEffect(() => {\n const quoteDataEvent = events.on('quote-management/quote-data', (data: { quote: NegotiableQuoteModel }) => {\n setQuoteData(data.quote);\n }, {\n eager: true,\n });\n return () => quoteDataEvent?.off();\n }, []);\n\n if (!quoteData) {\n return <ItemsQuotedComponent loading={true} />;\n }\n\n const quotePricesSummaryEntries = [];\n\n quoteData.prices.subtotalExcludingTax && quotePricesSummaryEntries.push({\n label: dictionary.subtotal,\n id: 'subtotal',\n value: <Price amount={quoteData.prices.subtotalExcludingTax.value} currency={quoteData.prices.subtotalExcludingTax.currency} weight='normal' />,\n })\n\n quoteData.prices.grandTotal && quotePricesSummaryEntries.push({\n label: dictionary.grandTotal,\n id: 'total',\n value: <Price amount={quoteData.prices.grandTotal.value} currency={quoteData.prices.grandTotal.currency} />,\n strong: true,\n })\n\n return (\n <ItemsQuotedComponent data-testid=\"items-quoted-container\" {...props} loading={false}\n table={<Slot name=\"ProductListTable\" slot={slots?.ProductListTable}\n context={{\n items: quoteData.items,\n canEdit: true,\n onItemCheckboxChange,\n onItemDropdownChange,\n onUpdate\n }}>\n <ProductListTable\n items={quoteData.items}\n canEdit={true}\n onItemCheckboxChange={onItemCheckboxChange}\n onItemDropdownChange={onItemDropdownChange}\n onUpdate={onUpdate}\n />\n </Slot>}\n pricesSummary={<Slot name=\"QuotePricesSummary\" slot={slots?.QuotePricesSummary} context={{\n items: quoteData.items,\n prices: quoteData.prices,\n }}>\n <QuotePricesSummary entries={quotePricesSummaryEntries} />\n </Slot>\n }\n />\n );\n};"],"names":["ItemsQuoted","className","loading","table","pricesSummary","props","ItemsQuotedSkeleton","jsxs","classes","jsx","VComponent","Skeleton","SkeletonRow","ProductListTable","items","canEdit","onItemCheckboxChange","onItemDropdownChange","onUpdate","dictionary","useText","columns","handleItemCheckboxChange","event","item","isSelected","handleItemDropdownChange","action","handleUpdate","discountElement","amountOff","percentOff","Price","getProductNameContent","configurableOptions","_a","option","bundleOptions","_b","value","rowData","Checkbox","e","Picker","Table","wrapperNode","h","wrapperProps","submitButton","Button","QuotePricesSummary","entries","createEntry","entry","children","Accordion","AccordionSection","Fragment","initialData","slots","quoteData","setQuoteData","useState","useEffect","quoteDataEvent","events","data","ItemsQuotedComponent","quotePricesSummaryEntries","Slot"],"mappings":"4kBAqBO,MAAMA,EAAmD,CAAC,CAC/D,UAAAC,EACA,QAAAC,EACA,MAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IACMH,IACMI,EAAA,EAAoB,EAI5BC,EAAC,MAAA,CAAI,UAAWC,EAAQ,CAAC,gCAAiCP,CAAS,CAAC,EAAI,GAAGI,EACxE,SAAA,CAAAF,GACCM,EAACC,EAAA,CACC,KAAMP,EACN,UAAWK,EAAQ,CAAC,sCAAsC,CAAC,EAC3D,cAAY,sCAAA,CAAA,EAGfJ,GACCK,EAACC,EAAA,CACC,KAAMN,EACN,UAAWI,EAAQ,CAAC,+CAA+C,CAAC,EACpE,cAAY,+CAAA,CAAA,CACd,EAEJ,EAISF,EAAyC,MAEjDK,EAAA,CAAS,cAAY,wBACpB,SAAAF,EAACG,GAAY,QAAQ,MAAM,UAAW,GAAM,KAAK,SAAS,MAAO,EAAG,aAAa,SAA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,EAAO,mBAAoB,QAAS,CACvF,MAAOC,EAAU,MACjB,OAAQA,EAAU,MAAA,EAElB,SAAAnD,EAACyC,EAAA,CAAmB,QAASkB,EAA2B,CAAA,CAC1D,CAAA,CAAA,CAIN"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { NegotiableQuoteModel, ShippingAddress } from '../../data/models/negotiable-quote-model';
|
|
4
|
+
|
|
5
|
+
export interface ManageNegotiableQuoteProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
onActionsDropdownChange?: (event: Event) => void;
|
|
7
|
+
onActionsButtonClick?: (action: string) => void;
|
|
8
|
+
onSendForReview?: (params: {
|
|
9
|
+
quoteData: NegotiableQuoteModel;
|
|
10
|
+
comment?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
slots?: {
|
|
13
|
+
QuoteName?: SlotProps<{
|
|
14
|
+
quoteName?: string;
|
|
15
|
+
quoteData?: NegotiableQuoteModel;
|
|
16
|
+
}>;
|
|
17
|
+
QuoteStatus?: SlotProps<{
|
|
18
|
+
quoteStatus?: string;
|
|
19
|
+
quoteData?: NegotiableQuoteModel;
|
|
20
|
+
}>;
|
|
21
|
+
Banner?: SlotProps<{
|
|
22
|
+
quoteData?: NegotiableQuoteModel;
|
|
23
|
+
}>;
|
|
24
|
+
Details?: SlotProps<{
|
|
25
|
+
quoteData?: NegotiableQuoteModel;
|
|
26
|
+
}>;
|
|
27
|
+
ActionBar?: SlotProps<{
|
|
28
|
+
quoteData?: NegotiableQuoteModel;
|
|
29
|
+
}>;
|
|
30
|
+
QuoteContent?: SlotProps<{
|
|
31
|
+
quoteData?: NegotiableQuoteModel;
|
|
32
|
+
}>;
|
|
33
|
+
ShippingInformationTitle?: SlotProps<{
|
|
34
|
+
quoteData?: NegotiableQuoteModel;
|
|
35
|
+
}>;
|
|
36
|
+
ShippingInformation?: SlotProps<{
|
|
37
|
+
quoteData?: NegotiableQuoteModel;
|
|
38
|
+
primaryShippingAddress?: ShippingAddress | undefined;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
setLoading?: (loading: boolean) => void;
|
|
41
|
+
}>;
|
|
42
|
+
QuoteCommentsTitle?: SlotProps<{
|
|
43
|
+
quoteData?: NegotiableQuoteModel;
|
|
44
|
+
}>;
|
|
45
|
+
QuoteComments?: SlotProps<{
|
|
46
|
+
quoteData?: NegotiableQuoteModel;
|
|
47
|
+
}>;
|
|
48
|
+
Footer?: SlotProps<{
|
|
49
|
+
quoteData?: NegotiableQuoteModel;
|
|
50
|
+
comment?: string;
|
|
51
|
+
isSubmitting?: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export declare const ManageNegotiableQuote: Container<ManageNegotiableQuoteProps>;
|
|
56
|
+
//# sourceMappingURL=ManageNegotiableQuote.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 './ManageNegotiableQuote';
|
|
10
|
+
export { ManageNegotiableQuote as default } from './ManageNegotiableQuote';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as t,jsxs as l}from"@dropins/tools/preact-jsx-runtime.js";import{useState as x,useEffect as M,useMemo as b,useCallback as F}from"@dropins/tools/preact-compat.js";import{classes as d,VComponent as s,Slot as h,getGlobalLocale as Y}from"@dropins/tools/lib.js";/* empty css */import{Picker as Z,Skeleton as R,SkeletonRow as y,InLineAlert as D,Button as P,TextArea as O}from"@dropins/tools/components.js";import{events as S}from"@dropins/tools/event-bus.js";/* empty css */import"@dropins/tools/preact.js";import{useText as W}from"@dropins/tools/i18n.js";/* empty css */import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import{s as B}from"../chunks/sendForReview.js";import{S as k}from"../chunks/WarningFilled.js";import"../chunks/NegotiableQuoteFragment.js";const A=({className:p,dropdownPlaceholder:e,dropdownOptions:i,handleDropdownChange:q,buttons:u,...a})=>{const _=i&&i.length>0,c=u&&u.length>0,f=(i==null?void 0:i.map(o=>({text:o.label,value:o.value})))||[];return f.unshift({text:e||"",value:""}),t("div",{className:"quote-management-actions-bar__container","data-testid":"actions-bar-container",children:l("div",{className:d(["quote-management-actions-bar",p]),"data-testid":"actions-bar",...a,children:[_&&t(Z,{name:"dropdown",id:"dropdown",onInput:q,className:"quote-management-actions-bar__dropdown","data-testid":"dropdown",options:f}),c&&t("div",{className:"quote-management-actions-bar__buttons","data-testid":"buttons-container",children:u==null?void 0:u.map((o,v)=>t(s,{node:o,className:d(["quote-management-actions-bar__button"])},v))})]})})},ee=({className:p,loading:e,quoteName:i,quoteStatus:q,banner:u,details:a,actionBar:_,quoteContent:c,shippingInformationTitle:f,shippingInformation:o,quoteCommentsTitle:v,quoteComments:N,footer:Q,...n})=>e?t(ae,{}):l("div",{...n,className:d(["quote-management-manage-negotiable-quote",p]),children:[l("div",{className:d(["quote-management-manage-negotiable-quote__header"]),children:[i&&t(s,{node:i,className:d(["quote-management-manage-negotiable-quote__quote-name"])}),q&&t(s,{node:q,className:d(["quote-management-manage-negotiable-quote__quote-status"])})]}),u&&t(s,{node:u,className:d(["quote-management-manage-negotiable-quote__banner"])}),a&&t(s,{node:a,className:d(["quote-management-manage-negotiable-quote__details"])}),_&&t(s,{node:_,className:d(["quote-management-manage-negotiable-quote__action-bar"])}),c&&t(s,{node:c,className:d(["quote-management-manage-negotiable-quote__quote-content"])}),l("div",{"data-testid":"quote-shipping-information-container",className:d(["quote-management-manage-negotiable-quote__shipping-information-container"]),children:[f&&t(s,{node:f,className:d(["quote-management-manage-negotiable-quote__shipping-information-title"])}),o&&t(s,{node:o,className:d(["quote-management-manage-negotiable-quote__shipping-information"])})]}),l("div",{"data-testid":"quote-comments-container",className:d(["quote-management-manage-negotiable-quote__quote-comments-container"]),children:[v&&t(s,{node:v,className:d(["quote-management-manage-negotiable-quote__quote-comments-title"])}),N&&t(s,{node:N,className:d(["quote-management-manage-negotiable-quote__quote-comments"])})]}),t(s,{node:Q,className:d(["quote-management-manage-negotiable-quote__footer"])})]}),ae=()=>l(R,{"data-testid":"manage-negotiable-quote-skeleton",children:[t(y,{variant:"heading",fullWidth:!0,size:"large"}),t(y,{variant:"row",fullWidth:!1,size:"small"}),t(y,{variant:"row",fullWidth:!1,size:"small"}),t(y,{variant:"row",fullWidth:!0}),t(y,{variant:"row",fullWidth:!0,size:"xlarge",lines:2}),t(y,{variant:"row",fullWidth:!1,size:"small"})]}),te=({className:p,shippingAddress:e,loading:i,noAddressMessage:q,...u})=>{const a=W({noAddress:"NegotiableQuote.Manage.shippingAddress.noAddress"});return i?t(ne,{}):e?l("div",{className:d(["quote-management-shipping-address-display",p]),"data-testid":"shipping-address-display",...u,children:[t("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-name",children:l("span",{className:"quote-management-shipping-address-display__name",children:[e.firstname," ",e.lastname]})}),e.company&&t("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-company",children:e.company}),e.street.map((_,c)=>t("div",{className:"quote-management-shipping-address-display__field","data-testid":`address-street-${c}`,children:_},c)),l("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-city-region",children:[e.city,e.region&&`, ${e.region.label}`," ",e.postcode]}),t("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-country",children:e.country.label}),t("div",{className:"quote-management-shipping-address-display__field","data-testid":"address-telephone",children:e.telephone})]}):t("div",{className:d(["quote-management-shipping-address-display","quote-management-shipping-address-display--empty",p]),"data-testid":"shipping-address-display-empty",...u,children:t("p",{className:"quote-management-shipping-address-display__no-address",children:q||a.noAddress})})},ne=()=>t(R,{"data-testid":"shipping-address-display-skeleton",children:t(y,{variant:"row",fullWidth:!0,size:"small",lines:5,multilineGap:"xsmall"})}),ve=({onActionsDropdownChange:p,slots:e,onActionsButtonClick:i,onSendForReview:q,...u})=>{const[a,_]=x(void 0),[c,f]=x(!0),[o,v]=x(""),[N,Q]=x(!1),n=W({createdLabel:"NegotiableQuote.Manage.createdLabel",salesRepLabel:"NegotiableQuote.Manage.salesRepLabel",expiresLabel:"NegotiableQuote.Manage.expiresLabel",actionsLabel:"NegotiableQuote.Manage.actionsLabel",remove:"NegotiableQuote.Manage.actions.remove",close:"NegotiableQuote.Manage.actionButtons.close",delete:"NegotiableQuote.Manage.actionButtons.delete",print:"NegotiableQuote.Manage.actionButtons.print",createTemplate:"NegotiableQuote.Manage.actionButtons.createTemplate",createCopy:"NegotiableQuote.Manage.actionButtons.createCopy",shippingInformationTitle:"NegotiableQuote.Manage.shippingInformation.title",quoteCommentsTitle:"NegotiableQuote.Manage.quoteComments.title",quoteCommentsPlaceholder:"NegotiableQuote.Manage.quoteComments.placeholder",sendForReview:"NegotiableQuote.Manage.actionButtons.sendForReview",bannerTitle:"NegotiableQuote.Manage.bannerTitle",statusSubmitted:"NegotiableQuote.Manage.bannerStatusMessages.submitted",statusPending:"NegotiableQuote.Manage.bannerStatusMessages.pending",statusExpired:"NegotiableQuote.Manage.bannerStatusMessages.expired"});M(()=>{const m=S.on("quote-management/quote-data",g=>{const{quote:r}=g;r&&(_(r),f(!1))},{eager:!0});return()=>m==null?void 0:m.off()},[]),M(()=>{const m=S.on("quote-management/shipping-address-set",g=>{const{quote:r}=g;r&&_(r)},{eager:!0});return()=>m==null?void 0:m.off()},[]),M(()=>{const m=S.on("quote-management/quote-sent-for-review",g=>{const{quote:r}=g;_(r),v(""),Q(!1)},{eager:!0});return()=>m==null?void 0:m.off()},[]);const z=b(()=>t(h,{name:"QuoteName",slot:e==null?void 0:e.QuoteName,context:{quoteName:a==null?void 0:a.name,quoteData:a},children:t("h1",{"data-testid":"quote-name",children:a==null?void 0:a.name})}),[e==null?void 0:e.QuoteName,a]),E=b(()=>t(h,{name:"QuoteStatus",slot:e==null?void 0:e.QuoteStatus,context:{quoteStatus:a==null?void 0:a.status,quoteData:a},children:t("div",{"data-testid":"quote-status",children:a==null?void 0:a.status})}),[e==null?void 0:e.QuoteStatus,a]),T=F(m=>{switch(m){case"SUBMITTED":return n.statusSubmitted;case"PENDING":return n.statusPending;case"EXPIRED":return n.statusExpired;default:return null}},[n])(a==null?void 0:a.status),w=T&&t(D,{type:"warning",variant:"secondary",icon:t(k,{}),heading:n.bannerTitle,description:T}),$=w&&t(h,{name:"Banner","data-testid":"banner",slot:e==null?void 0:e.Banner,context:{quoteData:a},children:w}),G=b(()=>{if(!a)return null;const m=Y()||"en-US",g=new Intl.DateTimeFormat(m,{year:"numeric",month:"long",day:"numeric"});let r;try{r=g.format(new Date(a.expirationDate))}catch{r=a.expirationDate}return l(h,{name:"Details",slot:e==null?void 0:e.Details,context:{quoteData:a},children:[l("div",{className:"quote-management-manage-negotiable-quote__detail",children:[t("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"created-label",children:n.createdLabel}),l("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"created-value",children:[g.format(new Date(a.createdAt))," (",a.buyer.firstname," ",a.buyer.lastname,")"]})]}),l("div",{className:"quote-management-manage-negotiable-quote__detail",children:[t("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"sales-rep-label",children:n.salesRepLabel}),t("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"sales-rep-value",children:a.salesRepName})]}),l("div",{className:"quote-management-manage-negotiable-quote__detail",children:[t("span",{className:"quote-management-manage-negotiable-quote__detail-title","data-testid":"expires-label",children:n.expiresLabel}),t("span",{className:"quote-management-manage-negotiable-quote__detail-content","data-testid":"expires-value",children:r})]})]})},[e==null?void 0:e.Details,n,a]),I=b(()=>[{label:n.close,value:"close"},{label:n.delete,value:"delete"},{label:n.print,value:"print"},{label:n.createTemplate,value:"createTemplate"},{label:n.createCopy,value:"createCopy"}],[n]),U=b(()=>{const m=r=>{p==null||p(r)},g=r=>{switch(r){case"close":i==null||i(r);break;case"delete":i==null||i(r);break;case"print":i==null||i(r);break;case"createTemplate":i==null||i(r);break;case"createCopy":i==null||i(r);break}};return t(h,{name:"ActionBar",slot:e==null?void 0:e.ActionBar,context:{quoteData:a},children:t(A,{dropdownPlaceholder:n.actionsLabel,dropdownOptions:[{label:n.remove,value:"remove"}],handleDropdownChange:m,buttons:I.map(r=>t(P,{variant:"tertiary",onClick:()=>g(r.value),"data-testid":`actions-bar-${r.value}-button`,"data-action":r.value,disabled:r.disabled,children:r.label},r.value))})})},[I,n,e==null?void 0:e.ActionBar,a,p,i]),j=b(()=>t(h,{name:"QuoteContent",slot:e==null?void 0:e.QuoteContent,context:{quoteData:a}}),[e==null?void 0:e.QuoteContent,a]),V=b(()=>t(h,{name:"ShippingInformationTitle",slot:e==null?void 0:e.ShippingInformationTitle,context:{quoteData:a},children:t("h2",{children:n.shippingInformationTitle})}),[e==null?void 0:e.ShippingInformationTitle,a,n]),X=b(()=>{var g;const m=(g=a==null?void 0:a.shippingAddresses)==null?void 0:g[0];return t(h,{name:"ShippingInformation",slot:e==null?void 0:e.ShippingInformation,context:{quoteData:a,primaryShippingAddress:m,loading:c,setLoading:f},children:t(te,{shippingAddress:m,loading:c,"data-testid":"manage-quote-shipping-address"})})},[e==null?void 0:e.ShippingInformation,a,c,f]),C=b(()=>t(h,{name:"QuoteCommentsTitle",slot:e==null?void 0:e.QuoteCommentsTitle,context:{quoteData:a},children:t("h2",{children:n.quoteCommentsTitle})}),[e==null?void 0:e.QuoteCommentsTitle,n,a]),H=b(()=>t(h,{name:"QuoteComments",slot:e==null?void 0:e.QuoteComments,context:{quoteData:a},children:t(O,{name:"quoteComments",placeholder:n.quoteCommentsPlaceholder,rows:3,value:o,onInput:m=>{v(m.target.value)},disabled:N})}),[e==null?void 0:e.QuoteComments,n,a,o,N]),L=F(async()=>{if(q){q({quoteData:a,comment:o.trim()||void 0});return}Q(!0);try{await B({quoteUid:a.uid,comment:o.trim()||void 0})}catch(m){console.error("Failed to send quote for review:",m),Q(!1)}},[a,q,o]),J=b(()=>t(h,{name:"Footer",slot:e==null?void 0:e.Footer,context:{quoteData:a,comment:o,isSubmitting:N},children:t(P,{variant:"primary",onClick:L,"data-testid":"send-for-review-button",disabled:!(a!=null&&a.canSendForReview)||N,children:n.sendForReview})}),[e==null?void 0:e.Footer,n,a,o,N,L]),K={...u,loading:c,quoteName:z,quoteStatus:E,banner:$||void 0,details:G,actionBar:U,quoteContent:j,shippingInformationTitle:V,shippingInformation:X,quoteCommentsTitle:C,quoteComments:H,footer:J};return t(ee,{...K})};export{ve as ManageNegotiableQuote,ve as default};
|
|
4
|
+
//# sourceMappingURL=ManageNegotiableQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManageNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/components/ActionsBar/ActionsBar.tsx","/@dropins/storefront-quote-management/src/components/ManageNegotiableQuote/ManageNegotiableQuote.tsx","/@dropins/storefront-quote-management/src/components/ShippingAddressDisplay/ShippingAddressDisplay.tsx","/@dropins/storefront-quote-management/src/containers/ManageNegotiableQuote/ManageNegotiableQuote.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ActionsBar/ActionsBar.css';\nimport { Picker } from '@adobe-commerce/elsie/components';\n\nexport interface ActionsBarProps extends HTMLAttributes<HTMLDivElement> {\n dropdownPlaceholder?: string;\n dropdownOptions?: {\n label: string;\n value: string;\n }[];\n handleDropdownChange?: (event: Event) => void;\n buttons?: VNode[];\n}\n\nexport const ActionsBar: FunctionComponent<ActionsBarProps> = ({\n className,\n dropdownPlaceholder,\n dropdownOptions,\n handleDropdownChange,\n buttons,\n ...props\n}) => {\n const hasDropdown = dropdownOptions && dropdownOptions.length > 0;\n const hasButtons = buttons && buttons.length > 0;\n\n const pickerOptions = dropdownOptions?.map((option) => ({\n text: option.label,\n value: option.value,\n })) || [];\n pickerOptions.unshift({\n text: dropdownPlaceholder || '',\n value: '',\n });\n\n return (\n <div className=\"quote-management-actions-bar__container\" data-testid=\"actions-bar-container\">\n <div className={classes(['quote-management-actions-bar', className])} data-testid=\"actions-bar\" {...props}>\n {hasDropdown && (\n <Picker\n name=\"dropdown\"\n id=\"dropdown\"\n onInput={handleDropdownChange}\n className=\"quote-management-actions-bar__dropdown\"\n data-testid=\"dropdown\"\n options={pickerOptions}\n />\n )}\n {hasButtons && (\n <div className=\"quote-management-actions-bar__buttons\" data-testid=\"buttons-container\">\n {buttons?.map((button, index) => (\n <VComponent\n node={button}\n className={classes(['quote-management-actions-bar__button'])}\n key={index}\n />\n ))}\n </div>\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 { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/quote-management/components/ManageNegotiableQuote/ManageNegotiableQuote.css';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport interface ManageNegotiableQuoteProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n loading?: boolean;\n quoteName: VNode;\n quoteStatus: VNode;\n banner?: VNode;\n details: VNode;\n actionBar?: VNode;\n quoteContent: VNode;\n shippingInformationTitle: VNode;\n shippingInformation: VNode;\n quoteCommentsTitle: VNode;\n quoteComments: VNode;\n footer: VNode;\n}\n\nexport const ManageNegotiableQuote: FunctionComponent<ManageNegotiableQuoteProps> = ({\n className,\n loading,\n quoteName,\n quoteStatus,\n banner,\n details,\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n footer,\n ...props\n}) => {\n if (loading) {\n return <ManageNegotiableQuoteSkeleton />;\n }\n\n return (\n <div {...props} className={classes(['quote-management-manage-negotiable-quote', className])}>\n <div className={classes(['quote-management-manage-negotiable-quote__header'])}>\n {quoteName &&\n <VComponent\n node={quoteName}\n className={classes(['quote-management-manage-negotiable-quote__quote-name'])}\n />\n }\n {quoteStatus &&\n <VComponent\n node={quoteStatus}\n className={classes(['quote-management-manage-negotiable-quote__quote-status'])}\n />\n }\n </div>\n {banner &&\n <VComponent\n node={banner}\n className={classes(['quote-management-manage-negotiable-quote__banner'])}\n />\n }\n {details &&\n <VComponent\n node={details}\n className={classes(['quote-management-manage-negotiable-quote__details'])}\n />\n }\n {actionBar &&\n <VComponent\n node={actionBar}\n className={classes(['quote-management-manage-negotiable-quote__action-bar'])}\n />\n }\n {quoteContent &&\n <VComponent\n node={quoteContent}\n className={classes(['quote-management-manage-negotiable-quote__quote-content'])}\n />\n }\n <div data-testid=\"quote-shipping-information-container\" className={classes(['quote-management-manage-negotiable-quote__shipping-information-container'])}>\n {shippingInformationTitle &&\n <VComponent\n node={shippingInformationTitle}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information-title'])}\n />\n }\n {shippingInformation &&\n <VComponent\n node={shippingInformation}\n className={classes(['quote-management-manage-negotiable-quote__shipping-information'])}\n />\n }\n </div>\n <div data-testid=\"quote-comments-container\" className={classes(['quote-management-manage-negotiable-quote__quote-comments-container'])}>\n {quoteCommentsTitle &&\n <VComponent\n node={quoteCommentsTitle}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments-title'])}\n />\n }\n {quoteComments &&\n <VComponent\n node={quoteComments}\n className={classes(['quote-management-manage-negotiable-quote__quote-comments'])}\n />\n }\n </div>\n <VComponent\n node={footer}\n className={classes(['quote-management-manage-negotiable-quote__footer'])}\n />\n </div>\n );\n};\n\nexport const ManageNegotiableQuoteSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"manage-negotiable-quote-skeleton\">\n <SkeletonRow variant=\"heading\" fullWidth={true} size=\"large\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n <SkeletonRow variant=\"row\" fullWidth={true} />\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"xlarge\" lines={2} />\n <SkeletonRow variant=\"row\" fullWidth={false} size=\"small\" />\n </Skeleton>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport '@/quote-management/components/ShippingAddressDisplay/ShippingAddressDisplay.css';\n\nexport interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {\n shippingAddress?: ShippingAddress;\n loading?: boolean;\n noAddressMessage?: string;\n}\n\nexport const ShippingAddressDisplay: FunctionComponent<ShippingAddressDisplayProps> = ({\n className,\n shippingAddress,\n loading,\n noAddressMessage,\n ...props\n}) => {\n const dictionary = useText({\n noAddress: 'NegotiableQuote.Manage.shippingAddress.noAddress',\n });\n\n if (loading) {\n return <ShippingAddressDisplaySkeleton />;\n }\n\n if (!shippingAddress) {\n return (\n <div \n className={classes(['quote-management-shipping-address-display', 'quote-management-shipping-address-display--empty', className])}\n data-testid=\"shipping-address-display-empty\"\n {...props}\n >\n <p className=\"quote-management-shipping-address-display__no-address\">\n {noAddressMessage || dictionary.noAddress}\n </p>\n </div>\n );\n }\n\n return (\n <div \n className={classes(['quote-management-shipping-address-display', className])}\n data-testid=\"shipping-address-display\"\n {...props}\n >\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-name\">\n <span className=\"quote-management-shipping-address-display__name\">\n {shippingAddress.firstname} {shippingAddress.lastname}\n </span>\n </div>\n \n {shippingAddress.company && (\n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-company\">\n {shippingAddress.company}\n </div>\n )}\n \n {shippingAddress.street.map((line, index) => (\n <div \n key={index} \n className=\"quote-management-shipping-address-display__field\" \n data-testid={`address-street-${index}`}\n >\n {line}\n </div>\n ))}\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-city-region\">\n {shippingAddress.city}\n {shippingAddress.region && `, ${shippingAddress.region.label}`}\n {' '}\n {shippingAddress.postcode}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-country\">\n {shippingAddress.country.label}\n </div>\n \n <div className=\"quote-management-shipping-address-display__field\" data-testid=\"address-telephone\">\n {shippingAddress.telephone}\n </div>\n </div>\n );\n};\n\nexport const ShippingAddressDisplaySkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-address-display-skeleton\">\n <SkeletonRow variant=\"row\" fullWidth={true} size=\"small\" lines={5} multilineGap='xsmall' />\n </Skeleton>\n );\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { HTMLAttributes, useCallback, useEffect, useMemo, useState } from 'preact/compat';\nimport { Container, getGlobalLocale, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { NegotiableQuoteModel, ShippingAddress } from '@/quote-management/data/models/negotiable-quote-model';\nimport { ManageNegotiableQuote as ManageNegotiableQuoteComponent, ManageNegotiableQuoteProps as ManageNegotiableQuoteComponentProps } from '@/quote-management/components/ManageNegotiableQuote';\nimport { events } from '@adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ActionsBar, ShippingAddressDisplay } from '@/quote-management/components';\nimport { Button, InLineAlert, TextArea } from '@adobe-commerce/elsie/components';\nimport { WarningFilled } from '@adobe-commerce/elsie/icons';\nimport { sendForReview } from '@/quote-management/api';\n\nexport interface ManageNegotiableQuoteProps extends HTMLAttributes<HTMLDivElement> {\n onActionsDropdownChange?: (event: Event) => void;\n onActionsButtonClick?: (action: string) => void;\n onSendForReview?: (params:\n {\n quoteData: NegotiableQuoteModel,\n comment?: string,\n }) => void;\n slots?: {\n QuoteName?: SlotProps<{\n quoteName?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteStatus?: SlotProps<{\n quoteStatus?: string;\n quoteData?: NegotiableQuoteModel;\n }>;\n Banner?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n Details?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ActionBar?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteContent?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformationTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n ShippingInformation?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n primaryShippingAddress?: ShippingAddress | undefined;\n loading?: boolean;\n setLoading?: (loading: boolean) => void;\n }>;\n QuoteCommentsTitle?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n QuoteComments?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n }>;\n Footer?: SlotProps<{\n quoteData?: NegotiableQuoteModel;\n comment?: string;\n isSubmitting?: boolean;\n }>;\n }\n}\n\nexport const ManageNegotiableQuote: Container<ManageNegotiableQuoteProps> = ({\n onActionsDropdownChange,\n slots,\n onActionsButtonClick,\n onSendForReview,\n ...props\n}) => {\n\n const [quoteData, setQuoteData] = useState<NegotiableQuoteModel | undefined>(undefined)\n const [loading, setLoading] = useState<boolean>(true)\n const [comment, setComment] = useState<string>('')\n const [isSubmitting, setIsSubmitting] = useState<boolean>(false)\n\n const dictionary = useText({\n createdLabel: 'NegotiableQuote.Manage.createdLabel',\n salesRepLabel: 'NegotiableQuote.Manage.salesRepLabel',\n expiresLabel: 'NegotiableQuote.Manage.expiresLabel',\n actionsLabel: 'NegotiableQuote.Manage.actionsLabel',\n remove: 'NegotiableQuote.Manage.actions.remove',\n close: 'NegotiableQuote.Manage.actionButtons.close',\n delete: 'NegotiableQuote.Manage.actionButtons.delete',\n print: 'NegotiableQuote.Manage.actionButtons.print',\n createTemplate: 'NegotiableQuote.Manage.actionButtons.createTemplate',\n createCopy: 'NegotiableQuote.Manage.actionButtons.createCopy',\n shippingInformationTitle: 'NegotiableQuote.Manage.shippingInformation.title',\n quoteCommentsTitle: 'NegotiableQuote.Manage.quoteComments.title',\n quoteCommentsPlaceholder: 'NegotiableQuote.Manage.quoteComments.placeholder',\n sendForReview: 'NegotiableQuote.Manage.actionButtons.sendForReview',\n bannerTitle: 'NegotiableQuote.Manage.bannerTitle',\n statusSubmitted: 'NegotiableQuote.Manage.bannerStatusMessages.submitted',\n statusPending: 'NegotiableQuote.Manage.bannerStatusMessages.pending',\n statusExpired: 'NegotiableQuote.Manage.bannerStatusMessages.expired',\n });\n /* Event listeners */\n useEffect(() => {\n const quoteDataEvent = events.on('quote-management/quote-data', (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n setLoading(false);\n }\n }, {\n eager: true,\n });\n return () => quoteDataEvent?.off();\n }, []);\n\n // Listen for shipping address set event\n useEffect(() => {\n const shippingAddressSetEvent = events.on('quote-management/shipping-address-set', (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n if (quote) {\n setQuoteData(quote);\n }\n }, {\n eager: true,\n });\n return () => shippingAddressSetEvent?.off();\n }, []);\n\n // Listen for quote sent for review event\n useEffect(() => {\n const quoteSentForReviewEvent = events.on('quote-management/quote-sent-for-review', (data: { quote: NegotiableQuoteModel }) => {\n const { quote } = data;\n setQuoteData(quote);\n setComment(''); // Reset comment after successful submission\n setIsSubmitting(false);\n }, {\n eager: true,\n });\n return () => quoteSentForReviewEvent?.off();\n }, []);\n\n /**\n * VNodes for the ManageNegotiableQuote component\n */\n\n // Quote name\n const quoteName = useMemo(() => {\n return <Slot name=\"QuoteName\" slot={slots?.QuoteName} context={{ quoteName: quoteData?.name, quoteData }}>\n <h1 data-testid=\"quote-name\">{quoteData?.name}</h1>\n </Slot>;\n }, [slots?.QuoteName, quoteData]);\n\n // Quote status\n const quoteStatus = useMemo(() => {\n return <Slot name=\"QuoteStatus\" slot={slots?.QuoteStatus} context={{ quoteStatus: quoteData?.status, quoteData }}>\n <div data-testid=\"quote-status\">{quoteData?.status}</div>\n </Slot>;\n }, [slots?.QuoteStatus, quoteData]);\n\n // Banner\n const getBannerStatusMessage = useCallback((status: string | undefined) => {\n switch (status) {\n case 'SUBMITTED':\n return dictionary.statusSubmitted;\n case 'PENDING':\n return dictionary.statusPending;\n case 'EXPIRED':\n return dictionary.statusExpired;\n default:\n return null;\n }\n }, [dictionary]);\n\n const bannerMessage = getBannerStatusMessage(quoteData?.status);\n\n const bannerContent = bannerMessage &&\n <InLineAlert\n type=\"warning\"\n variant=\"secondary\"\n icon={<WarningFilled />}\n heading={dictionary.bannerTitle}\n description={bannerMessage} />;\n\n const banner = bannerContent && <Slot name=\"Banner\" data-testid=\"banner\" slot={slots?.Banner} context={{ quoteData }}>\n {bannerContent}\n </Slot>;\n\n // Details\n const details = useMemo(() => {\n\n if (!quoteData) {\n return null;\n }\n\n const calculatedLocale = getGlobalLocale() || 'en-US';\n\n const dateFormatter = new Intl.DateTimeFormat(calculatedLocale, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n\n // Some quotes, such as draft quotes, don't have a date formatted expiration date\n let expirationDate;\n try {\n expirationDate = dateFormatter.format(new Date(quoteData!.expirationDate));\n } catch (error) {\n expirationDate = quoteData!.expirationDate;\n }\n\n return <Slot name=\"Details\" slot={slots?.Details} context={{ quoteData }}>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span className=\"quote-management-manage-negotiable-quote__detail-title\" data-testid=\"created-label\">\n {dictionary.createdLabel}\n </span>\n <span className=\"quote-management-manage-negotiable-quote__detail-content\" data-testid=\"created-value\">\n {dateFormatter.format(new Date(quoteData!.createdAt))} ({quoteData!.buyer.firstname} {quoteData!.buyer.lastname})\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span className=\"quote-management-manage-negotiable-quote__detail-title\" data-testid=\"sales-rep-label\">\n {dictionary.salesRepLabel}\n </span>\n <span className=\"quote-management-manage-negotiable-quote__detail-content\" data-testid=\"sales-rep-value\">\n {quoteData!.salesRepName}\n </span>\n </div>\n <div className=\"quote-management-manage-negotiable-quote__detail\">\n <span className=\"quote-management-manage-negotiable-quote__detail-title\" data-testid=\"expires-label\">\n {dictionary.expiresLabel}\n </span>\n <span className=\"quote-management-manage-negotiable-quote__detail-content\" data-testid=\"expires-value\">\n {expirationDate}\n </span>\n </div>\n </Slot>;\n }, [slots?.Details, dictionary, quoteData]);\n\n // Action bar\n const buttons: { label: string; value: string; disabled?: boolean }[] = useMemo(() => [\n {\n label: dictionary.close,\n value: 'close'\n },\n {\n label: dictionary.delete,\n value: 'delete'\n },\n {\n label: dictionary.print,\n value: 'print'\n },\n {\n label: dictionary.createTemplate,\n value: 'createTemplate'\n },\n {\n label: dictionary.createCopy,\n value: 'createCopy'\n },\n ], [dictionary]);\n const actionBar = useMemo(() => {\n const handleActionsDropdownChange = (event: Event) => {\n onActionsDropdownChange?.(event);\n };\n\n const handleActionsButtonClick = (action: string) => {\n switch (action) {\n case 'close':\n onActionsButtonClick?.(action);\n break;\n case 'delete':\n onActionsButtonClick?.(action);\n break;\n case 'print':\n onActionsButtonClick?.(action);\n break;\n case 'createTemplate':\n onActionsButtonClick?.(action);\n break;\n case 'createCopy':\n onActionsButtonClick?.(action);\n break;\n }\n }\n return <Slot name=\"ActionBar\" slot={slots?.ActionBar} context={{ quoteData }}>\n <ActionsBar\n dropdownPlaceholder={dictionary.actionsLabel}\n dropdownOptions={[\n {\n label: dictionary.remove,\n value: 'remove'\n },\n ]}\n handleDropdownChange={handleActionsDropdownChange}\n buttons={\n buttons.map((button) => (\n <Button\n key={button.value}\n variant=\"tertiary\"\n onClick={() => handleActionsButtonClick(button.value)}\n data-testid={`actions-bar-${button.value}-button`}\n data-action={button.value}\n disabled={button.disabled}\n >\n {button.label}\n </Button>\n ))\n }\n />\n </Slot>;\n }, [buttons, dictionary, slots?.ActionBar, quoteData, onActionsDropdownChange, onActionsButtonClick]);\n\n // Quote content\n const quoteContent = useMemo(() => {\n return <Slot name=\"QuoteContent\" slot={slots?.QuoteContent} context={{ quoteData }} />\n }, [slots?.QuoteContent, quoteData]);\n\n // Shipping information title\n const shippingInformationTitle = useMemo(() => {\n return <Slot name=\"ShippingInformationTitle\" slot={slots?.ShippingInformationTitle} context={{ quoteData }}>\n <h2>{dictionary.shippingInformationTitle}</h2>\n </Slot>;\n }, [slots?.ShippingInformationTitle, quoteData, dictionary]);\n\n // Shipping information\n const shippingInformation = useMemo(() => {\n const primaryShippingAddress = quoteData?.shippingAddresses?.[0];\n\n return (\n <Slot name=\"ShippingInformation\" slot={slots?.ShippingInformation} context={{ quoteData, primaryShippingAddress, loading, setLoading }}>\n <ShippingAddressDisplay\n shippingAddress={primaryShippingAddress}\n loading={loading}\n data-testid=\"manage-quote-shipping-address\"\n />\n </Slot>\n );\n }, [slots?.ShippingInformation, quoteData, loading, setLoading]);\n\n // Quote comments title\n const quoteCommentsTitle = useMemo(() => {\n return <Slot name=\"QuoteCommentsTitle\" slot={slots?.QuoteCommentsTitle} context={{ quoteData }}>\n <h2>{dictionary.quoteCommentsTitle}</h2>\n </Slot>;\n }, [slots?.QuoteCommentsTitle, dictionary, quoteData]);\n\n // Quote comments\n const quoteComments = useMemo(() => {\n return <Slot name=\"QuoteComments\" slot={slots?.QuoteComments} context={{ quoteData }}>\n <TextArea\n name=\"quoteComments\"\n placeholder={dictionary.quoteCommentsPlaceholder}\n rows={3}\n value={comment}\n onInput={(e) => {\n setComment((e.target as HTMLTextAreaElement).value);\n }}\n disabled={isSubmitting}\n />\n </Slot>;\n }, [slots?.QuoteComments, dictionary, quoteData, comment, isSubmitting]);\n\n // Footer\n const handleSendForReview = useCallback(async () => {\n // If override prop is provided, use it instead of the API\n if (onSendForReview) {\n onSendForReview({ quoteData: quoteData!, comment: comment.trim() || undefined });\n return;\n }\n\n // Otherwise, use the sendForReview API\n setIsSubmitting(true);\n try {\n await sendForReview({\n quoteUid: quoteData!.uid,\n comment: comment.trim() || undefined,\n });\n // The quote-sent-for-review event will handle updating state\n } catch (error) {\n console.error('Failed to send quote for review:', error);\n setIsSubmitting(false);\n // TODO: Show error notification to user\n }\n }, [quoteData, onSendForReview, comment]);\n\n const footer = useMemo(() => {\n return <Slot name=\"Footer\" slot={slots?.Footer} context={{ quoteData, comment, isSubmitting }}>\n <Button variant=\"primary\"\n onClick={handleSendForReview}\n data-testid=\"send-for-review-button\"\n disabled={!quoteData?.canSendForReview || isSubmitting}\n >{dictionary.sendForReview}</Button>\n </Slot>;\n }, [slots?.Footer, dictionary, quoteData, comment, isSubmitting, handleSendForReview]);\n\n const manageNegotiableQuoteProps: ManageNegotiableQuoteComponentProps = {\n ...props,\n loading,\n quoteName,\n quoteStatus,\n banner: banner || undefined,\n details: details!, // Details will always be defined at this point\n actionBar,\n quoteContent,\n shippingInformationTitle,\n shippingInformation,\n quoteCommentsTitle,\n quoteComments,\n footer\n };\n\n return (\n <ManageNegotiableQuoteComponent\n {...manageNegotiableQuoteProps}\n />\n );\n};"],"names":["ActionsBar","className","dropdownPlaceholder","dropdownOptions","handleDropdownChange","buttons","props","hasDropdown","hasButtons","pickerOptions","option","classes","jsx","Picker","button","index","VComponent","ManageNegotiableQuote","loading","quoteName","quoteStatus","banner","details","actionBar","quoteContent","shippingInformationTitle","shippingInformation","quoteCommentsTitle","quoteComments","footer","ManageNegotiableQuoteSkeleton","jsxs","Skeleton","SkeletonRow","ShippingAddressDisplay","shippingAddress","noAddressMessage","dictionary","useText","ShippingAddressDisplaySkeleton","line","onActionsDropdownChange","slots","onActionsButtonClick","onSendForReview","quoteData","setQuoteData","useState","setLoading","comment","setComment","isSubmitting","setIsSubmitting","useEffect","quoteDataEvent","events","data","quote","shippingAddressSetEvent","quoteSentForReviewEvent","useMemo","Slot","bannerMessage","useCallback","status","bannerContent","InLineAlert","WarningFilled","calculatedLocale","getGlobalLocale","dateFormatter","expirationDate","handleActionsDropdownChange","event","handleActionsButtonClick","action","Button","primaryShippingAddress","_a","TextArea","e","handleSendForReview","sendForReview","error","manageNegotiableQuoteProps","ManageNegotiableQuoteComponent"],"mappings":"s2BAyBO,MAAMA,EAAiD,CAAC,CAC7D,UAAAC,EACA,oBAAAC,EACA,gBAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAcJ,GAAmBA,EAAgB,OAAS,EAC1DK,EAAaH,GAAWA,EAAQ,OAAS,EAEzCI,GAAgBN,GAAA,YAAAA,EAAiB,IAAKO,IAAY,CACtD,KAAMA,EAAO,MACb,MAAOA,EAAO,KAAA,MACT,CAAA,EACP,OAAAD,EAAc,QAAQ,CACpB,KAAMP,GAAuB,GAC7B,MAAO,EAAA,CACR,IAGE,MAAA,CAAI,UAAU,0CAA0C,cAAY,wBACnE,WAAC,MAAA,CAAI,UAAWS,EAAQ,CAAC,+BAAgCV,CAAS,CAAC,EAAG,cAAY,cAAe,GAAGK,EACj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/types/elsie/src/lib';
|
|
3
|
-
import {
|
|
3
|
+
import { NegotiableQuoteListEntry } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
pageSize?: number;
|
|
@@ -13,35 +13,35 @@ export interface QuotesListTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
slots?: {
|
|
14
14
|
/** Slot for customizing the quote name cell content */
|
|
15
15
|
QuoteName?: SlotProps<{
|
|
16
|
-
quote:
|
|
16
|
+
quote: NegotiableQuoteListEntry;
|
|
17
17
|
}>;
|
|
18
18
|
/** Slot for customizing the created date cell content */
|
|
19
19
|
Created?: SlotProps<{
|
|
20
|
-
quote:
|
|
20
|
+
quote: NegotiableQuoteListEntry;
|
|
21
21
|
}>;
|
|
22
22
|
/** Slot for customizing the created by cell content */
|
|
23
23
|
CreatedBy?: SlotProps<{
|
|
24
|
-
quote:
|
|
24
|
+
quote: NegotiableQuoteListEntry;
|
|
25
25
|
}>;
|
|
26
26
|
/** Slot for customizing the status cell content */
|
|
27
27
|
Status?: SlotProps<{
|
|
28
|
-
quote:
|
|
28
|
+
quote: NegotiableQuoteListEntry;
|
|
29
29
|
}>;
|
|
30
30
|
/** Slot for customizing the last updated cell content */
|
|
31
31
|
LastUpdated?: SlotProps<{
|
|
32
|
-
quote:
|
|
32
|
+
quote: NegotiableQuoteListEntry;
|
|
33
33
|
}>;
|
|
34
34
|
/** Slot for customizing the quote template cell content */
|
|
35
35
|
QuoteTemplate?: SlotProps<{
|
|
36
|
-
quote:
|
|
36
|
+
quote: NegotiableQuoteListEntry;
|
|
37
37
|
}>;
|
|
38
38
|
/** Slot for customizing the quote total cell content */
|
|
39
39
|
QuoteTotal?: SlotProps<{
|
|
40
|
-
quote:
|
|
40
|
+
quote: NegotiableQuoteListEntry;
|
|
41
41
|
}>;
|
|
42
42
|
/** Slot for customizing the actions cell content */
|
|
43
43
|
Actions?: SlotProps<{
|
|
44
|
-
quote:
|
|
44
|
+
quote: NegotiableQuoteListEntry;
|
|
45
45
|
onViewQuote?: (id: string, name: string, status: string) => void;
|
|
46
46
|
}>;
|
|
47
47
|
/** Slot for customizing the empty quotes message */
|
|
@@ -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
|
|
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 */import{g as V}from"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";import{n as q}from"../chunks/negotiableQuotes.js";const ee=({rowData:h=[],loading:S=!1,className:N,emptyStateMessage:y,showItemRange:v=!0,itemRangeMessage:m,showPageSizePicker:u=!0,pageSizePickerMessage:i,showPagination:x=!0,paginationMessage:l,...b})=>{const d=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"}),s=[{key:"quoteName",label:d.quoteName},{key:"created",label:d.created},{key:"createdBy",label:d.createdBy},{key:"status",label:d.status},{key:"lastUpdated",label:d.lastUpdated},{key:"quoteTemplate",label:d.quoteTemplate},{key:"quoteTotal",label:d.quoteTotal},{key:"actions",label:d.actions}],z=!S&&h.length===0&&y,p=v&&m,f=u&&i,g=x&&l,T=p||f||g;return P("div",{...b,className:j(["quote-management-quotes-list-table",N]),children:[t(G,{columns:s,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:p&&m}),t("div",{className:"quotes-list-table__pagination",children:g&&l}),t("div",{className:"quotes-list-table__page-size-picker",children:f&&i})]})]})},ge=({pageSize:h,showItemRange:S=!0,showPageSizePicker:N=!0,showPagination:y=!0,onViewQuote:v,onPageSizeChange:m,onPageChange:u,slots:i,...x})=>{const[l,b]=Q(null),[d,s]=Q(!0),z=V()[0],[p,f]=Q(h||z),[g,T]=Q(1);$(()=>{const r=async()=>{try{s(!0);const c=await q({pageSize:p,currentPage:g});b(c)}catch(c){console.error("Failed to fetch quotes:",c)}finally{s(!1)}},e=Y.on("authenticated",c=>{c?r():(b(null),s(!1))},{eager:!0});return()=>{e==null||e.off()}},[p,g]);const k=r=>{f(r),T(1),m==null||m(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:d,className:x.className,emptyStateMessage:O,showItemRange:S&&L,itemRangeMessage:R,showPageSizePicker:N&&L,pageSizePickerMessage:D,showPagination:y&&L,paginationMessage:E})};export{ge as QuotesListTable,ge as default};
|
|
4
4
|
//# sourceMappingURL=QuotesListTable.js.map
|