@dropins/storefront-requisition-list 1.2.3-alpha1 → 1.3.0-alpha-20260327100447

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/api/copyItemsBetweenRequisitionLists/copyItemsBetweenRequisitionLists.d.ts +7 -0
  3. package/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists.d.ts +18 -0
  4. package/api/copyItemsBetweenRequisitionLists/index.d.ts +18 -0
  5. package/api/fragments/RequisitionListFragment.graphql.d.ts +5 -5
  6. package/api/getRequisitionLists/getRequisitionLists.d.ts +1 -1
  7. package/api/getRequisitionLists/graphql/getRequisitionLists.d.ts +5 -0
  8. package/api/index.d.ts +2 -0
  9. package/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists.d.ts +18 -0
  10. package/api/moveItemsBetweenRequisitionLists/index.d.ts +18 -0
  11. package/api/moveItemsBetweenRequisitionLists/moveItemsBetweenRequisitionLists.d.ts +9 -0
  12. package/api.js +1 -8
  13. package/api.js.map +1 -1
  14. package/chunks/PaginationItemsCounter.js.map +1 -1
  15. package/chunks/RequisitionListActions.js.map +1 -1
  16. package/chunks/RequisitionListForm.js.map +1 -1
  17. package/chunks/RequisitionListForm2.js +2 -2
  18. package/chunks/RequisitionListForm2.js.map +1 -1
  19. package/chunks/RequisitionListHeader.js.map +1 -1
  20. package/chunks/RequisitionListModal.js.map +1 -1
  21. package/chunks/RequisitionListPicker.js +4 -0
  22. package/chunks/RequisitionListPicker.js.map +1 -0
  23. package/chunks/RequisitionListView.js +1 -1
  24. package/chunks/RequisitionListView.js.map +1 -1
  25. package/chunks/copyItemsBetweenRequisitionLists.js +119 -0
  26. package/chunks/copyItemsBetweenRequisitionLists.js.map +1 -0
  27. package/chunks/deleteRequisitionList.js +2 -2
  28. package/chunks/deleteRequisitionList.js.map +1 -1
  29. package/chunks/fetch-graphql.js +4 -0
  30. package/chunks/fetch-graphql.js.map +1 -0
  31. package/chunks/getRequisitionLists.js +34 -3
  32. package/chunks/getRequisitionLists.js.map +1 -1
  33. package/chunks/initialize.js +11 -0
  34. package/chunks/initialize.js.map +1 -0
  35. package/chunks/state.js +1 -1
  36. package/chunks/state.js.map +1 -1
  37. package/chunks/updateRequisitionList.js +6 -6
  38. package/chunks/updateRequisitionList.js.map +1 -1
  39. package/components/BatchActions/BatchActions.d.ts +4 -0
  40. package/components/RequisitionListPicker/RequisitionListPicker.d.ts +10 -0
  41. package/components/RequisitionListPicker/index.d.ts +19 -0
  42. package/components/index.d.ts +1 -0
  43. package/containers/RequisitionListForm.js +1 -1
  44. package/containers/RequisitionListGrid.js +1 -1
  45. package/containers/RequisitionListGrid.js.map +1 -1
  46. package/containers/RequisitionListHeader.js +1 -1
  47. package/containers/RequisitionListSelector/RequisitionListSelector.d.ts +1 -0
  48. package/containers/RequisitionListSelector.js +4 -4
  49. package/containers/RequisitionListSelector.js.map +1 -1
  50. package/containers/RequisitionListView.js +1 -1
  51. package/containers/RequisitionListView.js.map +1 -1
  52. package/hooks/useRequisitionListEnabled.d.ts +1 -1
  53. package/i18n/en_US.json.d.ts +11 -1
  54. package/lib/requisition-list-item-comparator.d.ts +15 -0
  55. package/package.json +5 -1
  56. package/render.js +3 -3
  57. package/render.js.map +1 -1
  58. package/chunks/addRequisitionListItemsToCart.js +0 -101
  59. package/chunks/addRequisitionListItemsToCart.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,60 @@
1
+ # @dropins/storefront-requisition-list
2
+
3
+ ## 1.3.0-alpha-20260327100447
4
+
5
+ ### Minor Changes
6
+
7
+ - 8a25534: Begin next development cycle
8
+ - 9fdf4f4: Add an an active class and prop to the **RequisitionListSelector** so the button on the PDP page can reflect when the current product is already in the requisition list. Both an `active` prop as well as `requisition-list-selector--active` class was added. In addition, the `activeIcon` was also included should that the developer would like to change the button icon once an active state is truthy.
9
+ - 98cd3b9: fix: merge user-provided langDefinitions in Provider
10
+
11
+ The Provider now imports `config` and uses `deepmerge` to merge user-provided `langDefinitions` with the drop-in's bundled defaults before passing them to `UIProvider`. This enables label/placeholder overrides via the initializer API.
12
+
13
+ ## 1.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - a23ab81: Replaced API catalog functions with props that must be injected from the integration layer
18
+
19
+ ### Patch Changes
20
+
21
+ - 9dfd6da: Bump adobe-commerce/elsie from 1.8.0-beta.1 to 1.8.0
22
+ - 13f4ea9: Add Changesets-based release automation with branch-aware workflows (alpha/beta/stable), PR changeset validation, and contributor helper scripts.
23
+ - 2f02836: Bump "@adobe-commerce/elsie" from 1.7.0 to 1.8.0-beta.1
24
+ - b8e1dbe: Fix RequisitionListSelector Storybook stories: WhenRequisitionListIsDisabled now correctly shows disabled behavior via loaders and state; WithoutExistingRequisitionLists shows empty lists via loader; Docs overview uses iframe isolation (docs.story.inline: false) so all stories appear and work correctly together.
25
+ - c26676c: fix: merge user-provided langDefinitions in Provider
26
+
27
+ The Provider now imports `config` and uses `deepmerge` to merge user-provided `langDefinitions` with the drop-in's bundled defaults before passing them to `UIProvider`. This enables label/placeholder overrides via the initializer API.
28
+
29
+ ## 1.2.0-beta.4
30
+
31
+ ### Patch Changes
32
+
33
+ - 9dfd6da: Bump adobe-commerce/elsie from 1.8.0-beta.1 to 1.8.0
34
+
35
+ ## 1.2.0-beta.3
36
+
37
+ ### Patch Changes
38
+
39
+ - 2f02836: Bump "@adobe-commerce/elsie" from 1.7.0 to 1.8.0-beta.1
40
+
41
+ ## 1.2.0-beta.2
42
+
43
+ ### Patch Changes
44
+
45
+ - c26676c: fix: merge user-provided langDefinitions in Provider
46
+
47
+ The Provider now imports `config` and uses `deepmerge` to merge user-provided `langDefinitions` with the drop-in's bundled defaults before passing them to `UIProvider`. This enables label/placeholder overrides via the initializer API.
48
+
49
+ ## 1.2.0-beta.1
50
+
51
+ ### Minor Changes
52
+
53
+ - a23ab81: Replaced API catalog functions with props that must be injected from the integration layer
54
+
55
+ ## 1.1.1-beta.0
56
+
57
+ ### Patch Changes
58
+
59
+ - 13f4ea9: Add Changesets-based release automation with branch-aware workflows (alpha/beta/stable), PR changeset validation, and contributor helper scripts.
60
+ - b8e1dbe: Fix RequisitionListSelector Storybook stories: WhenRequisitionListIsDisabled now correctly shows disabled behavior via loaders and state; WithoutExistingRequisitionLists shows empty lists via loader; Docs overview uses iframe isolation (docs.story.inline: false) so all stories appear and work correctly together.
@@ -0,0 +1,7 @@
1
+ import { RequisitionList } from '../../data/models/requisitionList';
2
+
3
+ export interface CopyItemsResult {
4
+ destinationList: RequisitionList | null;
5
+ }
6
+ export declare const copyItemsBetweenRequisitionLists: (sourceRequisitionListUid: string, destinationRequisitionListUid: string, requisitionListItemUids: string[]) => Promise<CopyItemsResult | null>;
7
+ //# sourceMappingURL=copyItemsBetweenRequisitionLists.d.ts.map
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2026 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export declare const COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION: string;
18
+ //# sourceMappingURL=copyItemsBetweenRequisitionLists.d.ts.map
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2026 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './copyItemsBetweenRequisitionLists';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -2,14 +2,14 @@
2
2
  * ADOBE CONFIDENTIAL
