@dropins/storefront-requisition-list 1.1.0 → 1.2.1-alpha1
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/deleteRequisitionListItems/deleteRequisitionListItems.d.ts +2 -1
- package/api/fragments.d.ts +0 -1
- package/api/getRequisitionList/getRequisitionList.d.ts +2 -1
- package/api/index.d.ts +0 -2
- package/api/updateRequisitionList/updateRequisitionList.d.ts +2 -1
- package/api/updateRequisitionListItems/updateRequisitionListItems.d.ts +2 -1
- package/api.js +2 -2
- package/api.js.map +1 -1
- package/chunks/RequisitionListHeader.js +1 -1
- package/chunks/RequisitionListHeader.js.map +1 -1
- package/chunks/addRequisitionListItemsToCart.js +11 -151
- package/chunks/addRequisitionListItemsToCart.js.map +1 -1
- package/chunks/updateRequisitionList.js +6 -32
- package/chunks/updateRequisitionList.js.map +1 -1
- package/containers/RequisitionListHeader/RequisitionListHeader.d.ts +2 -0
- package/containers/RequisitionListView/RequisitionListView.d.ts +3 -0
- package/containers/RequisitionListView.js +1 -1
- package/containers/RequisitionListView.js.map +1 -1
- package/package.json +1 -1
- package/api/fragments/ProductFragment.graphql.d.ts +0 -18
- package/api/getProductData/getProductData.d.ts +0 -4
- package/api/getProductData/graphql/getProductData.d.ts +0 -18
- package/api/getProductData/index.d.ts +0 -18
- package/api/refineProduct/enrichConfigurableProducts.d.ts +0 -10
- package/api/refineProduct/graphql/refineProduct.d.ts +0 -18
- package/api/refineProduct/index.d.ts +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListView.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Minus.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","/@dropins/storefront-requisition-list/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-requisition-list/src/components/BatchActions/BatchActions.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListView/RequisitionListView.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgCart = (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(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.3332 11.75H6.6665\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\", vectorEffect: \"non-scaling-stroke\", fill: \"none\", stroke: \"currentColor\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\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 { Item } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\ntype UseRequisitionListSelectedItems = {\n currentRequisitionList: RequisitionList | null;\n setCurrentRequisitionList: (\n value:\n | RequisitionList\n | null\n | ((prev: RequisitionList | null) => RequisitionList | null)\n ) => void;\n selectedItems: Set<string>;\n setSelectedItems: (\n value: Set<string> | ((prev: Set<string>) => Set<string>)\n ) => void;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleSelectAll: () => void;\n handleSelectNone: () => void;\n};\n\nexport function useRequisitionListSelectedItems(): UseRequisitionListSelectedItems {\n const [currentRequisitionList, setCurrentRequisitionList] =\n useState<RequisitionList | null>(null);\n const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());\n\n const handleItemSelection = useCallback(\n (itemUid: string, isSelected: boolean) => {\n setSelectedItems((prev: Set<string>) => {\n const newSet = new Set(prev);\n if (isSelected) {\n newSet.add(itemUid);\n } else {\n newSet.delete(itemUid);\n }\n return newSet;\n });\n },\n []\n );\n\n const handleSelectAll = useCallback(() => {\n const allItemUids = currentRequisitionList?.items?.map(\n (item: Item) => item.uid\n );\n setSelectedItems(new Set(allItemUids));\n }, [currentRequisitionList]);\n\n const handleSelectNone = useCallback(() => {\n setSelectedItems(new Set());\n }, []);\n\n return {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\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 { FunctionComponent, h } from 'preact';\nimport { useState } from 'preact/hooks';\nimport { HTMLAttributes, ChangeEvent } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Icon,\n Table,\n Checkbox,\n Price,\n Button,\n Field,\n Input,\n Image,\n} from '@adobe-commerce/elsie/components';\nimport { Trash, Cart } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/ProductListTable/ProductListTable.css';\nimport { RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { Item, BundleOption } from '@/requisitionList/data/models/item';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n className?: string;\n items: RequisitionListModel['items'];\n selectedItems: Set<string>;\n currentPage: number;\n pageSize: number;\n canEdit?: boolean;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleUpdateQuantity: (itemUid: string, newQuantity: number) => Promise<void>;\n onAddToCart: (itemUids: string[] | undefined) => void;\n onDeleteItem: (itemUids: string[] | undefined) => void;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n selectedItems,\n currentPage,\n pageSize,\n canEdit = true,\n handleItemSelection,\n handleUpdateQuantity,\n onAddToCart,\n onDeleteItem,\n ...props\n}) => {\n const [disabledInputs, setDisabledInputs] = useState<Record<string, boolean>>(\n {}\n );\n const [inputValues, setInputValues] = useState<Record<string, number>>({});\n\n const translations = useText({\n productNameHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.productName',\n skuHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.sku',\n priceHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.price',\n quantityHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.quantity',\n subtotalHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.subtotal',\n actionsHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.actions',\n actionAddToCart: 'RequisitionList.RequisitionListView.actionAddToCart',\n actionDelete: 'RequisitionList.RequisitionListView.actionDelete',\n actionSelect: 'RequisitionList.RequisitionListView.actionSelect',\n itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\n outOfStock:\n 'RequisitionList.RequisitionListView.productListTable.outOfStock',\n onlyXLeftInStock:\n 'RequisitionList.RequisitionListView.productListTable.onlyXLeftInStock',\n });\n const columns = [\n {\n label: '#',\n key: 'index',\n },\n {\n label: 'item',\n key: 'item',\n },\n {\n label: translations.priceHeader,\n key: 'price',\n },\n {\n label: translations.quantityHeader,\n key: 'quantity',\n },\n {\n label: translations.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit) {\n columns.unshift({\n label: translations.actionSelect,\n key: 'selector',\n });\n columns.push({\n label: translations.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: ChangeEvent<HTMLInputElement>,\n item: Item\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n handleItemSelection(item.uid, isSelected);\n };\n\n const getRowIndex = (index: number): number => {\n return (currentPage - 1) * pageSize + index + 1;\n };\n\n const getImageAlt = (item: Item): string => {\n return item.configured_product?.name || item.product?.name || item.sku;\n };\n\n const getImageSrc = (item: Item): string => {\n return item.configured_product?.images?.length\n ? item.configured_product.images[0]?.url || ''\n : item.product?.images?.length\n ? item.product.images[0]?.url || ''\n : '';\n };\n\n const getProductName = (item: Item): string | undefined => {\n return item.product?.name || item.sku;\n };\n\n const getConfiguredProductName = (item: Item): string | undefined => {\n return item.configured_product?.name;\n };\n\n const getBundleProducts = (\n item: Item\n ): h.JSX<HTMLSpanElement>[] | undefined => {\n if (!item.bundle_options) {\n return;\n }\n\n const bundleProducts = item.bundle_options.map(\n (option: BundleOption, index: number): h.JSX<HTMLSpanElement> => {\n return (\n <span\n key={option.values[0].label || index}\n className=\"requisition-list-view-product-list-table__product-configurable-name\"\n >\n {option.values[0]!.label} x {option.values[0]!.quantity}\n </span>\n );\n }\n );\n return bundleProducts;\n };\n\n const getSku = (item: Item): string | undefined => {\n return item.configured_product?.sku || item.sku;\n };\n\n const getPriceAmount = (item: Item): number => {\n if (Array.isArray(item.bundle_options) && item.bundle_options.length > 0) {\n return item.bundle_options.reduce(\n (previousValue: number, option: BundleOption): number => {\n return (\n previousValue +\n (option.values[0]?.priceV2?.value || 0) *\n (option.values[0]?.quantity || 0)\n );\n },\n 0\n );\n }\n return (\n item.configured_product?.price?.final?.amount?.value ||\n item.product?.price?.final?.amount?.value ||\n 0\n );\n };\n\n const getPriceCurrency = (item: Item): string | undefined => {\n return (\n item.configured_product?.price?.final?.amount?.currency ||\n item.product?.price?.final?.amount?.currency\n );\n };\n\n const getSubtotal = (item: Item): number => {\n return getPriceAmount(item) * item.quantity;\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>, item: Item) => {\n const inputValue = +(e.target as HTMLInputElement).value;\n if (inputValue > 0 && !Number.isNaN(e.target.value)) {\n setInputValues((prev) => ({ ...prev, [item.uid]: inputValue }));\n }\n };\n\n const handleInputBlur = async (e: FocusEvent, item: Item) => {\n let newQty = +(e.target as HTMLInputElement).value;\n\n if ((newQty > 0 && newQty !== item.quantity) === false) {\n setInputValues((prev) => ({ ...prev, [item.uid]: item.quantity }));\n return;\n }\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: true }));\n try {\n await handleUpdateQuantity(item.uid, newQty);\n } finally {\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: false }));\n }\n };\n\n const rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <label id={`item-selector-${item.sku}-label`}>\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name={`item-selector-${item.sku}`}\n aria-label={`${translations.actionSelect} ${getProductName(item)}`}\n data-testid={`item-checkbox-${item.sku}`}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleItemCheckboxChange(e, item)\n }\n value={item.sku}\n checked={selectedItems.has(item.uid)}\n />\n </label>\n ),\n index: (\n <div className=\"requisition-list-view-product-list-table__index-container\">\n {getRowIndex(index)}\n </div>\n ),\n item: (\n <div className=\"requisition-list-view-product-list-table__item-container\">\n <Image\n className=\"requisition-list-view-product-list-table__thumbnail\"\n alt={getImageAlt(item)}\n src={getImageSrc(item)}\n />\n <div className=\"requisition-list-view-product-list-table__item-details\">\n <div className=\"requisition-list-view-product-list-table__product-name\">\n {getProductName(item)}\n </div>\n {item.stock_status === 'OUT_OF_STOCK' && (\n <div className=\"requisition-list-view-product-list-table__out-of-stock\">\n {translations.outOfStock}\n </div>\n )}\n {item.stock_status !== 'OUT_OF_STOCK' &&\n item.only_x_left_in_stock !== null &&\n item.only_x_left_in_stock < item.quantity && (\n <div className=\"requisition-list-view-product-list-table__low-stock\">\n {translations.onlyXLeftInStock.replace(\n '{count}',\n String(item.only_x_left_in_stock)\n )}\n </div>\n )}\n <span className=\"requisition-list-view-product-list-table__product-configurable-name\">\n {getConfiguredProductName(item)}\n </span>\n <div className=\"requisition-list-view-product-list-table__sku\">\n {getSku(item)}\n </div>\n {getBundleProducts(item)}\n </div>\n </div>\n ),\n price: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getPriceAmount(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n quantity: (\n <span className=\"requisition-list-view-product-list-table__quantity\">\n <Field disabled={!!disabledInputs[item.uid]}>\n <Input\n id={`requisition-list-item-quantity-${item.sku}`}\n data-testid={`requisition-list-item-quantity-${item.sku}`}\n name=\"quantity\"\n type=\"text\"\n aria-label={`${translations.itemQuantity} - ${getProductName(\n item\n )}`}\n value={inputValues[item.uid] ?? item.quantity}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleInputChange(e, item)\n }\n onBlur={(e: FocusEvent) => handleInputBlur(e, item)}\n />\n </Field>\n </span>\n ),\n subtotal: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getSubtotal(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n actions: (\n <div className=\"requisition-list-view__bulk-actions\">\n <Button\n type=\"button\"\n onClick={() => onAddToCart([item.uid])}\n icon={<Icon source={Cart} />}\n aria-label={`${translations.actionAddToCart} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-add-to-cart-button\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n icon={<Icon source={Trash} />}\n onClick={() => onDeleteItem([item.uid])}\n aria-label={`${translations.actionDelete} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-delete-button\"\n />\n </div>\n ),\n };\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n />\n );\n\n return (\n <VComponent\n node={h('div', {})}\n className={classes([\n 'requisition-list-view-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...props}\n >\n {table}\n </VComponent>\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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { Trash, Minus } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/BatchActions/BatchActions.css';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface BatchActionsProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n selectedItems: Set<string>;\n deletingItemId: string | null;\n addingToCartItemId: string | null;\n bulkAddingToCart: boolean;\n updatingQuantityItemId: string | null;\n onSelectAll: () => void;\n onSelectNone: () => void;\n onBulkAddToCart: () => void;\n onBulkDelete: () => void;\n}\n\nexport const BatchActions: FunctionComponent<BatchActionsProps> = ({\n selectedItems,\n deletingItemId,\n addingToCartItemId,\n bulkAddingToCart,\n updatingQuantityItemId,\n onSelectAll,\n onSelectNone,\n onBulkAddToCart,\n onBulkDelete,\n}) => {\n const translations = useText({\n statusDeleting: `RequisitionList.RequisitionListView.statusDeleting`,\n actionSelectAll: `RequisitionList.RequisitionListView.actionSelectAll`,\n actionSelectNone: `RequisitionList.RequisitionListView.actionSelectNone`,\n actionAddToCart: `RequisitionList.RequisitionListView.actionAddToCart`,\n actionDeleteSelectedItems: `RequisitionList.RequisitionListView.actionDeleteSelectedItems`,\n statusBulkAddingToCart: `RequisitionList.RequisitionListView.statusBulkAddingToCart`,\n });\n\n const isDisabled =\n deletingItemId !== null ||\n addingToCartItemId !== null ||\n bulkAddingToCart ||\n updatingQuantityItemId !== null;\n\n const hasSelectedItems = selectedItems.size > 0;\n\n return (\n <div className=\"requisition-list-view__batch-actions\">\n <div className=\"requisition-list-view__batch-actions-left\">\n <button\n data-testid=\"bulk-actions-select-toggle-btn\"\n type=\"button\"\n className={`requisition-list-view__batch-actions-select-toggle ${\n hasSelectedItems\n ? 'requisition-list-view__batch-actions-select-toggle--active'\n : ''\n }`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={\n hasSelectedItems\n ? translations.actionSelectNone\n : translations.actionSelectAll\n }\n >\n <Icon source={Minus} />\n </button>\n <button\n type=\"button\"\n className=\"requisition-list-view__batch-actions-select-label\"\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n >\n {translations.actionSelectAll}\n </button>\n </div>\n\n {hasSelectedItems && (\n <div className=\"requisition-list-view__batch-actions-buttons\">\n <span\n className=\"requisition-list-view__batch-actions-count-badge\"\n aria-label={`${selectedItems.size} items selected`}\n >\n {selectedItems.size}\n </span>\n <Button\n data-testid=\"bulk-actions-add-to-cart-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkAddToCart}\n disabled={isDisabled}\n >\n {bulkAddingToCart\n ? translations.statusBulkAddingToCart\n : translations.actionAddToCart}\n </Button>\n <button\n data-testid=\"bulk-actions-delete-btn\"\n type=\"button\"\n className=\"requisition-list-view__batch-actions-delete-icon\"\n onClick={onBulkDelete}\n disabled={isDisabled}\n aria-label={translations.actionDeleteSelectedItems}\n >\n <Icon source={Trash} />\n </button>\n </div>\n )}\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 *******************************************************************/\nimport {\n HTMLAttributes,\n useState,\n useCallback,\n useEffect,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n addRequisitionListItemsToCart,\n AddToCartError,\n} from '@/requisitionList/api/addRequisitionListItemsToCart';\nimport { deleteRequisitionListItems } from '@/requisitionList/api/deleteRequisitionListItems';\nimport { getProductData } from '@/requisitionList/api/getProductData';\nimport { updateRequisitionListItems } from '@/requisitionList/api/updateRequisitionListItems';\nimport { getRequisitionList } from '@/requisitionList/api/getRequisitionList';\nimport {\n Pagination,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { Item, Product } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n PageSizePicker,\n EmptyList,\n NotFound,\n RequisitionListModal,\n PaginationItemsCounter,\n} from '@/requisitionList/components';\nimport { ProductListTable } from '@/requisitionList/components/ProductListTable/ProductListTable';\nimport { BatchActions } from '@/requisitionList/components/BatchActions/BatchActions';\nimport { RequisitionListHeader } from '@/requisitionList/containers/RequisitionListHeader';\nimport { useRequisitionListSelectedItems } from '@/requisitionList/hooks/useRequisitionListSelectedItems';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks/useRequisitionListAlert';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport '@/requisitionList/containers/RequisitionListView/RequisitionListView.css';\n\nexport interface RequisitionListViewProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * The UID of the requisition list to display.\n * The UID must be a base64-encoded string.\n * If an invalid UID is provided, the component will render the NotFound state.\n * The component will fetch the requisition list data internally.\n */\n requisitionListUid: string;\n /**\n * When true, skips automatic product data fetching on component mount.\n * Used in tests to prevent API calls.\n */\n skipProductLoading?: boolean;\n /**\n * Number of items per page for pagination.\n * Defaults to DEFAULT_PAGE_SIZE.\n */\n pageSize?: number;\n selectedItems: Set<string>;\n /**\n * Function that returns the URL to the requisition list grid view or performs navigation\n */\n routeRequisitionListGrid?: () => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n}\n\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\n fallbackRoute = '/customer/account',\n}: RequisitionListViewProps) => {\n const [loadingProducts, setLoadingProducts] = useState<boolean>(false);\n const [deletingItemId, setDeletingItemId] = useState<string | null>(null);\n const [addingToCartItemId, setAddingToCartItemId] = useState<\n string[] | undefined\n >(null);\n const [bulkAddingToCart, setBulkAddingToCart] = useState<boolean>(false);\n const [updatingQuantityItemId, setUpdatingQuantityItemId] = useState<\n string | null\n >(null);\n const [loadingPage, setLoadingPage] = useState<boolean>(false);\n const [currentPageSize, setCurrentPageSize] = useState<number>(pageSize);\n const [initializing, setInitializing] = useState<boolean>(true);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [itemsToDelete, setItemsToDelete] = useState<string[]>([]);\n\n const {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n } = useRequisitionListSelectedItems();\n\n const translations = useText({\n emptyRequisitionList: `RequisitionList.RequisitionListView.emptyRequisitionList`,\n errorLoadingProducts: `RequisitionList.RequisitionListView.errorLoadingProducts`,\n errorLoadPage: `RequisitionList.RequisitionListView.errorLoadPage`,\n notFoundTitle: `RequisitionList.RequisitionListView.notFoundTitle`,\n notFoundMessage: `RequisitionList.RequisitionListView.notFoundMessage`,\n notFoundActionLabel: `RequisitionList.RequisitionListView.notFoundActionLabel`,\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n partialMoveSuccess: `RequisitionList.RequisitionListAlert.partialMoveSuccess`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n show: `RequisitionList.PageSizePicker.show`,\n deleteItemsTitle: `RequisitionList.RequisitionListView.deleteItemsTitle`,\n deleteItemsMessage: `RequisitionList.RequisitionListView.deleteItemsMessage`,\n confirmAction: `RequisitionList.RequisitionListView.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListView.cancelAction`,\n });\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const { isEnabled } = useRequisitionListEnabled();\n\n useEffect(() => {\n const requisitionListEvent = events.on(\n 'requisitionList/data',\n (payload: RequisitionList) => {\n // Only update from events if it matches our current UID\n if (payload?.uid === requisitionListUid) {\n setCurrentRequisitionList(payload);\n setSelectedItems(new Set());\n }\n }\n );\n // Keep event listener for cross-component alert communication\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n return () => {\n requisitionListEvent?.off();\n alertEvent?.off();\n };\n }, [\n handleRequisitionListAlert,\n requisitionListUid,\n setCurrentRequisitionList,\n setSelectedItems,\n ]);\n\n // Sync pageSize prop changes to local state\n useEffect(() => {\n setCurrentPageSize(pageSize);\n }, [pageSize]);\n\n // Function to fetch and merge product data\n const fetchAndMergeProducts = useCallback(\n async (baseRequisitionList: RequisitionList) => {\n // Extract SKUs from requisition list items\n const productSkus =\n baseRequisitionList.items?.map((item: Item) => item.sku) || [];\n\n if (productSkus.length === 0) {\n return baseRequisitionList;\n }\n\n setLoadingProducts(true);\n\n try {\n const fetchedProducts = await getProductData(productSkus);\n if (fetchedProducts) {\n // Create a map of SKU to Product for easy lookup\n const productMap = new Map<string, Product>();\n fetchedProducts.forEach((product: Product) => {\n productMap.set(product.sku, product);\n });\n\n // Update requisition list items with fetched product data\n return {\n ...baseRequisitionList,\n items: baseRequisitionList.items?.map((item: Item) => {\n const fetchedProduct = productMap.get(item.sku);\n return {\n ...item,\n product: fetchedProduct || item.product, // Use fetched product or keep existing\n stock_status: (item.stock_status ||\n fetchedProduct?.stock_status ||\n 'IN_STOCK') as 'IN_STOCK' | 'OUT_OF_STOCK',\n only_x_left_in_stock:\n item.only_x_left_in_stock ??\n fetchedProduct?.only_x_left_in_stock ??\n null,\n };\n }),\n };\n }\n console.warn('No products found');\n return baseRequisitionList;\n } catch (error) {\n console.warn(\n error instanceof Error\n ? error.message\n : translations.errorLoadingProducts\n );\n return baseRequisitionList;\n } finally {\n setLoadingProducts(false);\n }\n },\n [translations.errorLoadingProducts]\n );\n\n // Initialize requisition list from UID\n // Only triggers initial load when UID changes. Page size changes trigger pagination, not re-initialization.\n useEffect(() => {\n if (!requisitionListUid) {\n setInitializing(false);\n return;\n }\n\n // Only initialize if we don't have a list or if the UID changed\n if (\n currentRequisitionList &&\n currentRequisitionList.uid === requisitionListUid\n ) {\n // Same list already loaded, don't re-initialize\n return;\n }\n\n setInitializing(true);\n\n const initializeFromUid = async () => {\n try {\n const fetchedList = await getRequisitionList(\n requisitionListUid,\n 1,\n pageSize\n );\n\n if (fetchedList) {\n // Fetch and merge product data\n if (!skipProductLoading) {\n const enrichedList = await fetchAndMergeProducts(fetchedList);\n setCurrentRequisitionList(enrichedList);\n } else {\n setCurrentRequisitionList(fetchedList);\n }\n }\n } catch (error) {\n console.error('Failed to initialize requisition list from UID:', error);\n } finally {\n setInitializing(false);\n }\n };\n\n initializeFromUid();\n }, [\n requisitionListUid,\n pageSize,\n skipProductLoading,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentRequisitionList,\n ]);\n\n const handleAddItemsToCart = useCallback(\n async (itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length === 1) {\n setBulkAddingToCart(false);\n setAddingToCartItemId(itemUids);\n } else {\n setBulkAddingToCart(true);\n setAddingToCartItemId(null);\n }\n\n try {\n const errors = await addRequisitionListItemsToCart(\n currentRequisitionList.uid,\n itemUids\n );\n\n const totalItems = itemUids?.length || 0;\n const errorCount = errors?.length || 0;\n const successCount = totalItems - errorCount;\n\n // Check for partial success: some items succeeded and some failed\n if (errors && errors.length > 0 && successCount > 0) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: [\n translations.partialMoveSuccess\n .replace('{successCount}', String(successCount))\n .replace('{failedCount}', String(errorCount)),\n ],\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else if (errors && errors.length > 0) {\n // All items failed\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: AddToCartError) => e.message),\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else {\n // All items succeeded\n const alertPayload = {\n action: 'move',\n type: 'success',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n }\n } catch (error) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList, handleRequisitionListAlert, translations]\n );\n\n const handleDeleteItems = useCallback((itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length > 0) {\n setItemsToDelete(itemUids);\n setShowDeleteModal(true);\n }\n }, []);\n\n const handleConfirmDelete = useCallback(async () => {\n if (itemsToDelete.length === 1) {\n setDeletingItemId(itemsToDelete[0]);\n } else {\n setDeletingItemId('bulk');\n }\n\n try {\n const updatedRequisitionList = await deleteRequisitionListItems(\n currentRequisitionList.uid,\n itemsToDelete,\n currentPageSize,\n currentRequisitionList.page_info.current_page\n );\n\n if (updatedRequisitionList) {\n // Fetch and merge product data to ensure prices are loaded\n const enrichedRequisitionList = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'delete',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n } finally {\n setDeletingItemId(null);\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }\n }, [\n itemsToDelete,\n currentRequisitionList,\n currentPageSize,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n handleRequisitionListAlert,\n ]);\n\n const handleUpdateQuantity = useCallback(\n async (itemUid: string, newQuantity: number) => {\n setUpdatingQuantityItemId(itemUid);\n\n try {\n // Find the current item to update\n const currentItem = currentRequisitionList.items?.find(\n (item: Item) => item.uid === itemUid\n );\n if (!currentItem) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n return;\n }\n\n // Create updated item with new quantity\n const updatedItem = {\n item_id: currentItem.uid,\n entered_options: currentItem.entered_options,\n selected_options: currentItem.selected_options,\n quantity: newQuantity,\n };\n\n const updatedRequisitionList = await updateRequisitionListItems(\n currentRequisitionList.uid,\n [updatedItem],\n currentPageSize,\n currentRequisitionList.page_info.current_page\n );\n\n if (updatedRequisitionList) {\n // Reload product data with updated quantities\n const enrichedRequisitionList = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'update',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n } finally {\n setUpdatingQuantityItemId(null);\n }\n },\n [\n currentRequisitionList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentPageSize,\n handleRequisitionListAlert,\n ]\n );\n\n const handlePageChange = useCallback(\n async (page: number) => {\n setLoadingPage(true);\n\n try {\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n page,\n currentPageSize\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page\n const updatedListWithProducts = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(\n error instanceof Error ? error.message : translations.errorLoadPage\n );\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n currentPageSize,\n translations,\n setCurrentRequisitionList,\n ]\n );\n\n const handlePageSizeChange = useCallback(\n async (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setLoadingPage(true);\n\n try {\n // Reset to page 1 when changing page size\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n 1,\n newPageSize\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page\n const updatedListWithProducts = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(translations.errorLoadPage);\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n translations,\n setCurrentRequisitionList,\n ]\n );\n\n const handleUpdate = useCallback(\n async (updatedList: RequisitionList) => {\n // With the updated API, the response includes items and page_info\n // but we need to fetch and merge full product data (prices, images, etc.)\n const enrichedList = await fetchAndMergeProducts(updatedList);\n setCurrentRequisitionList(enrichedList);\n },\n [setCurrentRequisitionList, fetchAndMergeProducts]\n );\n\n return (\n <div className=\"requisition-list-view__container\">\n {initializing ? (\n <div className=\"requisition-list-view__loading\">\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : isEnabled === false ? (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n ) : !currentRequisitionList ||\n !isValidBase64Uid(currentRequisitionList?.uid) ? (\n <NotFound\n title={translations.notFoundTitle}\n message={translations.notFoundMessage}\n actionLabel={\n routeRequisitionListGrid\n ? translations.notFoundActionLabel\n : undefined\n }\n onAction={\n routeRequisitionListGrid\n ? () => {\n const url = routeRequisitionListGrid();\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n <RequisitionListHeader\n requisitionList={currentRequisitionList}\n routeRequisitionListGrid={routeRequisitionListGrid}\n onUpdate={handleUpdate}\n onAlert={handleRequisitionListAlert}\n />\n\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {currentRequisitionList.items_count === 0 ? (\n <EmptyList\n textContent={`${currentRequisitionList.name} ${translations.emptyRequisitionList}`}\n />\n ) : (\n <>\n <BatchActions\n selectedItems={selectedItems}\n deletingItemId={deletingItemId}\n addingToCartItemId={addingToCartItemId}\n bulkAddingToCart={bulkAddingToCart}\n updatingQuantityItemId={updatingQuantityItemId}\n onSelectAll={handleSelectAll}\n onSelectNone={handleSelectNone}\n onBulkAddToCart={() =>\n handleAddItemsToCart(Array.from(selectedItems))\n }\n onBulkDelete={() =>\n handleDeleteItems(Array.from(selectedItems))\n }\n />\n\n <ProductListTable\n items={currentRequisitionList.items}\n selectedItems={selectedItems}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n pageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n handleItemSelection={handleItemSelection}\n handleUpdateQuantity={handleUpdateQuantity}\n onAddToCart={handleAddItemsToCart}\n onDeleteItem={handleDeleteItems}\n />\n\n {/* Pagination */}\n {currentRequisitionList.page_info && (\n <div className=\"requisition-list-view__pagination\">\n <PaginationItemsCounter\n pageInfo={currentRequisitionList.page_info}\n totalCount={currentRequisitionList.items_count}\n />\n {(currentRequisitionList.page_info?.total_pages || 0) > 1 && (\n <Pagination\n totalPages={currentRequisitionList.page_info.total_pages}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n onChange={handlePageChange}\n disabled={loadingPage || loadingProducts}\n />\n )}\n <div className=\"requisition-list-view__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n onPageSizeChange={handlePageSizeChange}\n disabled={loadingPage || loadingProducts}\n />\n </div>\n </div>\n )}\n </>\n )}\n </>\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={deletingItemId !== null}\n title={translations.deleteItemsTitle}\n modalContent={translations.deleteItemsMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => {\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }}\n handleModalOnConfirm={handleConfirmDelete}\n />\n )}\n </div>\n );\n};\n"],"names":["SvgCart","props","React","SvgMinus","SvgTrash","useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","useState","selectedItems","setSelectedItems","handleItemSelection","useCallback","itemUid","isSelected","prev","newSet","handleSelectAll","allItemUids","_a","item","handleSelectNone","ProductListTable","className","items","currentPage","pageSize","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","disabledInputs","setDisabledInputs","inputValues","setInputValues","translations","useText","columns","handleItemCheckboxChange","event","getRowIndex","index","getImageAlt","_b","getImageSrc","_c","_e","_d","_f","getProductName","getConfiguredProductName","getBundleProducts","option","jsxs","getSku","getPriceAmount","previousValue","_h","_g","getPriceCurrency","getSubtotal","handleInputChange","e","inputValue","handleInputBlur","newQty","rowData","jsx","Checkbox","Image","Price","Field","Input","Button","Icon","Cart","Trash","table","Table","VComponent","h","classes","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","isDisabled","hasSelectedItems","Minus","RequisitionListView","requisitionListUid","skipProductLoading","DEFAULT_PAGE_SIZE","routeRequisitionListGrid","fallbackRoute","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","currentPageSize","setCurrentPageSize","initializing","setInitializing","showDeleteModal","setShowDeleteModal","itemsToDelete","setItemsToDelete","alert","setAlert","handleRequisitionListAlert","useRequisitionListAlert","isEnabled","useRequisitionListEnabled","useEffect","requisitionListEvent","events","payload","alertEvent","fetchAndMergeProducts","baseRequisitionList","productSkus","fetchedProducts","getProductData","productMap","product","fetchedProduct","error","fetchedList","getRequisitionList","enrichedList","handleAddItemsToCart","itemUids","errors","addRequisitionListItemsToCart","totalItems","errorCount","successCount","alertPayload","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","handlePageChange","page","updatedListWithProducts","handlePageSizeChange","newPageSize","handleUpdate","updatedList","ProgressS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AAvB,YAAAyC,GAAkC,eAAgB,EAEpD,SAAU6G,EACV,SAAUlD,GAAeN,CAAA,CAAA,EAG7B/C,EAAC,MAAA,CAAI,UAAU,2CACb,SAAA,CAAAc,EAAC,OAAA,CAAM,WAAa,IAAA,CAAK,EACzBA,EAAC0G,GAAA,CACC,kBACE/H,GAAAxC,EAAuB,YAAvB,YAAAwC,GAAkC,YAClCmD,GAEF,iBAAkB8D,EAClB,SAAUrD,GAAeN,CAAA,CAAA,CAC3B,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,EAEJ,EAIDY,GACC7C,EAAC2G,GAAA,CACC,OAAQ9D,EACR,UAAW7B,IAAmB,KAC9B,MAAOhD,EAAa,iBACpB,aAAcA,EAAa,mBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAM,CACxB8E,EAAmB,EAAK,EACxBE,EAAiB,CAAA,CAAE,CACrB,EACA,qBAAsBiC,CAAA,CAAA,CACxB,EAEJ,CAEJ","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"RequisitionListView.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Minus.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","/@dropins/storefront-requisition-list/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-requisition-list/src/components/BatchActions/BatchActions.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListView/RequisitionListView.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgCart = (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(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.3332 11.75H6.6665\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\", vectorEffect: \"non-scaling-stroke\", fill: \"none\", stroke: \"currentColor\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\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 { Item } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\ntype UseRequisitionListSelectedItems = {\n currentRequisitionList: RequisitionList | null;\n setCurrentRequisitionList: (\n value:\n | RequisitionList\n | null\n | ((prev: RequisitionList | null) => RequisitionList | null)\n ) => void;\n selectedItems: Set<string>;\n setSelectedItems: (\n value: Set<string> | ((prev: Set<string>) => Set<string>)\n ) => void;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleSelectAll: () => void;\n handleSelectNone: () => void;\n};\n\nexport function useRequisitionListSelectedItems(): UseRequisitionListSelectedItems {\n const [currentRequisitionList, setCurrentRequisitionList] =\n useState<RequisitionList | null>(null);\n const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());\n\n const handleItemSelection = useCallback(\n (itemUid: string, isSelected: boolean) => {\n setSelectedItems((prev: Set<string>) => {\n const newSet = new Set(prev);\n if (isSelected) {\n newSet.add(itemUid);\n } else {\n newSet.delete(itemUid);\n }\n return newSet;\n });\n },\n []\n );\n\n const handleSelectAll = useCallback(() => {\n const allItemUids = currentRequisitionList?.items?.map(\n (item: Item) => item.uid\n );\n setSelectedItems(new Set(allItemUids));\n }, [currentRequisitionList]);\n\n const handleSelectNone = useCallback(() => {\n setSelectedItems(new Set());\n }, []);\n\n return {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\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 { FunctionComponent, h } from 'preact';\nimport { useState } from 'preact/hooks';\nimport { HTMLAttributes, ChangeEvent } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Icon,\n Table,\n Checkbox,\n Price,\n Button,\n Field,\n Input,\n Image,\n} from '@adobe-commerce/elsie/components';\nimport { Trash, Cart } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/ProductListTable/ProductListTable.css';\nimport { RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { Item, BundleOption } from '@/requisitionList/data/models/item';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n className?: string;\n items: RequisitionListModel['items'];\n selectedItems: Set<string>;\n currentPage: number;\n pageSize: number;\n canEdit?: boolean;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleUpdateQuantity: (itemUid: string, newQuantity: number) => Promise<void>;\n onAddToCart: (itemUids: string[] | undefined) => void;\n onDeleteItem: (itemUids: string[] | undefined) => void;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n selectedItems,\n currentPage,\n pageSize,\n canEdit = true,\n handleItemSelection,\n handleUpdateQuantity,\n onAddToCart,\n onDeleteItem,\n ...props\n}) => {\n const [disabledInputs, setDisabledInputs] = useState<Record<string, boolean>>(\n {}\n );\n const [inputValues, setInputValues] = useState<Record<string, number>>({});\n\n const translations = useText({\n productNameHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.productName',\n skuHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.sku',\n priceHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.price',\n quantityHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.quantity',\n subtotalHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.subtotal',\n actionsHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.actions',\n actionAddToCart: 'RequisitionList.RequisitionListView.actionAddToCart',\n actionDelete: 'RequisitionList.RequisitionListView.actionDelete',\n actionSelect: 'RequisitionList.RequisitionListView.actionSelect',\n itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\n outOfStock:\n 'RequisitionList.RequisitionListView.productListTable.outOfStock',\n onlyXLeftInStock:\n 'RequisitionList.RequisitionListView.productListTable.onlyXLeftInStock',\n });\n const columns = [\n {\n label: '#',\n key: 'index',\n },\n {\n label: 'item',\n key: 'item',\n },\n {\n label: translations.priceHeader,\n key: 'price',\n },\n {\n label: translations.quantityHeader,\n key: 'quantity',\n },\n {\n label: translations.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit) {\n columns.unshift({\n label: translations.actionSelect,\n key: 'selector',\n });\n columns.push({\n label: translations.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: ChangeEvent<HTMLInputElement>,\n item: Item\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n handleItemSelection(item.uid, isSelected);\n };\n\n const getRowIndex = (index: number): number => {\n return (currentPage - 1) * pageSize + index + 1;\n };\n\n const getImageAlt = (item: Item): string => {\n return item.configured_product?.name || item.product?.name || item.sku;\n };\n\n const getImageSrc = (item: Item): string => {\n return item.configured_product?.images?.length\n ? item.configured_product.images[0]?.url || ''\n : item.product?.images?.length\n ? item.product.images[0]?.url || ''\n : '';\n };\n\n const getProductName = (item: Item): string | undefined => {\n return item.product?.name || item.sku;\n };\n\n const getConfiguredProductName = (item: Item): string | undefined => {\n return item.configured_product?.name;\n };\n\n const getBundleProducts = (\n item: Item\n ): h.JSX<HTMLSpanElement>[] | undefined => {\n if (!item.bundle_options) {\n return;\n }\n\n const bundleProducts = item.bundle_options.map(\n (option: BundleOption, index: number): h.JSX<HTMLSpanElement> => {\n return (\n <span\n key={option.values[0].label || index}\n className=\"requisition-list-view-product-list-table__product-configurable-name\"\n >\n {option.values[0]!.label} x {option.values[0]!.quantity}\n </span>\n );\n }\n );\n return bundleProducts;\n };\n\n const getSku = (item: Item): string | undefined => {\n return item.configured_product?.sku || item.sku;\n };\n\n const getPriceAmount = (item: Item): number => {\n if (Array.isArray(item.bundle_options) && item.bundle_options.length > 0) {\n return item.bundle_options.reduce(\n (previousValue: number, option: BundleOption): number => {\n return (\n previousValue +\n (option.values[0]?.priceV2?.value || 0) *\n (option.values[0]?.quantity || 0)\n );\n },\n 0\n );\n }\n return (\n item.configured_product?.price?.final?.amount?.value ||\n item.product?.price?.final?.amount?.value ||\n 0\n );\n };\n\n const getPriceCurrency = (item: Item): string | undefined => {\n return (\n item.configured_product?.price?.final?.amount?.currency ||\n item.product?.price?.final?.amount?.currency\n );\n };\n\n const getSubtotal = (item: Item): number => {\n return getPriceAmount(item) * item.quantity;\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>, item: Item) => {\n const inputValue = +(e.target as HTMLInputElement).value;\n if (inputValue > 0 && !Number.isNaN(e.target.value)) {\n setInputValues((prev) => ({ ...prev, [item.uid]: inputValue }));\n }\n };\n\n const handleInputBlur = async (e: FocusEvent, item: Item) => {\n let newQty = +(e.target as HTMLInputElement).value;\n\n if ((newQty > 0 && newQty !== item.quantity) === false) {\n setInputValues((prev) => ({ ...prev, [item.uid]: item.quantity }));\n return;\n }\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: true }));\n try {\n await handleUpdateQuantity(item.uid, newQty);\n } finally {\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: false }));\n }\n };\n\n const rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <label id={`item-selector-${item.sku}-label`}>\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name={`item-selector-${item.sku}`}\n aria-label={`${translations.actionSelect} ${getProductName(item)}`}\n data-testid={`item-checkbox-${item.sku}`}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleItemCheckboxChange(e, item)\n }\n value={item.sku}\n checked={selectedItems.has(item.uid)}\n />\n </label>\n ),\n index: (\n <div className=\"requisition-list-view-product-list-table__index-container\">\n {getRowIndex(index)}\n </div>\n ),\n item: (\n <div className=\"requisition-list-view-product-list-table__item-container\">\n <Image\n className=\"requisition-list-view-product-list-table__thumbnail\"\n alt={getImageAlt(item)}\n src={getImageSrc(item)}\n />\n <div className=\"requisition-list-view-product-list-table__item-details\">\n <div className=\"requisition-list-view-product-list-table__product-name\">\n {getProductName(item)}\n </div>\n {item.stock_status === 'OUT_OF_STOCK' && (\n <div className=\"requisition-list-view-product-list-table__out-of-stock\">\n {translations.outOfStock}\n </div>\n )}\n {item.stock_status !== 'OUT_OF_STOCK' &&\n item.only_x_left_in_stock !== null &&\n item.only_x_left_in_stock < item.quantity && (\n <div className=\"requisition-list-view-product-list-table__low-stock\">\n {translations.onlyXLeftInStock.replace(\n '{count}',\n String(item.only_x_left_in_stock)\n )}\n </div>\n )}\n <span className=\"requisition-list-view-product-list-table__product-configurable-name\">\n {getConfiguredProductName(item)}\n </span>\n <div className=\"requisition-list-view-product-list-table__sku\">\n {getSku(item)}\n </div>\n {getBundleProducts(item)}\n </div>\n </div>\n ),\n price: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getPriceAmount(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n quantity: (\n <span className=\"requisition-list-view-product-list-table__quantity\">\n <Field disabled={!!disabledInputs[item.uid]}>\n <Input\n id={`requisition-list-item-quantity-${item.sku}`}\n data-testid={`requisition-list-item-quantity-${item.sku}`}\n name=\"quantity\"\n type=\"text\"\n aria-label={`${translations.itemQuantity} - ${getProductName(\n item\n )}`}\n value={inputValues[item.uid] ?? item.quantity}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleInputChange(e, item)\n }\n onBlur={(e: FocusEvent) => handleInputBlur(e, item)}\n />\n </Field>\n </span>\n ),\n subtotal: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getSubtotal(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n actions: (\n <div className=\"requisition-list-view__bulk-actions\">\n <Button\n type=\"button\"\n onClick={() => onAddToCart([item.uid])}\n icon={<Icon source={Cart} />}\n aria-label={`${translations.actionAddToCart} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-add-to-cart-button\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n icon={<Icon source={Trash} />}\n onClick={() => onDeleteItem([item.uid])}\n aria-label={`${translations.actionDelete} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-delete-button\"\n />\n </div>\n ),\n };\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n />\n );\n\n return (\n <VComponent\n node={h('div', {})}\n className={classes([\n 'requisition-list-view-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...props}\n >\n {table}\n </VComponent>\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 { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { Trash, Minus } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/BatchActions/BatchActions.css';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface BatchActionsProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n selectedItems: Set<string>;\n deletingItemId: string | null;\n addingToCartItemId: string | null;\n bulkAddingToCart: boolean;\n updatingQuantityItemId: string | null;\n onSelectAll: () => void;\n onSelectNone: () => void;\n onBulkAddToCart: () => void;\n onBulkDelete: () => void;\n}\n\nexport const BatchActions: FunctionComponent<BatchActionsProps> = ({\n selectedItems,\n deletingItemId,\n addingToCartItemId,\n bulkAddingToCart,\n updatingQuantityItemId,\n onSelectAll,\n onSelectNone,\n onBulkAddToCart,\n onBulkDelete,\n}) => {\n const translations = useText({\n statusDeleting: `RequisitionList.RequisitionListView.statusDeleting`,\n actionSelectAll: `RequisitionList.RequisitionListView.actionSelectAll`,\n actionSelectNone: `RequisitionList.RequisitionListView.actionSelectNone`,\n actionAddToCart: `RequisitionList.RequisitionListView.actionAddToCart`,\n actionDeleteSelectedItems: `RequisitionList.RequisitionListView.actionDeleteSelectedItems`,\n statusBulkAddingToCart: `RequisitionList.RequisitionListView.statusBulkAddingToCart`,\n });\n\n const isDisabled =\n deletingItemId !== null ||\n addingToCartItemId !== null ||\n bulkAddingToCart ||\n updatingQuantityItemId !== null;\n\n const hasSelectedItems = selectedItems.size > 0;\n\n return (\n <div className=\"requisition-list-view__batch-actions\">\n <div className=\"requisition-list-view__batch-actions-left\">\n <button\n data-testid=\"bulk-actions-select-toggle-btn\"\n type=\"button\"\n className={`requisition-list-view__batch-actions-select-toggle ${\n hasSelectedItems\n ? 'requisition-list-view__batch-actions-select-toggle--active'\n : ''\n }`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={\n hasSelectedItems\n ? translations.actionSelectNone\n : translations.actionSelectAll\n }\n >\n <Icon source={Minus} />\n </button>\n <button\n type=\"button\"\n className=\"requisition-list-view__batch-actions-select-label\"\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n >\n {translations.actionSelectAll}\n </button>\n </div>\n\n {hasSelectedItems && (\n <div className=\"requisition-list-view__batch-actions-buttons\">\n <span\n className=\"requisition-list-view__batch-actions-count-badge\"\n aria-label={`${selectedItems.size} items selected`}\n >\n {selectedItems.size}\n </span>\n <Button\n data-testid=\"bulk-actions-add-to-cart-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkAddToCart}\n disabled={isDisabled}\n >\n {bulkAddingToCart\n ? translations.statusBulkAddingToCart\n : translations.actionAddToCart}\n </Button>\n <button\n data-testid=\"bulk-actions-delete-btn\"\n type=\"button\"\n className=\"requisition-list-view__batch-actions-delete-icon\"\n onClick={onBulkDelete}\n disabled={isDisabled}\n aria-label={translations.actionDeleteSelectedItems}\n >\n <Icon source={Trash} />\n </button>\n </div>\n )}\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 *******************************************************************/\nimport {\n HTMLAttributes,\n useState,\n useCallback,\n useEffect,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n addRequisitionListItemsToCart,\n AddToCartError,\n} from '@/requisitionList/api/addRequisitionListItemsToCart';\nimport { deleteRequisitionListItems } from '@/requisitionList/api/deleteRequisitionListItems';\nimport { updateRequisitionListItems } from '@/requisitionList/api/updateRequisitionListItems';\nimport { getRequisitionList } from '@/requisitionList/api/getRequisitionList';\nimport {\n Pagination,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { Item, Product } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n PageSizePicker,\n EmptyList,\n NotFound,\n RequisitionListModal,\n PaginationItemsCounter,\n} from '@/requisitionList/components';\nimport { ProductListTable } from '@/requisitionList/components/ProductListTable/ProductListTable';\nimport { BatchActions } from '@/requisitionList/components/BatchActions/BatchActions';\nimport { RequisitionListHeader } from '@/requisitionList/containers/RequisitionListHeader';\nimport { useRequisitionListSelectedItems } from '@/requisitionList/hooks/useRequisitionListSelectedItems';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks/useRequisitionListAlert';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport '@/requisitionList/containers/RequisitionListView/RequisitionListView.css';\n\nexport interface RequisitionListViewProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * The UID of the requisition list to display.\n * The UID must be a base64-encoded string.\n * If an invalid UID is provided, the component will render the NotFound state.\n * The component will fetch the requisition list data internally.\n */\n requisitionListUid: string;\n /**\n * When true, skips automatic product data fetching on component mount.\n * Used in tests to prevent API calls.\n */\n skipProductLoading?: boolean;\n /**\n * Number of items per page for pagination.\n * Defaults to DEFAULT_PAGE_SIZE.\n */\n pageSize?: number;\n selectedItems: Set<string>;\n /**\n * Function that returns the URL to the requisition list grid view or performs navigation\n */\n routeRequisitionListGrid?: () => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n getProductData: (skus: string[]) => Promise<Product[] | null>;\n enrichConfigurableProducts: (items: Item[]) => Promise<Item[]>;\n}\n\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\n fallbackRoute = '/customer/account',\n getProductData,\n enrichConfigurableProducts,\n}: RequisitionListViewProps) => {\n const [loadingProducts, setLoadingProducts] = useState<boolean>(false);\n const [deletingItemId, setDeletingItemId] = useState<string | null>(null);\n const [addingToCartItemId, setAddingToCartItemId] = useState<\n string[] | undefined\n >(null);\n const [bulkAddingToCart, setBulkAddingToCart] = useState<boolean>(false);\n const [updatingQuantityItemId, setUpdatingQuantityItemId] = useState<\n string | null\n >(null);\n const [loadingPage, setLoadingPage] = useState<boolean>(false);\n const [currentPageSize, setCurrentPageSize] = useState<number>(pageSize);\n const [initializing, setInitializing] = useState<boolean>(true);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [itemsToDelete, setItemsToDelete] = useState<string[]>([]);\n\n const {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n } = useRequisitionListSelectedItems();\n\n const translations = useText({\n emptyRequisitionList: `RequisitionList.RequisitionListView.emptyRequisitionList`,\n errorLoadingProducts: `RequisitionList.RequisitionListView.errorLoadingProducts`,\n errorLoadPage: `RequisitionList.RequisitionListView.errorLoadPage`,\n notFoundTitle: `RequisitionList.RequisitionListView.notFoundTitle`,\n notFoundMessage: `RequisitionList.RequisitionListView.notFoundMessage`,\n notFoundActionLabel: `RequisitionList.RequisitionListView.notFoundActionLabel`,\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n partialMoveSuccess: `RequisitionList.RequisitionListAlert.partialMoveSuccess`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n show: `RequisitionList.PageSizePicker.show`,\n deleteItemsTitle: `RequisitionList.RequisitionListView.deleteItemsTitle`,\n deleteItemsMessage: `RequisitionList.RequisitionListView.deleteItemsMessage`,\n confirmAction: `RequisitionList.RequisitionListView.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListView.cancelAction`,\n });\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const { isEnabled } = useRequisitionListEnabled();\n\n useEffect(() => {\n const requisitionListEvent = events.on(\n 'requisitionList/data',\n (payload: RequisitionList) => {\n // Only update from events if it matches our current UID\n if (payload?.uid === requisitionListUid) {\n setCurrentRequisitionList(payload);\n setSelectedItems(new Set());\n }\n }\n );\n // Keep event listener for cross-component alert communication\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n return () => {\n requisitionListEvent?.off();\n alertEvent?.off();\n };\n }, [\n handleRequisitionListAlert,\n requisitionListUid,\n setCurrentRequisitionList,\n setSelectedItems,\n ]);\n\n // Sync pageSize prop changes to local state\n useEffect(() => {\n setCurrentPageSize(pageSize);\n }, [pageSize]);\n\n // Function to enrich configurable products\n const enrichConfigurableProductsInList = useCallback(\n async (baseRequisitionList: RequisitionList): Promise<RequisitionList> => {\n if (!baseRequisitionList.items?.length) {\n return baseRequisitionList;\n }\n\n const enrichedItems = await enrichConfigurableProducts(\n baseRequisitionList.items\n );\n return {\n ...baseRequisitionList,\n items: enrichedItems,\n };\n },\n [enrichConfigurableProducts]\n );\n\n // Function to fetch and merge product data\n const fetchAndMergeProducts = useCallback(\n async (baseRequisitionList: RequisitionList) => {\n // Extract SKUs from requisition list items\n const productSkus =\n baseRequisitionList.items?.map((item: Item) => item.sku) || [];\n\n if (productSkus.length === 0) {\n return baseRequisitionList;\n }\n\n setLoadingProducts(true);\n\n try {\n const fetchedProducts = await getProductData(productSkus);\n if (fetchedProducts) {\n // Create a map of SKU to Product for easy lookup\n const productMap = new Map<string, Product>();\n fetchedProducts.forEach((product: Product) => {\n productMap.set(product.sku, product);\n });\n\n // Update requisition list items with fetched product data\n return {\n ...baseRequisitionList,\n items: baseRequisitionList.items?.map((item: Item) => {\n const fetchedProduct = productMap.get(item.sku);\n return {\n ...item,\n product: fetchedProduct || item.product, // Use fetched product or keep existing\n stock_status: (item.stock_status ||\n fetchedProduct?.stock_status ||\n 'IN_STOCK') as 'IN_STOCK' | 'OUT_OF_STOCK',\n only_x_left_in_stock:\n item.only_x_left_in_stock ??\n fetchedProduct?.only_x_left_in_stock ??\n null,\n };\n }),\n };\n }\n console.warn('No products found');\n return baseRequisitionList;\n } catch (error) {\n console.warn(\n error instanceof Error\n ? error.message\n : translations.errorLoadingProducts\n );\n return baseRequisitionList;\n } finally {\n setLoadingProducts(false);\n }\n },\n [getProductData, translations.errorLoadingProducts]\n );\n\n // Initialize requisition list from UID\n // Only triggers initial load when UID changes. Page size changes trigger pagination, not re-initialization.\n useEffect(() => {\n if (!requisitionListUid) {\n setInitializing(false);\n return;\n }\n\n // Only initialize if we don't have a list or if the UID changed\n if (\n currentRequisitionList &&\n currentRequisitionList.uid === requisitionListUid\n ) {\n // Same list already loaded, don't re-initialize\n return;\n }\n\n setInitializing(true);\n\n const initializeFromUid = async () => {\n try {\n const fetchedList = await getRequisitionList(\n requisitionListUid,\n 1,\n pageSize,\n enrichConfigurableProducts\n );\n\n if (fetchedList) {\n // List already enriched via getRequisitionList(enrichConfigurableProducts)\n if (!skipProductLoading) {\n const enrichedList = await fetchAndMergeProducts(fetchedList);\n setCurrentRequisitionList(enrichedList);\n } else {\n setCurrentRequisitionList(fetchedList);\n }\n }\n } catch (error) {\n console.error('Failed to initialize requisition list from UID:', error);\n } finally {\n setInitializing(false);\n }\n };\n\n initializeFromUid();\n }, [\n requisitionListUid,\n pageSize,\n skipProductLoading,\n enrichConfigurableProducts,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentRequisitionList,\n ]);\n\n const handleAddItemsToCart = useCallback(\n async (itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length === 1) {\n setBulkAddingToCart(false);\n setAddingToCartItemId(itemUids);\n } else {\n setBulkAddingToCart(true);\n setAddingToCartItemId(null);\n }\n\n try {\n const errors = await addRequisitionListItemsToCart(\n currentRequisitionList.uid,\n itemUids\n );\n\n const totalItems = itemUids?.length || 0;\n const errorCount = errors?.length || 0;\n const successCount = totalItems - errorCount;\n\n // Check for partial success: some items succeeded and some failed\n if (errors && errors.length > 0 && successCount > 0) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: [\n translations.partialMoveSuccess\n .replace('{successCount}', String(successCount))\n .replace('{failedCount}', String(errorCount)),\n ],\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else if (errors && errors.length > 0) {\n // All items failed\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: AddToCartError) => e.message),\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else {\n // All items succeeded\n const alertPayload = {\n action: 'move',\n type: 'success',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n }\n } catch (error) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList, handleRequisitionListAlert, translations]\n );\n\n const handleDeleteItems = useCallback((itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length > 0) {\n setItemsToDelete(itemUids);\n setShowDeleteModal(true);\n }\n }, []);\n\n const handleConfirmDelete = useCallback(async () => {\n if (itemsToDelete.length === 1) {\n setDeletingItemId(itemsToDelete[0]);\n } else {\n setDeletingItemId('bulk');\n }\n\n try {\n const updatedRequisitionList = await deleteRequisitionListItems(\n currentRequisitionList.uid,\n itemsToDelete,\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Enrich configurable products\n const enrichedWithConfigurable =\n await enrichConfigurableProductsInList(updatedRequisitionList);\n // Fetch and merge product data to ensure prices are loaded\n const enrichedRequisitionList = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'delete',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n } finally {\n setDeletingItemId(null);\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }\n }, [\n itemsToDelete,\n currentRequisitionList,\n currentPageSize,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n handleRequisitionListAlert,\n enrichConfigurableProductsInList,\n enrichConfigurableProducts,\n ]);\n\n const handleUpdateQuantity = useCallback(\n async (itemUid: string, newQuantity: number) => {\n setUpdatingQuantityItemId(itemUid);\n\n try {\n // Find the current item to update\n const currentItem = currentRequisitionList.items?.find(\n (item: Item) => item.uid === itemUid\n );\n if (!currentItem) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n return;\n }\n\n // Create updated item with new quantity\n const updatedItem = {\n item_id: currentItem.uid,\n entered_options: currentItem.entered_options,\n selected_options: currentItem.selected_options,\n quantity: newQuantity,\n };\n\n const updatedRequisitionList = await updateRequisitionListItems(\n currentRequisitionList.uid,\n [updatedItem],\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // List already enriched via updateRequisitionListItems(enrichConfigurableProducts)\n const enrichedRequisitionList = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'update',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n } finally {\n setUpdatingQuantityItemId(null);\n }\n },\n [\n currentRequisitionList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentPageSize,\n handleRequisitionListAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageChange = useCallback(\n async (page: number) => {\n setLoadingPage(true);\n\n try {\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n page,\n currentPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(\n error instanceof Error ? error.message : translations.errorLoadPage\n );\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n currentPageSize,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageSizeChange = useCallback(\n async (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setLoadingPage(true);\n\n try {\n // Reset to page 1 when changing page size\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n 1,\n newPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(translations.errorLoadPage);\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handleUpdate = useCallback(\n async (updatedList: RequisitionList) => {\n // Enrich configurable products\n const enrichedWithConfigurable =\n await enrichConfigurableProductsInList(updatedList);\n // With the updated API, the response includes items and page_info\n // but we need to fetch and merge full product data (prices, images, etc.)\n const enrichedList = await fetchAndMergeProducts(enrichedWithConfigurable);\n setCurrentRequisitionList(enrichedList);\n },\n [\n setCurrentRequisitionList,\n fetchAndMergeProducts,\n enrichConfigurableProductsInList,\n ]\n );\n\n return (\n <div className=\"requisition-list-view__container\">\n {initializing ? (\n <div className=\"requisition-list-view__loading\">\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : isEnabled === false ? (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n ) : !currentRequisitionList ||\n !isValidBase64Uid(currentRequisitionList?.uid) ? (\n <NotFound\n title={translations.notFoundTitle}\n message={translations.notFoundMessage}\n actionLabel={\n routeRequisitionListGrid\n ? translations.notFoundActionLabel\n : undefined\n }\n onAction={\n routeRequisitionListGrid\n ? () => {\n const url = routeRequisitionListGrid();\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n <RequisitionListHeader\n requisitionList={currentRequisitionList}\n routeRequisitionListGrid={routeRequisitionListGrid}\n onUpdate={handleUpdate}\n onAlert={handleRequisitionListAlert}\n enrichConfigurableProducts={enrichConfigurableProducts}\n />\n\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {currentRequisitionList.items_count === 0 ? (\n <EmptyList\n textContent={`${currentRequisitionList.name} ${translations.emptyRequisitionList}`}\n />\n ) : (\n <>\n <BatchActions\n selectedItems={selectedItems}\n deletingItemId={deletingItemId}\n addingToCartItemId={addingToCartItemId}\n bulkAddingToCart={bulkAddingToCart}\n updatingQuantityItemId={updatingQuantityItemId}\n onSelectAll={handleSelectAll}\n onSelectNone={handleSelectNone}\n onBulkAddToCart={() =>\n handleAddItemsToCart(Array.from(selectedItems))\n }\n onBulkDelete={() =>\n handleDeleteItems(Array.from(selectedItems))\n }\n />\n\n <ProductListTable\n items={currentRequisitionList.items}\n selectedItems={selectedItems}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n pageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n handleItemSelection={handleItemSelection}\n handleUpdateQuantity={handleUpdateQuantity}\n onAddToCart={handleAddItemsToCart}\n onDeleteItem={handleDeleteItems}\n />\n\n {/* Pagination */}\n {currentRequisitionList.page_info && (\n <div className=\"requisition-list-view__pagination\">\n <PaginationItemsCounter\n pageInfo={currentRequisitionList.page_info}\n totalCount={currentRequisitionList.items_count}\n />\n {(currentRequisitionList.page_info?.total_pages || 0) > 1 && (\n <Pagination\n totalPages={currentRequisitionList.page_info.total_pages}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n onChange={handlePageChange}\n disabled={loadingPage || loadingProducts}\n />\n )}\n <div className=\"requisition-list-view__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n onPageSizeChange={handlePageSizeChange}\n disabled={loadingPage || loadingProducts}\n />\n </div>\n </div>\n )}\n </>\n )}\n </>\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={deletingItemId !== null}\n title={translations.deleteItemsTitle}\n modalContent={translations.deleteItemsMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => {\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }}\n handleModalOnConfirm={handleConfirmDelete}\n />\n )}\n </div>\n );\n};\n"],"names":["SvgCart","props","React","SvgMinus","SvgTrash","useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","useState","selectedItems","setSelectedItems","handleItemSelection","useCallback","itemUid","isSelected","prev","newSet","handleSelectAll","allItemUids","_a","item","handleSelectNone","ProductListTable","className","items","currentPage","pageSize","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","disabledInputs","setDisabledInputs","inputValues","setInputValues","translations","useText","columns","handleItemCheckboxChange","event","getRowIndex","index","getImageAlt","_b","getImageSrc","_c","_e","_d","_f","getProductName","getConfiguredProductName","getBundleProducts","option","jsxs","getSku","getPriceAmount","previousValue","_h","_g","getPriceCurrency","getSubtotal","handleInputChange","e","inputValue","handleInputBlur","newQty","rowData","jsx","Checkbox","Image","Price","Field","Input","Button","Icon","Cart","Trash","table","Table","VComponent","h","classes","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","isDisabled","hasSelectedItems","Minus","RequisitionListView","requisitionListUid","skipProductLoading","DEFAULT_PAGE_SIZE","routeRequisitionListGrid","fallbackRoute","getProductData","enrichConfigurableProducts","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","currentPageSize","setCurrentPageSize","initializing","setInitializing","showDeleteModal","setShowDeleteModal","itemsToDelete","setItemsToDelete","alert","setAlert","handleRequisitionListAlert","useRequisitionListAlert","isEnabled","useRequisitionListEnabled","useEffect","requisitionListEvent","events","payload","alertEvent","enrichConfigurableProductsInList","baseRequisitionList","enrichedItems","fetchAndMergeProducts","productSkus","fetchedProducts","productMap","product","fetchedProduct","error","fetchedList","getRequisitionList","enrichedList","handleAddItemsToCart","itemUids","errors","addRequisitionListItemsToCart","totalItems","errorCount","successCount","alertPayload","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedWithConfigurable","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","handlePageChange","page","updatedListWithProducts","handlePageSizeChange","newPageSize","handleUpdate","updatedList","ProgressSpinner","NotFound","isValidBase64Uid","url","Fragment","RequisitionListHeader","InLineAlert","EmptyList","PaginationItemsCounter","Pagination","PageSizePicker","RequisitionListModal"],"mappings":"yvCACA,MAAMA,GAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,IAAK,CAAE,SAAU,qBAAqB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,oZAAqZ,OAAQ,eAAgB,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,wCAAyC,OAAQ,eAAgB,eAAgB,OAAO,CAAE,CAAC,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,WAAY,CAAE,GAAI,eAAe,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,MAAO,MAAO,OAAQ,KAAM,KAAM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AAA,CACC,kBACEnI,GAAAxC,EAAuB,YAAvB,YAAAwC,GAAkC,YAClCmD,GAEF,iBAAkBkE,GAClB,SAAUvD,GAAeN,CAAA,CAAA,CAC3B,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,EAEJ,EAIDY,GACC/C,EAAC+G,GAAA,CACC,OAAQhE,EACR,UAAW/B,IAAmB,KAC9B,MAAOhD,EAAa,iBACpB,aAAcA,EAAa,mBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAM,CACxBgF,EAAmB,EAAK,EACxBE,EAAiB,CAAA,CAAE,CACrB,EACA,qBAAsBkC,EAAA,CAAA,CACxB,EAEJ,CAEJ","x_google_ignoreList":[0,1,2]}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-requisition-list", "version": "1.1
|
|
1
|
+
{"name": "@dropins/storefront-requisition-list", "version": "1.2.1-alpha1", "@dropins/tools": "~1.7.0", "license": "SEE LICENSE IN LICENSE.md"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2025 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare 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";
|
|
18
|
-
//# sourceMappingURL=ProductFragment.graphql.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2025 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const GET_PRODUCT_DATA_QUERY: string;
|
|
18
|
-
//# sourceMappingURL=getProductData.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2025 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export * from './getProductData';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Item } from '../../data/models/item';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Enriches configurable products with variant data by calling the refineProduct query
|
|
5
|
-
*
|
|
6
|
-
* @param items - Array of requisition list items
|
|
7
|
-
* @returns Promise resolving to array of items with configured_product populated for configurable items
|
|
8
|
-
*/
|
|
9
|
-
export declare const enrichConfigurableProducts: (items: Item[]) => Promise<Item[]>;
|
|
10
|
-
//# sourceMappingURL=enrichConfigurableProducts.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2025 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare 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";
|
|
18
|
-
//# sourceMappingURL=refineProduct.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2025 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export * from './enrichConfigurableProducts';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|