@dropins/storefront-quote-management 0.0.1-alpha9 → 1.0.0-beta1
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/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +13 -0
- package/api/{getCustomerData/getCustomerData.d.ts → acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts} +2 -2
- package/{data/transforms/__fixtures__/customerData.d.ts → api/acceptQuoteTemplate/index.d.ts} +2 -2
- package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +15 -0
- package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +10 -0
- package/api/addQuoteTemplateLineItemNote/index.d.ts +10 -0
- package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +37 -0
- package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +10 -0
- package/api/addQuoteTemplateShippingAddress/index.d.ts +10 -0
- package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +14 -0
- package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +10 -0
- package/api/cancelQuoteTemplate/index.d.ts +10 -0
- package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +31 -0
- package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +2 -0
- package/api/closeNegotiableQuote/index.d.ts +10 -0
- package/api/createQuoteTemplate/createQuoteTemplate.d.ts +4 -0
- package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +10 -0
- package/api/createQuoteTemplate/index.d.ts +10 -0
- package/api/deleteQuote/deleteQuote.d.ts +28 -0
- package/api/deleteQuote/graphql/DeleteQuoteMutation.d.ts +10 -0
- package/api/{getCustomerData → deleteQuote}/index.d.ts +1 -1
- package/{data/models/customer-model.d.ts → api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts} +6 -8
- package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +10 -0
- package/api/deleteQuoteTemplate/index.d.ts +10 -0
- package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +8 -0
- package/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.d.ts +10 -0
- package/api/duplicateNegotiableQuote/index.d.ts +10 -0
- package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +15 -0
- package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +10 -0
- package/api/generateQuoteFromTemplate/index.d.ts +10 -0
- 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/getQuoteTemplateData/getQuoteTemplateData.d.ts +4 -0
- package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +10 -0
- package/api/getQuoteTemplateData/index.d.ts +10 -0
- package/api/getQuoteTemplates/getQuoteTemplates.d.ts +34 -0
- package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +10 -0
- package/api/getQuoteTemplates/index.d.ts +10 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +10 -0
- package/api/getStoreConfig/index.d.ts +10 -0
- package/api/graphql/NegotiableQuoteAddressFragment.d.ts +10 -0
- package/api/graphql/NegotiableQuoteFragment.d.ts +5 -13
- package/api/graphql/NegotiableQuoteListFragment.d.ts +10 -0
- package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +10 -0
- package/api/graphql/SearchResultPageInfoFragment.d.ts +10 -0
- package/api/graphql/ShippingMethodFragment.d.ts +10 -0
- package/api/graphql/SortFieldsFragment.d.ts +10 -0
- package/api/index.d.ts +34 -1
- package/api/initialize/initialize.d.ts +2 -0
- package/api/negotiableQuotes/graphql/NegotiableQuotesQuery.d.ts +10 -0
- package/api/negotiableQuotes/index.d.ts +10 -0
- package/api/negotiableQuotes/negotiableQuotes.d.ts +39 -0
- package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +10 -0
- package/api/openQuoteTemplate/index.d.ts +10 -0
- package/api/openQuoteTemplate/openQuoteTemplate.d.ts +13 -0
- package/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.d.ts +10 -0
- package/api/removeNegotiableQuoteItems/index.d.ts +10 -0
- package/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.d.ts +8 -0
- package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +10 -0
- package/api/removeQuoteTemplateItems/index.d.ts +10 -0
- package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +14 -0
- package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +10 -0
- package/api/renameNegotiableQuote/index.d.ts +10 -0
- package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +9 -0
- package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +4 -12
- package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -3
- package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +10 -0
- package/api/sendForReview/index.d.ts +10 -0
- package/api/sendForReview/sendForReview.d.ts +11 -0
- package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +10 -0
- package/api/sendQuoteTemplateForReview/index.d.ts +10 -0
- package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +15 -0
- package/api/setLineItemNote/graphql/SetLineItemNoteMutation.d.ts +10 -0
- package/api/setLineItemNote/index.d.ts +10 -0
- package/api/setLineItemNote/setLineItemNote.d.ts +10 -0
- package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +10 -0
- package/api/setShippingAddress/index.d.ts +2 -0
- package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
- package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +10 -0
- package/api/updateQuantities/index.d.ts +10 -0
- package/api/updateQuantities/updateQuantities.d.ts +36 -0
- package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +10 -0
- package/api/updateQuoteTemplateItemQuantities/index.d.ts +10 -0
- package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +20 -0
- package/api/uploadFile/graphql/FinishUploadMutation.d.ts +10 -0
- package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +10 -0
- package/api/uploadFile/index.d.ts +10 -0
- package/api/uploadFile/uploadFile.d.ts +12 -0
- package/api.js +95 -22
- package/api.js.map +1 -1
- package/chunks/AttachedFilesList.js +4 -0
- package/chunks/AttachedFilesList.js.map +1 -0
- package/chunks/CheckWithCircle.js +4 -0
- package/chunks/CheckWithCircle.js.map +1 -0
- package/chunks/ChevronDown.js +4 -0
- package/chunks/ChevronDown.js.map +1 -0
- package/chunks/ConfirmationModal.js +4 -0
- package/chunks/ConfirmationModal.js.map +1 -0
- package/chunks/ItemsQuoted.js +4 -0
- package/chunks/ItemsQuoted.js.map +1 -0
- package/chunks/ItemsQuotedTemplate.js +4 -0
- package/chunks/ItemsQuotedTemplate.js.map +1 -0
- package/chunks/LineItemNoteModal2.js +4 -0
- package/chunks/LineItemNoteModal2.js.map +1 -0
- package/chunks/NegotiableQuoteFragment.js +391 -0
- package/chunks/NegotiableQuoteFragment.js.map +1 -0
- package/chunks/NegotiableQuoteTemplateFragment.js +190 -0
- package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -0
- package/chunks/OrderSummaryLine.js +4 -0
- package/chunks/OrderSummaryLine.js.map +1 -0
- package/chunks/QuoteCommentsList.js +4 -0
- package/chunks/QuoteCommentsList.js.map +1 -0
- package/chunks/QuoteCommentsList3.js +4 -0
- package/chunks/QuoteCommentsList3.js.map +1 -0
- package/chunks/QuoteHistoryLog.js +4 -0
- package/chunks/QuoteHistoryLog.js.map +1 -0
- package/chunks/QuoteHistoryLog3.js +4 -0
- package/chunks/QuoteHistoryLog3.js.map +1 -0
- package/chunks/QuoteTemplateCommentsList.js +4 -0
- package/chunks/QuoteTemplateCommentsList.js.map +1 -0
- package/chunks/QuoteTemplateHistoryLog.js +4 -0
- package/chunks/QuoteTemplateHistoryLog.js.map +1 -0
- package/chunks/ShippingAddressDisplay.js +4 -0
- package/chunks/ShippingAddressDisplay.js.map +1 -0
- package/chunks/TabbedContent.js +4 -0
- package/chunks/TabbedContent.js.map +1 -0
- package/chunks/WarningFilled.js +4 -0
- package/chunks/WarningFilled.js.map +1 -0
- package/chunks/addQuoteTemplateLineItemNote.js +13 -0
- package/chunks/addQuoteTemplateLineItemNote.js.map +1 -0
- package/chunks/dateUtils.js +4 -0
- package/chunks/dateUtils.js.map +1 -0
- package/chunks/duplicateNegotiableQuote.js +121 -0
- package/chunks/duplicateNegotiableQuote.js.map +1 -0
- package/chunks/generateQuoteFromTemplate.js +12 -0
- package/chunks/generateQuoteFromTemplate.js.map +1 -0
- package/chunks/getQuoteTemplates.js +50 -0
- package/chunks/getQuoteTemplates.js.map +1 -0
- package/chunks/negotiableQuotes.js +77 -0
- package/chunks/negotiableQuotes.js.map +1 -0
- package/chunks/openQuoteTemplate.js +31 -0
- package/chunks/openQuoteTemplate.js.map +1 -0
- package/chunks/requestNegotiableQuote.js +6 -81
- package/chunks/requestNegotiableQuote.js.map +1 -1
- package/chunks/setLineItemNote.js +47 -0
- package/chunks/setLineItemNote.js.map +1 -0
- package/chunks/state.js +4 -0
- package/chunks/state.js.map +1 -0
- package/chunks/transform-quote-template.js +4 -0
- package/chunks/transform-quote-template.js.map +1 -0
- package/chunks/transform-quote.js +4 -0
- package/chunks/transform-quote.js.map +1 -0
- package/chunks/uploadFile.js +20 -0
- package/chunks/uploadFile.js.map +1 -0
- package/components/ActionsBar/ActionsBar.d.ts +15 -0
- package/components/ActionsBar/index.d.ts +11 -0
- package/components/AttachedFilesList/AttachedFilesList.d.ts +16 -0
- package/components/AttachedFilesList/index.d.ts +11 -0
- package/components/ConfirmationModal/ConfirmationModal.d.ts +17 -0
- package/components/ConfirmationModal/index.d.ts +11 -0
- package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
- package/components/ItemsQuoted/index.d.ts +11 -0
- package/components/LineItemNoteModal/LineItemNoteModal.d.ts +17 -0
- package/components/LineItemNoteModal/index.d.ts +11 -0
- package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +22 -0
- package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
- package/components/ManageNegotiableQuote/index.d.ts +11 -0
- package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +20 -0
- package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +4 -0
- package/components/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/components/OrderSummary/OrderSummary.d.ts +48 -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 +61 -0
- package/components/ProductListTable/index.d.ts +11 -0
- package/components/QuoteCommentsList/QuoteCommentsList.d.ts +17 -0
- package/components/QuoteCommentsList/index.d.ts +11 -0
- package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +77 -0
- package/components/QuoteHistoryLog/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/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +29 -0
- package/components/QuoteTemplatesListTable/index.d.ts +10 -0
- package/components/QuotesListTable/QuotesListTable.d.ts +29 -0
- package/components/QuotesListTable/index.d.ts +11 -0
- package/components/RenameQuoteModal/RenameQuoteModal.d.ts +18 -0
- package/components/RenameQuoteModal/index.d.ts +11 -0
- package/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +1 -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 +28 -0
- package/containers/ItemsQuoted/ItemsQuoted.d.ts +30 -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/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +21 -0
- package/containers/ItemsQuotedTemplate/index.d.ts +11 -0
- package/containers/ItemsQuotedTemplate.d.ts +3 -0
- package/containers/ItemsQuotedTemplate.js +4 -0
- package/containers/ItemsQuotedTemplate.js.map +1 -0
- package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +87 -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/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +67 -0
- package/containers/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/containers/ManageNegotiableQuoteTemplate.d.ts +3 -0
- package/containers/ManageNegotiableQuoteTemplate.js +4 -0
- package/containers/ManageNegotiableQuoteTemplate.js.map +1 -0
- package/containers/OrderSummary/OrderSummary.d.ts +11 -0
- package/containers/OrderSummary/index.d.ts +11 -0
- package/containers/OrderSummary.d.ts +3 -0
- package/containers/OrderSummary.js +4 -0
- package/containers/OrderSummary.js.map +1 -0
- package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +14 -0
- package/containers/OrderSummaryLine/index.d.ts +11 -0
- package/containers/OrderSummaryLine.d.ts +3 -0
- package/containers/OrderSummaryLine.js +4 -0
- package/containers/OrderSummaryLine.js.map +1 -0
- package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -0
- package/containers/QuoteCommentsList/index.d.ts +11 -0
- package/containers/QuoteCommentsList.d.ts +3 -0
- package/containers/QuoteCommentsList.js +4 -0
- package/containers/QuoteCommentsList.js.map +1 -0
- package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -0
- package/containers/QuoteHistoryLog/index.d.ts +11 -0
- package/containers/QuoteHistoryLog.d.ts +3 -0
- package/containers/QuoteHistoryLog.js +4 -0
- package/containers/QuoteHistoryLog.js.map +1 -0
- package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +51 -0
- package/containers/QuoteSummaryList/index.d.ts +11 -0
- package/containers/QuoteSummaryList.d.ts +3 -0
- package/containers/QuoteSummaryList.js +4 -0
- package/containers/QuoteSummaryList.js.map +1 -0
- package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -0
- package/containers/QuoteTemplateCommentsList/index.d.ts +11 -0
- package/containers/QuoteTemplateCommentsList.d.ts +3 -0
- package/containers/QuoteTemplateCommentsList.js +4 -0
- package/containers/QuoteTemplateCommentsList.js.map +1 -0
- package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -0
- package/containers/QuoteTemplateHistoryLog/index.d.ts +11 -0
- package/containers/QuoteTemplateHistoryLog.d.ts +3 -0
- package/containers/QuoteTemplateHistoryLog.js +4 -0
- package/containers/QuoteTemplateHistoryLog.js.map +1 -0
- package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +74 -0
- package/containers/QuoteTemplatesListTable/index.d.ts +11 -0
- package/containers/QuoteTemplatesListTable.d.ts +3 -0
- package/containers/QuoteTemplatesListTable.js +4 -0
- package/containers/QuoteTemplatesListTable.js.map +1 -0
- package/containers/QuotesListTable/QuotesListTable.d.ts +72 -0
- package/containers/QuotesListTable/index.d.ts +11 -0
- package/containers/QuotesListTable.d.ts +3 -0
- package/containers/QuotesListTable.js +4 -0
- package/containers/QuotesListTable.js.map +1 -0
- package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +10 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +10 -0
- package/containers/ShippingAddressDisplay/index.d.ts +11 -0
- package/containers/ShippingAddressDisplay.d.ts +1 -0
- package/containers/ShippingAddressDisplay.js +4 -0
- package/containers/ShippingAddressDisplay.js.map +1 -0
- package/containers/index.d.ts +22 -0
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +8 -0
- package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +4 -0
- package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +5 -0
- package/data/models/__fixtures__/negotiableQuotesListModel.d.ts +5 -0
- package/data/models/__fixtures__/storeConfigModel.d.ts +5 -0
- package/data/models/index.d.ts +11 -1
- package/data/models/negotiable-quote-model.d.ts +262 -27
- package/data/models/negotiable-quote-template-model.d.ts +147 -0
- package/data/models/store-config-model.d.ts +27 -0
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +665 -2
- package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +1610 -0
- package/data/transforms/__fixtures__/storeConfigData.d.ts +31 -0
- package/data/transforms/index.d.ts +6 -13
- package/data/transforms/transform-quote-template.d.ts +5 -0
- package/data/transforms/transform-quote.d.ts +13 -2
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/useQuoteSummaryData.d.ts +10 -0
- package/i18n/en_US.json.d.ts +360 -1
- package/lib/configurationTransformers.d.ts +27 -0
- package/lib/itemFormatters.d.ts +47 -0
- package/lib/priceCalculators.d.ts +41 -0
- package/lib/state.d.ts +6 -0
- package/package.json +1 -1
- package/render.js +6 -2
- package/render.js.map +1 -1
- package/types/state.types.d.ts +13 -0
- package/utils/dateUtils.d.ts +26 -0
- package/utils/fileUtils.d.ts +46 -0
- package/utils/mapAuthPermissions.d.ts +39 -0
- package/api/getCustomerData/graphql/CustomerQuery.d.ts +0 -2
- package/api/graphql/CustomerFragment.d.ts +0 -2
- package/data/models/__fixtures__/customerModel.d.ts +0 -4
- package/data/transforms/transform-customer.d.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as K,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as x,useEffect as L,useCallback as G}from"@dropins/tools/preact-compat.js";import{classes as c,VComponent as N,Slot as b,getFormErrors as J,getFormValues as me}from"@dropins/tools/lib.js";import{TextArea as ce,Field as de,Input as le,InputFile as fe,Button as T,InLineAlert as qe}from"@dropins/tools/components.js";/* empty css */import{events as U}from"@dropins/tools/event-bus.js";import{r as H}from"../chunks/requestNegotiableQuote.js";import"../chunks/state.js";import{u as ge}from"../chunks/uploadFile.js";import{v as he,f as Ne,a as be,S as pe,A as ve}from"../chunks/AttachedFilesList.js";import"@dropins/tools/preact.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */import{S as Fe}from"../chunks/CheckWithCircle.js";import{S as Qe}from"../chunks/WarningFilled.js";import{useText as Re}from"@dropins/tools/i18n.js";import"../chunks/NegotiableQuoteFragment.js";import"../chunks/transform-quote.js";import"@dropins/tools/fetch-graphql.js";const xe=({className:S,title:t,banner:B,commentField:D,quoteNameField:C,attachFile:d,attachedFilesList:p,requestButton:z,saveButton:v,onSubmit:_,...g})=>K("form",{...g,className:c(["request-negotiable-quote-form",S]),onSubmit:_,children:[B&&a(N,{node:B,className:c(["request-negotiable-quote-form__banner"])}),t&&a(N,{node:t,className:c(["request-negotiable-quote-form__title"])}),D&&a(N,{node:D,className:c(["request-negotiable-quote-form__comment-field"])}),C&&a(N,{node:C,className:c(["request-negotiable-quote-form__quote-name-field"])}),d&&a(N,{node:d,className:c(["request-negotiable-quote-form__attach-file-field"])}),p&&a(N,{node:p,className:c(["request-negotiable-quote-form__attached-files-list"])}),K("div",{className:c(["request-negotiable-quote-form__actions"]),children:[z&&a(N,{node:z,className:c(["request-negotiable-quote-form__request-button"])}),v&&a(N,{node:v,className:c(["request-negotiable-quote-form__save-button"])})]})]}),We=({cartId:S,slots:t,onRequestNegotiableQuote:B,onSaveNegotiableQuote:D,onAttachFiles:C,onSubmitErrors:d,onError:p,className:z,maxFiles:v,maxFileSize:_,acceptedFileTypes:g})=>{const[w,X]=x(void 0),[P,Y]=x(void 0),[F,E]=x([]),[y,k]=x(void 0),[h,u]=x({}),[j,Z]=x(void 0),[i,l]=x(!1),n=Re({title:"NegotiableQuote.Request.title",comment:"NegotiableQuote.Request.comment",commentError:"NegotiableQuote.Request.commentError",quoteName:"NegotiableQuote.Request.quoteName",quoteNameError:"NegotiableQuote.Request.quoteNameError",attachmentsError:"NegotiableQuote.Request.attachmentsError",maxFilesExceeded:"NegotiableQuote.Request.maxFilesExceeded",maxFileSizeExceeded:"NegotiableQuote.Request.maxFileSizeExceeded",invalidFileType:"NegotiableQuote.Request.invalidFileType",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"});L(()=>{const e=U.on("quote-management/permissions",o=>{k(void 0),o.requestQuote?l(!1):(k(n.unauthorized),l(!0))},{eager:!0});return()=>e==null?void 0:e.off()},[n.unauthorized]),L(()=>{const e=U.on("authenticated",o=>{k(void 0),o?l(!1):(k(n.unauthenticated),l(!0))},{eager:!0});return()=>e==null?void 0:e.off()},[n.unauthenticated]),L(()=>{S||(k(n.missingCart),l(!0))},[S,n.missingCart]),L(()=>{y&&(p==null||p({error:y,isFormDisabled:i,setIsFormDisabled:l}))},[y,p,i]);const V=G(async e=>{var s;if(!(e!=null&&e.length))return;if(v&&F.length+e.length>v){u(r=>({...r,attachments:n.maxFilesExceeded.replace("{maxFiles}",String(v))}));return}for(const r of e){if(_&&!he(r.size,_)){u(m=>({...m,attachments:n.maxFileSizeExceeded.replace("{maxSize}",Ne(_))}));return}if(g&&!be(r.type,g)){u(m=>({...m,attachments:n.invalidFileType}));return}}if(u(r=>{const{attachments:m,...f}=r;return f}),C){(s=C(e))==null||s.catch(()=>{u(r=>({...r,attachments:n.attachmentsError}))});return}const o=e.map(r=>({key:`temp-${Date.now()}-${Math.random()}-${r.name}`,name:r.name,size:r.size,status:"uploading"}));E(r=>[...r,...o]);for(let r=0;r<e.length;r++){const m=e[r],f=o[r].key;try{const Q=await ge(m);E(R=>R.map(q=>q.key===f?{...q,key:Q.key,status:"success"}:q))}catch(Q){u(R=>({...R,attachments:Q.message})),E(R=>R.map(q=>q.key===f?{...q,status:"error",error:Q.message}:q))}}},[C,n,v,_,g,F]),I=G(e=>{E(o=>o.filter(s=>s.key!==e))},[]),ee=()=>{let e,o;if(j?(o={name:"SuccessBanner",slot:t==null?void 0:t.SuccessBanner,context:{message:j},"data-testid":"form-success-banner"},e={type:"success",variant:"primary",icon:a(Fe,{}),heading:n.successHeader,description:j,className:"request-negotiable-quote-form__success-banner"}):y&&(o={name:"ErrorBanner",slot:t==null?void 0:t.ErrorBanner,context:{message:y},"data-testid":"form-error-banner"},e={type:"error",variant:"primary",icon:a(Qe,{}),heading:n.errorHeader,description:y,className:"request-negotiable-quote-form__error-banner"}),o&&e)return a(b,{...o,children:a(qe,{...e})})},O=e=>{u({});const o=e.target.closest("form"),s=J(o);Object.keys(s).length>0&&(u(s),d==null||d(s))},te=e=>{var W;e.preventDefault(),l(!0);const o=e.target,r={...J(o),...h};if(Object.keys(r).length>0){d==null||d(r);return}const m=e.submitter,f=me(o);X(f.comment),Y(f.quoteName);const Q=((W=m==null?void 0:m.dataset)==null?void 0:W.draft)==="true"||!1,R=F.filter(A=>A.status==="success").map(A=>({key:A.key})),q={cartId:S,quoteName:f.quoteName,comment:f.comment,attachments:R,isDraft:Q};let M,$;Q?(M=D??H,$=n.draftSuccess):(M=B??H,$=n.submitSuccess),M(q).then(()=>{Z($)}).catch(A=>{k(A.message)})},ae=a(b,{name:"Title",slot:t==null?void 0:t.Title,context:{text:n.title},children:a("span",{"data-testid":"form-title",children:n.title})}),re=a(b,{name:"CommentField",slot:t==null?void 0:t.CommentField,context:{value:w,required:!0,errorMessage:h.comment,setFormErrors:u,isFormDisabled:i},children:a(ce,{name:"comment",value:w,label:n.comment,required:!0,autoComplete:"off","data-testid":"form-comment-field",errorMessage:h.comment,disabled:i})}),oe=a(b,{name:"QuoteNameField",slot:t==null?void 0:t.QuoteNameField,context:{value:P,required:!0,errorMessage:h.quoteName,setFormErrors:u,isFormDisabled:i},children:a(de,{error:h.quoteName,disabled:i,children:a(le,{value:P,name:"quoteName",floatingLabel:n.quoteName,required:!0,autoComplete:"off","data-testid":"form-quote-name-field"})})}),ne=a(b,{name:"AttachFileField",slot:t==null?void 0:t.AttachFileField,context:{onChange:V,formErrors:h,isFormDisabled:i,attachedFiles:F},children:a(fe,{multiple:!0,onChange:e=>{const o=e.target,s=o==null?void 0:o.files,r=s?Array.from(s):[];r.length>0&&V(r)},icon:a(pe,{}),disabled:i,"data-testid":"form-attach-file-field",accept:g==null?void 0:g.join(",")})}),ie=F.length>0?a(b,{name:"AttachedFilesList",slot:t==null?void 0:t.AttachedFilesList,context:{files:F,onRemove:I,disabled:i},children:a(ve,{files:F,onRemove:I,disabled:i})}):void 0,se=a(b,{name:"RequestButton",slot:t==null?void 0:t.RequestButton,context:{requestNegotiableQuote:H,formErrors:h,isFormDisabled:i,setIsFormDisabled:l},children:a(T,{type:"submit","data-testid":"form-request-button",onClick:O,disabled:i,children:n.requestCta})}),ue=a(b,{name:"SaveDraftButton",slot:t==null?void 0:t.SaveDraftButton,context:{requestNegotiableQuote:H,formErrors:h,isFormDisabled:i,setIsFormDisabled:l},children:a(T,{type:"submit","data-draft":"true",variant:"secondary","data-testid":"form-save-draft-button",onClick:O,disabled:i,children:n.saveDraftCta})});return a(xe,{title:ae,banner:ee(),commentField:re,quoteNameField:oe,attachFile:ne,attachedFilesList:ie,requestButton:se,saveButton:ue,onSubmit:te,className:z,disabled:i,"data-testid":"form-container"})};export{We as RequestNegotiableQuoteForm,We 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 enableFileUpload?: boolean;\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 enableFileUpload = true,\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: enableFileUpload ? attachmentKeys : undefined,\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 = enableFileUpload ? (\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 ) : undefined;\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","enableFileUpload","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","Add","requestButtonNode","Button","saveButtonNode","RequestNegotiableQuoteFormComponent"],"mappings":"kpBACA,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,EAA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AQ,YACR,cAAY,yBACZ,QAAS1B,EACT,SAAUxB,EAET,SAAAE,EAAW,YAAA,CAAA,CACd,CAAA,EAIJ,OACEzB,EAAC2E,GAAA,CACC,MAAOZ,EACP,OAAQvB,EAAA,EACR,aAAcwB,EACd,eAAgBE,EAChB,WAAYG,EACZ,cAAeG,GACf,WAAYE,GACZ,SAAUvB,EACV,UAAA9D,EACA,SAAUkC,EACV,cAAY,gBAAA,CAAA,CAGlB","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"RequestNegotiableQuoteForm.js","sources":["/@dropins/storefront-quote-management/src/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.tsx","/@dropins/storefront-quote-management/src/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.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/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 attachedFilesList?: 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 attachedFilesList,\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 {attachedFilesList &&\n <VComponent\n node={attachedFilesList}\n className={classes(['request-negotiable-quote-form__attached-files-list'])}\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';\nimport { AttachedFilesList, AttachedFile } from '@/quote-management/components';\nimport { formatFileSize, validateFileType, validateFileSize } from '@/quote-management/utils/fileUtils';\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 maxFiles?: number;\n maxFileSize?: number;\n acceptedFileTypes?: 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 attachedFiles: AttachedFile[]\n }>;\n AttachedFilesList?: SlotProps<{\n files: AttachedFile[];\n onRemove: (key: string) => void;\n disabled?: 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 maxFiles,\n maxFileSize,\n acceptedFileTypes,\n}) => {\n const [comment, setComment] = useState<string | undefined>(undefined);\n const [quoteName, setQuoteName] = useState<string | undefined>(undefined);\n const [attachedFiles, setAttachedFiles] = useState<AttachedFile[]>([]);\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 maxFilesExceeded: 'NegotiableQuote.Request.maxFilesExceeded',\n maxFileSizeExceeded: 'NegotiableQuote.Request.maxFileSizeExceeded',\n invalidFileType: 'NegotiableQuote.Request.invalidFileType',\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 else {\n setIsFormDisabled(false);\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 else {\n setIsFormDisabled(false);\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 // Check maxFiles limit\n if (maxFiles && attachedFiles.length + files.length > maxFiles) {\n setFormErrors(prev => ({\n ...prev,\n attachments: dictionary.maxFilesExceeded.replace('{maxFiles}', String(maxFiles))\n }));\n return;\n }\n\n // Validate file types and sizes before uploading\n for (const file of files) {\n if (maxFileSize && !validateFileSize(file.size, maxFileSize)) {\n setFormErrors(prev => ({\n ...prev,\n attachments: dictionary.maxFileSizeExceeded.replace('{maxSize}', formatFileSize(maxFileSize))\n }));\n return;\n }\n\n if (acceptedFileTypes && !validateFileType(file.type, acceptedFileTypes)) {\n setFormErrors(prev => ({ ...prev, attachments: dictionary.invalidFileType }));\n return;\n }\n }\n\n // Set form errors without attachments key\n setFormErrors(prev => { \n // Disable eslint rule for unused attachments key\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { attachments, ...rest } = prev;\n return rest;\n });\n\n\n if (onAttachFiles) {\n onAttachFiles(files)?.catch(() => {\n setFormErrors(prev => ({ ...prev, attachments: dictionary.attachmentsError }));\n });\n return;\n }\n\n // Add files with 'uploading' status\n const newFiles: AttachedFile[] = files.map(file => ({\n key: `temp-${Date.now()}-${Math.random()}-${file.name}`,\n name: file.name,\n size: file.size,\n status: 'uploading',\n }));\n\n setAttachedFiles(prev => [...prev, ...newFiles]);\n\n // Upload each file and update its status\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const tempKey = newFiles[i].key;\n\n try {\n const result = await uploadFile(file);\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, key: result.key, status: 'success' }\n : f\n ));\n } catch (error) {\n setFormErrors(prev => ({ ...prev, attachments: (error as Error).message }));\n setAttachedFiles(prev => prev.map(f =>\n f.key === tempKey\n ? { ...f, status: 'error', error: (error as Error).message }\n : f\n ));\n }\n }\n }, [onAttachFiles, dictionary, maxFiles, maxFileSize, acceptedFileTypes, attachedFiles]);\n\n const handleRemoveFile = useCallback((key: string) => {\n setAttachedFiles(prev => prev.filter(f => f.key !== key));\n }, []);\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 // Only include successfully uploaded files\n const successfulAttachments = attachedFiles\n .filter(f => f.status === 'success')\n .map(f => ({ key: f.key }));\n\n const contextData: RequestNegotiableQuoteInput = {\n cartId: cartId!,\n quoteName: formValues.quoteName,\n comment: formValues.comment,\n attachments: successfulAttachments,\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, attachedFiles }}\n >\n <InputFile\n multiple\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 accept={acceptedFileTypes?.join(',')}\n />\n </Slot>\n );\n\n const attachedFilesListNode = attachedFiles.length > 0 ? (\n <Slot\n name=\"AttachedFilesList\"\n slot={slots?.AttachedFilesList}\n context={{ files: attachedFiles, onRemove: handleRemoveFile, disabled: isFormDisabled }}\n >\n <AttachedFilesList\n files={attachedFiles}\n onRemove={handleRemoveFile}\n disabled={isFormDisabled}\n />\n </Slot>\n ) : undefined;\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 attachedFilesList={attachedFilesListNode}\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":["RequestNegotiableQuoteForm","className","title","banner","commentField","quoteNameField","attachFile","attachedFilesList","requestButton","saveButton","onSubmit","props","jsxs","classes","jsx","VComponent","cartId","slots","onRequestNegotiableQuote","onSaveNegotiableQuote","onAttachFiles","onSubmitErrors","onError","maxFiles","maxFileSize","acceptedFileTypes","comment","setComment","useState","quoteName","setQuoteName","attachedFiles","setAttachedFiles","error","setError","formErrors","setFormErrors","success","setSuccess","isFormDisabled","setIsFormDisabled","dictionary","useText","useEffect","permissionsEvent","events","permissions","authenticatedEvent","authenticated","handleAttachFiles","useCallback","files","prev","file","validateFileSize","formatFileSize","validateFileType","attachments","rest","_a","newFiles","i","tempKey","result","uploadFile","f","handleRemoveFile","key","getBannerNode","inlineAlertProps","slotProps","CheckWithCircle","WarningFilled","Slot","InLineAlert","validateParentForm","closestForm","getFormErrors","formSubmitHandler","form","mergedFormErrors","buttonTarget","formValues","getFormValues","isDraft","successfulAttachments","contextData","submitHandler","successMessage","requestNegotiableQuote","titleNode","commentFieldNode","TextArea","quoteNameFieldNode","Field","Input","attachFileNode","InputFile","target","fileList","Add","attachedFilesListNode","AttachedFilesList","requestButtonNode","Button","saveButtonNode","RequestNegotiableQuoteFormComponent"],"mappings":"omCA0BO,MAAMA,GAAiF,CAAC,CAC7F,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,aAAAC,EACA,eAAAC,EACA,WAAAC,EACA,kBAAAC,E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AAOiD,GAAA,EAAI,EACX,SAAU7D,EACV,cAAY,yBACZ,OAAQd,GAAA,YAAAA,EAAmB,KAAK,IAAG,CAAA,CACrC,CAAA,EAIE4E,GAAwBtE,EAAc,OAAS,EACnDjB,EAAC2D,EAAA,CACC,KAAK,oBACL,KAAMxD,GAAA,YAAAA,EAAO,kBACb,QAAS,CAAE,MAAOc,EAAe,SAAUmC,EAAkB,SAAU3B,CAAA,EAEvE,SAAAzB,EAACwF,GAAA,CACC,MAAOvE,EACP,SAAUmC,EACV,SAAU3B,CAAA,CAAA,CACZ,CAAA,EAEA,OAEEgE,GACJzF,EAAC2D,EAAA,CACC,KAAK,gBACL,KAAMxD,GAAA,YAAAA,EAAO,cACb,QACE,CACE,uBAAAwE,EACA,WAAAtD,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAA1B,EAAC0F,EAAA,CACC,KAAK,SACL,cAAY,sBACZ,QAAS7B,EACT,SAAUpC,EAET,SAAAE,EAAW,UAAA,CAAA,CACd,CAAA,EAIEgE,GACJ3F,EAAC2D,EAAA,CACC,KAAK,kBACL,KAAMxD,GAAA,YAAAA,EAAO,gBACb,QACE,CACE,uBAAAwE,EACA,WAAAtD,EACA,eAAAI,EACA,kBAAAC,CAAA,EAIJ,SAAA1B,EAAC0F,EAAA,CACC,KAAK,SACL,aAAW,OACX,QAAQ,YACR,cAAY,yBACZ,QAAS7B,EACT,SAAUpC,EAET,SAAAE,EAAW,YAAA,CAAA,CACd,CAAA,EAIJ,OACE3B,EAAC4F,GAAA,CACC,MAAOhB,GACP,OAAQtB,GAAA,EACR,aAAcuB,GACd,eAAgBE,GAChB,WAAYG,GACZ,kBAAmBK,GACnB,cAAeE,GACf,WAAYE,GACZ,SAAU3B,GACV,UAAA7E,EACA,SAAUsC,EACV,cAAY,gBAAA,CAAA,CAGlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { NegotiableQuoteModel } from '../../data/models/negotiable-quote-model';
|
|
4
|
+
|
|
5
|
+
export interface ShippingAddressDisplayProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
|
|
6
|
+
quoteData?: NegotiableQuoteModel;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ShippingAddressDisplay: Container<ShippingAddressDisplayProps>;
|
|
10
|
+
//# sourceMappingURL=ShippingAddressDisplay.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 { ShippingAddressDisplay } from './ShippingAddressDisplay';
|
|
10
|
+
export type { ShippingAddressDisplayProps } from './ShippingAddressDisplay';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ShippingAddressDisplay/index'
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{S as d}from"../chunks/ShippingAddressDisplay.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";export{d as ShippingAddressDisplay};
|
|
4
|
+
//# sourceMappingURL=ShippingAddressDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShippingAddressDisplay.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/containers/index.d.ts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
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
|
+
*******************************************************************/
|
|
1
9
|
export * from './RequestNegotiableQuoteForm';
|
|
10
|
+
export * from './ManageNegotiableQuote';
|
|
11
|
+
export * from './ItemsQuoted';
|
|
12
|
+
export * from './OrderSummary';
|
|
13
|
+
export * from './OrderSummaryLine';
|
|
14
|
+
export * from './QuoteCommentsList';
|
|
15
|
+
export * from './QuoteHistoryLog';
|
|
16
|
+
export * from './QuoteSummaryList';
|
|
17
|
+
export * from './QuotesListTable';
|
|
18
|
+
export * from './ShippingAddressDisplay';
|
|
19
|
+
export * from './ManageNegotiableQuoteTemplate';
|
|
20
|
+
export * from './ItemsQuotedTemplate';
|
|
21
|
+
export * from './QuoteTemplateCommentsList';
|
|
22
|
+
export * from './QuoteTemplateHistoryLog';
|
|
23
|
+
export * from './QuoteTemplatesListTable';
|
|
2
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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 downloadableCartItem: NegotiableQuoteCartItem;
|
|
7
|
+
export declare const base: NegotiableQuoteModel;
|
|
8
|
+
//# sourceMappingURL=negotiableQuoteModel.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NegotiableQuoteTemplatesListModel } from '../negotiable-quote-template-model';
|
|
2
|
+
|
|
3
|
+
export declare const quoteTemplatesListData: NegotiableQuoteTemplatesListModel;
|
|
4
|
+
export declare const emptyQuoteTemplatesListData: NegotiableQuoteTemplatesListModel;
|
|
5
|
+
//# sourceMappingURL=negotiableQuoteTemplatesListModel.d.ts.map
|
package/data/models/index.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
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 './negotiable-quote-model';
|
|
10
|
+
export * from './negotiable-quote-template-model';
|
|
11
|
+
export * from './store-config-model';
|
|
2
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,51 +1,286 @@
|
|
|
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 interface ShippingAddress {
|
|
10
|
+
/**
|
|
11
|
+
* The unique string identifier of the address
|
|
12
|
+
*/
|
|
13
|
+
uid?: string;
|
|
14
|
+
firstname: string;
|
|
15
|
+
lastname: string;
|
|
16
|
+
company?: string;
|
|
17
|
+
street: string[];
|
|
18
|
+
city: string;
|
|
19
|
+
region?: {
|
|
20
|
+
code: string;
|
|
21
|
+
label: string;
|
|
22
|
+
regionId: number;
|
|
23
|
+
};
|
|
24
|
+
postcode: string;
|
|
25
|
+
country: {
|
|
26
|
+
code: string;
|
|
27
|
+
label: string;
|
|
28
|
+
};
|
|
29
|
+
telephone: string;
|
|
30
|
+
}
|
|
1
31
|
export interface NegotiableQuoteModel {
|
|
2
32
|
uid: string;
|
|
33
|
+
name: string;
|
|
3
34
|
createdAt: string;
|
|
4
|
-
|
|
35
|
+
salesRepName: string;
|
|
36
|
+
expirationDate: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
status: NegotiableQuoteStatus;
|
|
39
|
+
isVirtual: boolean;
|
|
5
40
|
buyer: {
|
|
6
41
|
firstname: string;
|
|
7
42
|
lastname: string;
|
|
8
43
|
};
|
|
9
|
-
|
|
44
|
+
templateName?: string;
|
|
45
|
+
totalQuantity: number;
|
|
46
|
+
comments?: {
|
|
10
47
|
uid: string;
|
|
11
48
|
createdAt: string;
|
|
12
49
|
author: {
|
|
13
50
|
firstname: string;
|
|
14
51
|
lastname: string;
|
|
15
52
|
};
|
|
53
|
+
text: string;
|
|
16
54
|
attachments?: {
|
|
17
55
|
name: string;
|
|
18
56
|
url: string;
|
|
19
57
|
}[];
|
|
20
58
|
}[];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
history?: NegotiableQuoteHistoryEntry[];
|
|
60
|
+
prices: {
|
|
61
|
+
appliedDiscounts?: Discount[];
|
|
62
|
+
appliedTaxes?: Tax[];
|
|
63
|
+
discount?: Currency;
|
|
64
|
+
grandTotal?: Currency;
|
|
65
|
+
grandTotalExcludingTax?: Currency;
|
|
66
|
+
shippingExcludingTax?: Currency;
|
|
67
|
+
shippingIncludingTax?: Currency;
|
|
68
|
+
subtotalExcludingTax?: Currency;
|
|
69
|
+
subtotalIncludingTax?: Currency;
|
|
70
|
+
subtotalWithDiscountExcludingTax?: Currency;
|
|
71
|
+
totalTax?: Currency;
|
|
72
|
+
};
|
|
73
|
+
items: NegotiableQuoteCartItem[];
|
|
74
|
+
shippingAddresses?: ShippingAddress[];
|
|
75
|
+
canCheckout: boolean;
|
|
76
|
+
canSendForReview: boolean;
|
|
77
|
+
lockedForEditing?: boolean;
|
|
78
|
+
canDelete: boolean;
|
|
79
|
+
canClose: boolean;
|
|
80
|
+
canUpdateQuote: boolean;
|
|
81
|
+
readOnly: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface ConfigurableOption {
|
|
84
|
+
optionLabel: string;
|
|
85
|
+
valueLabel: string;
|
|
86
|
+
}
|
|
87
|
+
export interface BundleOption {
|
|
88
|
+
label: string;
|
|
89
|
+
values: {
|
|
90
|
+
label: string;
|
|
34
91
|
quantity: number;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
originalPrice: Currency;
|
|
93
|
+
price: Currency;
|
|
94
|
+
}[];
|
|
95
|
+
}
|
|
96
|
+
export interface CustomizableOption {
|
|
97
|
+
type: string;
|
|
98
|
+
label: string;
|
|
99
|
+
values: {
|
|
100
|
+
label: string;
|
|
101
|
+
value: string;
|
|
102
|
+
}[];
|
|
103
|
+
}
|
|
104
|
+
export interface NegotiableQuoteCartItem {
|
|
105
|
+
itemType: string;
|
|
106
|
+
uid: string;
|
|
107
|
+
product: {
|
|
108
|
+
uid: string;
|
|
109
|
+
sku: string;
|
|
110
|
+
name: string;
|
|
111
|
+
templateId?: string;
|
|
112
|
+
templateName?: string;
|
|
113
|
+
priceRange: {
|
|
114
|
+
maximumPrice: {
|
|
115
|
+
regularPrice: Currency;
|
|
47
116
|
};
|
|
48
117
|
};
|
|
118
|
+
};
|
|
119
|
+
image: ItemImage;
|
|
120
|
+
links?: ItemLinks;
|
|
121
|
+
discounted: boolean;
|
|
122
|
+
discountedTotal: Currency;
|
|
123
|
+
catalogDiscount: {
|
|
124
|
+
amountOff: number;
|
|
125
|
+
percentOff: number;
|
|
126
|
+
};
|
|
127
|
+
discounts: {
|
|
128
|
+
label: string;
|
|
129
|
+
value: string;
|
|
130
|
+
amount: Currency;
|
|
49
131
|
}[];
|
|
132
|
+
discountPercentage?: number;
|
|
133
|
+
insufficientQuantity?: boolean;
|
|
134
|
+
outOfStock?: boolean;
|
|
135
|
+
stockStatus: string;
|
|
136
|
+
quantity: number;
|
|
137
|
+
prices: {
|
|
138
|
+
regularPrice: Currency;
|
|
139
|
+
priceIncludingTax: Currency;
|
|
140
|
+
originalItemPrice: Currency;
|
|
141
|
+
originalRowTotal: Currency;
|
|
142
|
+
rowTotal: Currency;
|
|
143
|
+
rowTotalIncludingTax: Currency;
|
|
144
|
+
};
|
|
145
|
+
savingsAmount?: Currency;
|
|
146
|
+
configurableOptions?: ConfigurableOption[];
|
|
147
|
+
bundleOptions?: BundleOption[];
|
|
148
|
+
customizableOptions?: CustomizableOption[];
|
|
149
|
+
noteFromBuyer?: ItemNote[];
|
|
150
|
+
noteFromSeller?: ItemNote[];
|
|
151
|
+
}
|
|
152
|
+
interface ItemImage {
|
|
153
|
+
src: string;
|
|
154
|
+
alt: string;
|
|
155
|
+
}
|
|
156
|
+
interface ItemLinks {
|
|
157
|
+
count: number;
|
|
158
|
+
result: string;
|
|
159
|
+
}
|
|
160
|
+
export interface ItemNote {
|
|
161
|
+
createdAt: string;
|
|
162
|
+
creatorId: number;
|
|
163
|
+
creatorType: number;
|
|
164
|
+
negotiableQuoteItemUid: string;
|
|
165
|
+
note: string;
|
|
166
|
+
noteUid: string;
|
|
167
|
+
}
|
|
168
|
+
export interface Currency {
|
|
169
|
+
value: number;
|
|
170
|
+
currency: string;
|
|
171
|
+
}
|
|
172
|
+
export interface Tax {
|
|
173
|
+
amount: Currency;
|
|
174
|
+
label: string;
|
|
175
|
+
}
|
|
176
|
+
export interface Discount {
|
|
177
|
+
amount: Currency;
|
|
178
|
+
label: string;
|
|
179
|
+
coupon?: Coupon;
|
|
180
|
+
}
|
|
181
|
+
export interface Coupon {
|
|
182
|
+
code: string;
|
|
183
|
+
}
|
|
184
|
+
export interface NegotiableQuoteListEntry {
|
|
185
|
+
uid: string;
|
|
186
|
+
name: string;
|
|
187
|
+
createdAt: string;
|
|
188
|
+
updatedAt: string;
|
|
189
|
+
status: NegotiableQuoteStatus;
|
|
190
|
+
buyer: {
|
|
191
|
+
firstname: string;
|
|
192
|
+
lastname: string;
|
|
193
|
+
};
|
|
194
|
+
templateName: string;
|
|
195
|
+
prices: {
|
|
196
|
+
grandTotal: Currency;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export interface NegotiableQuotesListModel {
|
|
200
|
+
items: NegotiableQuoteListEntry[];
|
|
201
|
+
pageInfo: {
|
|
202
|
+
currentPage: number;
|
|
203
|
+
pageSize: number;
|
|
204
|
+
totalPages: number;
|
|
205
|
+
};
|
|
206
|
+
totalCount: number;
|
|
207
|
+
paginationInfo?: PaginationInfo;
|
|
208
|
+
sortFields?: {
|
|
209
|
+
default: string;
|
|
210
|
+
options: Array<{
|
|
211
|
+
label: string;
|
|
212
|
+
value: string;
|
|
213
|
+
}>;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export interface NegotiableQuoteHistoryEntry {
|
|
217
|
+
author: {
|
|
218
|
+
firstname: string;
|
|
219
|
+
lastname: string;
|
|
220
|
+
};
|
|
221
|
+
changeType: NegotiableQuoteHistoryEntryChangeType;
|
|
222
|
+
changes: {
|
|
223
|
+
commentAdded?: {
|
|
224
|
+
comment: string;
|
|
225
|
+
};
|
|
226
|
+
customChanges?: {
|
|
227
|
+
new_value: string;
|
|
228
|
+
old_value: string;
|
|
229
|
+
title: string;
|
|
230
|
+
};
|
|
231
|
+
expiration?: {
|
|
232
|
+
newExpiration: string;
|
|
233
|
+
oldExpiration: string;
|
|
234
|
+
};
|
|
235
|
+
productsRemoved?: {
|
|
236
|
+
productsRemovedFromCatalog: string[];
|
|
237
|
+
productsRemovedFromQuote?: {
|
|
238
|
+
uid: string;
|
|
239
|
+
name: string;
|
|
240
|
+
sku: string;
|
|
241
|
+
quantity: number;
|
|
242
|
+
}[];
|
|
243
|
+
};
|
|
244
|
+
statuses?: {
|
|
245
|
+
changes: {
|
|
246
|
+
newStatus: string;
|
|
247
|
+
oldStatus: string;
|
|
248
|
+
}[];
|
|
249
|
+
};
|
|
250
|
+
total?: {
|
|
251
|
+
newPrice: Currency;
|
|
252
|
+
oldPrice: Currency;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
createdAt: string;
|
|
256
|
+
uid: string;
|
|
257
|
+
}
|
|
258
|
+
export declare enum NegotiableQuoteHistoryEntryChangeType {
|
|
259
|
+
CREATED = "CREATED",
|
|
260
|
+
UPDATED = "UPDATED",
|
|
261
|
+
CLOSED = "CLOSED",
|
|
262
|
+
UPDATED_BY_SYSTEM = "UPDATED_BY_SYSTEM"
|
|
263
|
+
}
|
|
264
|
+
export declare enum NegotiableQuoteStatus {
|
|
265
|
+
NEW = "NEW",
|
|
266
|
+
SUBMITTED = "SUBMITTED",
|
|
267
|
+
PENDING = "PENDING",
|
|
268
|
+
UPDATED = "UPDATED",
|
|
269
|
+
OPEN = "OPEN",
|
|
270
|
+
ORDERED = "ORDERED",
|
|
271
|
+
CLOSED = "CLOSED",
|
|
272
|
+
DECLINED = "DECLINED",
|
|
273
|
+
EXPIRED = "EXPIRED",
|
|
274
|
+
DRAFT = "DRAFT"
|
|
275
|
+
}
|
|
276
|
+
export interface PaginationInfo {
|
|
277
|
+
currentPage: number;
|
|
278
|
+
totalCount: number;
|
|
279
|
+
pageSize: number;
|
|
280
|
+
startItem: number;
|
|
281
|
+
endItem: number;
|
|
282
|
+
totalPages: number;
|
|
283
|
+
pageSizeOptions?: number[];
|
|
50
284
|
}
|
|
285
|
+
export {};
|
|
51
286
|
//# sourceMappingURL=negotiable-quote-model.d.ts.map
|