3
3
  * __________________
4
4
  *
5
- * Copyright 2025 Adobe
5
+ * Copyright 2026 Adobe
6
6
  * All Rights Reserved.
7
7
  *
8
8
  * NOTICE: All information contained herein is, and remains
9
- * the property of Adobe and its suppliers, if any. The intellectual
10
- * and technical concepts contained herein are proprietary to Adobe
11
- * and its suppliers and are protected by all applicable intellectual
12
- * property laws, including trade secret and copyright laws.
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
13
  * Dissemination of this information or reproduction of this material
14
14
  * is strictly forbidden unless prior written permission is obtained
15
15
  * from Adobe.
@@ -1,4 +1,4 @@
1
1
  import { RequisitionList } from '../../data/models/requisitionList';
2
2
 
3
- export declare const getRequisitionLists: (currentPage?: number, pageSize?: number) => Promise<RequisitionList[] | null>;
3
+ export declare const getRequisitionLists: (currentPage?: number, pageSize?: number, listItemsPageSize?: number) => Promise<RequisitionList[] | null>;
4
4
  //# sourceMappingURL=getRequisitionLists.d.ts.map
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Nested list line items use pagination. Default listItemsPageSize is 100 per page;
3
+ * getRequisitionLists fetches further pages per list when page_info.total_pages > 1
4
+ * so PDP "active" / membership checks are not limited to the first page only.
5
+ */
1
6
  export declare const GET_REQUISITION_LISTS_QUERY: string;
2
7
  //# sourceMappingURL=getRequisitionLists.d.ts.map
package/api/index.d.ts CHANGED
@@ -26,4 +26,6 @@ export * from './updateRequisitionListItems';
26
26
  export * from './deleteRequisitionListItems';
27
27
  export * from './addProductsToRequisitionList';
28
28
  export * from './addRequisitionListItemsToCart';
29
+ export * from './moveItemsBetweenRequisitionLists';
30
+ export * from './copyItemsBetweenRequisitionLists';
29
31
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2026 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export declare const MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION: string;
18
+ //# sourceMappingURL=moveItemsBetweenRequisitionLists.d.ts.map
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2026 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './moveItemsBetweenRequisitionLists';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { RequisitionList } from '../../data/models/requisitionList';
2
+ import { Item } from '../../data/models/item';
3
+
4
+ export interface MoveItemsResult {
5
+ sourceList: RequisitionList | null;
6
+ destinationList: RequisitionList | null;
7
+ }
8
+ export declare const moveItemsBetweenRequisitionLists: (sourceRequisitionListUid: string, destinationRequisitionListUid: string, requisitionListItemUids: string[], pageSize: number, currentPage: number, enrichConfigurableProducts?: ((items: Item[]) => Promise<Item[]>) | undefined) => Promise<MoveItemsResult | null>;
9
+ //# sourceMappingURL=moveItemsBetweenRequisitionLists.d.ts.map
package/api.js CHANGED
@@ -1,11 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{f as a,h as r}from"./chunks/updateRequisitionList.js";import{g as R,r as y,s as F,a as L,b as E,u as G}from"./chunks/updateRequisitionList.js";import{events as n}from"@dropins/tools/event-bus.js";import{g as Q}from"./chunks/getRequisitionLists.js";import{a as x,d as b,g as O,u as w}from"./chunks/addRequisitionListItemsToCart.js";import{d as H}from"./chunks/deleteRequisitionList.js";import{Initializer as c}from"@dropins/tools/lib.js";import{s as t}from"./chunks/state.js";import"@dropins/tools/fetch-graphql.js";const f=`
4
- query STORE_CONFIG_QUERY {
5
- storeConfig {
6
- is_requisition_list_active
7
- company_enabled
8
- }
9
- }
10
- `,m=async()=>{try{const{errors:e,data:i}=await a(f,{cache:"force-cache"});return e?e.some(s=>s.message&&s.message.includes('Cannot query field "is_requisition_list_active"')||s.message.includes('Cannot query field "company_enabled"'))?!1:r(e):i==null?void 0:i.storeConfig}catch{return{is_requisition_list_active:"0",company_enabled:!1}}},o=new c({init:async e=>{const i={};t.config||(t.config=await m(),n.emit("requisitionList/initialized",t.config)),o.config.setConfig({...i,...e})},listeners:()=>[n.on("authenticated",e=>{t.authenticated=e})]}),_=o.config;export{x as addRequisitionListItemsToCart,_ as config,H as deleteRequisitionList,b as deleteRequisitionListItems,a as fetchGraphQl,R as getConfig,O as getRequisitionList,Q as getRequisitionLists,m as getStoreConfig,o as initialize,y as removeFetchGraphQlHeader,F as setEndpoint,L as setFetchGraphQlHeader,E as setFetchGraphQlHeaders,G as updateRequisitionList,w as updateRequisitionListItems};
3
+ import{c as r,g as m,i as p}from"./chunks/initialize.js";import{g as u}from"./chunks/getRequisitionLists.js";import{a as f,c as g,d as q,g as L,m as R,u as c}from"./chunks/copyItemsBetweenRequisitionLists.js";import{u as l}from"./chunks/updateRequisitionList.js";import{d as I}from"./chunks/deleteRequisitionList.js";import{f as Q,g as C,r as F,s as H,a as v,b as w}from"./chunks/fetch-graphql.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"./chunks/state.js";import"@dropins/tools/fetch-graphql.js";export{f as addRequisitionListItemsToCart,r as config,g as copyItemsBetweenRequisitionLists,I as deleteRequisitionList,q as deleteRequisitionListItems,Q as fetchGraphQl,C as getConfig,L as getRequisitionList,u as getRequisitionLists,m as getStoreConfig,p as initialize,R as moveItemsBetweenRequisitionLists,F as removeFetchGraphQlHeader,H as setEndpoint,v as setFetchGraphQlHeader,w as setFetchGraphQlHeaders,l as updateRequisitionList,c as updateRequisitionListItems};
11
4
  //# sourceMappingURL=api.js.map
