@dropins/storefront-quote-management 0.0.1-alpha8 → 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/ShippingMethodFragment.d.ts +10 -0
- package/api/index.d.ts +33 -1
- package/api/initialize/initialize.d.ts +2 -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 +3 -0
- 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 +342 -7
- package/chunks/NegotiableQuoteFragment.js.map +1 -1
- 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 +35 -5
- package/chunks/negotiableQuotes.js.map +1 -1
- package/chunks/openQuoteTemplate.js +31 -0
- package/chunks/openQuoteTemplate.js.map +1 -0
- package/chunks/requestNegotiableQuote.js +3 -3
- 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/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 -1
- 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 +9 -9
- package/containers/QuotesListTable.js +1 -1
- package/containers/QuotesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +10 -0
- 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 +21 -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__/storeConfigModel.d.ts +5 -0
- package/data/models/index.d.ts +10 -1
- package/data/models/negotiable-quote-model.d.ts +228 -31
- 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 +590 -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 +8 -0
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/useQuoteSummaryData.d.ts +10 -0
- package/i18n/en_US.json.d.ts +346 -0
- 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 -3
- 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 +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 } 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};"],"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","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":"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,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,0JAA2J,OAAQ,cAAc,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,qCAAsC,OAAQ,cAAc,CAAE,CAAC,ECAxlBE,GAAoBH,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,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AY,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,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,EACA,cAAAC,EACA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AAI,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,3 +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';
|
|
2
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';
|
|
3
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,3 +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
|
+
*******************************************************************/
|
|
2
9
|
export * from './negotiable-quote-model';
|
|
10
|
+
export * from './negotiable-quote-template-model';
|
|
11
|
+
export * from './store-config-model';
|
|
3
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,13 +1,48 @@
|
|
|
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;
|
|
3
33
|
name: string;
|
|
4
|
-
createdAt
|
|
5
|
-
|
|
34
|
+
createdAt: string;
|
|
35
|
+
salesRepName: string;
|
|
36
|
+
expirationDate: string;
|
|
37
|
+
updatedAt: string;
|
|
6
38
|
status: NegotiableQuoteStatus;
|
|
39
|
+
isVirtual: boolean;
|
|
7
40
|
buyer: {
|
|
8
41
|
firstname: string;
|
|
9
42
|
lastname: string;
|
|
10
43
|
};
|
|
44
|
+
templateName?: string;
|
|
45
|
+
totalQuantity: number;
|
|
11
46
|
comments?: {
|
|
12
47
|
uid: string;
|
|
13
48
|
createdAt: string;
|
|
@@ -15,42 +50,154 @@ export interface NegotiableQuoteModel {
|
|
|
15
50
|
firstname: string;
|
|
16
51
|
lastname: string;
|
|
17
52
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
product: {
|
|
21
|
-
uid: string;
|
|
22
|
-
sku: string;
|
|
53
|
+
text: string;
|
|
54
|
+
attachments?: {
|
|
23
55
|
name: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
56
|
+
url: string;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
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
|
-
|
|
47
|
-
|
|
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;
|
|
48
116
|
};
|
|
49
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;
|
|
50
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
|
+
};
|
|
51
198
|
}
|
|
52
199
|
export interface NegotiableQuotesListModel {
|
|
53
|
-
items:
|
|
200
|
+
items: NegotiableQuoteListEntry[];
|
|
54
201
|
pageInfo: {
|
|
55
202
|
currentPage: number;
|
|
56
203
|
pageSize: number;
|
|
@@ -66,7 +213,56 @@ export interface NegotiableQuotesListModel {
|
|
|
66
213
|
}>;
|
|
67
214
|
};
|
|
68
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
|
+
}
|
|
69
264
|
export declare enum NegotiableQuoteStatus {
|
|
265
|
+
NEW = "NEW",
|
|
70
266
|
SUBMITTED = "SUBMITTED",
|
|
71
267
|
PENDING = "PENDING",
|
|
72
268
|
UPDATED = "UPDATED",
|
|
@@ -86,4 +282,5 @@ export interface PaginationInfo {
|
|
|
86
282
|
totalPages: number;
|
|
87
283
|
pageSizeOptions?: number[];
|
|
88
284
|
}
|
|
285
|
+
export {};
|
|
89
286
|
//# sourceMappingURL=negotiable-quote-model.d.ts.map
|