@dropins/storefront-quote-management 0.0.1-alpha12 → 0.0.1-alpha13
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 +22 -0
- package/api.js +37 -4
- package/api.js.map +1 -1
- package/chunks/NegotiableQuoteFragment.js +166 -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 +53 -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 +96 -34
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +229 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as j,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import*as m from"@dropins/tools/preact-compat.js";import{useState as q,useEffect as R,useCallback as ae}from"@dropins/tools/preact-compat.js";import{classes as c,VComponent as h,Slot as N,getFormErrors as z,getFormValues as re}from"@dropins/tools/lib.js";import{TextArea as oe,Field as ne,Input as ie,InputFile as se,Button as I,InLineAlert as ce}from"@dropins/tools/components.js";/* empty css */import{events as T}from"@dropins/tools/event-bus.js";import"../chunks/transform-quote.js";import{r as B}from"../chunks/requestNegotiableQuote.js";import"@dropins/tools/fetch-graphql.js";import{S as me}from"../chunks/WarningFilled.js";import{useText as ue}from"@dropins/tools/i18n.js";import"../chunks/NegotiableQuoteFragment.js";const de=i=>m.createElement("svg",{id:"Icon_Add_Base","data-name":"Icon \\u2013 Add \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...i},m.createElement("g",{id:"Large"},m.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),m.createElement("g",{id:"Add_icon","data-name":"Add icon",transform:"translate(9.734 9.737)"},m.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_579","data-name":"Line 579",y2:12.7,transform:"translate(2.216 -4.087)",fill:"none",stroke:"currentColor"}),m.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_580","data-name":"Line 580",x2:12.7,transform:"translate(-4.079 2.263)",fill:"none",stroke:"currentColor"})))),le=i=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},m.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),m.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),fe=({className:i,title:e,banner:C,commentField:_,quoteNameField:l,attachFile:s,requestButton:f,saveButton:F,onSubmit:Q,...E})=>j("form",{...E,className:c(["request-negotiable-quote-form",i]),onSubmit:Q,children:[C&&t(h,{node:C,className:c(["request-negotiable-quote-form__banner"])}),e&&t(h,{node:e,className:c(["request-negotiable-quote-form__title"])}),_&&t(h,{node:_,className:c(["request-negotiable-quote-form__comment-field"])}),l&&t(h,{node:l,className:c(["request-negotiable-quote-form__quote-name-field"])}),s&&t(h,{node:s,className:c(["request-negotiable-quote-form__attach-file-field"])}),j("div",{className:c(["request-negotiable-quote-form__actions"]),children:[f&&t(h,{node:f,className:c(["request-negotiable-quote-form__request-button"])}),F&&t(h,{node:F,className:c(["request-negotiable-quote-form__save-button"])})]})]}),Re=({cartId:i,slots:e,onRequestNegotiableQuote:C,onSaveNegotiableQuote:_,onAttachFiles:l,onSubmitErrors:s,onError:f,className:F})=>{const[Q,E]=q(void 0),[L,V]=q(void 0),[,O]=q([]),[b,v]=q(void 0),[u,p]=q({}),[k,W]=q(void 0),[n,g]=q(!1),o=ue({title:"NegotiableQuote.Request.title",comment:"NegotiableQuote.Request.comment",commentError:"NegotiableQuote.Request.commentError",quoteName:"NegotiableQuote.Request.quoteName",quoteNameError:"NegotiableQuote.Request.quoteNameError",attachmentsError:"NegotiableQuote.Request.attachmentsError",requestCta:"NegotiableQuote.Request.requestCta",saveDraftCta:"NegotiableQuote.Request.saveDraftCta",errorHeader:"NegotiableQuote.Request.error.header",unauthenticated:"NegotiableQuote.Request.error.unauthenticated",unauthorized:"NegotiableQuote.Request.error.unauthorized",missingCart:"NegotiableQuote.Request.error.missingCart",successHeader:"NegotiableQuote.Request.success.header",submitSuccess:"NegotiableQuote.Request.success.submitted",draftSuccess:"NegotiableQuote.Request.success.draftSaved"});R(()=>{const a=T.on("quote-management/permissions",r=>{v(void 0),r.requestQuote||(v(o.unauthorized),g(!0))},{eager:!0});return()=>a==null?void 0:a.off()},[o.unauthorized]),R(()=>{const a=T.on("authenticated",r=>{v(void 0),r||(v(o.unauthenticated),g(!0))},{eager:!0});return()=>a==null?void 0:a.off()},[o.unauthenticated]),R(()=>{i||(v(o.missingCart),g(!0))},[i,o.missingCart]),R(()=>{b&&(f==null||f({error:b,isFormDisabled:n,setIsFormDisabled:g}))},[b,f,n]);const S=ae(async a=>{var r;p(d=>({...d,attachments:""})),O(a),(r=l==null?void 0:l(a))==null||r.catch(()=>{p(d=>({...d,attachments:o.attachmentsError}))})},[l,o]),Z=()=>{let a,r;if(k?(r={name:"SuccessBanner",slot:e==null?void 0:e.SuccessBanner,context:{message:k},"data-testid":"form-success-banner"},a={type:"success",variant:"primary",icon:t(le,{}),heading:o.successHeader,description:k,className:"request-negotiable-quote-form__success-banner"}):b&&(r={name:"ErrorBanner",slot:e==null?void 0:e.ErrorBanner,context:{message:b},"data-testid":"form-error-banner"},a={type:"error",variant:"primary",icon:t(me,{}),heading:o.errorHeader,description:b,className:"request-negotiable-quote-form__error-banner"}),r&&a)return t(N,{...r,children:t(ce,{...a})})},A=a=>{p({});const r=a.target.closest("form"),d=z(r);Object.keys(d).length>0&&(p(d),s==null||s(d))},$=a=>{var P;a.preventDefault(),g(!0);const r=a.target,H={...z(r),...u};if(Object.keys(H).length>0){s==null||s(H);return}const y=a.submitter,x=re(r);E(x.comment),V(x.quoteName);const M=((P=y==null?void 0:y.dataset)==null?void 0:P.draft)==="true"||!1,ee={cartId:i,quoteName:x.quoteName,comment:x.comment,isDraft:M};let w,D;M?(w=_??B,D=o.draftSuccess):(w=C??B,D=o.submitSuccess),w(ee).then(()=>{W(D)}).catch(te=>{v(te.message)})},G=t(N,{name:"Title",slot:e==null?void 0:e.Title,context:{text:o.title},children:t("span",{"data-testid":"form-title",children:o.title})}),J=t(N,{name:"CommentField",slot:e==null?void 0:e.CommentField,context:{value:Q,required:!0,errorMessage:u.comment,setFormErrors:p,isFormDisabled:n},children:t(oe,{name:"comment",value:Q,label:o.comment,required:!0,autoComplete:"off","data-testid":"form-comment-field",errorMessage:u.comment,disabled:n})}),K=t(N,{name:"QuoteNameField",slot:e==null?void 0:e.QuoteNameField,context:{value:L,required:!0,errorMessage:u.quoteName,setFormErrors:p,isFormDisabled:n},children:t(ne,{error:u.quoteName,disabled:n,children:t(ie,{value:L,name:"quoteName",floatingLabel:o.quoteName,required:!0,autoComplete:"off","data-testid":"form-quote-name-field"})})}),U=t(N,{name:"AttachFileField",slot:e==null?void 0:e.AttachFileField,context:{onChange:S,formErrors:u,isFormDisabled:n},children:t(se,{onChange:a=>{const r=Array.from(a.target.files);r.length>0&&S(r)},icon:t(de,{}),disabled:n,"data-testid":"form-attach-file-field"})}),X=t(N,{name:"RequestButton",slot:e==null?void 0:e.RequestButton,context:{requestNegotiableQuote:B,formErrors:u,isFormDisabled:n,setIsFormDisabled:g},children:t(I,{type:"submit","data-testid":"form-request-button",onClick:A,disabled:n,children:o.requestCta})}),Y=t(N,{name:"SaveDraftButton",slot:e==null?void 0:e.SaveDraftButton,context:{requestNegotiableQuote:B,formErrors:u,isFormDisabled:n,setIsFormDisabled:g},children:t(I,{type:"submit","data-draft":"true",variant:"secondary","data-testid":"form-save-draft-button",onClick:A,disabled:n,children:o.saveDraftCta})});return t(fe,{title:G,banner:Z(),commentField:J,quoteNameField:K,attachFile:U,requestButton:X,saveButton:Y,onSubmit:$,className:F,disabled:n,"data-testid":"form-container"})};export{Re as RequestNegotiableQuoteForm,Re as default};
|
|
4
4
|
//# sourceMappingURL=RequestNegotiableQuoteForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestNegotiableQuoteForm.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","../../node_modules/@adobe-commerce/elsie/src/icons/CheckWithCircle.svg","../../node_modules/@adobe-commerce/elsie/src/icons/WarningFilled.svg","/@dropins/storefront-quote-management/src/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.tsx","/@dropins/storefront-quote-management/src/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","import * as React from \"react\";\nconst SvgCheckWithCircle = (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: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M6.75 12.762L10.2385 15.75L17.25 9\", stroke: \"currentColor\" }));\nexport default SvgCheckWithCircle;\n","import * as React from \"react\";\nconst SvgWarningFilled = (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\", fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z\", fill: \"currentColor\" }));\nexport default SvgWarningFilled;\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/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.css';\n\nexport interface RequestNegotiableQuoteFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 'title'> {\n title: VNode;\n banner?: VNode;\n commentField?: VNode;\n quoteNameField?: VNode;\n attachFile?: VNode;\n requestButton?: VNode;\n saveButton?: VNode;\n onSubmit: (e: Event) => void;\n}\n\nexport const RequestNegotiableQuoteForm: FunctionComponent<RequestNegotiableQuoteFormProps> = ({\n className,\n title,\n banner,\n commentField,\n quoteNameField,\n attachFile,\n requestButton,\n saveButton,\n onSubmit,\n ...props\n}) => {\n return (\n <form {...props} className={classes(['request-negotiable-quote-form', className])} onSubmit={onSubmit}>\n {banner &&\n <VComponent\n node={banner}\n className={classes(['request-negotiable-quote-form__banner'])}\n />\n }\n {title &&\n <VComponent\n node={title}\n className={classes(['request-negotiable-quote-form__title'])}\n />\n }\n {commentField &&\n <VComponent\n node={commentField}\n className={classes(['request-negotiable-quote-form__comment-field'])}\n />\n }\n {quoteNameField &&\n <VComponent\n node={quoteNameField}\n className={classes(['request-negotiable-quote-form__quote-name-field'])}\n />\n }\n {attachFile &&\n <VComponent\n node={attachFile}\n className={classes(['request-negotiable-quote-form__attach-file-field'])}\n />\n }\n <div className={classes(['request-negotiable-quote-form__actions'])}>\n {requestButton &&\n <VComponent\n node={requestButton}\n className={classes(['request-negotiable-quote-form__request-button'])}\n />\n }\n {saveButton &&\n <VComponent\n node={saveButton}\n className={classes(['request-negotiable-quote-form__save-button'])}\n />\n }\n </div>\n </form>\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, useState } from 'preact/compat';\nimport { Container, getFormErrors, getFormValues, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { InLineAlert, Button, InputFile, TextArea, Input, Field, InLineAlertProps } from '@adobe-commerce/elsie/components';\nimport { WarningFilled, CheckWithCircle, Add } from '@adobe-commerce/elsie/icons';\nimport RequestNegotiableQuoteFormComponent from '@/quote-management/components/RequestNegotiableQuoteForm';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { requestNegotiableQuote, RequestNegotiableQuoteInput, uploadFile } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\n\nexport type RequestNegotiableQuoteHandlers = {\n onAttachFiles?: (files: File[]) => Promise<void>;\n onRequestNegotiableQuote?: typeof requestNegotiableQuote;\n onSaveNegotiableQuote?: typeof requestNegotiableQuote;\n onSubmitErrors?: (errors: Record<string, string>) => void;\n onError?: (props: {\n error: string,\n isFormDisabled: boolean,\n setIsFormDisabled: (isFormDisabled: boolean) => void,\n }) => void;\n};\n\nexport interface RequestNegotiableQuoteFormProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onError'>,\n RequestNegotiableQuoteHandlers {\n cartId: string;\n slots?: {\n ErrorBanner?: SlotProps<{\n message: string,\n }>;\n SuccessBanner?: SlotProps<{\n message: string,\n }>;\n Title?: SlotProps<{\n text: string,\n }>;\n CommentField?: SlotProps<{\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setFormErrors: (errors: Record<string, string>) => void;\n }>;\n QuoteNameField?: SlotProps<{\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setFormErrors: (errors: Record<string, string>) => void;\n }>;\n AttachFileField?: SlotProps<{\n onChange: (files: File[]) => void, formErrors: Record<string, string>,\n isFormDisabled: boolean\n }>;\n RequestButton?: SlotProps<{\n requestNegotiableQuote: typeof requestNegotiableQuote;\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setIsFormDisabled: (isFormDisabled: boolean) => void;\n }>;\n SaveDraftButton?: SlotProps<{\n requestNegotiableQuote: typeof requestNegotiableQuote;\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setIsFormDisabled: (isFormDisabled: boolean) => void;\n }>;\n };\n}\n\nexport const RequestNegotiableQuoteForm: Container<RequestNegotiableQuoteFormProps> = ({\n cartId,\n slots,\n onRequestNegotiableQuote,\n onSaveNegotiableQuote,\n onAttachFiles,\n onSubmitErrors,\n onError,\n className,\n}) => {\n const [comment, setComment] = useState<string | undefined>(undefined);\n const [quoteName, setQuoteName] = useState<string | undefined>(undefined);\n const [attachmentKeys, setAttachmentKeys] = useState<{ key: string }[]>([]);\n const [error, setError] = useState<string | undefined>(undefined);\n const [formErrors, setFormErrors] = useState<Record<string, string>>({});\n const [success, setSuccess] = useState<string | undefined>(undefined);\n const [isFormDisabled, setIsFormDisabled] = useState<boolean>(false);\n\n const dictionary = useText({\n title: 'NegotiableQuote.Request.title',\n comment: 'NegotiableQuote.Request.comment',\n commentError: 'NegotiableQuote.Request.commentError',\n quoteName: 'NegotiableQuote.Request.quoteName',\n quoteNameError: 'NegotiableQuote.Request.quoteNameError',\n attachmentsError: 'NegotiableQuote.Request.attachmentsError',\n requestCta: 'NegotiableQuote.Request.requestCta',\n saveDraftCta: 'NegotiableQuote.Request.saveDraftCta',\n errorHeader: 'NegotiableQuote.Request.error.header',\n unauthenticated: 'NegotiableQuote.Request.error.unauthenticated',\n unauthorized: 'NegotiableQuote.Request.error.unauthorized',\n missingCart: 'NegotiableQuote.Request.error.missingCart',\n successHeader: 'NegotiableQuote.Request.success.header',\n submitSuccess: 'NegotiableQuote.Request.success.submitted',\n draftSuccess: 'NegotiableQuote.Request.success.draftSaved',\n });\n\n useEffect(() => {\n const permissionsEvent = events.on(\n 'quote-management/permissions',\n (permissions: typeof state.permissions) => {\n setError(undefined);\n if (!permissions.requestQuote) {\n setError(dictionary.unauthorized);\n setIsFormDisabled(true);\n }\n },\n { eager: true }\n );\n return () => permissionsEvent?.off();\n }, [dictionary.unauthorized]);\n\n useEffect(() => {\n const authenticatedEvent = events.on(\n 'authenticated',\n (authenticated: boolean) => {\n setError(undefined);\n if (!authenticated) {\n setError(dictionary.unauthenticated);\n setIsFormDisabled(true);\n }\n },\n { eager: true }\n );\n return () => authenticatedEvent?.off();\n }, [dictionary.unauthenticated]);\n\n useEffect(() => {\n if (!cartId) {\n setError(dictionary.missingCart);\n setIsFormDisabled(true);\n }\n }, [cartId, dictionary.missingCart]);\n\n useEffect(() => {\n if (error) {\n onError?.({ error, isFormDisabled, setIsFormDisabled });\n }\n }, [error, onError, isFormDisabled]);\n\n const handleAttachFiles = useCallback(async (files: File[]) => {\n /* istanbul ignore next: defensive guard; */\n if (!files?.length) return;\n\n setFormErrors(prev => ({ ...prev, attachments: '' }));\n\n if (onAttachFiles) {\n try {\n await onAttachFiles(files);\n } catch {\n setFormErrors(prev => ({ ...prev, attachments: dictionary.attachmentsError }));\n }\n return;\n }\n\n try {\n const uploaded = await Promise.all(files.map(uploadFile));\n setAttachmentKeys(uploaded.map(({ key }) => ({ key })));\n } catch {\n setFormErrors(prev => ({ ...prev, attachments: dictionary.attachmentsError }));\n }\n }, [onAttachFiles, dictionary]);\n\n /*\n * This function is used to get the banner node.\n * It can be used to render a success or error banner depending on the success or error state.\n */\n const getBannerNode = () => {\n let inlineAlertProps: InLineAlertProps | undefined;\n let slotProps: any | undefined;\n\n if (success) {\n slotProps = {\n name: 'SuccessBanner',\n slot: slots?.SuccessBanner,\n context: {\n message: success,\n },\n 'data-testid': 'form-success-banner',\n };\n inlineAlertProps = {\n type: 'success',\n variant: 'primary',\n icon: <CheckWithCircle />,\n heading: dictionary.successHeader,\n description: success,\n className: 'request-negotiable-quote-form__success-banner',\n };\n }\n else if (error) {\n slotProps = {\n name: 'ErrorBanner',\n slot: slots?.ErrorBanner,\n context: {\n message: error,\n },\n 'data-testid': 'form-error-banner',\n };\n inlineAlertProps = {\n type: 'error',\n variant: 'primary',\n icon: <WarningFilled />,\n heading: dictionary.errorHeader,\n description: error,\n className: 'request-negotiable-quote-form__error-banner',\n };\n }\n\n if (slotProps && inlineAlertProps) {\n return <Slot {...slotProps}>\n <InLineAlert {...inlineAlertProps} />\n </Slot>;\n }\n\n return undefined;\n }\n\n /*\n * This function is used to validate the parent form of the button that was clicked.\n */\n const validateParentForm = (e: Event) => {\n setFormErrors({});\n const closestForm = (e.target as HTMLElement).closest('form') as HTMLFormElement;\n const formErrors = getFormErrors(closestForm);\n if (Object.keys(formErrors).length > 0) {\n setFormErrors(formErrors);\n onSubmitErrors?.(formErrors);\n }\n };\n\n const formSubmitHandler = (e: Event) => {\n e.preventDefault();\n setIsFormDisabled(true);\n\n const form = (e.target as HTMLFormElement);\n\n const currentFormErrors = getFormErrors(form);\n\n const mergedFormErrors = { ...currentFormErrors, ...formErrors };\n\n if (Object.keys(mergedFormErrors).length > 0) {\n onSubmitErrors?.(mergedFormErrors)\n return;\n }\n\n // Since we have multiple submit buttons, we need to determine which one was clicked.\n const buttonTarget = (e as SubmitEvent).submitter as HTMLButtonElement;\n\n const formValues = getFormValues(form);\n\n setComment(formValues.comment);\n setQuoteName(formValues.quoteName);\n\n const isDraft = buttonTarget?.dataset?.draft === 'true' || false;\n\n const contextData: RequestNegotiableQuoteInput = {\n cartId: cartId!,\n quoteName: formValues.quoteName,\n comment: formValues.comment,\n attachments: attachmentKeys,\n isDraft,\n }\n\n let submitHandler;\n let successMessage;\n\n if (isDraft) {\n submitHandler = onSaveNegotiableQuote ?? requestNegotiableQuote;\n successMessage = dictionary.draftSuccess;\n } else {\n submitHandler = onRequestNegotiableQuote ?? requestNegotiableQuote;\n successMessage = dictionary.submitSuccess;\n }\n\n submitHandler(contextData).then(() => {\n setSuccess(successMessage);\n })\n .catch(error => {\n setError(error.message);\n })\n };\n\n const titleNode = (\n <Slot name=\"Title\" slot={slots?.Title} context={{ text: dictionary.title }}>\n <span data-testid=\"form-title\">{dictionary.title}</span>\n </Slot>\n );\n\n const commentFieldNode = (\n <Slot\n name=\"CommentField\"\n slot={slots?.CommentField}\n context={{\n value: comment,\n required: true,\n errorMessage: formErrors.comment,\n setFormErrors,\n isFormDisabled\n } as any}\n >\n <TextArea\n name=\"comment\"\n value={comment}\n label={dictionary.comment}\n required\n autoComplete=\"off\"\n data-testid=\"form-comment-field\"\n errorMessage={formErrors.comment}\n disabled={isFormDisabled}\n />\n </Slot>\n );\n\n const quoteNameFieldNode = (\n <Slot\n name=\"QuoteNameField\"\n slot={slots?.QuoteNameField}\n context={{\n value: quoteName,\n required: true,\n errorMessage: formErrors.quoteName,\n setFormErrors,\n isFormDisabled\n } as any}\n >\n <Field\n error={formErrors.quoteName}\n disabled={isFormDisabled}\n >\n <Input\n value={quoteName}\n name=\"quoteName\"\n floatingLabel={dictionary.quoteName}\n required\n autoComplete=\"off\"\n data-testid=\"form-quote-name-field\"\n />\n </Field>\n </Slot>\n );\n\n const attachFileNode = (\n <Slot\n name=\"AttachFileField\"\n slot={slots?.AttachFileField}\n context={{ onChange: handleAttachFiles, formErrors, isFormDisabled }}\n >\n <InputFile\n onChange={(e: Event) => {\n const target = e.target as HTMLInputElement;\n const fileList = target?.files;\n const files = fileList ? Array.from(fileList) : [];\n\n if (files.length > 0) {\n void handleAttachFiles(files);\n }\n }}\n icon={<Add />}\n disabled={isFormDisabled}\n data-testid=\"form-attach-file-field\"\n />\n </Slot>\n );\n\n const requestButtonNode = (\n <Slot\n name=\"RequestButton\"\n slot={slots?.RequestButton}\n context={\n {\n requestNegotiableQuote,\n formErrors,\n isFormDisabled,\n setIsFormDisabled\n }\n }\n >\n <Button\n type=\"submit\"\n data-testid=\"form-request-button\"\n onClick={validateParentForm}\n disabled={isFormDisabled}\n >\n {dictionary.requestCta}\n </Button>\n </Slot>\n );\n\n const saveButtonNode = (\n <Slot\n name=\"SaveDraftButton\"\n slot={slots?.SaveDraftButton}\n context={\n {\n requestNegotiableQuote,\n formErrors,\n isFormDisabled,\n setIsFormDisabled\n }\n }\n >\n <Button\n type=\"submit\"\n data-draft=\"true\"\n variant=\"secondary\"\n data-testid=\"form-save-draft-button\"\n onClick={validateParentForm}\n disabled={isFormDisabled}\n >\n {dictionary.saveDraftCta}\n </Button>\n </Slot>\n );\n\n return (\n <RequestNegotiableQuoteFormComponent\n title={titleNode}\n banner={getBannerNode()}\n commentField={commentFieldNode}\n quoteNameField={quoteNameFieldNode}\n attachFile={attachFileNode}\n requestButton={requestButtonNode}\n saveButton={saveButtonNode}\n onSubmit={formSubmitHandler}\n className={className}\n disabled={isFormDisabled}\n data-testid=\"form-container\"\n />\n );\n};"],"names":["SvgAdd","props","React","SvgCheckWithCircle","SvgWarningFilled","RequestNegotiableQuoteForm","className","title","banner","commentField","quoteNameField","attachFile","requestButton","saveButton","onSubmit","jsxs","classes","jsx","VComponent","cartId","slots","onRequestNegotiableQuote","onSaveNegotiableQuote","onAttachFiles","onSubmitErrors","onError","comment","setComment","useState","quoteName","setQuoteName","attachmentKeys","setAttachmentKeys","error","setError","formErrors","setFormErrors","success","setSuccess","isFormDisabled","setIsFormDisabled","dictionary","useText","useEffect","permissionsEvent","events","permissions","authenticatedEvent","authenticated","handleAttachFiles","useCallback","files","prev","uploaded","uploadFile","key","getBannerNode","inlineAlertProps","slotProps","CheckWithCircle","WarningFilled","Slot","InLineAlert","validateParentForm","e","closestForm","getFormErrors","formSubmitHandler","form","mergedFormErrors","buttonTarget","formValues","getFormValues","isDraft","_a","contextData","submitHandler","successMessage","requestNegotiableQuote","titleNode","commentFieldNode","TextArea","quoteNameFieldNode","Field","Input","attachFileNode","InputFile","target","fileList","Add","requestButtonNode","Button","saveButtonNode","RequestNegotiableQuoteFormComponent"],"mappings":"uuBACA,MAAMA,GAAUC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,gBAAiB,YAAa,gCAAiC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAO,EAAoBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,CAAC,CAAE,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,WAAY,YAAa,WAAY,UAAW,wBAAwB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,cAAc,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,eAAgB,CAAC,CAAC,CAAC,ECAt9BC,GAAsBF,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,G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,GAAA,CACC,SAAWtB,GAAa,CACtB,MAAMuB,EAASvB,EAAE,OACXwB,EAAWD,GAAA,YAAAA,EAAQ,MACnBpC,EAAQqC,EAAW,MAAM,KAAKA,CAAQ,EAAI,CAAA,EAE5CrC,EAAM,OAAS,GACZF,EAAkBE,CAAK,CAEhC,EACA,OAAOsC,GAAA,EAAI,EACX,SAAUlD,EACV,cAAY,wBAAA,CAAA,CACd,CAAA,EAIEmD,EACJzE,EAAC4C,EAAA,CACC,KAAK,gBACL,KAAMzC,GAAA,YAAAA,EAAO,cACb,QACE,CACE,uBAAA0D,EACA,WAAA3C,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAAvB,EAAC0E,EAAA,CACC,KAAK,SACL,cAAY,sBACZ,QAAS5B,EACT,SAAUxB,EAET,SAAAE,EAAW,UAAA,CAAA,CACd,CAAA,EAIEmD,GACJ3E,EAAC4C,EAAA,CACC,KAAK,kBACL,KAAMzC,GAAA,YAAAA,EAAO,gBACb,QACE,CACE,uBAAA0D,EACA,WAAA3C,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAAvB,EAAC0E,EAAA,CACC,KAAK,SACL,aAAW,OACX,QAAQ,YACR,cAAY,yBACZ,QAAS5B,EACT,SAAUxB,EAET,SAAAE,EAAW,YAAA,CAAA,CACd,CAAA,EAIJ,OACExB,EAAC4E,GAAA,CACC,MAAOd,EACP,OAAQvB,EAAA,EACR,aAAcwB,EACd,eAAgBE,EAChB,WAAYG,EACZ,cAAeK,EACf,WAAYE,GACZ,SAAUzB,EACV,UAAA7D,EACA,SAAUiC,EACV,cAAY,gBAAA,CAAA,CAGlB","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"RequestNegotiableQuoteForm.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","../../node_modules/@adobe-commerce/elsie/src/icons/CheckWithCircle.svg","/@dropins/storefront-quote-management/src/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.tsx","/@dropins/storefront-quote-management/src/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","import * as React from \"react\";\nconst SvgCheckWithCircle = (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: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M6.75 12.762L10.2385 15.75L17.25 9\", stroke: \"currentColor\" }));\nexport default SvgCheckWithCircle;\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/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.css';\n\nexport interface RequestNegotiableQuoteFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 'title'> {\n title: VNode;\n banner?: VNode;\n commentField?: VNode;\n quoteNameField?: VNode;\n attachFile?: VNode;\n requestButton?: VNode;\n saveButton?: VNode;\n onSubmit: (e: Event) => void;\n}\n\nexport const RequestNegotiableQuoteForm: FunctionComponent<RequestNegotiableQuoteFormProps> = ({\n className,\n title,\n banner,\n commentField,\n quoteNameField,\n attachFile,\n requestButton,\n saveButton,\n onSubmit,\n ...props\n}) => {\n return (\n <form {...props} className={classes(['request-negotiable-quote-form', className])} onSubmit={onSubmit}>\n {banner &&\n <VComponent\n node={banner}\n className={classes(['request-negotiable-quote-form__banner'])}\n />\n }\n {title &&\n <VComponent\n node={title}\n className={classes(['request-negotiable-quote-form__title'])}\n />\n }\n {commentField &&\n <VComponent\n node={commentField}\n className={classes(['request-negotiable-quote-form__comment-field'])}\n />\n }\n {quoteNameField &&\n <VComponent\n node={quoteNameField}\n className={classes(['request-negotiable-quote-form__quote-name-field'])}\n />\n }\n {attachFile &&\n <VComponent\n node={attachFile}\n className={classes(['request-negotiable-quote-form__attach-file-field'])}\n />\n }\n <div className={classes(['request-negotiable-quote-form__actions'])}>\n {requestButton &&\n <VComponent\n node={requestButton}\n className={classes(['request-negotiable-quote-form__request-button'])}\n />\n }\n {saveButton &&\n <VComponent\n node={saveButton}\n className={classes(['request-negotiable-quote-form__save-button'])}\n />\n }\n </div>\n </form>\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, useState } from 'preact/compat';\nimport { Container, getFormErrors, getFormValues, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { InLineAlert, Button, InputFile, TextArea, Input, Field, InLineAlertProps } from '@adobe-commerce/elsie/components';\nimport { WarningFilled, CheckWithCircle, Add } from '@adobe-commerce/elsie/icons';\nimport RequestNegotiableQuoteFormComponent from '@/quote-management/components/RequestNegotiableQuoteForm';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { requestNegotiableQuote, RequestNegotiableQuoteInput } from '@/quote-management/api';\nimport { state } from '@/quote-management/lib/state';\n\nexport type RequestNegotiableQuoteHandlers = {\n onAttachFiles?: (files: File[]) => Promise<void>;\n onRequestNegotiableQuote?: typeof requestNegotiableQuote;\n onSaveNegotiableQuote?: typeof requestNegotiableQuote;\n onSubmitErrors?: (errors: Record<string, string>) => void;\n onError?: (props: {\n error: string,\n isFormDisabled: boolean,\n setIsFormDisabled: (isFormDisabled: boolean) => void,\n }) => void;\n};\n\nexport interface RequestNegotiableQuoteFormProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onError'>,\n RequestNegotiableQuoteHandlers {\n cartId: string;\n slots?: {\n ErrorBanner?: SlotProps<{\n message: string,\n }>;\n SuccessBanner?: SlotProps<{\n message: string,\n }>;\n Title?: SlotProps<{\n text: string,\n }>;\n CommentField?: SlotProps<{\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setFormErrors: (errors: Record<string, string>) => void;\n }>;\n QuoteNameField?: SlotProps<{\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setFormErrors: (errors: Record<string, string>) => void;\n }>;\n AttachFileField?: SlotProps<{\n onChange: (files: File[]) => void, formErrors: Record<string, string>,\n isFormDisabled: boolean\n }>;\n RequestButton?: SlotProps<{\n requestNegotiableQuote: typeof requestNegotiableQuote;\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setIsFormDisabled: (isFormDisabled: boolean) => void;\n }>;\n SaveDraftButton?: SlotProps<{\n requestNegotiableQuote: typeof requestNegotiableQuote;\n formErrors: Record<string, string>;\n isFormDisabled: boolean;\n setIsFormDisabled: (isFormDisabled: boolean) => void;\n }>;\n };\n}\n\nexport const RequestNegotiableQuoteForm: Container<RequestNegotiableQuoteFormProps> = ({\n cartId,\n slots,\n onRequestNegotiableQuote,\n onSaveNegotiableQuote,\n onAttachFiles,\n onSubmitErrors,\n onError,\n className,\n}) => {\n const [comment, setComment] = useState<string | undefined>(undefined);\n const [quoteName, setQuoteName] = useState<string | undefined>(undefined);\n const [, setAttachments] = useState<File[]>([]);\n const [error, setError] = useState<string | undefined>(undefined);\n const [formErrors, setFormErrors] = useState<Record<string, string>>({});\n const [success, setSuccess] = useState<string | undefined>(undefined);\n const [isFormDisabled, setIsFormDisabled] = useState<boolean>(false);\n\n const dictionary = useText({\n title: 'NegotiableQuote.Request.title',\n comment: 'NegotiableQuote.Request.comment',\n commentError: 'NegotiableQuote.Request.commentError',\n quoteName: 'NegotiableQuote.Request.quoteName',\n quoteNameError: 'NegotiableQuote.Request.quoteNameError',\n attachmentsError: 'NegotiableQuote.Request.attachmentsError',\n requestCta: 'NegotiableQuote.Request.requestCta',\n saveDraftCta: 'NegotiableQuote.Request.saveDraftCta',\n errorHeader: 'NegotiableQuote.Request.error.header',\n unauthenticated: 'NegotiableQuote.Request.error.unauthenticated',\n unauthorized: 'NegotiableQuote.Request.error.unauthorized',\n missingCart: 'NegotiableQuote.Request.error.missingCart',\n successHeader: 'NegotiableQuote.Request.success.header',\n submitSuccess: 'NegotiableQuote.Request.success.submitted',\n draftSuccess: 'NegotiableQuote.Request.success.draftSaved',\n });\n\n useEffect(() => {\n const permissionsEvent = events.on(\n 'quote-management/permissions',\n (permissions: typeof state.permissions) => {\n setError(undefined);\n if (!permissions.requestQuote) {\n setError(dictionary.unauthorized);\n setIsFormDisabled(true);\n }\n },\n { eager: true }\n );\n return () => permissionsEvent?.off();\n }, [dictionary.unauthorized]);\n\n useEffect(() => {\n const authenticatedEvent = events.on(\n 'authenticated',\n (authenticated: boolean) => {\n setError(undefined);\n if (!authenticated) {\n setError(dictionary.unauthenticated);\n setIsFormDisabled(true);\n }\n },\n { eager: true }\n );\n return () => authenticatedEvent?.off();\n }, [dictionary.unauthenticated]);\n\n useEffect(() => {\n if (!cartId) {\n setError(dictionary.missingCart);\n setIsFormDisabled(true);\n }\n }, [cartId, dictionary.missingCart]);\n\n useEffect(() => {\n if (error) {\n onError?.({ error, isFormDisabled, setIsFormDisabled });\n }\n }, [error, onError, isFormDisabled]);\n\n const handleAttachFiles = useCallback(async (files: File[]) => {\n setFormErrors(prev => ({ ...prev, attachments: '' }));\n setAttachments(files);\n onAttachFiles?.(files)?.catch(() => {\n setFormErrors(prev => ({ ...prev, attachments: dictionary.attachmentsError }));\n });\n }, [onAttachFiles, dictionary]);\n\n /*\n * This function is used to get the banner node.\n * It can be used to render a success or error banner depending on the success or error state.\n */\n const getBannerNode = () => {\n let inlineAlertProps: InLineAlertProps | undefined;\n let slotProps: any | undefined;\n\n if (success) {\n slotProps = {\n name: 'SuccessBanner',\n slot: slots?.SuccessBanner,\n context: {\n message: success,\n },\n 'data-testid': 'form-success-banner',\n };\n inlineAlertProps = {\n type: 'success',\n variant: 'primary',\n icon: <CheckWithCircle />,\n heading: dictionary.successHeader,\n description: success,\n className: 'request-negotiable-quote-form__success-banner',\n };\n }\n else if (error) {\n slotProps = {\n name: 'ErrorBanner',\n slot: slots?.ErrorBanner,\n context: {\n message: error,\n },\n 'data-testid': 'form-error-banner',\n };\n inlineAlertProps = {\n type: 'error',\n variant: 'primary',\n icon: <WarningFilled />,\n heading: dictionary.errorHeader,\n description: error,\n className: 'request-negotiable-quote-form__error-banner',\n };\n }\n\n if (slotProps && inlineAlertProps) {\n return <Slot {...slotProps}>\n <InLineAlert {...inlineAlertProps} />\n </Slot>;\n }\n\n return undefined;\n }\n\n /*\n * This function is used to validate the parent form of the button that was clicked.\n */\n const validateParentForm = (e: Event) => {\n setFormErrors({});\n const closestForm = (e.target as HTMLElement).closest('form') as HTMLFormElement;\n const formErrors = getFormErrors(closestForm);\n if (Object.keys(formErrors).length > 0) {\n setFormErrors(formErrors);\n onSubmitErrors?.(formErrors);\n }\n };\n\n const formSubmitHandler = (e: Event) => {\n e.preventDefault();\n setIsFormDisabled(true);\n\n const form = (e.target as HTMLFormElement);\n\n const currentFormErrors = getFormErrors(form);\n\n const mergedFormErrors = { ...currentFormErrors, ...formErrors };\n\n if (Object.keys(mergedFormErrors).length > 0) {\n onSubmitErrors?.(mergedFormErrors)\n return;\n }\n\n // Since we have multiple submit buttons, we need to determine which one was clicked.\n const buttonTarget = (e as SubmitEvent).submitter as HTMLButtonElement;\n\n const formValues = getFormValues(form);\n\n setComment(formValues.comment);\n setQuoteName(formValues.quoteName);\n\n const isDraft = buttonTarget?.dataset?.draft === 'true' || false;\n\n const contextData: RequestNegotiableQuoteInput = {\n cartId: cartId!,\n quoteName: formValues.quoteName,\n comment: formValues.comment,\n isDraft,\n }\n\n let submitHandler;\n let successMessage;\n\n if (isDraft) {\n submitHandler = onSaveNegotiableQuote ?? requestNegotiableQuote;\n successMessage = dictionary.draftSuccess;\n } else {\n submitHandler = onRequestNegotiableQuote ?? requestNegotiableQuote;\n successMessage = dictionary.submitSuccess;\n }\n\n submitHandler(contextData).then(() => {\n setSuccess(successMessage);\n })\n .catch(error => {\n setError(error.message);\n })\n };\n\n const titleNode = (\n <Slot name=\"Title\" slot={slots?.Title} context={{ text: dictionary.title }}>\n <span data-testid=\"form-title\">{dictionary.title}</span>\n </Slot>\n );\n\n const commentFieldNode = (\n <Slot\n name=\"CommentField\"\n slot={slots?.CommentField}\n context={{\n value: comment,\n required: true,\n errorMessage: formErrors.comment,\n setFormErrors,\n isFormDisabled\n } as any}\n >\n <TextArea\n name=\"comment\"\n value={comment}\n label={dictionary.comment}\n required\n autoComplete=\"off\"\n data-testid=\"form-comment-field\"\n errorMessage={formErrors.comment}\n disabled={isFormDisabled}\n />\n </Slot>\n );\n\n const quoteNameFieldNode = (\n <Slot\n name=\"QuoteNameField\"\n slot={slots?.QuoteNameField}\n context={{\n value: quoteName,\n required: true,\n errorMessage: formErrors.quoteName,\n setFormErrors,\n isFormDisabled\n } as any}\n >\n <Field\n error={formErrors.quoteName}\n disabled={isFormDisabled}\n >\n <Input\n value={quoteName}\n name=\"quoteName\"\n floatingLabel={dictionary.quoteName}\n required\n autoComplete=\"off\"\n data-testid=\"form-quote-name-field\"\n />\n </Field>\n </Slot>\n );\n\n const attachFileNode = (\n <Slot\n name=\"AttachFileField\"\n slot={slots?.AttachFileField}\n context={{ onChange: handleAttachFiles, formErrors, isFormDisabled }}\n >\n <InputFile\n onChange={(e: any) => {\n const files = Array.from(((e.target as HTMLInputElement).files!));\n\n if (files.length > 0) {\n handleAttachFiles(files)\n }\n }}\n icon={<Add />}\n disabled={isFormDisabled}\n data-testid=\"form-attach-file-field\"\n />\n </Slot>\n );\n\n const requestButtonNode = (\n <Slot\n name=\"RequestButton\"\n slot={slots?.RequestButton}\n context={\n {\n requestNegotiableQuote,\n formErrors,\n isFormDisabled,\n setIsFormDisabled\n }\n }\n >\n <Button\n type=\"submit\"\n data-testid=\"form-request-button\"\n onClick={validateParentForm}\n disabled={isFormDisabled}\n >\n {dictionary.requestCta}\n </Button>\n </Slot>\n );\n\n const saveButtonNode = (\n <Slot\n name=\"SaveDraftButton\"\n slot={slots?.SaveDraftButton}\n context={\n {\n requestNegotiableQuote,\n formErrors,\n isFormDisabled,\n setIsFormDisabled\n }\n }\n >\n <Button\n type=\"submit\"\n data-draft=\"true\"\n variant=\"secondary\"\n data-testid=\"form-save-draft-button\"\n onClick={validateParentForm}\n disabled={isFormDisabled}\n >\n {dictionary.saveDraftCta}\n </Button>\n </Slot>\n );\n\n return (\n <RequestNegotiableQuoteFormComponent\n title={titleNode}\n banner={getBannerNode()}\n commentField={commentFieldNode}\n quoteNameField={quoteNameFieldNode}\n attachFile={attachFileNode}\n requestButton={requestButtonNode}\n saveButton={saveButtonNode}\n onSubmit={formSubmitHandler}\n className={className}\n disabled={isFormDisabled}\n data-testid=\"form-container\"\n />\n );\n};\n"],"names":["SvgAdd","props","React","SvgCheckWithCircle","RequestNegotiableQuoteForm","className","title","banner","commentField","quoteNameField","attachFile","requestButton","saveButton","onSubmit","jsxs","classes","jsx","VComponent","cartId","slots","onRequestNegotiableQuote","onSaveNegotiableQuote","onAttachFiles","onSubmitErrors","onError","comment","setComment","useState","quoteName","setQuoteName","setAttachments","error","setError","formErrors","setFormErrors","success","setSuccess","isFormDisabled","setIsFormDisabled","dictionary","useText","useEffect","permissionsEvent","events","permissions","authenticatedEvent","authenticated","handleAttachFiles","useCallback","files","prev","_a","getBannerNode","inlineAlertProps","slotProps","CheckWithCircle","WarningFilled","Slot","InLineAlert","validateParentForm","e","closestForm","getFormErrors","formSubmitHandler","form","mergedFormErrors","buttonTarget","formValues","getFormValues","isDraft","contextData","submitHandler","successMessage","requestNegotiableQuote","titleNode","commentFieldNode","TextArea","quoteNameFieldNode","Field","Input","attachFileNode","InputFile","Add","requestButtonNode","Button","saveButtonNode","RequestNegotiableQuoteFormComponent"],"mappings":"4zBACA,MAAMA,GAAUC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,gBAAiB,YAAa,gCAAiC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAO,EAAoBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,CAAC,CAAE,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,WAAY,YAAa,WAAY,UAAW,wBAAwB,EAAoBA,EAA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JnE,EAACyC,EAAA,CACC,KAAK,gBACL,KAAMtC,GAAA,YAAAA,EAAO,cACb,QACE,CACE,uBAAAsD,EACA,WAAAxC,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAAtB,EAACoE,EAAA,CACC,KAAK,SACL,cAAY,sBACZ,QAASzB,EACT,SAAUtB,EAET,SAAAE,EAAW,UAAA,CAAA,CACd,CAAA,EAIE8C,EACJrE,EAACyC,EAAA,CACC,KAAK,kBACL,KAAMtC,GAAA,YAAAA,EAAO,gBACb,QACE,CACE,uBAAAsD,EACA,WAAAxC,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAAtB,EAACoE,EAAA,CACC,KAAK,SACL,aAAW,OACX,QAAQ,YACR,cAAY,yBACZ,QAASzB,EACT,SAAUtB,EAET,SAAAE,EAAW,YAAA,CAAA,CACd,CAAA,EAIJ,OACEvB,EAACsE,GAAA,CACC,MAAOZ,EACP,OAAQtB,EAAA,EACR,aAAcuB,EACd,eAAgBE,EAChB,WAAYG,EACZ,cAAeG,EACf,WAAYE,EACZ,SAAUtB,EACV,UAAA1D,EACA,SAAUgC,EACV,cAAY,gBAAA,CAAA,CAGlB","x_google_ignoreList":[0,1]}
|
package/containers/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NegotiableQuoteCartItem, NegotiableQuoteModel } from '../negotiable-quote-model';
|
|
2
|
+
|
|
3
|
+
export declare const baseCartItem: NegotiableQuoteCartItem;
|
|
4
|
+
export declare const configurableCartItem: NegotiableQuoteCartItem;
|
|
5
|
+
export declare const bundleCartItem: NegotiableQuoteCartItem;
|
|
6
|
+
export declare const base: NegotiableQuoteModel;
|
|
7
|
+
//# sourceMappingURL=negotiableQuoteModel.d.ts.map
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
+
export interface ShippingAddress {
|
|
2
|
+
firstname: string;
|
|
3
|
+
lastname: string;
|
|
4
|
+
company?: string;
|
|
5
|
+
street: string[];
|
|
6
|
+
city: string;
|
|
7
|
+
region?: {
|
|
8
|
+
code: string;
|
|
9
|
+
label: string;
|
|
10
|
+
regionId: number;
|
|
11
|
+
};
|
|
12
|
+
postcode: string;
|
|
13
|
+
country: {
|
|
14
|
+
code: string;
|
|
15
|
+
label: string;
|
|
16
|
+
};
|
|
17
|
+
telephone: string;
|
|
18
|
+
}
|
|
1
19
|
export interface NegotiableQuoteModel {
|
|
2
20
|
uid: string;
|
|
3
21
|
name: string;
|
|
4
|
-
createdAt
|
|
5
|
-
|
|
22
|
+
createdAt: string;
|
|
23
|
+
salesRepName: string;
|
|
24
|
+
expirationDate: string;
|
|
25
|
+
updatedAt: string;
|
|
6
26
|
status: NegotiableQuoteStatus;
|
|
7
27
|
buyer: {
|
|
8
28
|
firstname: string;
|
|
@@ -16,46 +36,87 @@ export interface NegotiableQuoteModel {
|
|
|
16
36
|
firstname: string;
|
|
17
37
|
lastname: string;
|
|
18
38
|
};
|
|
19
|
-
attachments?: {
|
|
20
|
-
name: string;
|
|
21
|
-
url: string;
|
|
22
|
-
}[];
|
|
23
39
|
}[];
|
|
24
|
-
prices
|
|
25
|
-
subtotalExcludingTax?:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
grandTotal?: {
|
|
35
|
-
value: number;
|
|
36
|
-
currency: string;
|
|
37
|
-
};
|
|
40
|
+
prices: {
|
|
41
|
+
subtotalExcludingTax?: Currency;
|
|
42
|
+
subtotalIncludingTax?: Currency;
|
|
43
|
+
subtotalWithDiscountExcludingTax?: Currency;
|
|
44
|
+
grandTotal?: Currency;
|
|
45
|
+
appliedTaxes?: {
|
|
46
|
+
amount: Currency;
|
|
47
|
+
label: string;
|
|
48
|
+
}[];
|
|
38
49
|
};
|
|
39
|
-
items
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
items: NegotiableQuoteCartItem[];
|
|
51
|
+
shippingAddresses?: ShippingAddress[];
|
|
52
|
+
canCheckout: boolean;
|
|
53
|
+
canSendForReview: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface NegotiableQuoteCartItem {
|
|
56
|
+
product: {
|
|
57
|
+
uid: string;
|
|
58
|
+
sku: string;
|
|
59
|
+
name: string;
|
|
60
|
+
templateId?: string;
|
|
61
|
+
templateName?: string;
|
|
62
|
+
priceRange: {
|
|
63
|
+
maximumPrice: {
|
|
64
|
+
regularPrice: {
|
|
65
|
+
value: number;
|
|
51
66
|
};
|
|
52
67
|
};
|
|
53
68
|
};
|
|
54
|
-
|
|
69
|
+
};
|
|
70
|
+
catalogDiscount: {
|
|
71
|
+
amountOff: number;
|
|
72
|
+
percentOff: number;
|
|
73
|
+
};
|
|
74
|
+
discounts: {
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
amount: Currency;
|
|
55
78
|
}[];
|
|
79
|
+
stockStatus: string;
|
|
80
|
+
quantity: number;
|
|
81
|
+
prices: {
|
|
82
|
+
originalItemPrice: Currency;
|
|
83
|
+
rowTotal: Currency;
|
|
84
|
+
};
|
|
85
|
+
configurableOptions?: {
|
|
86
|
+
optionLabel: string;
|
|
87
|
+
valueLabel: string;
|
|
88
|
+
}[];
|
|
89
|
+
bundleOptions?: {
|
|
90
|
+
label: string;
|
|
91
|
+
values: {
|
|
92
|
+
label: string;
|
|
93
|
+
quantity: number;
|
|
94
|
+
originalPrice: Currency;
|
|
95
|
+
price: Currency;
|
|
96
|
+
}[];
|
|
97
|
+
}[];
|
|
98
|
+
}
|
|
99
|
+
export interface Currency {
|
|
100
|
+
value: number;
|
|
101
|
+
currency: string;
|
|
102
|
+
}
|
|
103
|
+
export interface NegotiableQuoteListEntry {
|
|
104
|
+
uid: string;
|
|
105
|
+
name: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
updatedAt: string;
|
|
108
|
+
status: NegotiableQuoteStatus;
|
|
109
|
+
buyer: {
|
|
110
|
+
firstname: string;
|
|
111
|
+
lastname: string;
|
|
112
|
+
};
|
|
113
|
+
templateName: string;
|
|
114
|
+
prices: {
|
|
115
|
+
grandTotal: Currency;
|
|
116
|
+
};
|
|
56
117
|
}
|
|
57
118
|
export interface NegotiableQuotesListModel {
|
|
58
|
-
items:
|
|
119
|
+
items: NegotiableQuoteListEntry[];
|
|
59
120
|
pageInfo: {
|
|
60
121
|
currentPage: number;
|
|
61
122
|
pageSize: number;
|
|
@@ -72,6 +133,7 @@ export interface NegotiableQuotesListModel {
|
|
|
72
133
|
};
|
|
73
134
|
}
|
|
74
135
|
export declare enum NegotiableQuoteStatus {
|
|
136
|
+
NEW = "NEW",
|
|
75
137
|
SUBMITTED = "SUBMITTED",
|
|
76
138
|
PENDING = "PENDING",
|
|
77
139
|
UPDATED = "UPDATED",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NegotiableQuoteStatus } from '../../models/negotiable-quote-model';
|
|
2
2
|
|
|
3
3
|
export declare const mockGraphQLResponse: {
|
|
4
4
|
data: {
|
|
@@ -55,7 +55,234 @@ export declare const mockGraphQLResponse: {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
-
export declare const
|
|
58
|
+
export declare const mockQuoteData: {
|
|
59
|
+
uid: string;
|
|
60
|
+
name: string;
|
|
61
|
+
created_at: string;
|
|
62
|
+
status: string;
|
|
63
|
+
sales_rep_name: string;
|
|
64
|
+
expiration_date: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
buyer: {
|
|
67
|
+
firstname: string;
|
|
68
|
+
lastname: string;
|
|
69
|
+
};
|
|
70
|
+
comments: {
|
|
71
|
+
uid: string;
|
|
72
|
+
created_at: string;
|
|
73
|
+
author: {
|
|
74
|
+
firstname: string;
|
|
75
|
+
lastname: string;
|
|
76
|
+
};
|
|
77
|
+
text: string;
|
|
78
|
+
}[];
|
|
79
|
+
template_id: null;
|
|
80
|
+
template_name: null;
|
|
81
|
+
items: ({
|
|
82
|
+
product: {
|
|
83
|
+
name: string;
|
|
84
|
+
sku: string;
|
|
85
|
+
uid: string;
|
|
86
|
+
stock_status: string;
|
|
87
|
+
quantity: null;
|
|
88
|
+
price_range: {
|
|
89
|
+
maximum_price: {
|
|
90
|
+
regular_price: {
|
|
91
|
+
value: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
prices: {
|
|
97
|
+
price: {
|
|
98
|
+
currency: string;
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
original_item_price: {
|
|
102
|
+
currency: string;
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
original_row_total: {
|
|
106
|
+
currency: string;
|
|
107
|
+
value: number;
|
|
108
|
+
};
|
|
109
|
+
row_total: {
|
|
110
|
+
currency: string;
|
|
111
|
+
value: number;
|
|
112
|
+
};
|
|
113
|
+
catalog_discount: {
|
|
114
|
+
amount_off: number;
|
|
115
|
+
percent_off: number;
|
|
116
|
+
};
|
|
117
|
+
discounts: {
|
|
118
|
+
label: string;
|
|
119
|
+
value: number;
|
|
120
|
+
amount: {
|
|
121
|
+
currency: string;
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
}[];
|
|
125
|
+
};
|
|
126
|
+
quantity: number;
|
|
127
|
+
configurable_options?: undefined;
|
|
128
|
+
bundle_options?: undefined;
|
|
129
|
+
} | {
|
|
130
|
+
product: {
|
|
131
|
+
name: string;
|
|
132
|
+
sku: string;
|
|
133
|
+
uid: string;
|
|
134
|
+
stock_status: string;
|
|
135
|
+
quantity: null;
|
|
136
|
+
price_range: {
|
|
137
|
+
maximum_price: {
|
|
138
|
+
regular_price: {
|
|
139
|
+
value: number;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
prices: {
|
|
145
|
+
price: {
|
|
146
|
+
currency: string;
|
|
147
|
+
value: number;
|
|
148
|
+
};
|
|
149
|
+
original_item_price: {
|
|
150
|
+
currency: string;
|
|
151
|
+
value: number;
|
|
152
|
+
};
|
|
153
|
+
original_row_total: {
|
|
154
|
+
currency: string;
|
|
155
|
+
value: number;
|
|
156
|
+
};
|
|
157
|
+
row_total: {
|
|
158
|
+
currency: string;
|
|
159
|
+
value: number;
|
|
160
|
+
};
|
|
161
|
+
catalog_discount: {
|
|
162
|
+
amount_off: number;
|
|
163
|
+
percent_off: number;
|
|
164
|
+
};
|
|
165
|
+
discounts: never[];
|
|
166
|
+
};
|
|
167
|
+
quantity: number;
|
|
168
|
+
configurable_options: {
|
|
169
|
+
option_label: string;
|
|
170
|
+
value_label: string;
|
|
171
|
+
}[];
|
|
172
|
+
bundle_options?: undefined;
|
|
173
|
+
} | {
|
|
174
|
+
product: {
|
|
175
|
+
name: string;
|
|
176
|
+
sku: string;
|
|
177
|
+
uid: string;
|
|
178
|
+
stock_status: string;
|
|
179
|
+
quantity: null;
|
|
180
|
+
price_range: {
|
|
181
|
+
maximum_price: {
|
|
182
|
+
regular_price: {
|
|
183
|
+
value: number;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
prices: {
|
|
189
|
+
price: {
|
|
190
|
+
currency: string;
|
|
191
|
+
value: number;
|
|
192
|
+
};
|
|
193
|
+
original_item_price: {
|
|
194
|
+
currency: string;
|
|
195
|
+
value: number;
|
|
196
|
+
};
|
|
197
|
+
original_row_total: {
|
|
198
|
+
currency: string;
|
|
199
|
+
value: number;
|
|
200
|
+
};
|
|
201
|
+
row_total: {
|
|
202
|
+
currency: string;
|
|
203
|
+
value: number;
|
|
204
|
+
};
|
|
205
|
+
catalog_discount: {
|
|
206
|
+
amount_off: number;
|
|
207
|
+
percent_off: number;
|
|
208
|
+
};
|
|
209
|
+
discounts: {
|
|
210
|
+
label: string;
|
|
211
|
+
value: number;
|
|
212
|
+
amount: {
|
|
213
|
+
currency: string;
|
|
214
|
+
value: number;
|
|
215
|
+
};
|
|
216
|
+
}[];
|
|
217
|
+
};
|
|
218
|
+
quantity: number;
|
|
219
|
+
bundle_options: {
|
|
220
|
+
label: string;
|
|
221
|
+
values: {
|
|
222
|
+
label: string;
|
|
223
|
+
quantity: number;
|
|
224
|
+
original_price: {
|
|
225
|
+
currency: string;
|
|
226
|
+
value: number;
|
|
227
|
+
};
|
|
228
|
+
priceV2: {
|
|
229
|
+
currency: string;
|
|
230
|
+
value: number;
|
|
231
|
+
};
|
|
232
|
+
}[];
|
|
233
|
+
}[];
|
|
234
|
+
configurable_options?: undefined;
|
|
235
|
+
})[];
|
|
236
|
+
history: {
|
|
237
|
+
uid: string;
|
|
238
|
+
created_at: string;
|
|
239
|
+
author: {
|
|
240
|
+
firstname: string;
|
|
241
|
+
lastname: string;
|
|
242
|
+
};
|
|
243
|
+
change_type: string;
|
|
244
|
+
changes: {
|
|
245
|
+
comment_added: {
|
|
246
|
+
comment: string;
|
|
247
|
+
};
|
|
248
|
+
statuses: {
|
|
249
|
+
changes: {
|
|
250
|
+
new_status: string;
|
|
251
|
+
old_status: null;
|
|
252
|
+
}[];
|
|
253
|
+
};
|
|
254
|
+
expiration: {
|
|
255
|
+
new_expiration: null;
|
|
256
|
+
old_expiration: null;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
}[];
|
|
260
|
+
prices: {
|
|
261
|
+
subtotal_excluding_tax: {
|
|
262
|
+
currency: string;
|
|
263
|
+
value: number;
|
|
264
|
+
};
|
|
265
|
+
subtotal_including_tax: {
|
|
266
|
+
currency: string;
|
|
267
|
+
value: number;
|
|
268
|
+
};
|
|
269
|
+
subtotal_with_discount_excluding_tax: {
|
|
270
|
+
currency: string;
|
|
271
|
+
value: number;
|
|
272
|
+
};
|
|
273
|
+
applied_taxes: {
|
|
274
|
+
label: string;
|
|
275
|
+
amount: {
|
|
276
|
+
currency: string;
|
|
277
|
+
value: number;
|
|
278
|
+
};
|
|
279
|
+
}[];
|
|
280
|
+
grand_total: {
|
|
281
|
+
currency: string;
|
|
282
|
+
value: number;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
59
286
|
export declare const mockNegotiableQuotesResponse: {
|
|
60
287
|
data: {
|
|
61
288
|
negotiableQuotes: {
|