package/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n if (errors) {\n const missingField = errors.some(\n (error) =>\n (error.message &&\n error.message.includes(\n 'Cannot query field \"is_requisition_list_active\"'\n )) ||\n error.message.includes('Cannot query field \"company_enabled\"')\n );\n if (missingField) {\n return false;\n }\n return handleFetchError(errors);\n }\n\n return data?.storeConfig;\n } catch {\n return {\n is_requisition_list_active: '0',\n company_enabled: false,\n } as StoreConfig;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n }),\n ],\n});\n\nexport const config = initialize.config;\n"],"names":["STORE_CONFIG_QUERY","getStoreConfig","errors","data","fetchGraphQl","error","handleFetchError","initialize","Initializer","config","defaultConfig","state","events","authenticated"],"mappings":"0gBAiBO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECMrBC,EAAiB,SAA0B,CACtD,GAAI,CACF,KAAM,CAAE,OAAAC,EAAQ,KAAAC,CAAA,EAAS,MAAMC,EAAaJ,EAAoB,CAC9D,MAAO,aAAA,CACR,EAED,OAAIE,EACmBA,EAAO,KACzBG,GACEA,EAAM,SACLA,EAAM,QAAQ,SACZ,iDAAA,GAEJA,EAAM,QAAQ,SAAS,sCAAsC,CAAA,EAGxD,GAEFC,EAAiBJ,CAAM,EAGzBC,GAAA,YAAAA,EAAM,WACf,MAAQ,CACN,MAAO,CACL,2BAA4B,IAC5B,gBAAiB,EAAA,CAErB,CACF,ECxBaI,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CACtB,MAAMC,EAAgB,CAAA,EAGjBC,EAAM,SACTA,EAAM,OAAS,MAAMV,EAAA,EAErBW,EAAO,KAAK,8BAA+BD,EAAM,MAAM,GAGzDJ,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe,GAAGD,EAAQ,CAC7D,EAEA,UAAW,IAAM,CACfG,EAAO,GAAG,gBAAkBC,GAAkB,CAC5CF,EAAM,cAAgBE,CACxB,CAAC,CAAA,CAEL,CAAC,EAEYJ,EAASF,EAAW"}
1
+ {"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationItemsCounter.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Search.svg","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx","/@dropins/storefront-requisition-list/src/components/PaginationItemsCounter/PaginationItemsCounter.tsx"],"sourcesContent":["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","/********************************************************************\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 * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n","/********************************************************************\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';\n\nimport { PageInfo } from '@/requisitionList/data/models';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/requisitionList/components/PaginationItemsCounter/PaginationItemsCounter.css';\n\nexport interface PaginationItemsCounterProps {\n pageInfo?: PageInfo;\n totalCount?: number;\n className?: string;\n}\n\nexport const PaginationItemsCounter: FunctionComponent<\n PaginationItemsCounterProps\n> = ({ pageInfo, totalCount, className = '' }) => {\n const translations = useText({\n itemsCounter: `RequisitionList.PaginationItemsCounter.itemsCounter`,\n });\n\n // Don't show counter if no pageInfo or if there's no total count\n if (!pageInfo || !totalCount) {\n return null;\n }\n\n const pageSize = pageInfo.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = pageInfo.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = totalCount;\n\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className={`pagination-items-counter ${className}`.trim()}>\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\n );\n};\n"],"names":["SvgSearch","props","React","NotFound","className","title","message","actionLabel","onAction","jsxs","classes","jsx","Icon","Search","Button","PageSizePicker","currentPageSize","onPageSizeChange","disabled","pageSizeOptions","translations","useText","handlePageSizeChange","event","target","newPageSize","options","size","Picker","PaginationItemsCounter","pageInfo","totalCount","pageSize","DEFAULT_PAGE_SIZE","currentPage","total","from","to"],"mappings":"kXACA,MAAMA,EAAaC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,mBAAoB,YAAa,mCAAoC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,YAAa,GAAGD,CAAK,EAAoBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAO,EAAoBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,EAAG,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,cAAe,YAAa,cAAe,UAAW,sBAAsB,EAAoBA,EAAM,cAAc,SAAU,CAAE,aAAc,qBAAsB,GAAI,cAAe,YAAa,cAAe,GAAI,EAAG,GAAI,EAAG,EAAG,EAAG,KAAM,OAAQ,OAAQ,cAAc,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,EAAG,GAAI,EAAG,UAAW,uBAAwB,KAAM,OAAQ,OAAQ,cAAc,CAAE,CAAC,CAAC,CAAC,EC6Bv9BC,EAA6C,CAAC,CACzD,UAAAC,EACA,MAAAC,EAAQ,kBACR,QAAAC,EAAU,2DACV,YAAAC,EACA,SAAAC,EACA,GAAGP,CACL,IAEIQ,EAAC,MAAA,CACC,UAAWC,EAAQ,CAAC,YAAaN,CAAS,CAAC,EAC3C,cAAY,YACX,GAAGH,EAEJ,SAAA,CAAAU,EAACC,GAAK,OAAQC,EAAQ,KAAM,KAAM,OAAQ,IAAK,EAC/CF,EA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C,EAAG,UAAU,EAC7B,QAAQ,UAAWF,EAAM,SAAA,CAAU,CAAA,CACxC,CAEJ","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"PaginationItemsCounter.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Search.svg","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx","/@dropins/storefront-requisition-list/src/components/PaginationItemsCounter/PaginationItemsCounter.tsx"],"sourcesContent":["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","/********************************************************************\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 * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n","/********************************************************************\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';\n\nimport { PageInfo } from '@/requisitionList/data/models';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/requisitionList/components/PaginationItemsCounter/PaginationItemsCounter.css';\n\nexport interface PaginationItemsCounterProps {\n pageInfo?: PageInfo;\n totalCount?: number;\n className?: string;\n}\n\nexport const PaginationItemsCounter: FunctionComponent<\n PaginationItemsCounterProps\n> = ({ pageInfo, totalCount, className = '' }) => {\n const translations = useText({\n itemsCounter: `RequisitionList.PaginationItemsCounter.itemsCounter`,\n });\n\n // Don't show counter if no pageInfo or if there's no total count\n if (!pageInfo || !totalCount) {\n return null;\n }\n\n const pageSize = pageInfo.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = pageInfo.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = totalCount;\n\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className={`pagination-items-counter ${className}`.trim()}>\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\n );\n};\n"],"names":["SvgSearch","props","React","NotFound","className","title","message","actionLabel","onAction","jsxs","classes","jsx","Icon","Search","Button","PageSizePicker","currentPageSize","onPageSizeChange","disabled","pageSizeOptions","translations","useText","handlePageSizeChange","event","target","newPageSize","options","size","Picker","PaginationItemsCounter","pageInfo","totalCount","pageSize","DEFAULT_PAGE_SIZE","currentPage","total","from","to"],"mappings":"kXACA,MAAMA,EAAaC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,mBAAoB,YAAa,mCAAoC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,YAAa,GAAGD,CAAK,EAAoBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAS,EAAkBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,EAAG,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,cAAe,YAAa,cAAe,UAAW,sBAAsB,EAAoBA,EAAM,cAAc,SAAU,CAAE,aAAc,qBAAsB,GAAI,cAAe,YAAa,cAAe,GAAI,EAAG,GAAI,EAAG,EAAG,EAAG,KAAM,OAAQ,OAAQ,cAAc,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,EAAG,GAAI,EAAG,UAAW,uBAAwB,KAAM,OAAQ,OAAQ,cAAgB,CAAA,CAAC,CAAC,CAAC,EC6Bv9BC,EAA6C,CAAC,CACzD,UAAAC,EACA,MAAAC,EAAQ,kBACR,QAAAC,EAAU,2DACV,YAAAC,EACA,SAAAC,EACA,GAAGP,CACL,IAE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KrB,EAAkBmB,EAAQA,EAAQnB,EAG3C,OAAAL,EAAC,OAAK,CAAA,UAAW,4BAA4BP,CAAS,GAAG,KAAA,EACtD,SAAAgB,EAAa,aACX,QAAQ,SAAUgB,EAAK,SAAS,CAAC,EACjC,QAAQ,OAAQC,EAAG,UAAU,EAC7B,QAAQ,UAAWF,EAAM,SAAS,CAAC,CACxC,CAAA,CAEJ","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"RequisitionListActions.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n"],"names":["SvgAdd","props","React","RequisitionListActions","selectable","className","onAddNew","translations","useText","jsxs","classes","jsx","Icon","Add"],"mappings":"6SACA,MAAMA,EAAUC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,gBAAiB,YAAa,gCAAiC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAO,EAAoBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,CAAC,CAAE,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,WAAY,YAAa,WAAY,UAAW,wBAAwB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,cAAc,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,eAAgB,CAAC,CAAC,CAAC,EC6B/8BC,EAET,CAAC,CAAE,WAAAC,EAAY,UAAAC,EAAW,SAAAC,KAAe,CAC3C,MAAMC,EAAeC,EAAQ,CAC3B,iBAAkB,gDAAA,CACnB,EAED,OACEC,EAAC,SAAA,CACC,KAAK,SACL,aAAYF,EAAa,iBACzB,KAAK,SACL,UAAWG,EAAQ,CACjB,2BACA,CAAC,uCAAwCN,CAAU,EACnDC,CAAA,CACD,EACD,cAAY,kCACZ,QAASC,EAET,SAAA,CAAAK,EAAC,OAAA,CACC,UAAU,kCACV,cAAY,uCAEX,SAAAJ,EAAa,gBAAA,CAAA,EAEhBI,EAACC,EAAA,CAAK,OAAQC,EAAK,KAAK,IAAA,CAAK,CAAA,CAAA,CAAA,CAGnC","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"RequisitionListActions.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n"],"names":["SvgAdd","props","React","RequisitionListActions","selectable","className","onAddNew","translations","useText","jsxs","classes","jsx","Icon","Add"],"mappings":"6SACA,MAAMA,EAAUC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,gBAAiB,YAAa,gCAAiC,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,GAAI,OAAS,EAAkBA,EAAM,cAAc,OAAQ,CAAE,GAAI,iBAAkB,YAAa,iBAAkB,MAAO,GAAI,OAAQ,GAAI,KAAM,OAAQ,QAAS,CAAG,CAAA,EAAmBA,EAAM,cAAc,IAAK,CAAE,GAAI,WAAY,YAAa,WAAY,UAAW,wBAAwB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,cAAgB,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,GAAI,WAAY,YAAa,WAAY,GAAI,KAAM,UAAW,0BAA2B,KAAM,OAAQ,OAAQ,eAAgB,CAAC,CAAC,CAAC,EC6B/8BC,EAET,CAAC,CAAE,WAAAC,EAAY,UAAAC,EAAW,SAAAC,KAAe,CAC3C,MAAMC,EAAeC,EAAQ,CAC3B,iBAAkB,gDAAA,CACnB,EAGC,OAAAC,EAAC,SAAA,CACC,KAAK,SACL,aAAYF,EAAa,iBACzB,KAAK,SACL,UAAWG,EAAQ,CACjB,2BACA,CAAC,uCAAwCN,CAAU,EACnDC,CAAA,CACD,EACD,cAAY,kCACZ,QAASC,EAET,SAAA,CAAAK,EAAC,OAAA,CACC,UAAU,kCACV,cAAY,uCAEX,SAAaJ,EAAA,gBAAA,CAChB,EACCI,EAAAC,EAAA,CAAK,OAAQC,EAAK,KAAK,IAAK,CAAA,CAAA,CAAA,CAC/B,CAEJ","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"RequisitionListForm.js","sources":["/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n"],"names":["DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onSubmit","onCancel","props","values","setValues","useState","touched","setTouched","isSubmitting","setIsSubmitting","translations","useText","validateName","name","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","handleSubmit","nameError","_a","title","jsxs","classes","jsx","ProgressSpinner","InLineAlert","Field","Input","TextArea","Button"],"mappings":"gWAoBO,MAAMA,EAAoB,GAKpBC,EAAkB,EAClBC,EAAkB,GAClBC,EAAyB,IAEzBC,EAAmB,+BCwBnBC,EAET,CAAC,CACH,UAAAC,EACA,KAAAC,EACA,cAAAC,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAA,EACzC,MAAAC,EAAQ,KACR,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EACtBC,EAAoCP,CAAa,EAC7C,CAACQ,EAASC,CAAU,EAAIF,EAAS,CACrC,KAAM,EAAA,CACP,EACK,CAACG,EAAcC,CAAe,EAAIJ,EAAS,EAAK,EAEhDK,EAAeC,EAAQ,CAC3B,aAAc,mDACd,WAAY,iDACZ,cAAe,oDACf,cAAe,oDACf,sBAAuB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C,EAAA,CAAgB,OAAQ,IAAK,KAAM,OAAA,CAAS,CAAA,CAAA,EAE7C,IAAA,EACN,EAEC9B,EACC6B,EAACE,EAAA,CACC,KAAK,QACL,UAAU,sCACV,QAAQ,YACR,QAAS/B,EACT,cAAY,wBAAA,CAAA,EAEZ,KAEJ2B,EAAC,OAAA,CACC,UAAWC,EAAQ,CAAC,8BAA+B/B,CAAS,CAAC,EAC7D,SAAU0B,EAEV,SAAA,CAAAM,EAACG,EAAA,CAAM,MAAOR,EAAW,SAAUf,EACjC,SAAAoB,EAACI,EAAA,CACC,GAAG,6BACH,KAAK,OACL,KAAK,OACL,cAAetB,EAAa,cAC5B,YAAaA,EAAa,YAC1B,UAAWlB,EACX,MAAOW,EAAO,KACd,SAAUY,EAAa,MAAM,EAC7B,OAAQK,EAAW,MAAM,CAAA,CAAA,EAE7B,EAEAQ,EAACG,EAAA,CAAM,SAAUvB,EACf,SAAAoB,EAACK,EAAA,CACC,GAAG,oCACH,KAAK,cACL,MAAOvB,EAAa,MACpB,YAAaA,EAAa,MAC1B,UAAWjB,EACX,MAAOU,EAAO,YACd,SAAUY,EAAa,aAAa,EACpC,OAAQK,EAAW,aAAa,CAAA,CAAA,EAEpC,EAEAM,EAAC,MAAA,CAAI,UAAU,iCACb,SAAA,CAAAE,EAACM,EAAA,CACC,KAAK,SACL,QAAQ,YACR,QAASjC,EACT,SAAUO,EACV,cAAY,+BAEX,SAAAE,EAAa,YAAA,CAAA,EAEhBkB,EAACM,EAAA,CACC,KAAK,SACL,SAAU1B,EACV,cAAY,6BAEX,SAAAE,EAAa,UAAA,CAAA,CAChB,CAAA,CACF,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
1
+ {"version":3,"file":"RequisitionListForm.js","sources":["/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n"],"names":["DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onSubmit","onCancel","props","values","setValues","useState","touched","setTouched","isSubmitting","setIsSubmitting","translations","useText","validateName","name","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","handleSubmit","nameError","_a","title","jsxs","classes","jsx","ProgressSpinner","InLineAlert","Field","Input","TextArea","Button"],"mappings":"gWAoBO,MAAMA,EAAoB,GAKpBC,EAAkB,EAClBC,EAAkB,GAClBC,EAAyB,IAEzBC,EAAmB,+BCwBnBC,EAET,CAAC,CACH,UAAAC,EACA,KAAAC,EACA,cAAAC,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAG,EAC5C,MAAAC,EAAQ,KACR,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EACtBC,EAAoCP,CAAa,EAC7C,CAACQ,EAASC,CAAU,EAAIF,EAAS,CACrC,KAAM,EAAA,CACP,EACK,CAACG,EAAcC,CAAe,EAAIJ,EAAS,EAAK,EAEhDK,EAAeC,EAAQ,CAC3B,aAAc,mDACd,WAAY,iDACZ,cAAe,oDACf,cAAe,oDACf,sBAAuB,4DACvB,cAAe,oDACf,YAAa,kDACb,MAAO,4CACP,YAAa,kDACb,YAAa,iDAAA,CACd,EAGKC,EAAgBC,GAAyB,CACvC,MAAAC,EAAcD,EAAK,KAAK,EAE9B,OAAKC,EAIDA,EAAY,OAASvB,EAChBmB,EAAa,cAAc,QAChC,QACAnB,EAAgB,SAAS,CAC3B,EAGGG,EAAiB,KAAKoB,CAAW,EAI/B,GAHEJ,EAAa,sBAXbA,EAAa,aAexB,EAEMK,EACHC,GAA4CC,GAA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,EAAW,SAAUf,EACjC,SAAAoB,EAACI,EAAA,CACC,GAAG,6BACH,KAAK,OACL,KAAK,OACL,cAAetB,EAAa,cAC5B,YAAaA,EAAa,YAC1B,UAAWlB,EACX,MAAOW,EAAO,KACd,SAAUY,EAAa,MAAM,EAC7B,OAAQK,EAAW,MAAM,CAAA,CAAA,EAE7B,EAEAQ,EAACG,EAAM,CAAA,SAAUvB,EACf,SAAAoB,EAACK,EAAA,CACC,GAAG,oCACH,KAAK,cACL,MAAOvB,EAAa,MACpB,YAAaA,EAAa,MAC1B,UAAWjB,EACX,MAAOU,EAAO,YACd,SAAUY,EAAa,aAAa,EACpC,OAAQK,EAAW,aAAa,CAAA,CAAA,EAEpC,EAEAM,EAAC,MAAI,CAAA,UAAU,iCACb,SAAA,CAAAE,EAACM,EAAA,CACC,KAAK,SACL,QAAQ,YACR,QAASjC,EACT,SAAUO,EACV,cAAY,+BAEX,SAAaE,EAAA,YAAA,CAChB,EACAkB,EAACM,EAAA,CACC,KAAK,SACL,SAAU1B,EACV,cAAY,6BAEX,SAAaE,EAAA,UAAA,CAAA,CAChB,CACF,CAAA,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
@@ -1,6 +1,6 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{R}from"./RequisitionListForm.js";import{useState as p}from"@dropins/tools/preact-hooks.js";import{R as L,f as q,h as I,t as l,u as T}from"./updateRequisitionList.js";import{events as _}from"@dropins/tools/event-bus.js";const f=`
3
+ import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{R as p}from"./RequisitionListForm.js";import{useState as R}from"@dropins/tools/preact-hooks.js";import{R as L,t as q,u as I}from"./updateRequisitionList.js";import{f as l,h as T}from"./fetch-graphql.js";import{events as f}from"@dropins/tools/event-bus.js";const _=`
4
4
  mutation CREATE_REQUISITION_LIST_MUTATION(
5
5
  $requisitionListName: String!,
6
6
  $requisitionListDescription: String,
@@ -17,5 +17,5 @@ import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{R}from"./Requi
17
17
  }
18
18
  }
19
19
  ${L}
20
- `,N=async(r,o)=>q(f,{variables:{requisitionListName:r,requisitionListDescription:o}}).then(({errors:t,data:i})=>{var e;if(t)return I(t);if(!((e=i==null?void 0:i.createRequisitionList)!=null&&e.requisition_list))return null;const u=l(i.createRequisitionList.requisition_list);return _.emit("requisitionList/data",u),u});function S(r,o,t,i){const[u,e]=p(null);return{error:u,submit:async a=>{e(null);try{const n=a.description??"",s=r==="update"&&o?await T(o,a.name,n):await N(a.name,n);return s&&(t==null||t(s)),s}catch(n){const s=(n==null?void 0:n.message)||"Unexpected error";return e(s),i==null||i(s),null}}}}const O=({mode:r,requisitionListUid:o,defaultValues:t={name:"",description:""},onSuccess:i,onError:u,onCancel:e})=>{const{error:m,submit:a}=S(r,o,i,u);return c(R,{mode:r,defaultValues:t,error:m,onSubmit:async s=>{await a(s)},onCancel:e})};export{O as R};
20
+ `,N=async(r,o)=>l(_,{variables:{requisitionListName:r,requisitionListDescription:o}}).then(({errors:t,data:i})=>{var e;if(t)return T(t);if(!((e=i==null?void 0:i.createRequisitionList)!=null&&e.requisition_list))return null;const u=q(i.createRequisitionList.requisition_list);return f.emit("requisitionList/data",u),u});function S(r,o,t,i){const[u,e]=R(null);return{error:u,submit:async a=>{e(null);try{const n=a.description??"",s=r==="update"&&o?await I(o,a.name,n):await N(a.name,n);return s&&(t==null||t(s)),s}catch(n){const s=(n==null?void 0:n.message)||"Unexpected error";return e(s),i==null||i(s),null}}}}const U=({mode:r,requisitionListUid:o,defaultValues:t={name:"",description:""},onSuccess:i,onError:u,onCancel:e})=>{const{error:m,submit:a}=S(r,o,i,u);return c(p,{mode:r,defaultValues:t,error:m,onSubmit:async s=>{await a(s)},onCancel:e})};export{U as R};
21
21
  //# sourceMappingURL=RequisitionListForm2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequisitionListForm2.js","sources":["/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n"],"names":["CREATE_REQUISITION_LIST_MUTATION","REQUISITION_LIST_FRAGMENT","createRequisitionList","name","description","fetchGraphQl","errors","data","handleFetchError","_a","payload","transformRequisitionList","events","useRequisitionListForm","mode","requisitionListUid","onSuccess","onError","error","setError","useState","values","result","updateRequisitionList","e","msg","RequisitionListForm","defaultValues","onCancel","submit","jsx","RequisitionListFormComponent"],"mappings":"6RAmBO,MAAMA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB9CC,CAAyB;AAAA,ECXdC,EAAwB,MACnCC,EACAC,IAEOC,EAAaL,EAAkC,CACpD,UAAW,CACT,oBAAqBG,EACrB,2BAA4BC,CAAA,CAC9B,CACD,EAAE,KAAK,CAAC,CAAE,OAAAE,EAAQ,KAAAC,KAAW,OAC5B,GAAID,EAAQ,OAAOE,EAAiBF,CAAM,EAE1C,GAAI,GAACG,EAAAF,GAAA,YAAAA,EAAM,wBAAN,MAAAE,EAA6B,kBAChC,OAAO,KAGT,MAAMC,EAAUC,EACdJ,EAAK,sBAAsB,gBAAA,EAE7B,OAAAK,EAAO,KAAK,uBAAwBF,CAAO,EACpCA,CACT,CAAC,ECbI,SAASG,EACdC,EACAC,EACAC,EACAC,EAC8B,CAC9B,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAwB,IAAI,EA0BtD,MAAO,CAAE,MAAAF,EAAO,OAxBD,MACbG,GACoC,CACpCF,EAAS,IAAI,EACb,GAAI,CACF,MAAMf,EAAciB,EAAO,aAAe,GACpCC,EACJR,IAAS,UAAYC,EACjB,MAAMQ,EACJR,EACAM,EAAO,KACPjB,CAAA,EAEF,MAAMF,EAAsBmB,EAAO,KAAMjB,CAAW,EAC1D,OAAIkB,eAAoBA,IACjBA,CACT,OAASE,EAAQ,CACf,MAAMC,GAAMD,GAAA,YAAAA,EAAG,UAAW,mBAC1B,OAAAL,EAASM,CAAG,EACZR,GAAA,MAAAA,EAAUQ,GACH,IACT,CACF,CAEgB,CAClB,CC9BO,MAAMC,EAA2D,CAAC,CACvE,KAAAZ,EACA,mBAAAC,EACA,cAAAY,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAA,EACzC,UAAAX,EACA,QAAAC,EACA,SAAAW,CACF,IAAM,CACJ,KAAM,CAAE,MAAAV,EAAO,OAAAW,CAAA,EAAWhB,EACxBC,EACAC,EACAC,EACAC,CAAA,EAOF,OACEa,EAACC,EAAA,CACC,KAAAjB,EACA,cAAAa,EACA,MAAAT,EACA,SATiB,MAAOG,GAAsC,CAChE,MAAMQ,EAAOR,CAAM,CACrB,EAQI,SAAAO,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"RequisitionListForm2.js","sources":["/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n"],"names":["CREATE_REQUISITION_LIST_MUTATION","REQUISITION_LIST_FRAGMENT","createRequisitionList","name","description","fetchGraphQl","errors","data","handleFetchError","_a","payload","transformRequisitionList","events","useRequisitionListForm","mode","requisitionListUid","onSuccess","onError","error","setError","useState","values","result","updateRequisitionList","e","msg","RequisitionListForm","defaultValues","onCancel","submit","jsx","RequisitionListFormComponent"],"mappings":"kUAmBO,MAAMA,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB9CC,CAAyB;AAAA,ECXdC,EAAwB,MACnCC,EACAC,IAEOC,EAAaL,EAAkC,CACpD,UAAW,CACT,oBAAqBG,EACrB,2BAA4BC,CAAA,CAE/B,CAAA,EAAE,KAAK,CAAC,CAAE,OAAAE,EAAQ,KAAAC,KAAW,OACxB,GAAAD,EAAe,OAAAE,EAAiBF,CAAM,EAEtC,GAAA,GAACG,EAAAF,GAAA,YAAAA,EAAM,wBAAN,MAAAE,EAA6B,kBACzB,OAAA,KAGT,MAAMC,EAAUC,EACdJ,EAAK,sBAAsB,gBAC7B,EACO,OAAAK,EAAA,KAAK,uBAAwBF,CAAO,EACpCA,CAAA,CACR,ECbI,SAASG,EACdC,EACAC,EACAC,EACAC,EAC8B,CAC9B,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAwB,IAAI,EA0B/C,MAAA,CAAE,MAAAF,EAAO,OAxBD,MACbG,GACoC,CACpCF,EAAS,IAAI,EACT,GAAA,CACI,MAAAf,EAAciB,EAAO,aAAe,GACpCC,EACJR,IAAS,UAAYC,EACjB,MAAMQ,EACJR,EACAM,EAAO,KACPjB,CAEF,EAAA,MAAMF,EAAsBmB,EAAO,KAAMjB,CAAW,EACtD,OAAAkB,eAAoBA,IACjBA,QACAE,EAAQ,CACT,MAAAC,GAAMD,GAAA,YAAAA,EAAG,UAAW,mBAC1B,OAAAL,EAASM,CAAG,EACZR,GAAA,MAAAA,EAAUQ,GACH,IAAA,CAEX,CAEuB,CACzB,CC9BO,MAAMC,EAA2D,CAAC,CACvE,KAAAZ,EACA,mBAAAC,EACA,cAAAY,EAAgB,CAAE,KAAM,GAAI,YAAa,EAAG,EAC5C,UAAAX,EACA,QAAAC,EACA,SAAAW,CACF,IAAM,CACE,KAAA,CAAE,MAAAV,EAAO,OAAAW,CAAA,EAAWhB,EACxBC,EACAC,EACAC,EACAC,CACF,EAOE,OAAAa,EAACC,EAAA,CACC,KAAAjB,EACA,cAAAa,EACA,MAAAT,EACA,SATiB,MAAOG,GAAsC,CAChE,MAAMQ,EAAOR,CAAM,CACrB,EAQI,SAAAO,CAAA,CACF,CAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequisitionListHeader.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\">&lt;</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions && (actions.onRename || actions.onDelete) && (\n <div className=\"requisition-list-header__actions\">\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n onAlert?: (payload: {\n action: string;\n type: string;\n context: string;\n }) => void;\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n}) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page,\n enrichConfigurableProducts\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n onAlert?.({\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n } else {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [\n requisitionList.uid,\n requisitionList.page_info,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n const alertPayload = {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n };\n\n // Store alert in localStorage before redirecting\n // This ensures the alert is shown after redirect to grid view\n try {\n localStorage.setItem(\n 'requisitionListPendingAlert',\n JSON.stringify(alertPayload)\n );\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid, onAlert]);\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n"],"names":["RequisitionListHeader","name","description","backLink","actions","className","props","jsxs","jsx","e","_a","requisitionList","routeRequisitionListGrid","onUpdate","onAlert","enrichConfigurableProducts","showRenameModal","setShowRenameModal","useState","showDeleteModal","setShowDeleteModal","isDeleting","setIsDeleting","translations","useText","handleRename","useCallback","handleRenameSubmit","values","updatedList","updateRequisitionList","_b","handleDeleteList","handleDeleteConfirm","deleteRequisitionList","alertPayload","url","Fragment","RequisitionListHeaderComponent","result","RequisitionListModal","RequisitionListForm"],"mappings":"wYAsCO,MAAMA,EAET,CAAC,C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+ {"version":3,"file":"RequisitionListHeader.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\">&lt;</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions && (actions.onRename || actions.onDelete) && (\n <div className=\"requisition-list-header__actions\">\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n onAlert?: (payload: {\n action: string;\n type: string;\n context: string;\n }) => void;\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n}) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page,\n enrichConfigurableProducts\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n onAlert?.({\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n } else {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [\n requisitionList.uid,\n requisitionList.page_info,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n const alertPayload = {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n };\n\n // Store alert in localStorage before redirecting\n // This ensures the alert is shown after redirect to grid view\n try {\n localStorage.setItem(\n 'requisitionListPendingAlert',\n JSON.stringify(alertPayload)\n );\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid, onAlert]);\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n"],"names":["RequisitionListHeader","name","description","backLink","actions","className","props","jsxs","jsx","e","_a","requisitionList","routeRequisitionListGrid","onUpdate","onAlert","enrichConfigurableProducts","showRenameModal","setShowRenameModal","useState","showDeleteModal","setShowDeleteModal","isDeleting","setIsDeleting","translations","useText","handleRename","useCallback","handleRenameSubmit","values","updatedList","updateRequisitionList","_b","handleDeleteList","handleDeleteConfirm","deleteRequisitionList","alertPayload","url","Fragment","RequisitionListHeaderComponent","result","RequisitionListModal","RequisitionListForm"],"mappings":"wYAsCa,MAAAA,EAET,CAAC,CAAE,KAAAC,EAAM,YAAAC,EAAa,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,GAAGC,KAEvDC,EAAC,OAAK,GAAGD,EAAO,UAAW,2BAA2BD,GAAa,EAAE,GAElE,SAAA,CACCF,GAAAK,EAAC,MAAI,CAAA,UAAU,gCACb,SAAAD,EAAC,IAAA,CACC,KAAMJ,EAAS,IACf,UAAU,qCACV,QAASA,EAAS,QAElB,SAAA,CAACK,EAAA,OAAA,CAAK,UAAU,sCAAsC,SAAI,IAAA,EACzDL,EAAS,KAAA,CAAA,CAAA,EAEd,EAIFI,EAAC,MAAI,CAAA,UAAU,gCACb,SAAA,CAACA,EAAA,MAAA,CAAI,UAAU,yCACb,SAAA,CAACC,EAAA,KAAA,CAAG,UAAU,iCAAkC,SAAKP,EAAA,EACpDC,GACCM,EAAC,IAAE,CAAA,UAAU,uCACV,SACHN,CAAA,CAAA,CAAA,EAEJ,EAGCE,IAAYA,EAAQ,UAAYA,EAAQ,WACtCG,EAAA,MAAA,CAAI,UAAU,mCACZ,SAAA,CAAAH,EAAQ,UACPI,EAAC,IAAA,CACC,KAAK,IACL,QAAUC,GAAM,OACdA,EAAE,eAAe,GACjBC,EAAAN,EAAQ,WAAR,MAAAM,EAAA,KAAAN,EAC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KAAK,SACL,cAAe,CACb,KAAM9B,EAAgB,KACtB,YAAaA,EAAgB,aAAe,EAC9C,EACA,SAAUgB,EACV,SAAU,IAAMV,EAAmB,EAAK,CAAA,CAC1C,EAEF,mBAAoB,IAAMA,EAAmB,EAAK,CAAA,CACpD,EAIDE,GACCX,EAACgC,EAAA,CACC,OAAQrB,EACR,UAAWE,EACX,MAAOE,EAAa,gBACpB,aAAcA,EAAa,kBAC3B,kBAAmBA,EAAa,cAChC,gBAAiBA,EAAa,aAC9B,mBAAoB,IAAMH,EAAmB,EAAK,EAClD,qBAAsBa,CAAA,CAAA,CACxB,EAEJ,CAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequisitionListModal.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":["RequisitionListModal","isOpen","isLoading","title","modalContent","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","jsx","Modal","jsxs","ProgressSpinner","Button"],"mappings":"2JAmCO,MAAMA,EAET,CAAC,CACH,OAAAC,EACA,UAAAC,EACA,MAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,qBAAAC,CACF,IACOP,EAGHQ,EAACC,EAAA,CACC,UAAU,kCACV,cAAY,yBACZ,KAAM,SACN,SAAU,GACV,MAAAP,EACA,QAASI,EACT,cAAe,GACf,eAAgB,GAChB,gBAAiB,GACjB,KAAK,SACL,aAAYJ,EAEZ,SAAAQ,EAAC,MAAA,CAAI,UAAU,yBACZ,SAAA,CAAAT,EACCO,EAAC,MAAA,CACC,UAAU,kCACV,cAAY,mBAEZ,SAAAA,EAACG,EAAA,CAAgB,OAAQ,IAAK,KAAM,OAAA,CAAS,CAAA,CAAA,EAE7C,KACJH,EAAC,KAAG,SAAAL,CAAA,CAAa,EACjBO,EAAC,MAAA,CAAI,UAAU,kCACZ,SAAA,CAAAJ,GAAsBF,GACrBI,EAACI,EAAA,CACC,cAAY,wBACZ,KAAM,SACN,QAASN,EACT,QAAQ,YACR,SAAUL,EAET,SAAAG,CAAA,CAAA,EAGJG,GAAwBF,GACvBG,EAACI,EAAA,CACC,cAAY,0BACZ,KAAM,SACN,QAASL,EACT,SAAUN,EAET,SAAAI,CAAA,CAAA,CACH,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,EAjDgB"}
1
+ {"version":3,"file":"RequisitionListModal.js","sources":["/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":["RequisitionListModal","isOpen","isLoading","title","modalContent","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","jsx","Modal","jsxs","ProgressSpinner","Button"],"mappings":"2JAmCO,MAAMA,EAET,CAAC,CACH,OAAAC,EACA,UAAAC,EACA,MAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,qBAAAC,CACF,IACOP,EAGHQ,EAACC,EAAA,CACC,UAAU,kCACV,cAAY,yBACZ,KAAM,SACN,SAAU,GACV,MAAAP,EACA,QAASI,EACT,cAAe,GACf,eAAgB,GAChB,gBAAiB,GACjB,KAAK,SACL,aAAYJ,EAEZ,SAAAQ,EAAC,MAAI,CAAA,UAAU,yBACZ,SAAA,CACCT,EAAAO,EAAC,MAAA,CACC,UAAU,kCACV,cAAY,mBAEZ,SAACA,EAAAG,EAAA,CAAgB,OAAQ,IAAK,KAAM,OAAS,CAAA,CAAA,CAAA,EAE7C,KACJH,EAAC,KAAG,SAAaL,CAAA,CAAA,EACjBO,EAAC,MAAI,CAAA,UAAU,kCACZ,SAAA,CAAAJ,GAAsBF,GACrBI,EAACI,EAAA,CACC,cAAY,wBACZ,KAAM,SACN,QAASN,EACT,QAAQ,YACR,SAAUL,EAET,SAAAG,CAAA,CACH,EAEDG,GAAwBF,GACvBG,EAACI,EAAA,CACC,cAAY,0BACZ,KAAM,SACN,QAASL,EACT,SAAUN,EAET,SAAAI,CAAA,CAAA,CACH,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,CACF,EAlDkB"}
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2026 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as r,jsxs as q}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useEffect as L}from"@dropins/tools/preact-compat.js";import{Card as p,Icon as v,Button as R}from"@dropins/tools/components.js";import{s as t,a as g,b as m,u as _}from"./state.js";import{g as b}from"./getRequisitionLists.js";import{events as h}from"@dropins/tools/event-bus.js";import{S as k}from"./RequisitionListView.js";let e=0;const S=()=>{const[d,a]=l(t.requisitionLists),[f,u]=l(t.requisitionListsLoading),[c,o]=l(e);return L(()=>{t.requisitionLists.length===0&&!t.requisitionListsLoading&&(g(!0),b(1,100).then(s=>{const n=(s==null?void 0:s.items)||[];m(n),e++}).catch(s=>{console.error("Error fetching requisition lists:",s),m([]),e++}).finally(()=>{g(!1)}))},[]),L(()=>{const s=h.on("requisitionLists/data",i=>{i&&(m(i),e++,o(e),a(t.requisitionLists),u(t.requisitionListsLoading))}),n=h.on("requisitionList/data",i=>{i&&(_(i),e++,o(e),a([...t.requisitionLists]),u(t.requisitionListsLoading))});return()=>{s==null||s.off(),n==null||n.off()}},[]),L(()=>{c!==e&&(a(t.requisitionLists),u(t.requisitionListsLoading),o(e))},[c]),{lists:d,loading:f}},w=({excludeUid:d,confirmLabel:a,disabled:f=!1,onConfirm:u})=>{const{lists:c}=S(),[o,s]=l(null),n=d?c.filter(i=>i.uid!==d):c;return r(p,{variant:"secondary",children:q("form",{onSubmit:i=>{i.preventDefault(),o&&u(o)},className:"requisition-list-picker__form",children:[r("div",{className:"requisition-list-picker__available-lists",children:n.map(i=>q(p,{variant:o===i.uid?"primary":"secondary",onClick:()=>s(i.uid),children:[r(v,{source:k}),r("span",{children:i.name})]},i.uid))}),r("div",{className:"requisition-list-picker__actions",children:r(R,{type:"submit",disabled:!o||f,children:a})})]})})};export{w as R,S as u};
4
+ //# sourceMappingURL=RequisitionListPicker.js.map