@dropins/storefront-requisition-list 1.0.0-beta1 → 1.0.0-beta2
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.js.map +1 -1
- package/chunks/PageSizePicker.js.map +1 -1
- package/chunks/RequisitionListActions.js.map +1 -1
- package/chunks/RequisitionListForm.js.map +1 -1
- package/chunks/RequisitionListForm2.js.map +1 -1
- package/chunks/RequisitionListHeader.js +1 -1
- package/chunks/RequisitionListHeader.js.map +1 -1
- package/chunks/RequisitionListModal.js.map +1 -1
- package/chunks/RequisitionListView.js.map +1 -1
- package/chunks/addRequisitionListItemsToCart.js.map +1 -1
- package/chunks/deleteRequisitionList.js.map +1 -1
- package/chunks/getRequisitionLists.js.map +1 -1
- package/chunks/state.js.map +1 -1
- package/chunks/updateRequisitionList.js.map +1 -1
- package/containers/RequisitionListGrid.js +1 -1
- package/containers/RequisitionListGrid.js.map +1 -1
- package/containers/RequisitionListHeader/RequisitionListHeader.d.ts +5 -0
- package/containers/RequisitionListHeader.js +1 -1
- package/containers/RequisitionListSelector.js +2 -2
- package/containers/RequisitionListSelector.js.map +1 -1
- package/containers/RequisitionListView.js +1 -1
- package/containers/RequisitionListView.js.map +1 -1
- package/package.json +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n if (errors) {\n const missingField = errors.some(\n (error) =>\n (error.message &&\n error.message.includes(\n 'Cannot query field \"is_requisition_list_active\"'\n )) ||\n error.message.includes('Cannot query field \"company_enabled\"')\n );\n if (missingField) {\n return false;\n }\n return handleFetchError(errors);\n }\n\n return data?.storeConfig;\n } catch {\n return {\n is_requisition_list_active: '0',\n company_enabled: false,\n } as StoreConfig;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n }),\n ],\n});\n\nexport const config = initialize.config;\n"],"names":["STORE_CONFIG_QUERY","getStoreConfig","errors","data","fetchGraphQl","error","handleFetchError","initialize","Initializer","config","defaultConfig","state","events","authenticated"],"mappings":"ihBAiBO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECMrBC,EAAiB,SAA0B,
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n if (errors) {\n const missingField = errors.some(\n (error) =>\n (error.message &&\n error.message.includes(\n 'Cannot query field \"is_requisition_list_active\"'\n )) ||\n error.message.includes('Cannot query field \"company_enabled\"')\n );\n if (missingField) {\n return false;\n }\n return handleFetchError(errors);\n }\n\n return data?.storeConfig;\n } catch {\n return {\n is_requisition_list_active: '0',\n company_enabled: false,\n } as StoreConfig;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n }),\n ],\n});\n\nexport const config = initialize.config;\n"],"names":["STORE_CONFIG_QUERY","getStoreConfig","errors","data","fetchGraphQl","error","handleFetchError","initialize","Initializer","config","defaultConfig","state","events","authenticated"],"mappings":"ihBAiBO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECMrBC,EAAiB,SAA0B,CACtD,GAAI,CACF,KAAM,CAAE,OAAAC,EAAQ,KAAAC,CAAA,EAAS,MAAMC,EAAaJ,EAAoB,CAC9D,MAAO,aAAA,CACR,EAED,OAAIE,EACmBA,EAAO,KACzBG,GACEA,EAAM,SACLA,EAAM,QAAQ,SACZ,iDAAA,GAEJA,EAAM,QAAQ,SAAS,sCAAsC,CAAA,EAGxD,GAEFC,EAAiBJ,CAAM,EAGzBC,GAAA,YAAAA,EAAM,WACf,MAAQ,CACN,MAAO,CACL,2BAA4B,IAC5B,gBAAiB,EAAA,CAErB,CACF,ECxBaI,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CACtB,MAAMC,EAAgB,CAAA,EAGjBC,EAAM,SACTA,EAAM,OAAS,MAAMV,EAAA,EAErBW,EAAO,KAAK,8BAA+BD,EAAM,MAAM,GAGzDJ,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe,GAAGD,EAAQ,CAC7D,EAEA,UAAW,IAAM,CACfG,EAAO,GAAG,gBAAkBC,GAAkB,CAC5CF,EAAM,cAAgBE,CACxB,CAAC,CAAA,CAEL,CAAC,EAEYJ,EAASF,EAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSizePicker.js","sources":["/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n"],"names":["PageSizePicker","currentPageSize","onPageSizeChange","disabled","pageSizeOptions","translations","useText","handlePageSizeChange","event","target","newPageSize","options","size","jsx","Picker"],"mappings":"mMA4BO,MAAMA,EAAiB,CAAC,CAC7B,gBAAAC,EACA,iBAAAC,EACA,SAAAC,EAAW,GACX,gBAAAC,EAAkB,CAAC,GAAI,GAAI,GAAI,GAAG,CACpC,IAA2B,CACzB,MAAMC,EAAeC,EAAQ,CAC3B,aAAc,6CAAA,CACf,EAEKC,EAAwBC,GAAiB,CAC7C,MAAMC,EAASD,EAAM,OACfE,EAAc,SAASD,EAAO,MAAO,EAAE,EAC7CP,EAAiBQ,CAAW,CAC9B,EAEMC,EAAUP,EAAgB,IAAKQ,IAAU,CAC7C,MAAOA,EAAK,
|
|
1
|
+
{"version":3,"file":"PageSizePicker.js","sources":["/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n"],"names":["PageSizePicker","currentPageSize","onPageSizeChange","disabled","pageSizeOptions","translations","useText","handlePageSizeChange","event","target","newPageSize","options","size","jsx","Picker"],"mappings":"mMA4BO,MAAMA,EAAiB,CAAC,CAC7B,gBAAAC,EACA,iBAAAC,EACA,SAAAC,EAAW,GACX,gBAAAC,EAAkB,CAAC,GAAI,GAAI,GAAI,GAAG,CACpC,IAA2B,CACzB,MAAMC,EAAeC,EAAQ,CAC3B,aAAc,6CAAA,CACf,EAEKC,EAAwBC,GAAiB,CAC7C,MAAMC,EAASD,EAAM,OACfE,EAAc,SAASD,EAAO,MAAO,EAAE,EAC7CP,EAAiBQ,CAAW,CAC9B,EAEMC,EAAUP,EAAgB,IAAKQ,IAAU,CAC7C,MAAOA,EAAK,SAAA,EACZ,KAAMA,EAAK,SAAA,CAAS,EACpB,EAEF,OACEC,EAACC,EAAA,CACC,SAAAX,EACA,cAAY,mBACZ,QAAQ,UACR,KAAK,SACL,MAAOF,EAAgB,SAAA,EACvB,QAAAU,EACA,aAAcJ,EACd,aAAYF,EAAa,YAAA,CAAA,CAG/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListActions.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.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","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n"],"names":["SvgAdd","props","React","RequisitionListActions","selectable","className","onAddNew","translations","useText","jsxs","classes","jsx","Icon","Add"],"mappings":"6SACA,MAAMA,EAAUC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,gBAAiB,YAAa,gCAAiC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,GAAI,
|
|
1
|
+
{"version":3,"file":"RequisitionListActions.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.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","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n"],"names":["SvgAdd","props","React","RequisitionListActions","selectable","className","onAddNew","translations","useText","jsxs","classes","jsx","Icon","Add"],"mappings":"6SACA,MAAMA,EAAUC,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,EC6B/8BC,EAET,CAAC,CAAE,WAAAC,EAAY,UAAAC,EAAW,SAAAC,KAAe,CAC3C,MAAMC,EAAeC,EAAQ,CAC3B,iBAAkB,gDAAA,CACnB,EAED,OACEC,EAAC,SAAA,CACC,KAAK,SACL,aAAYF,EAAa,iBACzB,KAAK,SACL,UAAWG,EAAQ,CACjB,2BACA,CAAC,uCAAwCN,CAAU,EACnDC,CAAA,CACD,EACD,cAAY,kCACZ,QAASC,EAET,SAAA,CAAAK,EAAC,OAAA,CACC,UAAU,kCACV,cAAY,uCAEX,SAAAJ,EAAa,gBAAA,CAAA,EAEhBI,EAACC,EAAA,CAAK,OAAQC,EAAK,KAAK,IAAA,CAAK,CAAA,CAAA,CAAA,CAGnC","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListForm.js","sources":["/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n"],"names":["DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onSubmit","onCancel","props","values","setValues","useState","touched","setTouched","isSubmitting","setIsSubmitting","translations","useText","validateName","name","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","handleSubmit","nameError","_a","title","jsxs","classes","jsx","ProgressSpinner","InLineAlert","Field","Input","TextArea","Button"],"mappings":"gWAoBO,MAAMA,EAAoB,GAKpBC,EAAkB,EAClBC,EAAkB,GAClBC,EAAyB,IAEzBC,EAAmB,+BCwBnBC,EAET,CAAC,CACH,UAAAC,EACA,KAAAC,EACA,cAAAC,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAG,EAC5C,MAAAC,EAAQ,KACR,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EACtBC,EAAoCP,CAAa,EAC7C,CAACQ,EAASC,CAAU,EAAIF,EAAS,CACrC,KAAM,EAAA,CACP,EACK,CAACG,EAAcC,CAAe,EAAIJ,EAAS,EAAK,EAEhDK,EAAeC,EAAQ,CAC3B,aAAc,mDACd,WAAY,iDACZ,cAAe,oDACf,cAAe,oDACf,sBAAuB,4DACvB,cAAe,oDACf,YAAa,kDACb,MAAO,4CACP,YAAa,kDACb,YAAa,iDAAA,CACd,EAGKC,EAAgBC,GAAyB,CACvC,MAAAC,EAAcD,EAAK,KAAK,EAE9B,OAAKC,EAIDA,EAAY,OAASvB,EAChBmB,EAAa,cAAc,QAChC,QACAnB,EAAgB,SAAS,CAC3B,EAGGG,EAAiB,KAAKoB,CAAW,EAI/B,GAHEJ,EAAa,sBAXbA,EAAa,aAexB,EAE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ACG,EAAM,CAAA,MAAOR,EAAW,SAAUf,EACjC,SAAAoB,EAACI,EAAA,CACC,GAAG,6BACH,KAAK,OACL,KAAK,OACL,cAAetB,EAAa,cAC5B,YAAaA,EAAa,YAC1B,UAAWlB,EACX,MAAOW,EAAO,KACd,SAAUY,EAAa,MAAM,EAC7B,OAAQK,EAAW,MAAM,CAAA,CAAA,EAE7B,EAEAQ,EAACG,EAAM,CAAA,SAAUvB,EACf,SAAAoB,EAACK,EAAA,CACC,GAAG,oCACH,KAAK,cACL,MAAOvB,EAAa,MACpB,YAAaA,EAAa,MAC1B,UAAWjB,EACX,MAAOU,EAAO,YACd,SAAUY,EAAa,aAAa,EACpC,OAAQK,EAAW,aAAa,CAAA,CAAA,EAEpC,EAEAM,EAAC,MAAI,CAAA,UAAU,iCACb,SAAA,CAAAE,EAACM,EAAA,CACC,KAAK,SACL,QAAQ,YACR,QAASjC,EACT,SAAUO,EACV,cAAY,+BAEX,SAAaE,EAAA,YAAA,CAChB,EACAkB,EAACM,EAAA,CACC,KAAK,SACL,SAAU1B,EACV,cAAY,6BAEX,SAAaE,EAAA,UAAA,CAAA,CAChB,CACF,CAAA,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"RequisitionListForm.js","sources":["/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n"],"names":["DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onSubmit","onCancel","props","values","setValues","useState","touched","setTouched","isSubmitting","setIsSubmitting","translations","useText","validateName","name","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","handleSubmit","nameError","_a","title","jsxs","classes","jsx","ProgressSpinner","InLineAlert","Field","Input","TextArea","Button"],"mappings":"gWAoBO,MAAMA,EAAoB,GAKpBC,EAAkB,EAClBC,EAAkB,GAClBC,EAAyB,IAEzBC,EAAmB,+BCwBnBC,EAET,CAAC,CACH,UAAAC,EACA,KAAAC,EACA,cAAAC,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAA,EACzC,MAAAC,EAAQ,KACR,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EACtBC,EAAoCP,CAAa,EAC7C,CAACQ,EAASC,CAAU,EAAIF,EAAS,CACrC,KAAM,EAAA,CACP,EACK,CAACG,EAAcC,CAAe,EAAIJ,EAAS,EAAK,EAEhDK,EAAeC,EAAQ,CAC3B,aAAc,mDACd,WAAY,iDACZ,cAAe,oDACf,cAAe,oDACf,sBAAuB,4DACvB,cAAe,oDACf,YAAa,kDACb,MAAO,4CACP,YAAa,kDACb,YAAa,iDAAA,CACd,EAGKC,EAAgBC,GAAyB,CAC7C,MAAMC,EAAcD,EAAK,KAAA,EAEzB,OAAKC,EAIDA,EAAY,OAASvB,EAChBmB,EAAa,cAAc,QAChC,QACAnB,EAAgB,SAAA,CAAS,EAIxBG,EAAiB,KAAKoB,CAAW,EAI/B,GAHEJ,EAAa,sBAXbA,EAAa,aAexB,EAEMK,EACHC,GAA4CC,GAAa,CACxD,MAAMC,EAASD,EAAE,OACjBb,EAAWe,IAAgB,CACzB,GAAGA,EACH,CAACH,CAAK,EAAGE,EAAO,KAAA,EAChB,CACJ,EAEIE,EAAcJ,GAA2C,IAAM,CACnET,EAAYc,IAAU,CAAE,GAAGA,EAAM,CAACL,CAAK,EAAG,EAAA,EAAO,CACnD,EAEMM,EAAe,MAAOL,GAAa,OASvC,GARAA,EAAE,eAAA,EAGFV,EAAW,CAAE,KA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ACH,KAAK,cACL,MAAOvB,EAAa,MACpB,YAAaA,EAAa,MAC1B,UAAWjB,EACX,MAAOU,EAAO,YACd,SAAUY,EAAa,aAAa,EACpC,OAAQK,EAAW,aAAa,CAAA,CAAA,EAEpC,EAEAM,EAAC,MAAA,CAAI,UAAU,iCACb,SAAA,CAAAE,EAACM,EAAA,CACC,KAAK,SACL,QAAQ,YACR,QAASjC,EACT,SAAUO,EACV,cAAY,+BAEX,SAAAE,EAAa,YAAA,CAAA,EAEhBkB,EAACM,EAAA,CACC,KAAK,SACL,SAAU1B,EACV,cAAY,6BAEX,SAAAE,EAAa,UAAA,CAAA,CAChB,CAAA,CACF,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListForm2.js","sources":["/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n"],"names":["CREATE_REQUISITION_LIST_MUTATION","REQUISITION_LIST_FRAGMENT","createRequisitionList","name","description","fetchGraphQl","errors","data","handleFetchError","_a","payload","transformRequisitionList","events","useRequisitionListForm","mode","requisitionListUid","onSuccess","onError","error","setError","useState","values","result","updateRequisitionList","e","msg","RequisitionListForm","defaultValues","onCancel","submit","jsx","RequisitionListFormComponent"],"mappings":"6RAmBO,MAAMA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB9CC,CAAyB;AAAA,ECXdC,EAAwB,MACnCC,EACAC,IAEOC,EAAaL,EAAkC,CACpD,UAAW,CACT,oBAAqBG,EACrB,2BAA4BC,CAAA,
|
|
1
|
+
{"version":3,"file":"RequisitionListForm2.js","sources":["/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n"],"names":["CREATE_REQUISITION_LIST_MUTATION","REQUISITION_LIST_FRAGMENT","createRequisitionList","name","description","fetchGraphQl","errors","data","handleFetchError","_a","payload","transformRequisitionList","events","useRequisitionListForm","mode","requisitionListUid","onSuccess","onError","error","setError","useState","values","result","updateRequisitionList","e","msg","RequisitionListForm","defaultValues","onCancel","submit","jsx","RequisitionListFormComponent"],"mappings":"6RAmBO,MAAMA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AAAT,EACA,SATiB,MAAOG,GAAsC,CAChE,MAAMQ,EAAOR,CAAM,CACrB,EAQI,SAAAO,CAAA,CAAA,CAGN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as m,jsx as
|
|
3
|
+
import{jsxs as m,jsx as t,Fragment as C}from"@dropins/tools/preact-jsx-runtime.js";import{useState as R,useCallback as h}from"@dropins/tools/preact-hooks.js";import{R as q}from"./RequisitionListModal.js";import{R as b}from"./RequisitionListForm.js";import{u as N}from"./updateRequisitionList.js";import{d as k}from"./deleteRequisitionList.js";import{useText as M}from"@dropins/tools/i18n.js";const x=({name:i,description:n,backLink:s,actions:e,className:f,...r})=>m("div",{...r,className:`requisition-list-header ${f||""}`,children:[s&&t("div",{className:"requisition-list-header__back",children:m("a",{href:s.url,className:"requisition-list-header__back-link",onClick:s.onClick,children:[t("span",{className:"requisition-list-header__back-arrow",children:"<"}),s.label]})}),m("div",{className:"requisition-list-header__main",children:[m("div",{className:"requisition-list-header__title-section",children:[t("h1",{className:"requisition-list-header__title",children:i}),n&&t("p",{className:"requisition-list-header__description",children:n})]}),e&&(e.onRename||e.onDelete)&&m("div",{className:"requisition-list-header__actions",children:[e.onRename&&t("a",{href:"#",onClick:d=>{var a;d.preventDefault(),(a=e.onRename)==null||a.call(e)},className:"requisition-list-header__action-link","data-testid":"rename-list-btn",children:e.renameLabel}),e.onDelete&&t("a",{href:"#",onClick:d=>{var a;d.preventDefault(),(a=e.onDelete)==null||a.call(e)},className:"requisition-list-header__action-link","data-testid":"delete-list-btn",children:e.deleteLabel})]})]})]}),j=({requisitionList:i,routeRequisitionListGrid:n,onUpdate:s,onAlert:e})=>{const[f,r]=R(!1),[d,a]=R(!1),[_,L]=R(!1),l=M({actionBackToRequisitionLists:"RequisitionList.RequisitionListView.actionBackToRequisitionLists",actionRename:"RequisitionList.RequisitionListView.actionRename",actionDeleteList:"RequisitionList.RequisitionListView.actionDeleteList",deleteListTitle:"RequisitionList.RequisitionListView.deleteListTitle",deleteListMessage:"RequisitionList.RequisitionListView.deleteListMessage",confirmAction:"RequisitionList.RequisitionListWrapper.confirmAction",cancelAction:"RequisitionList.RequisitionListWrapper.cancelAction",updateTitle:"RequisitionList.RequisitionListForm.updateTitle"}),g=h(()=>{r(!0)},[]),w=h(async u=>{var o,c;try{const p=await N(i.uid,u.name,u.description,(o=i.page_info)==null?void 0:o.page_size,(c=i.page_info)==null?void 0:c.current_page);p?(s==null||s(p),r(!1),e==null||e({action:"update",type:"success",context:"requisitionList"})):e==null||e({action:"update",type:"error",context:"requisitionList"})}catch{e==null||e({action:"update",type:"error",context:"requisitionList"})}},[i.uid,i.page_info,s,e]),y=h(()=>{a(!0)},[]),D=h(async()=>{L(!0);try{if(await k(i.uid)){const o={action:"delete",type:"success",context:"requisitionList"};try{localStorage.setItem("requisitionListPendingAlert",JSON.stringify(o))}catch{}if(n){const c=n();c&&typeof c=="string"&&(window.location.href=c)}}else e==null||e({action:"delete",type:"error",context:"requisitionList"})}catch{e==null||e({action:"delete",type:"error",context:"requisitionList"})}finally{L(!1),a(!1)}},[i.uid,n,e]);return m(C,{children:[t(x,{name:i.name,description:i.description,backLink:n?{url:"#",label:l.actionBackToRequisitionLists,onClick:u=>{u.preventDefault();const o=n();o&&typeof o=="string"&&(window.location.href=o)}}:void 0,actions:{onRename:g,onDelete:y,renameLabel:l.actionRename,deleteLabel:l.actionDeleteList}}),f&&t(q,{isOpen:f,isLoading:!1,title:l.updateTitle,modalContent:t(b,{mode:"update",defaultValues:{name:i.name,description:i.description||""},onSubmit:w,onCancel:()=>r(!1)}),handleModalOnClose:()=>r(!1)}),d&&t(q,{isOpen:d,isLoading:_,title:l.deleteListTitle,modalContent:l.deleteListMessage,confirmBtnCaption:l.confirmAction,closeBtnCaption:l.cancelAction,handleModalOnClose:()=>a(!1),handleModalOnConfirm:D})]})};export{j as R};
|
|
4
4
|
//# sourceMappingURL=RequisitionListHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListHeader.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\"><</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions && (actions.onRename || actions.onDelete) && (\n <div className=\"requisition-list-header__actions\">\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n}) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [requisitionList.uid, requisitionList.page_info, onUpdate]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n events.emit('requisitionList/alert', {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n });\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n events.emit('requisitionList/alert', {\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n events.emit('requisitionList/alert', {\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid]);\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n"],"names":["RequisitionListHeader","name","description","backLink","actions","className","props","jsxs","jsx","e","_a","requisitionList","routeRequisitionListGrid","onUpdate","showRenameModal","setShowRenameModal","useState","showDeleteModal","setShowDeleteModal","isDeleting","setIsDeleting","translations","useText","handleRename","useCallback","handleRenameSubmit","values","updatedList","updateRequisitionList","_b","events","handleDeleteList","handleDeleteConfirm","deleteRequisitionList","url","Fragment","RequisitionListHeaderComponent","result","RequisitionListModal","RequisitionListForm"],"mappings":"6bAsCa,MAAAA,EAET,CAAC,CAAE,KAAAC,EAAM,YAAAC,EAAa,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,GAAGC,KAEvDC,EAAC,OAAK,GAAGD,EAAO,UAAW,2BAA2BD,GAAa,EAAE,GAElE,SAAA,CACCF,GAAAK,EAAC,MAAI,CAAA,UAAU,gCACb,SAAAD,EAAC,IAAA,CACC,KAAMJ,EAAS,IACf,UAAU,qCACV,QAASA,EAAS,QAElB,SAAA,CAACK,EAAA,OAAA,CAAK,UAAU,sCAAsC,SAAI,IAAA,EACzDL,EAAS,KAAA,CAAA,CAAA,EAEd,EAIFI,EAAC,MAAI,CAAA,UAAU,gCACb,SAAA,CAACA,EAAA,MAAA,CAAI,UAAU,yCACb,SAAA,CAACC,EAAA,KAAA,CAAG,UAAU,iCAAkC,SAAKP,EAAA,EACpDC,GACCM,EAAC,IAAE,CAAA,UAAU,uCACV,SACHN,CAAA,CAAA,CAAA,EAEJ,EAGCE,IAAYA,EAAQ,UAAYA,EAAQ,WACtCG,EAAA,MAAA,CAAI,UAAU,mCACZ,SAAA,CAAAH,EAAQ,UACPI,EAAC,IAAA,CACC,KAAK,IACL,QAAUC,GAAM,OACdA,EAAE,eAAe,GACjBC,EAAAN,EAAQ,WAAR,MAAAM,EAAA,KAAAN,EACF,EACA,UAAU,uCACV,cAAY,kBAEX,SAAQA,EAAA,WAAA,CACX,EAEDA,EAAQ,UACPI,EAAC,IAAA,CACC,KAAK,IACL,QAAUC,GAAM,OACdA,EAAE,eAAe,GACjBC,EAAAN,EAAQ,WAAR,MAAAM,EAAA,KAAAN,EACF,EACA,UAAU,uCACV,cAAY,kBAEX,SAAQA,EAAA,WAAA,CAAA,CACX,CAEJ,CAAA,CAAA,CAEJ,CAAA,CAAA,EACF,EClESJ,EAA+D,CAAC,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/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\"><</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions && (actions.onRename || actions.onDelete) && (\n <div className=\"requisition-list-header__actions\">\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n onAlert?: (payload: {\n action: string;\n type: string;\n context: string;\n }) => void;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n onAlert,\n}) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n onAlert?.({\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n } else {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [requisitionList.uid, requisitionList.page_info, onUpdate, onAlert]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n const alertPayload = {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n };\n\n // Store alert in localStorage before redirecting\n // This ensures the alert is shown after redirect to grid view\n try {\n localStorage.setItem(\n 'requisitionListPendingAlert',\n JSON.stringify(alertPayload)\n );\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid, onAlert]);\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n"],"names":["RequisitionListHeader","name","description","backLink","actions","className","props","jsxs","jsx","e","_a","requisitionList","routeRequisitionListGrid","onUpdate","onAlert","showRenameModal","setShowRenameModal","useState","showDeleteModal","setShowDeleteModal","isDeleting","setIsDeleting","translations","useText","handleRename","useCallback","handleRenameSubmit","values","updatedList","updateRequisitionList","_b","handleDeleteList","handleDeleteConfirm","deleteRequisitionList","alertPayload","url","Fragment","RequisitionListHeaderComponent","result","RequisitionListModal","RequisitionListForm"],"mappings":"wYAsCO,MAAMA,EAET,CAAC,CAAE,KAAAC,EAAM,YAAAC,EAAa,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,GAAGC,KAEvDC,EAAC,OAAK,GAAGD,EAAO,UAAW,2BAA2BD,GAAa,EAAE,GAElE,SAAA,CAAAF,GACCK,EAAC,MAAA,CAAI,UAAU,gCACb,SAAAD,EAAC,IAAA,CACC,KAAMJ,EAAS,IACf,UAAU,qCACV,QAASA,EAAS,QAElB,SAAA,CAAAK,EAAC,OAAA,CAAK,UAAU,sCAAsC,SAAA,IAAI,EACzDL,EAAS,KAAA,CAAA,CAAA,EAEd,EAIFI,EAAC,MAAA,CAAI,UAAU,gCACb,SAAA,CAAAA,EAAC,MAAA,CAAI,UAAU,yCACb,SAAA,CAAAC,EAAC,KAAA,CAAG,UAAU,iCAAkC,SAAAP,EAAK,EACpDC,GACCM,EAAC,IAAA,CAAE,UAAU,uCACV,SAAAN,CAAA,CACH,CAAA,EAEJ,EAGCE,IAAYA,EAAQ,UAAYA,EAAQ,WACvCG,EAAC,MAAA,CAAI,UAAU,mCACZ,SAAA,CAAAH,EAAQ,UACPI,EAAC,IAAA,CACC,KAAK,IACL,QAAUC,GAAM,OACdA,EAAE,eAAA,GACFC,EAAAN,EAAQ,WAAR,MAAAM,EAAA,KAAAN,EACF,EACA,UAAU,uCACV,cAAY,kBAEX,SAAAA,EAAQ,WAAA,CAAA,EAGZA,EAAQ,UACPI,EAAC,IAAA,CACC,KAAK,IACL,QAAUC,GAAM,OACdA,EAAE,eAAA,GACFC,EAAAN,EAAQ,WAAR,MAAAM,EAAA,KAAAN,EACF,EACA,UAAU,uCAC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EAAC+B,EAAA,CACC,OAAQrB,EACR,UAAWE,EACX,MAAOE,EAAa,gBACpB,aAAcA,EAAa,kBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAMH,EAAmB,EAAK,EAClD,qBAAsBa,CAAA,CAAA,CACxB,EAEJ,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListModal.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":["RequisitionListModal","isOpen","isLoading","title","modalContent","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","jsx","Modal","jsxs","ProgressSpinner","Button"],"mappings":"2JAmCO,MAAMA,EAET,CAAC,CACH,OAAAC,EACA,UAAAC,EACA,MAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,qBAAAC,CACF,IACOP,EAGHQ,EAACC,EAAA,CACC,UAAU,kCACV,cAAY,yBACZ,KAAM,SACN,SAAU,GACV,MAAAP,EACA,QAASI,EACT,cAAe,GACf,eAAgB,GAChB,gBAAiB,GACjB,KAAK,SACL,aAAYJ,EAEZ,SAAAQ,EAAC,
|
|
1
|
+
{"version":3,"file":"RequisitionListModal.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":["RequisitionListModal","isOpen","isLoading","title","modalContent","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","jsx","Modal","jsxs","ProgressSpinner","Button"],"mappings":"2JAmCO,MAAMA,EAET,CAAC,CACH,OAAAC,EACA,UAAAC,EACA,MAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,qBAAAC,CACF,IACOP,EAGHQ,EAACC,EAAA,CACC,UAAU,kCACV,cAAY,yBACZ,KAAM,SACN,SAAU,GACV,MAAAP,EACA,QAASI,EACT,cAAe,GACf,eAAgB,GAChB,gBAAiB,GACjB,KAAK,SACL,aAAYJ,EAEZ,SAAAQ,EAAC,MAAA,CAAI,UAAU,yBACZ,SAAA,CAAAT,EACCO,EAAC,MAAA,CACC,UAAU,kCACV,cAAY,mBAEZ,SAAAA,EAACG,EAAA,CAAgB,OAAQ,IAAK,KAAM,OAAA,CAAS,CAAA,CAAA,EAE7C,KACJH,EAAC,KAAG,SAAAL,CAAA,CAAa,EACjBO,EAAC,MAAA,CAAI,UAAU,kCACZ,SAAA,CAAAJ,GAAsBF,GACrBI,EAACI,EAAA,CACC,cAAY,wBACZ,KAAM,SACN,QAASN,EACT,QAAQ,YACR,SAAUL,EAET,SAAAG,CAAA,CAAA,EAGJG,GAAwBF,GACvBG,EAACI,EAAA,CACC,cAAY,0BACZ,KAAM,SACN,QAASL,EACT,SAAUN,EAET,SAAAI,CAAA,CAAA,CACH,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,EAjDgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListView.js","sources":["/@dropins/storefront-requisition-list/src/hooks/useRequisitionListAlert.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/List.svg","/@dropins/storefront-requisition-list/src/components/EmptyList/EmptyList.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useMemo, useState } from 'preact/compat';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface Alert {\n type: string;\n description: string;\n action?: string;\n sku?: string;\n}\n\nexport function useRequisitionListAlert(\n translationsOverride?: Record<string, string>\n) {\n const [alert, setAlert] = useState<Alert | null>(null);\n\n const defaultTranslations = useText({\n errorCreate: `RequisitionList.RequisitionListAlert.errorCreate`,\n successCreate: `RequisitionList.RequisitionListAlert.successCreate`,\n errorDeleteItem: `RequisitionList.RequisitionListAlert.errorDeleteItem`,\n successDeleteItem: `RequisitionList.RequisitionListAlert.successDeleteItem`,\n errorDeleteReqList: `RequisitionList.RequisitionListAlert.errorDeleteReqList`,\n successDeleteReqList: `RequisitionList.RequisitionListAlert.successDeleteReqList`,\n errorAddToCart: `RequisitionList.RequisitionListAlert.errorAddToCart`,\n successAddToCart: `RequisitionList.RequisitionListAlert.successAddToCart`,\n errorUpdateQuantity: `RequisitionList.RequisitionListAlert.errorUpdateQuantity`,\n successUpdateQuantity: `RequisitionList.RequisitionListAlert.successUpdateQuantity`,\n errorUpdate: `RequisitionList.RequisitionListAlert.errorUpdate`,\n successUpdate: `RequisitionList.RequisitionListAlert.successUpdate`,\n errorMove: `RequisitionList.RequisitionListAlert.errorMove`,\n successMove: `RequisitionList.RequisitionListAlert.successMove`,\n errorAddToRequisitionList: `RequisitionList.RequisitionListAlert.errorAddToRequisitionList`,\n successAddToRequisitionList: `RequisitionList.RequisitionListAlert.successAddToRequisitionList`,\n });\n\n const translations = useMemo(\n () => ({\n ...defaultTranslations,\n ...translationsOverride,\n }),\n [defaultTranslations, translationsOverride]\n );\n\n const messages = useMemo(\n () => ({\n create: {\n // adding context for consistency, although 'create' action only applies to requisition lists\n requisitionList: {\n success: translations.successCreate,\n error: translations.errorCreate,\n },\n },\n add: {\n product: {\n success: translations.successAddToRequisitionList,\n error: translations.errorAddToRequisitionList,\n },\n },\n update: {\n product: {\n success: translations.successUpdateQuantity,\n error: translations.errorUpdateQuantity,\n },\n requisitionList: {\n success: translations.successUpdate,\n error: translations.errorUpdate,\n },\n },\n delete: {\n product: {\n success: translations.successDeleteItem,\n error: translations.errorDeleteItem,\n },\n requisitionList: {\n success: translations.successDeleteReqList,\n error: translations.errorDeleteReqList,\n },\n },\n move: {\n // adding context for consistency, although 'move' action only applies to products\n product: {\n success: translations.successMove,\n error: translations.errorMove,\n },\n },\n }),\n [translations]\n );\n\n const handleRequisitionListAlert = useCallback(\n (payload: RequisitionListActionPayload) => {\n const { type, action, context, skus } = payload;\n setAlert({\n type,\n description: messages[action][context][type],\n sku: skus?.[0],\n });\n\n const timer = setTimeout(() => {\n setAlert(null);\n }, 5000);\n\n return () => clearTimeout(timer);\n },\n [messages]\n );\n\n return { alert, setAlert, handleRequisitionListAlert };\n}\n","import * as React from \"react\";\nconst SvgList = (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(\"rect\", { x: 4.89282, y: 2.75, width: 14.2143, height: 18.5, rx: 2.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 7.67871, x2: 16.2857, y2: 7.67871, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 11.9644, x2: 16.2857, y2: 11.9644, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 16.25, x2: 16.2857, y2: 16.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 7.71429, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 11.9999, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 16.2856, r: 0.714286, fill: \"currentColor\" }));\nexport default SvgList;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/EmptyList/EmptyList.css';\n\nexport interface EmptyListProps {\n className?: string;\n textContent?: string | null;\n}\n\nexport const EmptyList: FunctionComponent<EmptyListProps> = ({\n className,\n textContent,\n ...props\n}) => {\n return (\n <div\n className={classes(['empty-list', className])}\n data-testid=\"empty-list\"\n {...props}\n >\n <Icon source={List} size={'64'} stroke={'2'} />\n {textContent && <h4>{textContent}</h4>}\n </div>\n );\n};\n"],"names":["useRequisitionListAlert","translationsOverride","alert","setAlert","useState","defaultTranslations","useText","translations","useMemo","messages","handleRequisitionListAlert","useCallback","payload","type","action","context","skus","timer","SvgList","props","React","EmptyList","className","textContent","jsxs","classes","jsx","Icon","List"],"mappings":"qWA4BO,SAASA,EACdC,EACA,CACA,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAuB,IAAI,EAE/CC,EAAsBC,EAAQ,CAClC,YAAa,mDACb,cAAe,qDACf,gBAAiB,uDACjB,kBAAmB,yDACnB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dropins/storefront-requisition-list/src/hooks/useRequisitionListAlert.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/List.svg","/@dropins/storefront-requisition-list/src/components/EmptyList/EmptyList.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useMemo, useState } from 'preact/compat';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface Alert {\n type: string;\n description: string;\n action?: string;\n sku?: string;\n}\n\nexport function useRequisitionListAlert(\n translationsOverride?: Record<string, string>\n) {\n const [alert, setAlert] = useState<Alert | null>(null);\n\n const defaultTranslations = useText({\n errorCreate: `RequisitionList.RequisitionListAlert.errorCreate`,\n successCreate: `RequisitionList.RequisitionListAlert.successCreate`,\n errorDeleteItem: `RequisitionList.RequisitionListAlert.errorDeleteItem`,\n successDeleteItem: `RequisitionList.RequisitionListAlert.successDeleteItem`,\n errorDeleteReqList: `RequisitionList.RequisitionListAlert.errorDeleteReqList`,\n successDeleteReqList: `RequisitionList.RequisitionListAlert.successDeleteReqList`,\n errorAddToCart: `RequisitionList.RequisitionListAlert.errorAddToCart`,\n successAddToCart: `RequisitionList.RequisitionListAlert.successAddToCart`,\n errorUpdateQuantity: `RequisitionList.RequisitionListAlert.errorUpdateQuantity`,\n successUpdateQuantity: `RequisitionList.RequisitionListAlert.successUpdateQuantity`,\n errorUpdate: `RequisitionList.RequisitionListAlert.errorUpdate`,\n successUpdate: `RequisitionList.RequisitionListAlert.successUpdate`,\n errorMove: `RequisitionList.RequisitionListAlert.errorMove`,\n successMove: `RequisitionList.RequisitionListAlert.successMove`,\n errorAddToRequisitionList: `RequisitionList.RequisitionListAlert.errorAddToRequisitionList`,\n successAddToRequisitionList: `RequisitionList.RequisitionListAlert.successAddToRequisitionList`,\n });\n\n const translations = useMemo(\n () => ({\n ...defaultTranslations,\n ...translationsOverride,\n }),\n [defaultTranslations, translationsOverride]\n );\n\n const messages = useMemo(\n () => ({\n create: {\n // adding context for consistency, although 'create' action only applies to requisition lists\n requisitionList: {\n success: translations.successCreate,\n error: translations.errorCreate,\n },\n },\n add: {\n product: {\n success: translations.successAddToRequisitionList,\n error: translations.errorAddToRequisitionList,\n },\n },\n update: {\n product: {\n success: translations.successUpdateQuantity,\n error: translations.errorUpdateQuantity,\n },\n requisitionList: {\n success: translations.successUpdate,\n error: translations.errorUpdate,\n },\n },\n delete: {\n product: {\n success: translations.successDeleteItem,\n error: translations.errorDeleteItem,\n },\n requisitionList: {\n success: translations.successDeleteReqList,\n error: translations.errorDeleteReqList,\n },\n },\n move: {\n // adding context for consistency, although 'move' action only applies to products\n product: {\n success: translations.successMove,\n error: translations.errorMove,\n },\n },\n }),\n [translations]\n );\n\n const handleRequisitionListAlert = useCallback(\n (payload: RequisitionListActionPayload) => {\n const { type, action, context, skus } = payload;\n setAlert({\n type,\n description: messages[action][context][type],\n sku: skus?.[0],\n });\n\n const timer = setTimeout(() => {\n setAlert(null);\n }, 5000);\n\n return () => clearTimeout(timer);\n },\n [messages]\n );\n\n return { alert, setAlert, handleRequisitionListAlert };\n}\n","import * as React from \"react\";\nconst SvgList = (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(\"rect\", { x: 4.89282, y: 2.75, width: 14.2143, height: 18.5, rx: 2.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 7.67871, x2: 16.2857, y2: 7.67871, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 11.9644, x2: 16.2857, y2: 11.9644, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 16.25, x2: 16.2857, y2: 16.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 7.71429, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 11.9999, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 16.2856, r: 0.714286, fill: \"currentColor\" }));\nexport default SvgList;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/EmptyList/EmptyList.css';\n\nexport interface EmptyListProps {\n className?: string;\n textContent?: string | null;\n}\n\nexport const EmptyList: FunctionComponent<EmptyListProps> = ({\n className,\n textContent,\n ...props\n}) => {\n return (\n <div\n className={classes(['empty-list', className])}\n data-testid=\"empty-list\"\n {...props}\n >\n <Icon source={List} size={'64'} stroke={'2'} />\n {textContent && <h4>{textContent}</h4>}\n </div>\n );\n};\n"],"names":["useRequisitionListAlert","translationsOverride","alert","setAlert","useState","defaultTranslations","useText","translations","useMemo","messages","handleRequisitionListAlert","useCallback","payload","type","action","context","skus","timer","SvgList","props","React","EmptyList","className","textContent","jsxs","classes","jsx","Icon","List"],"mappings":"qWA4BO,SAASA,EACdC,EACA,CACA,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAuB,IAAI,EAE/CC,EAAsBC,EAAQ,CAClC,YAAa,mDACb,cAAe,qDACf,gBAAiB,uDACjB,kBAAmB,yDACnB,mBAAoB,0DACpB,qBAAsB,4DACtB,eAAgB,sDAChB,iBAAkB,wDAClB,oBAAqB,2DACrB,sBAAuB,6DACvB,YAAa,mDACb,cAAe,qDACf,UAAW,iDACX,YAAa,mDACb,0BAA2B,iEAC3B,4BAA6B,kEAAA,CAC9B,EAEKC,EAAeC,EACnB,KAAO,CACL,GAAGH,EACH,GAAGJ,CAAA,GAEL,CAACI,EAAqBJ,CAAoB,CAAA,EAGtCQ,EAAWD,EACf,KAAO,CACL,OAAQ,CAEN,gBAAiB,CACf,QAASD,EAAa,cACtB,MAAOA,EAAa,WAAA,CACtB,EAEF,IAAK,CACH,QAAS,CACP,QAASA,EAAa,4BACtB,MAAOA,EAAa,yBAAA,CACtB,EAEF,OAAQ,CACN,QAAS,CACP,QAASA,EAAa,sBACtB,MAAOA,EAAa,mBAAA,EAEtB,gBAAiB,CACf,QAASA,EAAa,cACtB,MAAOA,EAAa,WAAA,CACtB,EAEF,OAAQ,CACN,QAAS,CACP,QAASA,EAAa,kBACtB,MAAOA,EAAa,eAAA,EAEtB,gBAAiB,CACf,QAASA,EAAa,qBACtB,MAAOA,EAAa,kBAAA,CACtB,EAEF,KAAM,CAEJ,QAAS,CACP,QAASA,EAAa,YACtB,MAAOA,EAAa,SAAA,CACtB,CACF,GAEF,CAACA,CAAY,CAAA,EAGTG,EAA6BC,EAChCC,GAA0C,CACzC,KAAM,CAAE,KAAAC,EAAM,OAAAC,EAAQ,QAAAC,EAAS,KAAAC,GAASJ,EACxCT,EAAS,CACP,KAAAU,EACA,YAAaJ,EAASK,CAAM,EAAEC,CAAO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AAC,aAAcH,CAAS,CAAC,EAC5C,cAAY,aACX,GAAGH,EAEJ,SAAA,CAAAO,EAACC,GAAK,OAAQC,EAAM,KAAM,KAAM,OAAQ,IAAK,EAC5CL,GAAeG,EAAC,KAAA,CAAI,SAAAH,CAAA,CAAY,CAAA,CAAA,CAAA","x_google_ignoreList":[1]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addRequisitionListItemsToCart.js","sources":["/@dropins/storefront-requisition-list/src/data/transforms/transform-product.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/refineProduct.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/fragments/ProductFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getProductData/graphql/getProductData.ts","/@dropins/storefront-requisition-list/src/api/getProductData/getProductData.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Product } from '@/requisitionList/data/models';\n\n// Interface for raw product data from GraphQL API\nexport interface RawProductData {\n __typename: string;\n id: string;\n sku: string;\n name: string;\n shortDescription?: string;\n metaDescription?: string;\n metaKeyword?: string;\n metaTitle?: string;\n description?: string;\n inStock: boolean;\n addToCartAllowed: boolean;\n url?: string;\n urlKey?: string;\n externalId?: string;\n images?: {\n url: string;\n label?: string;\n roles?: string[];\n }[];\n attributes?: {\n name: string;\n label: string;\n value: string;\n roles?: string[];\n }[];\n price?: {\n roles?: string[];\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n };\n priceRange?: {\n maximum?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n minimum?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n };\n options?: {\n id: string;\n title: string;\n required: boolean;\n multi: boolean;\n values: {\n id: string;\n title: string;\n inStock: boolean;\n __typename: string;\n quantity?: number;\n isDefault?: boolean;\n type?: string;\n value?: string;\n product?: {\n sku: string;\n name: string;\n shortDescription?: string;\n metaDescription?: string;\n metaKeyword?: string;\n metaTitle?: string;\n price?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n };\n }[];\n }[];\n}\n\nexport function transformProduct(data: RawProductData): Product {\n return {\n sku: data.sku,\n parent_sku: data.sku, // Use same SKU as parent for simple products\n name: data.name,\n price: data.price,\n shortDescription: data.shortDescription || '',\n metaDescription: data.metaDescription || '',\n metaKeyword: data.metaKeyword || '',\n metaTitle: data.metaTitle || '',\n description: data.description || '',\n addToCartAllowed: data.addToCartAllowed,\n url: data.url || '',\n urlKey: data.urlKey || '',\n externalId: data.externalId || '',\n images:\n data.images?.map((image) => ({\n url: image.url,\n label: image.label || '',\n roles: image.roles || [],\n })) || [],\n };\n}\n\nexport function transformProducts(products: RawProductData[]): Product[] {\n if (!products?.length) return [];\n\n return products.map(transformProduct);\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REFINE_PRODUCT = `\n query REFINE_PRODUCT(\n $optionIds: [String!]!,\n $sku: String!\n ) {\n refineProduct(\n optionIds: $optionIds\n sku: $sku\n ) {\n sku\n name\n images {\n url\n }\n ... on SimpleProductView {\n price {\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { REFINE_PRODUCT } from '@/requisitionList/api/getRequisitionList/graphql/refineProduct';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item, ConfigurableOption } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n // encodes option UID string into base64 string for refineProduct query\n // 'configurable/93/13' -> 'Y29uZmlndXJhYmxlLzkzLzEz'\n const encodeOptionUids = (item: Item): string[] => {\n return item.configurable_options.map((option: ConfigurableOption) => {\n return btoa(\n `configurable/${atob(option.configurable_product_option_uid)}/${atob(\n option.configurable_product_option_value_uid\n )}`\n );\n });\n };\n\n return fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n }).then(async ({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n const itemsWithConfigurableProducts = await Promise.all(\n data?.customer?.requisition_lists.items[0].items.items.map(\n async (item: Item) => {\n if (!item.product || !item.configurable_options) return item;\n\n const optionIds = encodeOptionUids(item);\n\n const { errors, data: refineData } = await fetchGraphQl(\n REFINE_PRODUCT,\n {\n variables: {\n optionIds,\n sku: item.product.sku,\n },\n }\n );\n\n if (errors) {\n console.error('Failed to refine product:', errors);\n return item;\n }\n\n if (!refineData?.refineProduct) {\n return item;\n }\n\n return {\n ...item,\n configured_product: refineData.refineProduct,\n };\n }\n )\n );\n\n // Update the items in the data structure\n data.customer.requisition_lists.items[0].items.items =\n itemsWithConfigurableProducts;\n\n const payload = transformRequisitionList(\n data.customer.requisition_lists.items[0]\n );\n\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(UPDATE_REQUISITION_LIST_ITEMS_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.updateRequisitionListItems.requisition_list\n );\n\n events.emit('requisitionList/data', payload);\n\n return payload;\n });\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_ITEMS_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.deleteRequisitionListItems.requisition_list\n );\n events.emit('requisitionList/data', payload);\n\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PRODUCT_FRAGMENT = `\nfragment PRODUCT_FRAGMENT on ProductView {\n __typename\n id\n sku\n name\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n description\n inStock\n addToCartAllowed\n url\n urlKey\n externalId\n images(roles: []) {\n url\n label\n roles\n }\n attributes(roles: []) {\n name\n label\n value\n roles\n }\n ... on SimpleProductView {\n price {\n roles\n regular {\n amount {\n value\n currency\n }\n }\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n ... on ComplexProductView {\n options {\n ...PRODUCT_OPTION_FRAGMENT\n }\n ...PRICE_RANGE_FRAGMENT\n }\n}\nfragment PRODUCT_OPTION_FRAGMENT on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n __typename\n product {\n sku\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n}\nfragment PRICE_RANGE_FRAGMENT on ComplexProductView {\n priceRange {\n maximum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n minimum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PRODUCT_FRAGMENT } from '@/requisitionList/api/fragments/ProductFragment.graphql';\n\nexport const GET_PRODUCT_DATA_QUERY = `\n query GET_PRODUCT_DATA($skus: [String]) {\n products(skus: $skus) {\n ...PRODUCT_FRAGMENT\n }\n }\n ${PRODUCT_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformProducts } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_PRODUCT_DATA_QUERY } from './graphql/getProductData';\nimport { Product } from '@/requisitionList/data/models/item';\n\nexport const getProductData = async (\n skus: string[]\n): Promise<Product[] | null> => {\n return fetchGraphQl(GET_PRODUCT_DATA_QUERY, {\n variables: {\n skus,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.products) {\n return null;\n }\n\n return transformProducts(data.products);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>\n): Promise<Array<string> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => e.type\n );\n }\n return null;\n });\n};\n"],"names":["transformProduct","data","_a","image","transformProducts","products","GET_REQUISITION_LIST_QUERY","REQUISITION_LIST_ITEMS_FRAGMENT","REQUISITION_LIST_FRAGMENT","REFINE_PRODUCT","isValidBase64Uid","uid","getRequisitionList","requisitionListID","currentPage","pageSize","encodeOptionUids","item","option","fetchGraphQl","errors","handleFetchError","itemsWithConfigurableProducts","_b","optionIds","refineData","payload","transformRequisitionList","events","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListUid","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","items","PRODUCT_FRAGMENT","GET_PRODUCT_DATA_QUERY","getProductData","skus","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids"],"mappings":"2HAsIO,SAASA,EAAiBC,EAA+B,OACvD,MAAA,CACL,IAAKA,EAAK,IACV,WAAYA,EAAK,IACjB,KAAMA,EAAK,KACX,MAAOA,EAAK,MACZ,iBAAkBA,EAAK,kBAAoB,GAC3C,gBAAiBA,EAAK,iBAAmB,GACzC,YAAaA,EAAK,aAAe,GACjC,UAAWA,EAAK,WAAa,GAC7B,YAAaA,EAAK,aAAe,GACjC,iBAAkBA,EAAK,iBACvB,IAAKA,EAAK,KAAO,GACjB,OAAQA,EAAK,QAAU,GACvB,WAAYA,EAAK,YAAc,GAC/B,SACEC,EAAAD,EAAK,SAAL,YAAAC,EAAa,IAAKC,IAAW,CAC3B,IAAKA,EAAM,IACX,MAAOA,EAAM,OAAS,GACtB,MAAOA,EAAM,OAAS,CAAA,CACxB,MAAO,CAAA,CACX,CACF,CAEO,SAASC,EAAkBC,EAAuC,CACvE,OAAKA,GAAA,MAAAA,EAAU,OAERA,EAAS,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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECEnBC,EAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlCD,CAAgB;AAAA,ECFPE,EAAiB,MAC5BC,GAEOpB,EAAakB,EAAwB,CAC1C,UAAW,CACT,KAAAE,CAAA,CAEH,CAAA,EAAE,KAAK,CAAC,CAAE,OAAAnB,EAAQ,KAAAnB,KACbmB,EAAeC,EAAiBD,CAAM,EAErCnB,GAAA,MAAAA,EAAM,SAIJG,EAAkBH,EAAK,QAAQ,EAH7B,IAIV,ECrBUuC,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECI9CC,EAAgC,MAC3CV,EACAW,IAEOvB,EAAaqB,EAA6C,CAC/D,UAAW,CACT,mBAAAT,EACA,wBAAAW,CAAA,CAEH,CAAA,EAAE,KAAK,CAAC,CAAE,OAAAtB,EAAQ,KAAAnB,KAAW,OACxB,OAAAmB,EAAeC,EAAiBD,CAAM,GAGxClB,EAAAD,EAAK,8BACF,iDADH,MAAAC,EACmD,OAE5CD,EAAK,8BAA8B,+CAA+C,IACtF,GAAW,EAAE,IAChB,EAEK,IAAA,CACR"}
|
|
1
|
+
{"version":3,"file":"addRequisitionListItemsToCart.js","sources":["/@dropins/storefront-requisition-list/src/data/transforms/transform-product.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/refineProduct.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/fragments/ProductFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getProductData/graphql/getProductData.ts","/@dropins/storefront-requisition-list/src/api/getProductData/getProductData.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Product } from '@/requisitionList/data/models';\n\n// Interface for raw product data from GraphQL API\nexport interface RawProductData {\n __typename: string;\n id: string;\n sku: string;\n name: string;\n shortDescription?: string;\n metaDescription?: string;\n metaKeyword?: string;\n metaTitle?: string;\n description?: string;\n inStock: boolean;\n addToCartAllowed: boolean;\n url?: string;\n urlKey?: string;\n externalId?: string;\n images?: {\n url: string;\n label?: string;\n roles?: string[];\n }[];\n attributes?: {\n name: string;\n label: string;\n value: string;\n roles?: string[];\n }[];\n price?: {\n roles?: string[];\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n };\n priceRange?: {\n maximum?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n minimum?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n };\n options?: {\n id: string;\n title: string;\n required: boolean;\n multi: boolean;\n values: {\n id: string;\n title: string;\n inStock: boolean;\n __typename: string;\n quantity?: number;\n isDefault?: boolean;\n type?: string;\n value?: string;\n product?: {\n sku: string;\n name: string;\n shortDescription?: string;\n metaDescription?: string;\n metaKeyword?: string;\n metaTitle?: string;\n price?: {\n final?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n regular?: {\n amount: {\n value: number;\n currency: string;\n };\n };\n roles?: string[];\n };\n };\n }[];\n }[];\n}\n\nexport function transformProduct(data: RawProductData): Product {\n return {\n sku: data.sku,\n parent_sku: data.sku, // Use same SKU as parent for simple products\n name: data.name,\n price: data.price,\n shortDescription: data.shortDescription || '',\n metaDescription: data.metaDescription || '',\n metaKeyword: data.metaKeyword || '',\n metaTitle: data.metaTitle || '',\n description: data.description || '',\n addToCartAllowed: data.addToCartAllowed,\n url: data.url || '',\n urlKey: data.urlKey || '',\n externalId: data.externalId || '',\n images:\n data.images?.map((image) => ({\n url: image.url,\n label: image.label || '',\n roles: image.roles || [],\n })) || [],\n };\n}\n\nexport function transformProducts(products: RawProductData[]): Product[] {\n if (!products?.length) return [];\n\n return products.map(transformProduct);\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REFINE_PRODUCT = `\n query REFINE_PRODUCT(\n $optionIds: [String!]!,\n $sku: String!\n ) {\n refineProduct(\n optionIds: $optionIds\n sku: $sku\n ) {\n sku\n name\n images {\n url\n }\n ... on SimpleProductView {\n price {\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { REFINE_PRODUCT } from '@/requisitionList/api/getRequisitionList/graphql/refineProduct';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item, ConfigurableOption } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n // encodes option UID string into base64 string for refineProduct query\n // 'configurable/93/13' -> 'Y29uZmlndXJhYmxlLzkzLzEz'\n const encodeOptionUids = (item: Item): string[] => {\n return item.configurable_options.map((option: ConfigurableOption) => {\n return btoa(\n `configurable/${atob(option.configurable_product_option_uid)}/${atob(\n option.configurable_product_option_value_uid\n )}`\n );\n });\n };\n\n return fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n }).then(async ({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n const itemsWithConfigurableProducts = await Promise.all(\n data?.customer?.requisition_lists.items[0].items.items.map(\n async (item: Item) => {\n if (!item.product || !item.configurable_options) return item;\n\n const optionIds = encodeOptionUids(item);\n\n const { errors, data: refineData } = await fetchGraphQl(\n REFINE_PRODUCT,\n {\n variables: {\n optionIds,\n sku: item.product.sku,\n },\n }\n );\n\n if (errors) {\n console.error('Failed to refine product:', errors);\n return item;\n }\n\n if (!refineData?.refineProduct) {\n return item;\n }\n\n return {\n ...item,\n configured_product: refineData.refineProduct,\n };\n }\n )\n );\n\n // Update the items in the data structure\n data.customer.requisition_lists.items[0].items.items =\n itemsWithConfigurableProducts;\n\n const payload = transformRequisitionList(\n data.customer.requisition_lists.items[0]\n );\n\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(UPDATE_REQUISITION_LIST_ITEMS_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.updateRequisitionListItems.requisition_list\n );\n\n events.emit('requisitionList/data', payload);\n\n return payload;\n });\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_ITEMS_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.deleteRequisitionListItems.requisition_list\n );\n events.emit('requisitionList/data', payload);\n\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PRODUCT_FRAGMENT = `\nfragment PRODUCT_FRAGMENT on ProductView {\n __typename\n id\n sku\n name\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n description\n inStock\n addToCartAllowed\n url\n urlKey\n externalId\n images(roles: []) {\n url\n label\n roles\n }\n attributes(roles: []) {\n name\n label\n value\n roles\n }\n ... on SimpleProductView {\n price {\n roles\n regular {\n amount {\n value\n currency\n }\n }\n final {\n amount {\n value\n currency\n }\n }\n }\n }\n ... on ComplexProductView {\n options {\n ...PRODUCT_OPTION_FRAGMENT\n }\n ...PRICE_RANGE_FRAGMENT\n }\n}\nfragment PRODUCT_OPTION_FRAGMENT on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n __typename\n product {\n sku\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n}\nfragment PRICE_RANGE_FRAGMENT on ComplexProductView {\n priceRange {\n maximum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n minimum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PRODUCT_FRAGMENT } from '@/requisitionList/api/fragments/ProductFragment.graphql';\n\nexport const GET_PRODUCT_DATA_QUERY = `\n query GET_PRODUCT_DATA($skus: [String]) {\n products(skus: $skus) {\n ...PRODUCT_FRAGMENT\n }\n }\n ${PRODUCT_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformProducts } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_PRODUCT_DATA_QUERY } from './graphql/getProductData';\nimport { Product } from '@/requisitionList/data/models/item';\n\nexport const getProductData = async (\n skus: string[]\n): Promise<Product[] | null> => {\n return fetchGraphQl(GET_PRODUCT_DATA_QUERY, {\n variables: {\n skus,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.products) {\n return null;\n }\n\n return transformProducts(data.products);\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>\n): Promise<Array<string> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => e.type\n );\n }\n return null;\n });\n};\n"],"names":["transformProduct","data","_a","image","transformProducts","products","GET_REQUISITION_LIST_QUERY","REQUISITION_LIST_ITEMS_FRAGMENT","REQUISITION_LIST_FRAGMENT","REFINE_PRODUCT","isValidBase64Uid","uid","getRequisitionList","requisitionListID","currentPage","pageSize","encodeOptionUids","item","option","fetchGraphQl","errors","handleFetchError","itemsWithConfigurableProducts","_b","optionIds","refineData","payload","transformRequisitionList","events","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListUid","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","items","PRODUCT_FRAGMENT","GET_PRODUCT_DATA_QUERY","getProductData","skus","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids"],"mappings":"2HAsIO,SAASA,EAAiBC,EAA+B,OAC9D,MAAO,CACL,IAAKA,EAAK,IACV,WAAYA,EAAK,IACjB,KAAMA,EAAK,KACX,MAAOA,EAAK,MACZ,iBAAkBA,EAAK,kBAAoB,GAC3C,gBAAiBA,EAAK,iBAAmB,GACzC,YAAaA,EAAK,aAAe,GACjC,UAAWA,EAAK,WAAa,GAC7B,YAAaA,EAAK,aAAe,GACjC,iBAAkBA,EAAK,iBACvB,IAAKA,EAAK,KAAO,GACjB,OAAQA,EAAK,QAAU,GACvB,WAAYA,EAAK,YAAc,GAC/B,SACEC,EAAAD,EAAK,SAAL,YAAAC,EAAa,IAAKC,IAAW,CAC3B,IAAKA,EAAM,IACX,MAAOA,EAAM,OAAS,GACtB,MAAOA,EAAM,OAAS,CAAA,CAAC,MAClB,CAAA,CAAC,CAEd,CAEO,SAASC,EAAkBC,EAAuC,CACvE,OAAKA,GAAA,MAAAA,EAAU,OAERA,EAAS,IAAIL,CAAgB,EAFN,CAAA,CAGhC,CC/IO,MAAMM,EAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBxCC,CAA+B;AAAA,EAC/BC,CAAyB;AAAA,EC1BdC,EAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECOvB,SAASC,EAAiBC,EAAyC,CAUxE,MATI,CAACA,GAAO,OAAOA,GAA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