@dropins/storefront-requisition-list 0.8.0-beta → 1.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/fragments/RequisitionListItemsFragment.graphql.d.ts +1 -1
- package/api.js.map +1 -1
- package/chunks/PageSizePicker.js.map +1 -1
- package/chunks/RequisitionListActions.js.map +1 -1
- package/chunks/RequisitionListForm.js +1 -1
- package/chunks/RequisitionListForm.js.map +1 -1
- package/chunks/RequisitionListForm2.js.map +1 -1
- package/chunks/RequisitionListHeader.js +1 -1
- package/chunks/RequisitionListHeader.js.map +1 -1
- package/chunks/RequisitionListModal.js.map +1 -1
- package/chunks/RequisitionListView.js +1 -1
- package/chunks/RequisitionListView.js.map +1 -1
- package/chunks/addRequisitionListItemsToCart.js.map +1 -1
- package/chunks/deleteRequisitionList.js.map +1 -1
- package/chunks/getRequisitionLists.js.map +1 -1
- package/chunks/state.js.map +1 -1
- package/chunks/updateRequisitionList.js +24 -4
- package/chunks/updateRequisitionList.js.map +1 -1
- package/components/RequisitionListGridWrapper/RequisitionListGridWrapper.d.ts +0 -1
- package/containers/RequisitionListGrid.js +1 -1
- package/containers/RequisitionListGrid.js.map +1 -1
- package/containers/RequisitionListHeader/RequisitionListHeader.d.ts +5 -0
- package/containers/RequisitionListHeader.js +1 -1
- package/containers/RequisitionListSelector.js +2 -2
- package/containers/RequisitionListSelector.js.map +1 -1
- package/containers/RequisitionListView.js +1 -1
- package/containers/RequisitionListView.js.map +1 -1
- package/hooks/useRequisitionListGrid.d.ts +3 -3
- package/package.json +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequisitionListView.js","sources":["/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","../../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/Search.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@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":["/********************************************************************\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","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.5, strokeLinecap: \"square\", strokeLinejoin: \"round\", vectorEffect: \"non-scaling-stroke\", fill: \"none\", stroke: \"currentColor\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgSearch = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Search_Base\", \"data-name\": \"Icon \\\\u2013 Search \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, fill: \"none\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Search_icon\", \"data-name\": \"Search icon\", transform: \"translate(3.75 3.75)\" }, /* @__PURE__ */ React.createElement(\"circle\", { vectorEffect: \"non-scaling-stroke\", id: \"Ellipse_186\", \"data-name\": \"Ellipse 186\", cx: 6, cy: 6, r: 6, fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_556\", \"data-name\": \"Line 556\", x2: 6, y2: 6, transform: \"translate(10.5 10.5)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgSearch;\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\", { d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1.5, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { 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.5, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { 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.5, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1.5, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1.5, 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 *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon, Button } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Search } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/NotFound/NotFound.css';\n\nexport interface NotFoundProps {\n className?: string;\n title?: string;\n message?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nexport const NotFound: FunctionComponent<NotFoundProps> = ({\n className,\n title = '404 - Not Found',\n message = 'The requisition list you are looking for does not exist.',\n actionLabel,\n onAction,\n ...props\n}) => {\n return (\n <div\n className={classes(['not-found', className])}\n data-testid=\"not-found\"\n {...props}\n >\n <Icon source={Search} size={'64'} stroke={'2'} />\n <h2>{title}</h2>\n {message && <p>{message}</p>}\n {actionLabel && onAction && (\n <Button variant=\"primary\" onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n};\n\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\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 } 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) => 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 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 itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\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: '',\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\n ? item.configured_product.images[0]?.url\n : item.product?.images\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 getSku = (item: Item): string | undefined => {\n return item.configured_product?.sku || item.sku;\n };\n\n const getPriceAmount = (item: Item): number => {\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 rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name=\"itemSelected\"\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 ),\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 <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 </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={false}>\n <Input\n id=\"requisition-list-item-quantity\"\n name=\"quantity\"\n type=\"text\"\n value={item.quantity}\n onBlur={(e: FocusEvent) => {\n const newValue = Number.parseInt(\n (e.target as HTMLInputElement).value,\n 10\n );\n handleUpdateQuantity(item.uid, newValue);\n }}\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 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 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 ${hasSelectedItems ? 'requisition-list-view__batch-actions-select-toggle--active' : ''}`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={hasSelectedItems ? translations.actionSelectNone : translations.actionSelectAll}\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 { addRequisitionListItemsToCart } 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} 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 { 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\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\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 show: `RequisitionList.RequisitionListView.show`,\n itemsCounter: `RequisitionList.RequisitionListView.itemsCounter`,\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 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 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 ...item,\n product: productMap.get(item.sku) || item.product, // Use fetched product or keep existing\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 if (errors && errors.length > 0) {\n events.emit('requisitionList/alert', {\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: any) => e.message),\n });\n } else {\n events.emit('requisitionList/alert', {\n action: 'move',\n type: 'success',\n context: 'product',\n });\n }\n } catch (error) {\n events.emit('requisitionList/alert', {\n action: 'move',\n type: 'error',\n context: 'product',\n });\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList]\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 events.emit('requisitionList/alert', {\n action: 'delete',\n type: 'success',\n context: 'product',\n });\n } else {\n events.emit('requisitionList/alert', {\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n events.emit('requisitionList/alert', {\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 ]);\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 events.emit('requisitionList/alert', {\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 events.emit('requisitionList/alert', {\n action: 'update',\n type: 'success',\n context: 'product',\n });\n } else {\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n events.emit('requisitionList/alert', {\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 ]\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 const itemsCounter = () => {\n const pageSize =\n currentRequisitionList.page_info?.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = currentRequisitionList.page_info?.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = currentRequisitionList?.items_count ?? 0;\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className=\"requisition-list-view__pagination-items\">\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\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 ) : !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 />\n\n {currentRequisitionList.items_count === 0 ? (\n <EmptyList\n textContent={`${currentRequisitionList.name} ${translations.emptyRequisitionList}`}\n />\n ) : (\n <>\n {alert && (\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\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 {itemsCounter()}\n {(currentRequisitionList.page_info?.total_pages || 0) > 1 && (\n <Pagination\n totalPages={\n currentRequisitionList.page_info?.total_pages || 1\n }\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":["useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","useState","selectedItems","setSelectedItems","handleItemSelection","useCallback","itemUid","isSelected","prev","newSet","handleSelectAll","allItemUids","_a","item","handleSelectNone","SvgCart","props","React","SvgMinus","SvgSearch","SvgTrash","NotFound","className","title","message","actionLabel","onAction","jsxs","classes","jsx","Icon","Search","Button","ProductListTable","items","currentPage","pageSize","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","translations","useText","columns","handleItemCheckboxChange","event","getRowIndex","index","getImageAlt","_b","getImageSrc","_c","_d","getProductName","getConfiguredProductName","getSku","getPriceAmount","_h","_g","_f","_e","getPriceCurrency","getSubtotal","rowData","Checkbox","e","Image","Price","Field","Input","newValue","Cart","Trash","table","Table","VComponent","h","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","isDisabled","hasSelectedItems","Minus","RequisitionListView","requisitionListUid","skipProductLoading","DEFAULT_PAGE_SIZE","routeRequisitionListGrid","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","currentPageSize","setCurrentPageSize","initializing","setInitializing","showDeleteModal","setShowDeleteModal","itemsToDelete","setItemsToDelete","alert","setAlert","handleRequisitionListAlert","useRequisitionListAlert","useEffect","requisitionListEvent","events","payload","alertEvent","fetchAndMergeProducts","baseRequisitionList","productSkus","fetchedProducts","getProductData","productMap","product","error","fetchedList","getRequisitionList","enrichedList","handleAddItemsToCart","itemUids","errors","addRequisitionListItemsToCart","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","handlePageChange","page","updatedListWithProducts","handlePageSizeChange","newPageSize","handleUpdate","updatedList","itemsCounter","total","from","to","ProgressSpinner","isValidBase64Uid","url","Fragment","RequisitionListHeader","EmptyList","InLineAlert","Pagination","PageSizePicker","RequisitionListModal"],"mappings":"2tCAsCO,SAASA,IAAmE,CACjF,KAAM,CAACC,EAAwBC,CAAyB,EACtDC,GAAiC,IAAI,EACjC,CAACC,EAAeC,CAAgB,EAAIF,GAAsB,IAAI,GAAK,EAEnEG,EAAsBC,EAC1B,CAACC,EAAiBC,IAAwB,CACxCJ,EAAkBK,GAAsB,CAChC,MAAAC,EAAS,IAAI,IAAID,CAAI,EAC3B,OAAID,EACFE,EAAO,IAAIH,CAAO,EAElBG,EAAO,OAAOH,CAAO,EAEhBG,CAAA,CACR,CACH,EACA,CAAA,CACF,EAEMC,EAAkBL,EAAY,IAAM,OAClC,MAAAM,GAAcC,EAAAb,GAAA,YAAAA,EAAwB,QAAxB,YAAAa,EAA+B,IAChDC,GAAeA,EAAK,KAENV,EAAA,IAAI,IAAIQ,CAAW,CAAC,CAAA,EACpC,CAACZ,CAAsB,CAAC,EAErBe,EAAmBT,EAAY,IAAM,CACxBF,EAAA,IAAI,GAAK,CAC5B,EAAG,EAAE,EAEE,MAAA,CACL,uBAAAJ,EACA,0BAAAC,EACA,cAAAE,EACA,iBAAAC,EACA,oBAAAC,EACA,gBAAAM,EACA,iBAAAI,CACF,CACF,CC7EA,MAAMC,GAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,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,eAA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,CACC,OAAQzD,EACR,UAAW5B,IAAmB,KAC9B,MAAOrC,EAAa,iBACpB,aAAcA,EAAa,mBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAM,CACxBkE,EAAmB,EAAK,EACxBE,EAAiB,CAAA,CAAE,CACrB,EACA,qBAAsB0B,EAAA,CAAA,CACxB,EAEJ,CAEJ","x_google_ignoreList":[1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"RequisitionListView.js","sources":["/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","../../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/Search.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@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":["/********************************************************************\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","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 SvgSearch = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Search_Base\", \"data-name\": \"Icon \\\\u2013 Search \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, fill: \"none\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Search_icon\", \"data-name\": \"Search icon\", transform: \"translate(3.75 3.75)\" }, /* @__PURE__ */ React.createElement(\"circle\", { vectorEffect: \"non-scaling-stroke\", id: \"Ellipse_186\", \"data-name\": \"Ellipse 186\", cx: 6, cy: 6, r: 6, fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_556\", \"data-name\": \"Line 556\", x2: 6, y2: 6, transform: \"translate(10.5 10.5)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgSearch;\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 *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon, Button } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Search } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/NotFound/NotFound.css';\n\nexport interface NotFoundProps {\n className?: string;\n title?: string;\n message?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nexport const NotFound: FunctionComponent<NotFoundProps> = ({\n className,\n title = '404 - Not Found',\n message = 'The requisition list you are looking for does not exist.',\n actionLabel,\n onAction,\n ...props\n}) => {\n return (\n <div\n className={classes(['not-found', className])}\n data-testid=\"not-found\"\n {...props}\n >\n <Icon source={Search} size={'64'} stroke={'2'} />\n <h2>{title}</h2>\n {message && <p>{message}</p>}\n {actionLabel && onAction && (\n <Button variant=\"primary\" onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n};\n\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\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) => 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 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 itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\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: '',\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\n ? item.configured_product.images[0]?.url\n : item.product?.images\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 rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name=\"itemSelected\"\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 ),\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 <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={false}>\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 value={item.quantity}\n onBlur={(e: FocusEvent) => {\n const newValue = Number.parseInt(\n (e.target as HTMLInputElement).value,\n 10\n );\n handleUpdateQuantity(item.uid, newValue);\n }}\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 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 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 ${hasSelectedItems ? 'requisition-list-view__batch-actions-select-toggle--active' : ''}`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={hasSelectedItems ? translations.actionSelectNone : translations.actionSelectAll}\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 { addRequisitionListItemsToCart } 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} 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 { 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\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\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 show: `RequisitionList.RequisitionListView.show`,\n itemsCounter: `RequisitionList.RequisitionListView.itemsCounter`,\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 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 ...item,\n product: productMap.get(item.sku) || item.product, // Use fetched product or keep existing\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 if (errors && errors.length > 0) {\n handleRequisitionListAlert({\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: any) => e.message),\n });\n } else {\n handleRequisitionListAlert({\n action: 'move',\n type: 'success',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'move',\n type: 'error',\n context: 'product',\n });\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList, handleRequisitionListAlert]\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 const itemsCounter = () => {\n const pageSize =\n currentRequisitionList.page_info?.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = currentRequisitionList.page_info?.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = currentRequisitionList?.items_count ?? 0;\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className=\"requisition-list-view__pagination-items\">\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\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 ) : !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 {itemsCounter()}\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":["useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","useState","selectedItems","setSelectedItems","handleItemSelection","useCallback","itemUid","isSelected","prev","newSet","handleSelectAll","allItemUids","_a","item","handleSelectNone","SvgCart","props","React","SvgMinus","SvgSearch","SvgTrash","NotFound","className","title","message","actionLabel","onAction","jsxs","classes","jsx","Icon","Search","Button","ProductListTable","items","currentPage","pageSize","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","translations","useText","columns","handleItemCheckboxChange","event","getRowIndex","index","getImageAlt","_b","getImageSrc","_c","_d","getProductName","getConfiguredProductName","getBundleProducts","option","getSku","getPriceAmount","previousValue","_h","_g","_f","_e","getPriceCurrency","getSubtotal","rowData","Checkbox","e","Image","Price","Field","Input","newValue","Cart","Trash","table","Table","VComponent","h","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","isDisabled","hasSelectedItems","Minus","RequisitionListView","requisitionListUid","skipProductLoading","DEFAULT_PAGE_SIZE","routeRequisitionListGrid","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","currentPageSize","setCurrentPageSize","initializing","setInitializing","showDeleteModal","setShowDeleteModal","itemsToDelete","setItemsToDelete","alert","setAlert","handleRequisitionListAlert","useRequisitionListAlert","useEffect","requisitionListEvent","events","payload","alertEvent","fetchAndMergeProducts","baseRequisitionList","productSkus","fetchedProducts","getProductData","productMap","product","error","fetchedList","getRequisitionList","enrichedList","handleAddItemsToCart","itemUids","errors","addRequisitionListItemsToCart","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","handlePageChange","page","updatedListWithProducts","handlePageSizeChange","newPageSize","handleUpdate","updatedList","itemsCounter","total","from","to","ProgressSpinner","isValidBase64Uid","url","Fragment","RequisitionListHeader","InLineAlert","EmptyList","Pagination","PageSizePicker","RequisitionListModal"],"mappings":"+tCAsCO,SAASA,IAAmE,CACjF,KAAM,CAACC,EAAwBC,CAAyB,EACtDC,GAAiC,IAAI,EACjC,CAACC,EAAeC,CAAgB,EAAIF,GAAsB,IAAI,GAAK,EAEnEG,EAAsBC,GAC1B,CAACC,EAAiBC,IAAwB,CACxCJ,EAAkBK,GAAsB,CACtC,MAAMC,EAAS,IAAI,IAAID,CAAI,EAC3B,OAAID,EACFE,EAAO,IAAIH,CAAO,EAElBG,EAAO,OAAOH,CAAO,EAEhBG,CACT,CAAC,CACH,EACA,CAAA,CAAC,EAGGC,EAAkBL,GAAY,IAAM,OACxC,MAAMM,GAAcC,EAAAb,GAAA,YAAAA,EAAwB,QAAxB,YAAAa,EAA+B,IAChDC,GAAeA,EAAK,KAEvBV,EAAiB,IAAI,IAAIQ,CAAW,CAAC,CACvC,EAAG,CAACZ,CAAsB,CAAC,EAErBe,EAAmBT,GAAY,IAAM,CACzCF,EAAiB,IAAI,GAAK,CAC5B,EAAG,CAAA,CAAE,EAEL,MAAO,CACL,uBAAAJ,EACA,0BAAAC,EACA,cAAAE,EACA,iBAAAC,EACA,oBAAAC,EACA,gBAAAM,EACA,iBAAAI,CAAA,CAEJ,CC7EA,MAAMC,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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F,EACA,qBAAAkC,EACA,YAAa+F,EACb,aAAcI,CAAA,CAAA,EAIf1I,EAAuB,WACtB4B,EAAC,MAAA,CAAI,UAAU,oCACZ,SAAA,CAAA8H,GAAA,KACCtG,GAAApD,EAAuB,YAAvB,YAAAoD,GAAkC,cAAe,GAAK,GACtDtB,EAACuI,GAAA,CACC,WAAYrK,EAAuB,UAAU,YAC7C,cACEqD,GAAArD,EAAuB,YAAvB,YAAAqD,GAAkC,eAAgB,EAEpD,SAAU8F,GACV,SAAU3C,GAAeN,CAAA,CAAA,EAG7BtE,EAAC,MAAA,CAAI,UAAU,2CACb,SAAA,CAAAE,EAAC,OAAA,CAAM,WAAa,IAAA,CAAK,EACzBA,EAACwI,GAAA,CACC,kBACEtG,GAAAhE,EAAuB,YAAvB,YAAAgE,GAAkC,YAClCgC,EAEF,iBAAkBsD,GAClB,SAAU9C,GAAeN,CAAA,CAAA,CAC3B,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,EAEJ,EAIDY,GACChF,EAACyI,GAAA,CACC,OAAQzD,EACR,UAAW5B,IAAmB,KAC9B,MAAOxC,EAAa,iBACpB,aAAcA,EAAa,mBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAM,CACxBqE,EAAmB,EAAK,EACxBE,EAAiB,CAAA,CAAE,CACrB,EACA,qBAAsB0B,CAAA,CAAA,CACxB,EAEJ,CAEJ","x_google_ignoreList":[1,2,3,4]}
|
|
@@ -3,11 +3,11 @@ import { RequisitionList as RequisitionListModel } from '../data/models/requisit
|
|
|
3
3
|
|
|
4
4
|
type Row = Record<string, VNode | string | number | undefined>;
|
|
5
5
|
type Callbacks = {
|
|
6
|
-
|
|
6
|
+
handleOpenRenameModal: (rl: RequisitionListModel) => void;
|
|
7
|
+
handleOpenDeleteModal: (rl: RequisitionListModel) => void;
|
|
7
8
|
};
|
|
8
|
-
export declare function useRequisitionListGrid(callbacks?: Callbacks, routeRequisitionListDetails?: (uid: string) => string | void): {
|
|
9
|
+
export declare function useRequisitionListGrid(callbacks?: Callbacks, routeRequisitionListDetails?: (uid: string) => string | void, closeModal?: () => void): {
|
|
9
10
|
rows: Row[];
|
|
10
|
-
expandedRows: Set<number>;
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
pageInfo: {
|
|
13
13
|
page_size: number;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-requisition-list", "version": "0.
|
|
1
|
+
{"name": "@dropins/storefront-requisition-list", "version": "1.0.0-beta2", "@dropins/tools": "~1.6.0-beta3", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(o,e){try{if(typeof document<"u"){const i=document.createElement("style"),r=e.styleId;for(const t in e.attributes)i.setAttribute(t,e.attributes[t]);i.setAttribute("data-dropin",r),i.appendChild(document.createTextNode(o));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(i);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(i):document.head.append(i)}}}catch(i){console.error("dropin-styles (injectCodeFunction)",i)}})(`.requisition-list-header{margin-bottom:var(--spacing-large)}.requisition-list-header__back{margin-bottom:var(--spacing-medium)}.requisition-list-header__back-link{display:inline-block;color:var(--color-neutral-800);font-size:var(--type-body-1-font-size);font-weight:var(--type-body-1-font-weight);line-height:var(--type-body-1-line-height);text-decoration:none!important;cursor:pointer;transition:color .2s ease;position:relative;padding-bottom:1px}.requisition-list-header__back-link *{text-decoration:none!important}.requisition-list-header__back-link:hover{color:var(--color-neutral-600);text-decoration:none!important}.requisition-list-header__back-link:hover:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background-color:var(--color-neutral-800)}.requisition-list-header__back-arrow{margin-right:var(--spacing-xsmall);text-decoration:none!important}.requisition-list-header__main{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--spacing-medium);flex-wrap:wrap}.requisition-list-header__title-section{flex:1;min-width:0}.requisition-list-header__title{margin:0;padding:0;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-900)}.requisition-list-header__description{margin:var(--spacing-xsmall) 0 0;padding:0;font-size:var(--type-body-1-font-size);font-weight:var(--type-body-1-font-weight);line-height:var(--type-body-1-line-height);color:var(--color-neutral-700)}.requisition-list-header__actions{display:flex;gap:var(--spacing-medium);flex-wrap:wrap;align-items:center}.requisition-list-header__action-link{color:var(--color-neutral-800);font-size:var(--type-body-2-font-size);font-style:normal;font-weight:var(--type-body-2-font-weight);line-height:var(--type-body-2-line-height);letter-spacing:var(--type-body-2-letter-spacing);text-decoration:underline;cursor:pointer;transition:color .2s ease}.requisition-list-header__action-link:hover{color:var(--color-neutral-600)}@media (max-width: 768px){.requisition-list-header__main{flex-direction:column;align-items:stretch}.requisition-list-header__actions{justify-content:flex-start}}@supports (height: 100dvh){.requisition-list-modal .dropin-modal{height:100dvh}}.dropin-modal__body--medium>.dropin-modal__header-title,.dropin-modal__body--full>.dropin-modal__header-title,.requisition-list-modal .dropin-modal__content{align-items:center;margin:0}.requisition-list-modal .dropin-modal__header-title-content h3{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);margin:0;padding:0}.requisition-list-modal .requisition-list-modal__spinner{align-items:center;background-color:var(--color-neutral-200);display:flex;height:100%;left:0;justify-content:center;opacity:var(--color-opacity-24);position:absolute;top:0;width:100%;z-index:1}.requisition-list-modal p{margin:var(--spacing-small) 0}.requisition-list-modal .requisition-list-modal__buttons{align-items:center;display:flex;gap:0 var(--spacing-small);justify-content:right}.requisition-list-modal--overlay{margin:auto;max-width:375px;padding:var(--spacing-small);position:relative;width:100%}@media (min-width: 768px){.requisition-list-modal--overlay{margin:auto;max-width:768px;padding:var(--spacing-xxbig);position:relative;width:100%}.requisition-list-modal p{color:var(--color-neutral-800);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-bottom:var(--spacing-medium)}}
|
|
4
4
|
.requisition-list-form{background-color:var(--color-neutral-50);box-sizing:border-box}.requisition-list-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin-bottom:var(--spacing-medium)}.requisition-list-form__notification{margin-bottom:var(--spacing-medium)}.requisition-list-form__form{display:grid;gap:var(--spacing-medium);grid-template-columns:1fr}.requisition-list-form__actions{align-items:center;display:flex;gap:0 var(--grid-2-gutters);justify-content:flex-end}.requisition-list-form_progress-spinner{float:right}
|
|
5
|
-
.requisition-list-selector__form .dropin-card__content{align-items:center;cursor:pointer;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-xxsmall);padding:var(--spacing-xsmall)}.requisition-list-selector__form .dropin-card--secondary{border:none}.requisition-list-selector__form .requisition-list-form__actions{margin-top:var(--spacing-medium)}.requisition-list-selector__available-lists{max-height:300px;min-height:200px;overflow-y:scroll}.requisition-list-selector__available-lists::-webkit-scrollbar{width:var(--spacing-small);display:block}.requisition-list-selector__available-lists::-webkit-scrollbar-track{background:var(--color-neutral-100);border-radius:var(--shape-border-radius-2)}.requisition-list-selector__available-lists::-webkit-scrollbar-thumb{background:var(--color-neutral-300);border-radius:var(--shape-border-radius-2)}.requisition-list-selector__available-lists::-webkit-scrollbar-thumb:hover{background:var(--color-neutral-500)}.requisition-list-modal .requisition-list-actions{margin:var(--spacing-medium) auto}.requisition-list-grid-wrapper__content{display:grid;grid-template-columns:repeat(4,1fr);row-gap:var(--spacing-xsmall);width:100%}.requisition-list-grid-wrapper__list-header{display:contents}.requisition-list-grid-wrapper__pagination{grid-column:1 / -1;margin:var(--spacing-medium)}.requisition-list-grid-wrapper__pagination-controls{display:flex;align-items:center;gap:var(--spacing-medium);justify-content:center;min-height:40px}.requisition-list-grid-wrapper__add-new{margin:var(--spacing-medium) 0}.requisition-list-grid-wrapper__name__title{display:block;font:var(--type-body-1-emphasized-font);margin-bottom:2px}.requisition-list-grid-wrapper__name__description{font:var(--type-details-caption-2-font)}.requisition-list-grid-wrapper__actions{display:flex;gap:var(--spacing-medium)}.requisition-list-grid-wrapper__actions .dropin-button--tertiary{padding:0}.requisition-list-grid-wrapper__actions .dropin-button--tertiary:hover{text-decoration:underline}.requisition-list-empty-list{margin-bottom:var(--spacing-small);text-align:center}.requisition-list-actions{align-items:center;background-color:var(--color-neutral-50);border:var(--shape-border-width-2) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-2);cursor:pointer;display:flex;justify-content:space-between;padding:var(--spacing-medium);width:100%}.requisition-list-actions--selectable{max-width:100%;width:auto}.requisition-list-actions__title{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);-moz-appearance:none;appearance:none;-webkit-appearance:none;color:var(--color-neutral-800)}.requisition-list-actions svg{color:var(--color-neutral-800);stroke:var(--shape-icon-stroke-4)}.empty-list{text-align:center;margin:auto 0}.not-found{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--spacing-large);text-align:center;min-height:400px}.not-found svg{color:var(--color-neutral-400);margin-bottom:var(--spacing-medium)}.not-found h2{font-size:var(--type-headline-3-font-size);font-weight:var(--type-headline-3-font-weight);margin:0 0 var(--spacing-small) 0;color:var(--color-neutral-800)}.not-found p{font-size:var(--type-body-1-font-size);color:var(--color-neutral-600);margin:0 0 var(--spacing-medium) 0;max-width:500px}.not-found button{margin-top:var(--spacing-small)}.requisition-list-view-product-list-table-container{display:flex;flex-direction:column;gap:var(--spacing-small)}.requisition-list-view-product-list-table__checkbox{align-self:center;justify-self:center}.requisition-list-view-product-list-table__index-container{display:inline-block;line-height:1}.requisition-list-view-product-list-table__item-container{display:flex;align-items:flex-start;gap:var(--spacing-small)}.requisition-list-view-product-list-table__item-details{display:flex;flex-direction:column;gap:var(--spacing-xxsmall)}.requisition-list-view-product-list-table__product-name{font:var(--type-body-1-font);letter-spacing:var(--type-body-1-letter-spacing);font-weight:700}.requisition-list-view-product-list-table__product-configurable-name{font:var(--type-body-1-default-font)}.requisition-list-view-product-list-table__sku{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.requisition-list-view-product-list-table__thumbnail{width:44px;flex-shrink:0}.requisition-list-view-product-list-table__quantity{font:var(--type-body-1-font);letter-spacing:var(--type-body-1-letter-spacing);display:block;justify-self:center}.requisition-list-view-product-list-table__discount-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-xxsmall);align-items:baseline}.requisition-list-view-product-list-table-container__submit-container{display:flex;justify-content:flex-end}.requisition-list-view__batch-actions{--batch-actions-background: #f0f4f8;--batch-actions-toggle-border: #b3b3b3;--batch-actions-toggle-border-hover: #666666;--batch-actions-toggle-background: #ffffff;--batch-actions-toggle-background-hover: #f5f5f5;--batch-actions-toggle-active-background: #505050;--batch-actions-toggle-active-background-hover: #3d3d3d;--batch-actions-toggle-icon-active: #ffffff;--batch-actions-label-color: #2d2d2d;--batch-actions-badge-background: #378ef0;--batch-actions-badge-color: #ffffff;--batch-actions-button-background: #fafafa;--batch-actions-button-background-hover: #f0f0f0;--batch-actions-button-border: #d3d3d3;--batch-actions-delete-color: #4a4a4a;--batch-actions-delete-color-hover: #d7373f;display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-medium) 0;margin-bottom:var(--spacing-small);background-color:var(--batch-actions-background);border-radius:0}.requisition-list-view__batch-actions-left{display:flex;align-items:center;gap:var(--spacing-small);padding-left:var(--spacing-medium)}.requisition-list-view__batch-actions-select-toggle{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:1px solid var(--batch-actions-toggle-border);border-radius:0;background-color:var(--batch-actions-toggle-background);cursor:pointer;transition:all .2s ease}.requisition-list-view__batch-actions-select-toggle:hover:not(:disabled){border-color:var(--batch-actions-toggle-border-hover);background-color:var(--batch-actions-toggle-background-hover)}.requisition-list-view__batch-actions-select-toggle--active{background-color:var(--batch-actions-toggle-active-background);border-color:var(--batch-actions-toggle-active-background)}.requisition-list-view__batch-actions-select-toggle--active svg,.requisition-list-view__batch-actions-select-toggle--active path{fill:var(--batch-actions-toggle-icon-active);color:var(--batch-actions-toggle-icon-active)}.requisition-list-view__batch-actions-select-toggle--active:hover:not(:disabled){background-color:var(--batch-actions-toggle-active-background-hover);border-color:var(--batch-actions-toggle-active-background-hover)}.requisition-list-view__batch-actions-select-toggle:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__batch-actions-select-label{padding:0;border:none;background:none;font-size:var(--type-base-font-size);font-weight:var(--type-base-font-weight);color:var(--batch-actions-label-color);cursor:pointer;transition:opacity .2s ease}.requisition-list-view__batch-actions-select-label:hover:not(:disabled){opacity:.8}.requisition-list-view__batch-actions-select-label:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__batch-actions-count-badge{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;background-color:var(--batch-actions-badge-background);color:var(--batch-actions-badge-color);font-size:var(--type-detail-2-font-size);font-weight:var(--type-detail-2-font-weight);line-height:1;flex-shrink:0}.requisition-list-view__batch-actions-buttons{display:flex;align-items:center;gap:var(--spacing-small);padding-right:var(--spacing-medium)}.requisition-list-view__batch-actions-buttons button:not(.requisition-list-view__batch-actions-delete-icon){border-radius:var(--shape-border-radius-1);background-color:var(--batch-actions-button-background);border:1px solid var(--batch-actions-button-border)}.requisition-list-view__batch-actions-buttons button:not(.requisition-list-view__batch-actions-delete-icon):hover:not(:disabled){background-color:var(--batch-actions-button-background-hover)}.requisition-list-view__batch-actions-delete-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:none;background:transparent;color:var(--batch-actions-delete-color);cursor:pointer;transition:color .2s ease}.requisition-list-view__batch-actions-delete-icon:hover:not(:disabled){color:var(--batch-actions-delete-color-hover);background:none!important}.requisition-list-view__batch-actions-delete-icon:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__bulk-actions{margin-bottom:var(--spacing-xsmall);display:flex;gap:var(--spacing-xsmall);align-items:center}.page-size-picker{display:flex;align-items:center;gap:var(--spacing-xsmall);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.page-size-picker__label{font-size:var(--font-size-small);color:var(--color-text-secondary);white-space:nowrap}.page-size-picker__select{min-width:60px}.requisition-list-view__container{width:100%}.requisition-list-view__loading{display:flex;justify-content:center;align-items:center;min-height:400px;width:100%}.requisition-list-view__pagination{margin-top:var(--spacing-small);display:flex;justify-content:space-between;align-items:center}.requisition-list-view__pagination-items{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.requisition-list-view__pagination-picker{display:flex;align-items:center;gap:var(--spacing-xsmall);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}`,{styleId:"RequisitionList"});
|
|
5
|
+
.requisition-list-selector__form .dropin-card__content{align-items:center;cursor:pointer;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-xxsmall);padding:var(--spacing-xsmall)}.requisition-list-selector__form .dropin-card--secondary{border:none}.requisition-list-selector__form .requisition-list-form__actions{margin-top:var(--spacing-medium)}.requisition-list-selector__available-lists{max-height:300px;min-height:200px;overflow-y:scroll}.requisition-list-selector__available-lists::-webkit-scrollbar{width:var(--spacing-small);display:block}.requisition-list-selector__available-lists::-webkit-scrollbar-track{background:var(--color-neutral-100);border-radius:var(--shape-border-radius-2)}.requisition-list-selector__available-lists::-webkit-scrollbar-thumb{background:var(--color-neutral-300);border-radius:var(--shape-border-radius-2)}.requisition-list-selector__available-lists::-webkit-scrollbar-thumb:hover{background:var(--color-neutral-500)}.requisition-list-modal .requisition-list-actions{margin:var(--spacing-medium) auto}.requisition-list-grid-wrapper__content{display:grid;grid-template-columns:repeat(4,1fr);row-gap:var(--spacing-xsmall);width:100%}.requisition-list-grid-wrapper__list-header{display:contents}.requisition-list-grid-wrapper__pagination{grid-column:1 / -1;margin:var(--spacing-medium)}.requisition-list-grid-wrapper__pagination-controls{display:flex;align-items:center;gap:var(--spacing-medium);justify-content:center;min-height:40px}.requisition-list-grid-wrapper__add-new{margin:var(--spacing-medium) 0}.requisition-list-grid-wrapper__name__title{display:block;font:var(--type-body-1-emphasized-font);margin-bottom:2px}.requisition-list-grid-wrapper__name__description{font:var(--type-details-caption-2-font)}.requisition-list-grid-wrapper__actions{display:flex;gap:var(--spacing-medium)}.requisition-list-grid-wrapper__actions .dropin-button--tertiary{padding:0}.requisition-list-grid-wrapper__actions .dropin-button--tertiary:hover{text-decoration:underline}.requisition-list-empty-list{margin-bottom:var(--spacing-small);text-align:center}.requisition-list__alert-wrapper{margin-bottom:var(--spacing-small)}.requisition-list-actions{align-items:center;background-color:var(--color-neutral-50);border:var(--shape-border-width-2) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-2);cursor:pointer;display:flex;justify-content:space-between;padding:var(--spacing-medium);width:100%}.requisition-list-actions--selectable{max-width:100%;width:auto}.requisition-list-actions__title{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);-moz-appearance:none;appearance:none;-webkit-appearance:none;color:var(--color-neutral-800)}.requisition-list-actions svg{color:var(--color-neutral-800);stroke:var(--shape-icon-stroke-4)}.empty-list{text-align:center;margin:auto 0}.not-found{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--spacing-large);text-align:center;min-height:400px}.not-found svg{color:var(--color-neutral-400);margin-bottom:var(--spacing-medium)}.not-found h2{font-size:var(--type-headline-3-font-size);font-weight:var(--type-headline-3-font-weight);margin:0 0 var(--spacing-small) 0;color:var(--color-neutral-800)}.not-found p{font-size:var(--type-body-1-font-size);color:var(--color-neutral-600);margin:0 0 var(--spacing-medium) 0;max-width:500px}.not-found button{margin-top:var(--spacing-small)}.requisition-list-view-product-list-table-container{display:flex;flex-direction:column;gap:var(--spacing-small)}.requisition-list-view-product-list-table__checkbox{align-self:center;justify-self:center}.requisition-list-view-product-list-table__index-container{display:inline-block;line-height:1}.requisition-list-view-product-list-table__item-container{display:flex;align-items:flex-start;gap:var(--spacing-small)}.requisition-list-view-product-list-table__item-details{display:flex;flex-direction:column;gap:var(--spacing-xxsmall)}.requisition-list-view-product-list-table__product-name{font:var(--type-body-1-font);letter-spacing:var(--type-body-1-letter-spacing);font-weight:700}.requisition-list-view-product-list-table__product-configurable-name{font:var(--type-body-1-default-font)}.requisition-list-view-product-list-table__sku{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.requisition-list-view-product-list-table__thumbnail{width:44px;flex-shrink:0}.requisition-list-view-product-list-table__quantity{font:var(--type-body-1-font);letter-spacing:var(--type-body-1-letter-spacing);display:block;justify-self:center}.requisition-list-view-product-list-table__discount-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-xxsmall);align-items:baseline}.requisition-list-view-product-list-table-container__submit-container{display:flex;justify-content:flex-end}.requisition-list-view__batch-actions{--batch-actions-background: #f0f4f8;--batch-actions-toggle-border: #b3b3b3;--batch-actions-toggle-border-hover: #666666;--batch-actions-toggle-background: #ffffff;--batch-actions-toggle-background-hover: #f5f5f5;--batch-actions-toggle-active-background: #505050;--batch-actions-toggle-active-background-hover: #3d3d3d;--batch-actions-toggle-icon-active: #ffffff;--batch-actions-label-color: #2d2d2d;--batch-actions-badge-background: #378ef0;--batch-actions-badge-color: #ffffff;--batch-actions-button-background: #fafafa;--batch-actions-button-background-hover: #f0f0f0;--batch-actions-button-border: #d3d3d3;--batch-actions-delete-color: #4a4a4a;--batch-actions-delete-color-hover: #d7373f;display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-medium) 0;margin-bottom:var(--spacing-small);background-color:var(--batch-actions-background);border-radius:0}.requisition-list-view__batch-actions-left{display:flex;align-items:center;gap:var(--spacing-small);padding-left:var(--spacing-medium)}.requisition-list-view__batch-actions-select-toggle{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:1px solid var(--batch-actions-toggle-border);border-radius:0;background-color:var(--batch-actions-toggle-background);cursor:pointer;transition:all .2s ease}.requisition-list-view__batch-actions-select-toggle:hover:not(:disabled){border-color:var(--batch-actions-toggle-border-hover);background-color:var(--batch-actions-toggle-background-hover)}.requisition-list-view__batch-actions-select-toggle--active{background-color:var(--batch-actions-toggle-active-background);border-color:var(--batch-actions-toggle-active-background)}.requisition-list-view__batch-actions-select-toggle--active svg,.requisition-list-view__batch-actions-select-toggle--active path{fill:var(--batch-actions-toggle-icon-active);color:var(--batch-actions-toggle-icon-active)}.requisition-list-view__batch-actions-select-toggle--active:hover:not(:disabled){background-color:var(--batch-actions-toggle-active-background-hover);border-color:var(--batch-actions-toggle-active-background-hover)}.requisition-list-view__batch-actions-select-toggle:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__batch-actions-select-label{padding:0;border:none;background:none;font-size:var(--type-base-font-size);font-weight:var(--type-base-font-weight);color:var(--batch-actions-label-color);cursor:pointer;transition:opacity .2s ease}.requisition-list-view__batch-actions-select-label:hover:not(:disabled){opacity:.8}.requisition-list-view__batch-actions-select-label:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__batch-actions-count-badge{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;background-color:var(--batch-actions-badge-background);color:var(--batch-actions-badge-color);font-size:var(--type-detail-2-font-size);font-weight:var(--type-detail-2-font-weight);line-height:1;flex-shrink:0}.requisition-list-view__batch-actions-buttons{display:flex;align-items:center;gap:var(--spacing-small);padding-right:var(--spacing-medium)}.requisition-list-view__batch-actions-buttons button:not(.requisition-list-view__batch-actions-delete-icon){border-radius:var(--shape-border-radius-1);background-color:var(--batch-actions-button-background);border:1px solid var(--batch-actions-button-border)}.requisition-list-view__batch-actions-buttons button:not(.requisition-list-view__batch-actions-delete-icon):hover:not(:disabled){background-color:var(--batch-actions-button-background-hover)}.requisition-list-view__batch-actions-delete-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:none;background:transparent;color:var(--batch-actions-delete-color);cursor:pointer;transition:color .2s ease}.requisition-list-view__batch-actions-delete-icon:hover:not(:disabled){color:var(--batch-actions-delete-color-hover);background:none!important}.requisition-list-view__batch-actions-delete-icon:disabled{opacity:.5;cursor:not-allowed}.requisition-list-view__bulk-actions{margin-bottom:var(--spacing-xsmall);display:flex;gap:var(--spacing-xsmall);align-items:center}.page-size-picker{display:flex;align-items:center;gap:var(--spacing-xsmall);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.page-size-picker__label{font-size:var(--font-size-small);color:var(--color-text-secondary);white-space:nowrap}.page-size-picker__select{min-width:60px}.requisition-list-view__container{width:100%}.requisition-list-view__loading{display:flex;justify-content:center;align-items:center;min-height:400px;width:100%}.requisition-list-view__pagination{margin-top:var(--spacing-small);display:flex;justify-content:space-between;align-items:center}.requisition-list-view__pagination-items{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.requisition-list-view__pagination-picker{display:flex;align-items:center;gap:var(--spacing-xsmall);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}`,{styleId:"RequisitionList"});
|
|
6
6
|
import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as r,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as u}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const l={containerTitle:"Requisition Lists",RequisitionListWrapper:{name:"Name & Description",itemsCount:"Items",lastUpdated:"Latest activity",actions:"Actions",loginMsg:"Please login",deleteRequisitionListTitle:"Are you sure you want to delete this Requisition List?",deleteRequisitionListMessage:"Requisition List will be permanently deleted. This action can not be undone.",confirmAction:"Confirm",cancelAction:"Cancel",emptyList:"No Requisition Lists found"},AddNewReqList:{addNewReqListBtn:"Add new Requisition List"},RequisitionListItem:{actionUpdate:"Update",actionDelete:"Delete"},RequisitionListForm:{actionCancel:"Cancel",actionSave:"Save",requiredField:"This is a required field.",nameMinLength:"Name must be at least {min} characters long.",nameInvalidCharacters:"Name contains invalid characters. Only letters, numbers, spaces, and basic punctuation are allowed.",floatingLabel:"Requisition List Name *",placeholder:"Requisition List Name",label:"Description",updateTitle:"Update Requisition List",createTitle:"Create Requisition List",addToRequisitionList:"Add to Requisition List"},RequisitionListSelector:{addToNewRequisitionList:"Add to New Requisition List",addToSelected:"Add to Selected List"},RequisitionListAlert:{errorCreate:"Error creating requisition list.",successCreate:"Requisition list created successfully.",errorAddToCart:"Error adding item to cart.",successAddToCart:"Item(s) added to cart successfully.",errorUpdateQuantity:"Error updating quantity.",successUpdateQuantity:"Item quantity updated successfully.",errorUpdate:"Error updating requisition list.",successUpdate:"Requisition list updated successfully.",errorDeleteItem:"Error deleting item.",successDeleteItem:"Item(s) deleted successfully.",errorDeleteReqList:"Error deleting requisition list.",successDeleteReqList:"Requisition list deleted successfully.",errorMove:"Error moving item(s) to cart.",successMove:"Item(s) successfully moved to cart.",errorAddToRequisitionList:"Error adding item(s) to requisition list.",successAddToRequisitionList:"Item(s) successfully added to requisition list."},RequisitionListView:{actionDelete:"Delete",statusDeleting:"Deleting...",actionDeleteSelected:"Delete Selected",actionDeleteSelectedItems:"Delete selected items",actionSelectAll:"Select All",actionSelectNone:"Select None",actionAddToCart:"Add to Cart",statusAddingToCart:"Adding...",actionAddSelectedToCart:"Add Selected to Cart",statusBulkAddingToCart:"Adding to Cart...",actionUpdateQuantity:"Update",statusUpdatingQuantity:"Updating...",errorUpdateQuantity:"Error updating quantity",successUpdateQuantity:"Item quantity updated successfully.",actionBackToRequisitionListsOverview:"Back to requisition lists overview",actionBackToRequisitionLists:"Back to Requisition Lists",actionRename:"Rename",actionDeleteList:"Delete List",deleteListTitle:"Delete Requisition List?",deleteListMessage:"Are you sure you want to delete this requisition list? This action cannot be undone.",deleteItemsTitle:"Delete Item(s)?",deleteItemsMessage:"Are you sure you want to delete the selected item(s) from this requisition list? This action cannot be undone.",confirmAction:"Delete",cancelAction:"Cancel",emptyRequisitionList:" Requisition List is empty",show:"Show",itemsCounter:"Items {from}-{to} of {total}",productListTable:{headers:{productName:"Product name",sku:"SKU",price:"Price",quantity:"Quantity",subtotal:"Subtotal",actions:"Actions"},itemQuantity:"Item quantity"},errorLoadPage:"Failed to load page",errorLoadingProducts:"Failed to load product data",notFoundTitle:"Requisition List Not Found",notFoundMessage:"The requisition list you are looking for does not exist or you do not have access to it.",notFoundActionLabel:"Back to Requisition Lists"},PageSizePicker:{itemsPerPage:"Items per page"}},m={RequisitionList:l},q={default:m},L=({children:i})=>{const[s,o]=r("en_US");return d(()=>{const e=c.on("locale",n=>{o(n)},{eager:!0});return()=>{e==null||e.off()}},[]),t(u,{lang:s,langDefinitions:q,children:i})},A=new a(t(L,{}));export{A as render};
|
|
7
7
|
//# sourceMappingURL=render.js.map
|
package/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sources":["/@dropins/storefront-requisition-list/src/render/Provider.tsx","/@dropins/storefront-requisition-list/src/render/render.tsx"],"sourcesContent":["import { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n return (\n <UIProvider lang={lang} langDefinitions={langDefinitions}>\n {children}\n </UIProvider>\n );\n};\n","import { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","jsx","UIProvider","render","Render"],"mappings":"ogIASMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9C,OAAAC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,
|
|
1
|
+
{"version":3,"file":"render.js","sources":["/@dropins/storefront-requisition-list/src/render/Provider.tsx","/@dropins/storefront-requisition-list/src/render/render.tsx"],"sourcesContent":["import { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n return (\n <UIProvider lang={lang} langDefinitions={langDefinitions}>\n {children}\n </UIProvider>\n );\n};\n","import { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","jsx","UIProvider","render","Render"],"mappings":"ogIASMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9C,OAAAC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,EAAA,CAAK,EAEhB,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,CAAA,CAAE,EAGHG,EAACC,EAAA,CAAW,KAAAR,EAAY,gBAAAJ,EACrB,SAAAG,CAAA,CACH,CAEJ,ECtCaU,EAAS,IAAIC,EAAOH,EAACT,IAAS,CAAE"}
|