umwd-components 0.1.737 → 0.1.738

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 (117) hide show
  1. package/dist/cjs/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  2. package/dist/cjs/node_modules/safe-buffer/index.js +1 -1
  3. package/dist/cjs/src/components/common/csv/CsvDownloader.js +1 -1
  4. package/dist/cjs/src/components/common/media/MediaGrid.js +1 -1
  5. package/dist/cjs/src/components/common/media/UploadMediaForm.js +1 -1
  6. package/dist/cjs/src/components/e-commerce/cart/CartDisplay.js +1 -1
  7. package/dist/cjs/src/components/e-commerce/categories/AddCategoryForm.js +1 -1
  8. package/dist/cjs/src/components/e-commerce/categories/EditCategoryForm.js +1 -1
  9. package/dist/cjs/src/components/e-commerce/checkout/CheckoutForm.js +1 -1
  10. package/dist/cjs/src/components/e-commerce/checkout/Step3.js +1 -1
  11. package/dist/cjs/src/components/e-commerce/customer/CustomerProfileDisplay.js +1 -1
  12. package/dist/cjs/src/components/e-commerce/customer/CustomerProfileEditForm.js +1 -1
  13. package/dist/cjs/src/components/e-commerce/customer/DenseCustomerProfileDisplay.js +1 -1
  14. package/dist/cjs/src/components/e-commerce/enduser/EnduserProfileDisplay.js +1 -1
  15. package/dist/cjs/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
  16. package/dist/cjs/src/components/e-commerce/invoice/CreateInvoiceForm.js +1 -1
  17. package/dist/cjs/src/components/e-commerce/iro/CreateIROForm.js +1 -1
  18. package/dist/cjs/src/components/e-commerce/iro/ManageIROForm.js +1 -1
  19. package/dist/cjs/src/components/e-commerce/iro/RmaForm.js +1 -1
  20. package/dist/cjs/src/components/e-commerce/iro/TextualManageIROForm.js +1 -1
  21. package/dist/cjs/src/components/e-commerce/opo/CreateOpoForm.js +1 -1
  22. package/dist/cjs/src/components/e-commerce/opo/ManageOpoForm.js +1 -1
  23. package/dist/cjs/src/components/e-commerce/opo/TextualManageOpoForm.js +1 -1
  24. package/dist/cjs/src/components/e-commerce/products/AddProductForm.js +1 -1
  25. package/dist/cjs/src/components/e-commerce/products/EditProductForm.js +1 -1
  26. package/dist/cjs/src/components/e-commerce/products/EditStockForm.js +1 -1
  27. package/dist/cjs/src/components/e-commerce/products/ProductCategoryCard.js +1 -1
  28. package/dist/cjs/src/components/e-commerce/products/SingleProduct.js +1 -1
  29. package/dist/cjs/src/components/layout/Footer.js +1 -1
  30. package/dist/cjs/src/components/logistics/dispatcher/DispatcherProfileDisplay.js +1 -1
  31. package/dist/cjs/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +1 -1
  32. package/dist/cjs/src/components/logistics/ipo/AddIPOForm.js +1 -1
  33. package/dist/cjs/src/components/logistics/ipo/ManageIPOForm.js +1 -1
  34. package/dist/cjs/src/components/logistics/ipo/TextualManageIPOForm.js +1 -1
  35. package/dist/cjs/src/components/logistics/report/PreReportsDisplay.js +1 -1
  36. package/dist/cjs/src/components/logistics/report/ReportsDisplay.js +1 -1
  37. package/dist/cjs/src/components/logistics/vendor/AddVendorForm.js +1 -1
  38. package/dist/cjs/src/components/logistics/vendor/EditVendorForm.js +1 -1
  39. package/dist/cjs/src/components/logistics/vendor/VendorDisplay.js +1 -1
  40. package/dist/cjs/src/components/page-builder/ColumnsSection.js +1 -1
  41. package/dist/cjs/src/components/page-builder/IconSection.js +1 -1
  42. package/dist/cjs/src/components/page-builder/LogoBarSection.js +1 -1
  43. package/dist/cjs/src/components/page-builder/PBPersonaliaSection.js +1 -1
  44. package/dist/cjs/src/components/page-builder/PBTextImageSection.js +1 -1
  45. package/dist/cjs/src/components/page-builder/PictureBarSection.js +1 -1
  46. package/dist/cjs/src/components/page-elements/CategoryBlock.js +1 -1
  47. package/dist/cjs/src/components/page-elements/ColumnsSection.js +1 -1
  48. package/dist/cjs/src/components/page-elements/IconSection.js +1 -1
  49. package/dist/cjs/src/components/page-elements/LogoBarSection.js +1 -1
  50. package/dist/cjs/src/components/page-elements/PersonaliaSection.js +1 -1
  51. package/dist/cjs/src/components/page-elements/PictureBarSection.js +1 -1
  52. package/dist/cjs/src/components/page-elements/ProductBlock.js +1 -1
  53. package/dist/cjs/src/components/page-elements/TextImageSection.js +1 -1
  54. package/dist/cjs/src/components/public-information/PublicInformationForm.js +1 -1
  55. package/dist/cjs/src/data/actions/auth-actions.js +1 -1
  56. package/dist/cjs/src/data/services/get-token.js +1 -1
  57. package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
  58. package/dist/esm/_virtual/index3.js +2 -2
  59. package/dist/esm/_virtual/index4.js +2 -2
  60. package/dist/esm/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  61. package/dist/esm/node_modules/safe-buffer/index.js +1 -1
  62. package/dist/esm/src/components/common/csv/CsvDownloader.js +5 -5
  63. package/dist/esm/src/components/common/media/MediaGrid.js +1 -1
  64. package/dist/esm/src/components/common/media/UploadMediaForm.js +12 -2
  65. package/dist/esm/src/components/e-commerce/cart/CartDisplay.js +1 -1
  66. package/dist/esm/src/components/e-commerce/categories/AddCategoryForm.js +1 -1
  67. package/dist/esm/src/components/e-commerce/categories/EditCategoryForm.js +1 -1
  68. package/dist/esm/src/components/e-commerce/checkout/CheckoutForm.js +2 -2
  69. package/dist/esm/src/components/e-commerce/checkout/Step3.js +9 -3
  70. package/dist/esm/src/components/e-commerce/customer/CustomerProfileDisplay.js +19 -1
  71. package/dist/esm/src/components/e-commerce/customer/CustomerProfileEditForm.js +1 -1
  72. package/dist/esm/src/components/e-commerce/customer/DenseCustomerProfileDisplay.js +16 -1
  73. package/dist/esm/src/components/e-commerce/enduser/EnduserProfileDisplay.js +4 -1
  74. package/dist/esm/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
  75. package/dist/esm/src/components/e-commerce/invoice/CreateInvoiceForm.js +3 -3
  76. package/dist/esm/src/components/e-commerce/iro/CreateIROForm.js +1 -1
  77. package/dist/esm/src/components/e-commerce/iro/ManageIROForm.js +2 -2
  78. package/dist/esm/src/components/e-commerce/iro/RmaForm.js +2 -2
  79. package/dist/esm/src/components/e-commerce/iro/TextualManageIROForm.js +3 -3
  80. package/dist/esm/src/components/e-commerce/opo/CreateOpoForm.js +1 -1
  81. package/dist/esm/src/components/e-commerce/opo/ManageOpoForm.js +4 -4
  82. package/dist/esm/src/components/e-commerce/opo/TextualManageOpoForm.js +4 -4
  83. package/dist/esm/src/components/e-commerce/products/AddProductForm.js +3 -3
  84. package/dist/esm/src/components/e-commerce/products/EditProductForm.js +3 -3
  85. package/dist/esm/src/components/e-commerce/products/EditStockForm.js +3 -3
  86. package/dist/esm/src/components/e-commerce/products/ProductCategoryCard.js +10 -2
  87. package/dist/esm/src/components/e-commerce/products/SingleProduct.js +40 -4
  88. package/dist/esm/src/components/layout/Footer.js +24 -9
  89. package/dist/esm/src/components/logistics/dispatcher/DispatcherProfileDisplay.js +10 -1
  90. package/dist/esm/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +1 -1
  91. package/dist/esm/src/components/logistics/ipo/AddIPOForm.js +4 -1
  92. package/dist/esm/src/components/logistics/ipo/ManageIPOForm.js +4 -4
  93. package/dist/esm/src/components/logistics/ipo/TextualManageIPOForm.js +4 -4
  94. package/dist/esm/src/components/logistics/report/PreReportsDisplay.js +1 -1
  95. package/dist/esm/src/components/logistics/report/ReportsDisplay.js +5 -5
  96. package/dist/esm/src/components/logistics/vendor/AddVendorForm.js +23 -4
  97. package/dist/esm/src/components/logistics/vendor/EditVendorForm.js +36 -7
  98. package/dist/esm/src/components/logistics/vendor/VendorDisplay.js +10 -1
  99. package/dist/esm/src/components/page-builder/ColumnsSection.js +4 -1
  100. package/dist/esm/src/components/page-builder/IconSection.js +6 -1
  101. package/dist/esm/src/components/page-builder/LogoBarSection.js +1 -1
  102. package/dist/esm/src/components/page-builder/PBPersonaliaSection.js +11 -2
  103. package/dist/esm/src/components/page-builder/PBTextImageSection.js +8 -2
  104. package/dist/esm/src/components/page-builder/PictureBarSection.js +1 -1
  105. package/dist/esm/src/components/page-elements/CategoryBlock.js +1 -1
  106. package/dist/esm/src/components/page-elements/ColumnsSection.js +4 -1
  107. package/dist/esm/src/components/page-elements/IconSection.js +6 -1
  108. package/dist/esm/src/components/page-elements/LogoBarSection.js +1 -1
  109. package/dist/esm/src/components/page-elements/PersonaliaSection.js +19 -4
  110. package/dist/esm/src/components/page-elements/PictureBarSection.js +1 -1
  111. package/dist/esm/src/components/page-elements/ProductBlock.js +1 -1
  112. package/dist/esm/src/components/page-elements/TextImageSection.js +8 -2
  113. package/dist/esm/src/components/public-information/PublicInformationForm.js +28 -6
  114. package/dist/esm/src/data/actions/auth-actions.js +6 -3
  115. package/dist/esm/src/data/services/get-token.js +1 -1
  116. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  117. package/package.json +12 -12
@@ -4,6 +4,6 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- var safeBuffer = {exports: {}};
7
+ var reactIs = {exports: {}};
8
8
 
9
- export { safeBuffer as __module };
9
+ export { reactIs as __module };
@@ -4,6 +4,6 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- var reactIs = {exports: {}};
7
+ var safeBuffer = {exports: {}};
8
8
 
9
- export { reactIs as __module };
9
+ export { safeBuffer as __module };
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- import { __module as reactIs } from '../../../../_virtual/index4.js';
7
+ import { __module as reactIs } from '../../../../_virtual/index3.js';
8
8
  import { __require as requireReactIs_production_min } from './cjs/react-is.production.min.js';
9
9
  import { __require as requireReactIs_development } from './cjs/react-is.development.js';
10
10
 
@@ -4,7 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
 
7
- import { __module as safeBuffer } from '../../_virtual/index3.js';
7
+ import { __module as safeBuffer } from '../../_virtual/index4.js';
8
8
  import require$$0 from 'buffer';
9
9
 
10
10
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -183,18 +183,18 @@ function CsvDownloader(props) {
183
183
  }, {}),
184
184
  }, { encodeValuesOnly: true }));
185
185
  }, [attributes, relations, startDate, endDate, dateType]);
186
- return (jsx(Paper, { sx: { width: "100%", p: 2 }, children: jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: jsxs(Grid, { container: true, spacing: 2, children: [open && (jsxs(Fragment, { children: [jsxs(Grid, { item: true, xs: 12, children: [jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) }) }), jsx(Divider, {})] }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Attributes" }), jsx(Checkbox, { checked: defaultAttributes.length === attributes.length, indeterminate: defaultAttributes.length !== attributes.length &&
187
- attributes.length > 0, sx: { "& .MuiSvgIcon-root": { fontSize: 28 } }, onChange: selectAllAttributes })] }) }), defaultAttributes.map((attribute) => (jsx(Grid, { item: true, xs: 4, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: attribute.name, checked: attributes.includes(attribute.name), onChange: handleAttributeChange }), jsx(Typography, { children: attribute.label })] }) }, attribute.name))), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Relations" }), jsx(Checkbox, { checked: defaultRelations.length === relations.length, indeterminate: defaultRelations.length !== relations.length &&
186
+ return (jsx(Paper, { sx: { width: "100%", p: 2 }, children: jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: jsxs(Grid, { container: true, spacing: 2, children: [open && (jsxs(Fragment, { children: [jsxs(Grid, { size: 12, children: [jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) }) }), jsx(Divider, {})] }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Attributes" }), jsx(Checkbox, { checked: defaultAttributes.length === attributes.length, indeterminate: defaultAttributes.length !== attributes.length &&
187
+ attributes.length > 0, sx: { "& .MuiSvgIcon-root": { fontSize: 28 } }, onChange: selectAllAttributes })] }) }), defaultAttributes.map((attribute) => (jsx(Grid, { size: 4, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: attribute.name, checked: attributes.includes(attribute.name), onChange: handleAttributeChange }), jsx(Typography, { children: attribute.label })] }) }, attribute.name))), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Relations" }), jsx(Checkbox, { checked: defaultRelations.length === relations.length, indeterminate: defaultRelations.length !== relations.length &&
188
188
  relations.length > 0, sx: { "& .MuiSvgIcon-root": { fontSize: 28 } }, onChange: selectAllRelations })] }) }), defaultRelations.map((relation) => {
189
189
  const isOpen = openRelations.includes(relation.name);
190
190
  const relationChecked = relations.some((rel) => rel.name === relation.name);
191
191
  const relationIndeterminate = relationChecked &&
192
192
  relations.some((rel) => rel.name === relation.name &&
193
193
  rel.attributes.length !== relation.attributes.length);
194
- return (jsxs(Grid, { item: true, xs: 12, children: [jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: relation.name, checked: relationChecked, indeterminate: relationIndeterminate, onChange: handleRelationChange }), jsx(Typography, { children: relation.label }), jsx(IconButton, { name: relation.name, onClick: () => toggleRelationOpen(relation.name), children: isOpen ? (jsx(KeyboardArrowDownIcon, {})) : (jsx(KeyboardArrowUpIcon, {})) })] }), jsx(Divider, {}), jsx(Collapse, { in: isOpen, children: jsx(Grid, { container: true, sx: { pl: 2 }, children: relation.attributes.map((attribute) => (jsx(Grid, { item: true, xs: 3, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: `${attribute.name}|${relation.name}`, checked: relations.some((rel) => rel.name === relation.name &&
194
+ return (jsxs(Grid, { size: 12, children: [jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: relation.name, checked: relationChecked, indeterminate: relationIndeterminate, onChange: handleRelationChange }), jsx(Typography, { children: relation.label }), jsx(IconButton, { name: relation.name, onClick: () => toggleRelationOpen(relation.name), children: isOpen ? (jsx(KeyboardArrowDownIcon, {})) : (jsx(KeyboardArrowUpIcon, {})) })] }), jsx(Divider, {}), jsx(Collapse, { in: isOpen, children: jsx(Grid, { container: true, sx: { pl: 2 }, children: relation.attributes.map((attribute) => (jsx(Grid, { size: 3, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: `${attribute.name}|${relation.name}`, checked: relations.some((rel) => rel.name === relation.name &&
195
195
  rel.attributes.includes(attribute.name)), onChange: handleRelationAttributeChange, size: "small" }), jsx(Typography, { variant: "body2", children: attribute.label })] }) }, attribute.name))) }) })] }, relation.name));
196
- }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Creation, Publication and Update" }), jsx(Checkbox, { checked: defaultStrapiAttributes.length === strapiAttributes.length, indeterminate: defaultStrapiAttributes.length !==
197
- strapiAttributes.length && strapiAttributes.length > 0, sx: { "& .MuiSvgIcon-root": { fontSize: 28 } }, onChange: selectAllStrapiAttributes })] }) }), defaultStrapiAttributes.map((strapi) => (jsx(Grid, { item: true, xs: 4, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: strapi.name, checked: strapiAttributes.includes(strapi.name), onChange: handleStrapiAttributeChange }), jsx(Typography, { children: strapi.label })] }) }, strapi.name))), jsx(Grid, { item: true, xs: 12, children: jsx(Typography, { variant: "h6", children: "Select date range" }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Autocomplete, { value: dateType, options: dateFieldOptions, multiple: false, onChange: (e, newValue) => setDateType(newValue), renderInput: (params) => (jsx(TextField, { ...params, label: "Date Type" })), sx: { width: 300 }, disableClearable: true }), jsx(DatePicker, { value: startDate, label: "start date", onChange: (value) => value && setStartDate(value) }), jsx(DatePicker, { value: endDate, label: "end date", onChange: (value) => value && setEndDate(value) })] }) })] })), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", spacing: 2, sx: { justifyContent: "space-between" }, children: [jsxs(Fragment$1, { children: [jsx(Button, { variant: "contained", disabled: attributes.length === 0 && relations.length === 0, onClick: exportCSV, children: "Export CSV" }), csvData && (jsx(reactCsv.CSVLink, { data: csvData, filename: `${dayjs(startDate).format("DD-MM-YYYY")}_${dayjs(endDate).format("DD-MM-YYYY")}/${dateType}_${entityCode}-export.csv`, ref: csvLinkRef }))] }), jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) })] }) })] }) }) }));
196
+ }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [jsx(Typography, { variant: "h6", children: "Creation, Publication and Update" }), jsx(Checkbox, { checked: defaultStrapiAttributes.length === strapiAttributes.length, indeterminate: defaultStrapiAttributes.length !==
197
+ strapiAttributes.length && strapiAttributes.length > 0, sx: { "& .MuiSvgIcon-root": { fontSize: 28 } }, onChange: selectAllStrapiAttributes })] }) }), defaultStrapiAttributes.map((strapi) => (jsx(Grid, { size: 4, children: jsxs(Stack, { spacing: 1, direction: "row", sx: { alignItems: "center" }, children: [jsx(Checkbox, { name: strapi.name, checked: strapiAttributes.includes(strapi.name), onChange: handleStrapiAttributeChange }), jsx(Typography, { children: strapi.label })] }) }, strapi.name))), jsx(Grid, { size: 12, children: jsx(Typography, { variant: "h6", children: "Select date range" }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Autocomplete, { value: dateType, options: dateFieldOptions, multiple: false, onChange: (e, newValue) => setDateType(newValue), renderInput: (params) => (jsx(TextField, { ...params, label: "Date Type" })), sx: { width: 300 }, disableClearable: true }), jsx(DatePicker, { value: startDate, label: "start date", onChange: (value) => value && setStartDate(value) }), jsx(DatePicker, { value: endDate, label: "end date", onChange: (value) => value && setEndDate(value) })] }) })] })), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", spacing: 2, sx: { justifyContent: "space-between" }, children: [jsxs(Fragment$1, { children: [jsx(Button, { variant: "contained", disabled: attributes.length === 0 && relations.length === 0, onClick: exportCSV, children: "Export CSV" }), csvData && (jsx(reactCsv.CSVLink, { data: csvData, filename: `${dayjs(startDate).format("DD-MM-YYYY")}_${dayjs(endDate).format("DD-MM-YYYY")}/${dateType}_${entityCode}-export.csv`, ref: csvLinkRef }))] }), jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) })] }) })] }) }) }));
198
198
  }
199
199
 
200
200
  export { CsvDownloader as default };
@@ -24,7 +24,7 @@ function MediaGrid({ mediaArray, selected = [], handleSelect, }) {
24
24
  };
25
25
  return (jsx(Grid, { container: true, spacing: 2, sx: { transform: "translateX(-1rem)" }, children: mediaArray?.length > 0 &&
26
26
  mediaArray.map((item, index) => {
27
- return (jsxs(Fragment, { children: [jsx(EditMediaDialog, { open: openDialog && openItem === index, handleClose: handleClose, data: item }), jsx(Grid, { item: true, xs: 3, children: jsx(MediaItem, { mediaItem: item, isSelected: selected.findIndex((select) => select.id === item.id) !== -1, onClick: handleSelect
27
+ return (jsxs(Fragment, { children: [jsx(EditMediaDialog, { open: openDialog && openItem === index, handleClose: handleClose, data: item }), jsx(Grid, { size: 3, children: jsx(MediaItem, { mediaItem: item, isSelected: selected.findIndex((select) => select.id === item.id) !== -1, onClick: handleSelect
28
28
  ? () => handleSelect(item)
29
29
  : () => handleButtonClick(index) }) })] }, item.id));
30
30
  }) }));
@@ -40,9 +40,19 @@ function UploadMediaForm({ reference, refID, field, multiple = true, accept = "i
40
40
  border: "1px dashed white",
41
41
  minHeight: "100px",
42
42
  }, children: accept === undefined || accept === "image/*" ? (jsx(Grid, { container: true, children: filePreviews.map((image, index) => {
43
- return (jsx(Grid, { item: true, xs: 12, sm: 6, md: 4, lg: 2, children: jsx("img", { src: image.url, alt: image.name, style: { width: "100px" } }, index) }, index));
43
+ return (jsx(Grid, { size: {
44
+ xs: 12,
45
+ sm: 6,
46
+ md: 4,
47
+ lg: 2
48
+ }, children: jsx("img", { src: image.url, alt: image.name, style: { width: "100px" } }, index) }, index));
44
49
  }) })) : (jsx(Grid, { container: true, children: filePreviews.map((file, index) => {
45
- return (jsx(Grid, { item: true, xs: 12, sm: 6, md: 4, lg: 2, children: jsx(Typography, { children: file.name }) }, index));
50
+ return (jsx(Grid, { size: {
51
+ xs: 12,
52
+ sm: 6,
53
+ md: 4,
54
+ lg: 2
55
+ }, children: jsx(Typography, { children: file.name }) }, index));
46
56
  }) })) })) : (jsx(Box, { onClick: () => fileInput.current?.click(), sx: {
47
57
  p: 2,
48
58
  width: "100%",
@@ -22,7 +22,7 @@ function CartDisplay({ data }) {
22
22
  if (!isClient) {
23
23
  return jsx(CircularProgress, {});
24
24
  }
25
- return (jsxs(Grid, { container: true, spacing: 2, sx: { py: 3, minHeight: "60vh" }, children: [jsx(Grid, { item: true, xs: 12, children: jsx(Typography, { variant: "h4", align: "center", component: "h1", children: "My cart" }) }), jsx(Grid, { item: true, xs: 12, children: jsx(Paper, { sx: { width: "100%", p: 2 }, children: jsxs(Stack, { spacing: 2, children: [jsx(CartSummary, {}), state.items.length > 0 && (jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555" }, children: "Total excl. VAT" }), jsxs(Typography, { sx: { width: "30%", color: "#555" }, align: "right", children: ["\u20AC ", state.totalExVAT.toFixed(2)] })] }), jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555" }, children: "Total VAT" }), jsxs(Typography, { sx: { width: "30%", color: "#555" }, align: "right", children: ["\u20AC ", state.totalVAT.toFixed(2)] })] }), jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555", fontWeight: 600 }, children: "Total" }), jsxs(Typography, { sx: { width: "30%", color: "#555", fontWeight: 600 }, align: "right", children: ["\u20AC ", state.totalInclVAT.toFixed(2)] })] })] })), jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Link, { href: shopUrl, legacyBehavior: true, children: jsx(Button, { variant: "outlined", children: "Continue shopping" }) }), state.items.length > 0 && (jsx(Link, { href: checkoutUrl, legacyBehavior: true, children: jsx(Button, { variant: "contained", children: "Check Out" }) }))] })] }) }) })] }));
25
+ return (jsxs(Grid, { container: true, spacing: 2, sx: { py: 3, minHeight: "60vh" }, children: [jsx(Grid, { size: 12, children: jsx(Typography, { variant: "h4", align: "center", component: "h1", children: "My cart" }) }), jsx(Grid, { size: 12, children: jsx(Paper, { sx: { width: "100%", p: 2 }, children: jsxs(Stack, { spacing: 2, children: [jsx(CartSummary, {}), state.items.length > 0 && (jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555" }, children: "Total excl. VAT" }), jsxs(Typography, { sx: { width: "30%", color: "#555" }, align: "right", children: ["\u20AC ", state.totalExVAT.toFixed(2)] })] }), jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555" }, children: "Total VAT" }), jsxs(Typography, { sx: { width: "30%", color: "#555" }, align: "right", children: ["\u20AC ", state.totalVAT.toFixed(2)] })] }), jsxs(Stack, { direction: "row", children: [jsx(Typography, { sx: { width: "10%" } }), jsx(Typography, { sx: { width: "60%", color: "#555", fontWeight: 600 }, children: "Total" }), jsxs(Typography, { sx: { width: "30%", color: "#555", fontWeight: 600 }, align: "right", children: ["\u20AC ", state.totalInclVAT.toFixed(2)] })] })] })), jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Link, { href: shopUrl, legacyBehavior: true, children: jsx(Button, { variant: "outlined", children: "Continue shopping" }) }), state.items.length > 0 && (jsx(Link, { href: checkoutUrl, legacyBehavior: true, children: jsx(Button, { variant: "contained", children: "Check Out" }) }))] })] }) }) })] }));
26
26
  }
27
27
 
28
28
  export { CartDisplay as default };
@@ -50,7 +50,7 @@ function AddCategoryForm({ productNamesArray, revalidateCallback, sx, handleClos
50
50
  });
51
51
  }
52
52
  }, [formState?.strapiErrors]);
53
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Add Category" }), jsx(Typography, { variant: "body2", children: "Create a new category for your products. You can add products to this category later." })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(TextField, { id: "title", name: "title", label: "Title" }), jsx(MarkdownEditor, { name: "description", label: "Description" })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Products" }), jsx(ProductSelector, { productNames: productNamesArray, currentValue: [] })] }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Create category", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
53
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Add Category" }), jsx(Typography, { variant: "body2", children: "Create a new category for your products. You can add products to this category later." })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(TextField, { id: "title", name: "title", label: "Title" }), jsx(MarkdownEditor, { name: "description", label: "Description" })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Products" }), jsx(ProductSelector, { productNames: productNamesArray, currentValue: [] })] }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Create category", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
54
54
  }
55
55
 
56
56
  export { AddCategoryForm };
@@ -52,7 +52,7 @@ function EditCategoryForm({ data, revalidateCallback, handleClose, productNamesA
52
52
  });
53
53
  }
54
54
  }, [formState?.strapiErrors]);
55
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Category" }), jsx(Typography, { variant: "body2", children: "Edit the category for your products. You can add products to this category later." })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(TextField, { id: "title", name: "title", label: "Title", defaultValue: title }), jsx(MarkdownEditor, { name: "description", label: "Description", defaultValue: description })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Products" }), jsx(ProductSelector, { productNames: productNamesArray, currentValue: [...initialProducts.map((prod) => prod.documentId)] })] }), jsxs(Grid, { item: true, xs: 12, children: [" ", jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Update category", loadingText: "Loading...", variant: "contained" })] })] })] }) }) }));
55
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Category" }), jsx(Typography, { variant: "body2", children: "Edit the category for your products. You can add products to this category later." })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(TextField, { id: "title", name: "title", label: "Title", defaultValue: title }), jsx(MarkdownEditor, { name: "description", label: "Description", defaultValue: description })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Products" }), jsx(ProductSelector, { productNames: productNamesArray, currentValue: [...initialProducts.map((prod) => prod.documentId)] })] }), jsxs(Grid, { size: 12, children: [" ", jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Update category", loadingText: "Loading...", variant: "contained" })] })] })] }) }) }));
56
56
  }
57
57
 
58
58
  export { EditCategoryForm };
@@ -145,7 +145,7 @@ function CheckoutForm({ shopUrl = "/shop" }) {
145
145
  small,
146
146
  activeStep,
147
147
  ]);
148
- return (jsx(Container, { sx: { py: 2, minHeight: "100vh" }, children: jsxs(Grid, { container: true, spacing: 2, sx: { py: 3, minHeight: "60vh" }, children: [jsx(Grid, { item: true, xs: 12, children: jsx(Typography, { variant: "h4", align: "center", children: "Check Out" }) }), cartIsEmpty && activeStep != 4 && (jsx(Grid, { item: true, xs: 12, children: jsxs(Alert, { severity: "error", children: [jsx(Typography, { variant: "h5", children: "No products in cart" }), jsx(Typography, { variant: "body1", children: "There are no products selected to order, please visit the shop befor continuing" })] }) })), alert != null && (jsx(Grid, { item: true, xs: 12, children: jsx(Alert, { severity: alert.severity, children: jsx(Typography, { variant: "body1", children: alert.message }) }) })), jsx(Grid, { item: true, xs: 12, children: jsxs(Box, { width: "100%", children: [jsx(Paper, { sx: {
148
+ return (jsx(Container, { sx: { py: 2, minHeight: "100vh" }, children: jsxs(Grid, { container: true, spacing: 2, sx: { py: 3, minHeight: "60vh" }, children: [jsx(Grid, { size: 12, children: jsx(Typography, { variant: "h4", align: "center", children: "Check Out" }) }), cartIsEmpty && activeStep != 4 && (jsx(Grid, { size: 12, children: jsxs(Alert, { severity: "error", children: [jsx(Typography, { variant: "h5", children: "No products in cart" }), jsx(Typography, { variant: "body1", children: "There are no products selected to order, please visit the shop befor continuing" })] }) })), alert != null && (jsx(Grid, { size: 12, children: jsx(Alert, { severity: alert.severity, children: jsx(Typography, { variant: "body1", children: alert.message }) }) })), jsx(Grid, { size: 12, children: jsxs(Box, { width: "100%", children: [jsx(Paper, { sx: {
149
149
  p: 2,
150
150
  mb: 2,
151
151
  display: { xs: "block", sm: "none" },
@@ -153,7 +153,7 @@ function CheckoutForm({ shopUrl = "/shop" }) {
153
153
  const stepProps = {};
154
154
  const labelProps = {};
155
155
  return (jsx(Step, { ...stepProps, sx: { pb: "20px" }, children: jsx(StepLabel, { ...labelProps, children: step.label }) }, index));
156
- }) }) }), !loading && (jsxs(Fragment, { children: [steps[activeStep].children, jsx(Paper, { sx: { p: 2, mt: 2, display: { xs: "none", sm: "block" } }, children: jsxs(Stack, { direction: "row", spacing: 2, children: [steps[activeStep].backButton, jsx(Button, { variant: "outlined", sx: { ml: 1 }, children: jsx(Link, { href: shopUrl, children: "continue shopping" }) }), jsx(Box, { sx: { flex: "1 1 auto" } }), steps[activeStep].nextButton] }) })] }))] }) }), jsx(Grid, { item: true, xs: 12, children: jsx(MobileStepper, { sx: { display: { xs: "flex", sm: "none" } }, variant: "text", steps: steps.length, position: "static", activeStep: activeStep, nextButton: steps[activeStep].nextButton, backButton: steps[activeStep].backButton }) })] }) }));
156
+ }) }) }), !loading && (jsxs(Fragment, { children: [steps[activeStep].children, jsx(Paper, { sx: { p: 2, mt: 2, display: { xs: "none", sm: "block" } }, children: jsxs(Stack, { direction: "row", spacing: 2, children: [steps[activeStep].backButton, jsx(Button, { variant: "outlined", sx: { ml: 1 }, children: jsx(Link, { href: shopUrl, children: "continue shopping" }) }), jsx(Box, { sx: { flex: "1 1 auto" } }), steps[activeStep].nextButton] }) })] }))] }) }), jsx(Grid, { size: 12, children: jsx(MobileStepper, { sx: { display: { xs: "flex", sm: "none" } }, variant: "text", steps: steps.length, position: "static", activeStep: activeStep, nextButton: steps[activeStep].nextButton, backButton: steps[activeStep].backButton }) })] }) }));
157
157
  }
158
158
 
159
159
  export { CheckoutForm as default };
@@ -15,9 +15,15 @@ import TextField from '@mui/material/TextField';
15
15
  import Address from '../../common/Address.js';
16
16
 
17
17
  function Step3({ user, prefersBillingAddress = true, prefersDeliveryAddress = true, delivery_options, payment_options, togglePrefersBillingAddress, togglePrefersDeliveryAddress, setCustomerInternalReference, }) {
18
- return (jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 2, children: user !== null && (jsx("form", { children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, md: 6, children: jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Typography, { variant: "h5", children: "Delivery Options" }), jsx(Typography, { variant: "body1", children: "Your order will be delivered at this address" }), prefersDeliveryAddress &&
19
- user.customer_profile.delivery_address ? (jsx(Address, { data: user.customer_profile.delivery_address })) : (jsx(Address, { data: user.customer_profile.company_address })), user?.customer_profile?.delivery_address != undefined && (jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { checked: !prefersDeliveryAddress, onChange: togglePrefersDeliveryAddress }), jsx(Typography, { children: "Use company address instead" })] })), delivery_options && delivery_options.length > 0 && (jsx(Autocomplete, { options: delivery_options, renderInput: (params) => (jsx(TextField, { ...params, label: "Delivery Options" })) }))] }) }), jsx(Grid, { item: true, xs: 12, md: 6, children: jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Typography, { variant: "h5", children: "Payment Options" }), jsx(Typography, { variant: "body1", children: "Your invoice will be shipped to this address" }), prefersBillingAddress &&
20
- user.customer_profile.billing_address ? (jsx(Address, { data: user.customer_profile.billing_address })) : (jsx(Address, { data: user.customer_profile.company_address })), user?.customer_profile?.billing_address != undefined && (jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { checked: !prefersBillingAddress, onChange: togglePrefersBillingAddress }), jsx(Typography, { children: "Use company address instead" })] })), payment_options && payment_options.length > 0 && (jsx(Autocomplete, { options: payment_options, renderInput: (params) => (jsx(TextField, { ...params, label: "Payment Options" })) }))] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Internal Reference" }), jsx(Typography, { variant: "body1", children: "Optionaly attach an internal reference to this order" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", label: "Internal Reference", onChange: (e) => setCustomerInternalReference(e.target.value) })] }) })] }) })) }) }));
18
+ return (jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 2, children: user !== null && (jsx("form", { children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: {
19
+ xs: 12,
20
+ md: 6
21
+ }, children: jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Typography, { variant: "h5", children: "Delivery Options" }), jsx(Typography, { variant: "body1", children: "Your order will be delivered at this address" }), prefersDeliveryAddress &&
22
+ user.customer_profile.delivery_address ? (jsx(Address, { data: user.customer_profile.delivery_address })) : (jsx(Address, { data: user.customer_profile.company_address })), user?.customer_profile?.delivery_address != undefined && (jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { checked: !prefersDeliveryAddress, onChange: togglePrefersDeliveryAddress }), jsx(Typography, { children: "Use company address instead" })] })), delivery_options && delivery_options.length > 0 && (jsx(Autocomplete, { options: delivery_options, renderInput: (params) => (jsx(TextField, { ...params, label: "Delivery Options" })) }))] }) }), jsx(Grid, { size: {
23
+ xs: 12,
24
+ md: 6
25
+ }, children: jsxs(Stack, { spacing: 2, justifyContent: "space-between", children: [jsx(Typography, { variant: "h5", children: "Payment Options" }), jsx(Typography, { variant: "body1", children: "Your invoice will be shipped to this address" }), prefersBillingAddress &&
26
+ user.customer_profile.billing_address ? (jsx(Address, { data: user.customer_profile.billing_address })) : (jsx(Address, { data: user.customer_profile.company_address })), user?.customer_profile?.billing_address != undefined && (jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { checked: !prefersBillingAddress, onChange: togglePrefersBillingAddress }), jsx(Typography, { children: "Use company address instead" })] })), payment_options && payment_options.length > 0 && (jsx(Autocomplete, { options: payment_options, renderInput: (params) => (jsx(TextField, { ...params, label: "Payment Options" })) }))] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Internal Reference" }), jsx(Typography, { variant: "body1", children: "Optionaly attach an internal reference to this order" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", label: "Internal Reference", onChange: (e) => setCustomerInternalReference(e.target.value) })] }) })] }) })) }) }));
21
27
  }
22
28
 
23
29
  export { Step3 as default };
@@ -40,7 +40,25 @@ function CustomerProfileDisplay({ data, }) {
40
40
  }
41
41
  const pathname = usePathname();
42
42
  const isCustomer = pathname.includes("/user/");
43
- return (jsxs(Grid, { container: true, sx: { width: "100%" }, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, sx: { width: "100%" }, children: [jsx(Typography, { variant: "h3", component: "h1", children: isCustomer ? "Your Profile" : "Customer Profile" }), !isCustomer && data.customer_number && (jsxs(Typography, { variant: "body1", children: ["Customer Number: ", jsx("strong", { children: data.customer_number })] }))] }), isCustomer && (jsx(Fragment, { children: !Boolean(completeEnough) ? (jsx(Alert, { severity: "warning", action: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "complete profile" }) }), children: "After completion of your profile you can enjoy all the benefits of your services." })) : (jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "edit profile" }) }) })) }))] }), jsx(Divider, {})] }) }), jsxs(Grid, { item: true, xs: 12, children: [business_credentials ? (jsx(BusinessCredentials, { data: business_credentials })) : (jsx(Typography, { children: "Business credentials not available" })), jsx(Divider, { sx: { pt: 2 } })] }), jsxs(Grid, { item: true, xs: 12, children: [jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PersonIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [first_name, " ", last_name, " ", !first_name && !last_name && "N/A"] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(EmailIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [email, " ", !email && "N/A"] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PhoneIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [phone, " ", !phone && "N/A"] }) })] }), jsx(Divider, { sx: { pt: 2 } })] }), company_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Address, { data: { ...company_address } })] })) : (jsx(Grid, { item: true, xs: 12, md: 4, children: jsx(Typography, { children: "Company address not available" }) })), delivery_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Address, { data: { ...delivery_address } })] })) : (jsx(Grid, { item: true, xs: 12, md: 4, children: jsx(Typography, { children: "Delivery address not available" }) })), billing_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Address, { data: { ...billing_address } })] })) : (jsx(Grid, { item: true, xs: 12, md: 4, children: jsx(Typography, { children: "Billing address not available" }) })), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", gutterBottom: true, children: "Orders" }), jsx(Paper, { children: orders && orders.length > 0 ? (jsxs(Table, { children: [jsx(TableHead, { children: jsxs(TableRow, { children: [jsx(TableCell, { children: "Order Number" }), jsx(TableCell, { children: "Date" }), jsx(TableCell, { children: "Status" }), jsx(TableCell, { align: "right", children: "Total" }), jsx(TableCell, { align: "right", children: "Actions" })] }) }), jsx(TableBody, { children: orders.map((order, index) => (jsxs(TableRow, { children: [jsx(TableCell, { children: order.opo_number }), jsx(TableCell, { children: new Date(order.order_date).toLocaleDateString() }), jsx(TableCell, { children: order.internal_status }), jsxs(TableCell, { align: "right", children: [order.total_incl_vat, " ", order.order_currency] }), jsx(TableCell, { align: "right", children: isCustomer ? (jsx(StyledLink, { href: `/user/orders?selectedOpoId=${order.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) : (jsx(StyledLink, { href: `/dashboard/admin/e-commerce/opos?selectedOpoId=${order.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) })] }, index))) })] })) : (jsx(Box, { p: 2, children: isCustomer ? (jsx(Typography, { children: "You have no orders." })) : (jsx(Typography, { children: "This user has no orders." })) })) })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", gutterBottom: true, children: "Returns" }), jsx(Paper, { children: returns && returns.length > 0 ? (jsxs(Table, { children: [jsx(TableHead, { children: jsxs(TableRow, { children: [jsx(TableCell, { children: "Return Number" }), jsx(TableCell, { children: "RMA Number" }), jsx(TableCell, { children: "Date" }), jsx(TableCell, { children: "Status" }), jsx(TableCell, { align: "right", children: "Actions" })] }) }), jsx(TableBody, { children: returns.map((iro, index) => (jsxs(TableRow, { children: [jsx(TableCell, { children: iro.return_number }), jsx(TableCell, { children: iro.rma_number }), jsx(TableCell, { children: new Date(iro.return_date).toLocaleDateString() }), jsx(TableCell, { children: iro.internal_status }), jsx(TableCell, { align: "right", children: isCustomer ? (jsx(StyledLink, { href: `/user/returns?selectedIroId=${iro.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) : (jsx(StyledLink, { href: `/dashboard/admin/e-commerce/iros?selectedIroId=${iro.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) })] }, index))) })] })) : (jsx(Box, { p: 2, children: isCustomer ? (jsx(Typography, { children: "You have no returns." })) : (jsx(Typography, { children: "This user has no returns." })) })) })] })] }));
43
+ return (jsxs(Grid, { container: true, sx: { width: "100%" }, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, sx: { width: "100%" }, children: [jsx(Typography, { variant: "h3", component: "h1", children: isCustomer ? "Your Profile" : "Customer Profile" }), !isCustomer && data.customer_number && (jsxs(Typography, { variant: "body1", children: ["Customer Number: ", jsx("strong", { children: data.customer_number })] }))] }), isCustomer && (jsx(Fragment, { children: !Boolean(completeEnough) ? (jsx(Alert, { severity: "warning", action: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "complete profile" }) }), children: "After completion of your profile you can enjoy all the benefits of your services." })) : (jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "edit profile" }) }) })) }))] }), jsx(Divider, {})] }) }), jsxs(Grid, { size: 12, children: [business_credentials ? (jsx(BusinessCredentials, { data: business_credentials })) : (jsx(Typography, { children: "Business credentials not available" })), jsx(Divider, { sx: { pt: 2 } })] }), jsxs(Grid, { size: 12, children: [jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PersonIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [first_name, " ", last_name, " ", !first_name && !last_name && "N/A"] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(EmailIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [email, " ", !email && "N/A"] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PhoneIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [phone, " ", !phone && "N/A"] }) })] }), jsx(Divider, { sx: { pt: 2 } })] }), company_address ? (jsxs(Grid, { size: {
44
+ xs: 12,
45
+ md: 4
46
+ }, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Address, { data: { ...company_address } })] })) : (jsx(Grid, { size: {
47
+ xs: 12,
48
+ md: 4
49
+ }, children: jsx(Typography, { children: "Company address not available" }) })), delivery_address ? (jsxs(Grid, { size: {
50
+ xs: 12,
51
+ md: 4
52
+ }, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Address, { data: { ...delivery_address } })] })) : (jsx(Grid, { size: {
53
+ xs: 12,
54
+ md: 4
55
+ }, children: jsx(Typography, { children: "Delivery address not available" }) })), billing_address ? (jsxs(Grid, { size: {
56
+ xs: 12,
57
+ md: 4
58
+ }, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Address, { data: { ...billing_address } })] })) : (jsx(Grid, { size: {
59
+ xs: 12,
60
+ md: 4
61
+ }, children: jsx(Typography, { children: "Billing address not available" }) })), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", gutterBottom: true, children: "Orders" }), jsx(Paper, { children: orders && orders.length > 0 ? (jsxs(Table, { children: [jsx(TableHead, { children: jsxs(TableRow, { children: [jsx(TableCell, { children: "Order Number" }), jsx(TableCell, { children: "Date" }), jsx(TableCell, { children: "Status" }), jsx(TableCell, { align: "right", children: "Total" }), jsx(TableCell, { align: "right", children: "Actions" })] }) }), jsx(TableBody, { children: orders.map((order, index) => (jsxs(TableRow, { children: [jsx(TableCell, { children: order.opo_number }), jsx(TableCell, { children: new Date(order.order_date).toLocaleDateString() }), jsx(TableCell, { children: order.internal_status }), jsxs(TableCell, { align: "right", children: [order.total_incl_vat, " ", order.order_currency] }), jsx(TableCell, { align: "right", children: isCustomer ? (jsx(StyledLink, { href: `/user/orders?selectedOpoId=${order.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) : (jsx(StyledLink, { href: `/dashboard/admin/e-commerce/opos?selectedOpoId=${order.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) })] }, index))) })] })) : (jsx(Box, { p: 2, children: isCustomer ? (jsx(Typography, { children: "You have no orders." })) : (jsx(Typography, { children: "This user has no orders." })) })) })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", gutterBottom: true, children: "Returns" }), jsx(Paper, { children: returns && returns.length > 0 ? (jsxs(Table, { children: [jsx(TableHead, { children: jsxs(TableRow, { children: [jsx(TableCell, { children: "Return Number" }), jsx(TableCell, { children: "RMA Number" }), jsx(TableCell, { children: "Date" }), jsx(TableCell, { children: "Status" }), jsx(TableCell, { align: "right", children: "Actions" })] }) }), jsx(TableBody, { children: returns.map((iro, index) => (jsxs(TableRow, { children: [jsx(TableCell, { children: iro.return_number }), jsx(TableCell, { children: iro.rma_number }), jsx(TableCell, { children: new Date(iro.return_date).toLocaleDateString() }), jsx(TableCell, { children: iro.internal_status }), jsx(TableCell, { align: "right", children: isCustomer ? (jsx(StyledLink, { href: `/user/returns?selectedIroId=${iro.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) : (jsx(StyledLink, { href: `/dashboard/admin/e-commerce/iros?selectedIroId=${iro.documentId}`, target: "_self", children: jsx(Button, { variant: "contained", size: "small", children: "View" }) })) })] }, index))) })] })) : (jsx(Box, { p: 2, children: isCustomer ? (jsx(Typography, { children: "You have no returns." })) : (jsx(Typography, { children: "This user has no returns." })) })) })] })] }));
44
62
  }
45
63
 
46
64
  export { CustomerProfileDisplay as default };
@@ -72,7 +72,7 @@ function CustomerProfileEditForm({ data, sx, revalidateCallback, handleClose, })
72
72
  });
73
73
  }
74
74
  }, [formState?.strapiErrors]);
75
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Profile" }), jsx(Typography, { variant: "body2", children: "Update your personal and business information" })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Personal Details" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsx(TextField, { id: "first_name", name: "first_name", label: "First Name", defaultValue: first_name }), jsx(TextField, { id: "last_name", name: "last_name", label: "Last Name", defaultValue: last_name }), jsx(TextField, { id: "email", name: "email", label: "Email", defaultValue: email, disabled: true }), jsx(TextField, { id: "phone", name: "phone", label: "Phone", defaultValue: phone })] })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Business Credentials" }), jsx(Divider, {}), jsx(Box, { sx: { mt: 2 }, children: jsx(BusinessCredentialsFields, { componentName: "business_credentials", componentReference: "business.credentials", data: business_credentials }) })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Divider, {}), jsx(Box, { sx: { mt: 2 }, children: jsx(AddressFields, { componentName: "company_address", componentReference: "common.address", data: company_address }) })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { value: withDeliveryAddress, checked: withDeliveryAddress, onChange: () => setWithDeliveryAddress(!withDeliveryAddress) }), jsx(Typography, { children: "Use a different address for delivery" })] }), withDeliveryAddress && (jsx(AddressFields, { componentName: "delivery_address", componentReference: "common.address", data: delivery_address }))] })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { value: withBillingAddress, checked: withBillingAddress, onChange: () => setWithBillingAddress(!withBillingAddress) }), jsx(Typography, { children: "Use a different address for billing" })] }), withBillingAddress && (jsx(AddressFields, { componentName: "billing_address", componentReference: "common.address", data: billing_address }))] })] }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Save changes", loadingText: "Saving...", variant: "contained" })] }) })] }) }) }));
75
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Profile" }), jsx(Typography, { variant: "body2", children: "Update your personal and business information" })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Personal Details" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsx(TextField, { id: "first_name", name: "first_name", label: "First Name", defaultValue: first_name }), jsx(TextField, { id: "last_name", name: "last_name", label: "Last Name", defaultValue: last_name }), jsx(TextField, { id: "email", name: "email", label: "Email", defaultValue: email, disabled: true }), jsx(TextField, { id: "phone", name: "phone", label: "Phone", defaultValue: phone })] })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Business Credentials" }), jsx(Divider, {}), jsx(Box, { sx: { mt: 2 }, children: jsx(BusinessCredentialsFields, { componentName: "business_credentials", componentReference: "business.credentials", data: business_credentials }) })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Divider, {}), jsx(Box, { sx: { mt: 2 }, children: jsx(AddressFields, { componentName: "company_address", componentReference: "common.address", data: company_address }) })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { value: withDeliveryAddress, checked: withDeliveryAddress, onChange: () => setWithDeliveryAddress(!withDeliveryAddress) }), jsx(Typography, { children: "Use a different address for delivery" })] }), withDeliveryAddress && (jsx(AddressFields, { componentName: "delivery_address", componentReference: "common.address", data: delivery_address }))] })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Divider, {}), jsxs(Stack, { spacing: 2, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(Checkbox, { value: withBillingAddress, checked: withBillingAddress, onChange: () => setWithBillingAddress(!withBillingAddress) }), jsx(Typography, { children: "Use a different address for billing" })] }), withBillingAddress && (jsx(AddressFields, { componentName: "billing_address", componentReference: "common.address", data: billing_address }))] })] }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Save changes", loadingText: "Saving...", variant: "contained" })] }) })] }) }) }));
76
76
  }
77
77
 
78
78
  export { CustomerProfileEditForm as default };
@@ -21,7 +21,22 @@ function CustomerProfileDisplay({ data, }) {
21
21
  return (jsx(Stack, { spacing: 2, children: jsx(Typography, { children: "Customer profile not available" }) }));
22
22
  }
23
23
  const { first_name = "", last_name, email, phone, company_address, billing_address, delivery_address, business_credentials, } = data;
24
- return (jsxs(Stack, { spacing: 2, children: [business_credentials ? (jsx(BusinessCredentials, { data: business_credentials })) : (jsx(Typography, { children: "Business credentials not available" })), jsx(Divider, {}), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PersonIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [first_name, " ", last_name] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(EmailIcon, {}), jsx(Box, { children: jsx(Typography, { variant: "body1", component: "p", children: email }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PhoneIcon, {}), jsx(Box, { children: jsx(Typography, { variant: "body1", component: "p", children: phone }) })] }), jsx(Divider, {}), jsxs(Grid, { container: true, children: [company_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Address, { data: { ...company_address } })] })) : (jsx(Typography, { children: "Company address not available" })), delivery_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Address, { data: { ...delivery_address } })] })) : (jsx(Grid, { item: true, xs: 12, md: 4, children: jsx(Typography, { children: "Delivery address not available" }) })), billing_address ? (jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Address, { data: { ...billing_address } })] })) : (jsx(Grid, { item: true, xs: 12, md: 4, children: jsx(Typography, { children: "Billing address not available" }) }))] })] }));
24
+ return (jsxs(Stack, { spacing: 2, children: [business_credentials ? (jsx(BusinessCredentials, { data: business_credentials })) : (jsx(Typography, { children: "Business credentials not available" })), jsx(Divider, {}), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PersonIcon, {}), jsx(Box, { children: jsxs(Typography, { variant: "body1", component: "p", children: [first_name, " ", last_name] }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(EmailIcon, {}), jsx(Box, { children: jsx(Typography, { variant: "body1", component: "p", children: email }) })] }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(PhoneIcon, {}), jsx(Box, { children: jsx(Typography, { variant: "body1", component: "p", children: phone }) })] }), jsx(Divider, {}), jsxs(Grid, { container: true, children: [company_address ? (jsxs(Grid, { size: {
25
+ xs: 12,
26
+ md: 4
27
+ }, children: [jsx(Typography, { variant: "h6", children: "Company Address" }), jsx(Address, { data: { ...company_address } })] })) : (jsx(Typography, { children: "Company address not available" })), delivery_address ? (jsxs(Grid, { size: {
28
+ xs: 12,
29
+ md: 4
30
+ }, children: [jsx(Typography, { variant: "h6", children: "Delivery Address" }), jsx(Address, { data: { ...delivery_address } })] })) : (jsx(Grid, { size: {
31
+ xs: 12,
32
+ md: 4
33
+ }, children: jsx(Typography, { children: "Delivery address not available" }) })), billing_address ? (jsxs(Grid, { size: {
34
+ xs: 12,
35
+ md: 4
36
+ }, children: [jsx(Typography, { variant: "h6", children: "Billing Address" }), jsx(Address, { data: { ...billing_address } })] })) : (jsx(Grid, { size: {
37
+ xs: 12,
38
+ md: 4
39
+ }, children: jsx(Typography, { children: "Billing address not available" }) }))] })] }));
25
40
  }
26
41
 
27
42
  export { CustomerProfileDisplay as default };
@@ -24,7 +24,10 @@ function EnduserProfileDisplay({ data, }) {
24
24
  const pathname = usePathname();
25
25
  // Check if the current path is for an enduser profile
26
26
  const isEnduser = pathname.includes("admin/user/");
27
- return (jsx(Paper, { sx: { p: 2 }, children: jsxs(Stack, { spacing: 2, children: [isEnduser && (jsx(Fragment, { children: !Boolean(completeEnough) ? (jsx(Alert, { severity: "warning", action: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "complete profile" }) }), children: "After completion of your profile you can enjoy all the benefits of your services." })) : (jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "edit profile" }) }) })) })), jsx(Divider, {}), jsx(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: jsxs(Grid, { item: true, xs: 12, md: 4, children: [jsx(Typography, { variant: "h6", children: "Personal Information" }), jsxs(Stack, { spacing: 1, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PersonIcon, {}), jsx(Typography, { children: `${first_name} ${last_name}` })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(EmailIcon, {}), jsx(Typography, { children: email })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PhoneIcon, {}), jsx(Typography, { children: phone })] })] })] }) })] }) }));
27
+ return (jsx(Paper, { sx: { p: 2 }, children: jsxs(Stack, { spacing: 2, children: [isEnduser && (jsx(Fragment, { children: !Boolean(completeEnough) ? (jsx(Alert, { severity: "warning", action: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "complete profile" }) }), children: "After completion of your profile you can enjoy all the benefits of your services." })) : (jsx(Stack, { direction: "row", justifyContent: "flex-end", children: jsx(StyledLink, { href: editProfileUrl, target: "_self", children: jsx(Button, { variant: "contained", children: "edit profile" }) }) })) })), jsx(Divider, {}), jsx(Grid, { container: true, spacing: 2, sx: { width: "100%" }, children: jsxs(Grid, { size: {
28
+ xs: 12,
29
+ md: 4
30
+ }, children: [jsx(Typography, { variant: "h6", children: "Personal Information" }), jsxs(Stack, { spacing: 1, sx: { mt: 2 }, children: [jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PersonIcon, {}), jsx(Typography, { children: `${first_name} ${last_name}` })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(EmailIcon, {}), jsx(Typography, { children: email })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PhoneIcon, {}), jsx(Typography, { children: phone })] })] })] }) })] }) }));
28
31
  }
29
32
 
30
33
  export { EnduserProfileDisplay as default };
@@ -56,7 +56,7 @@ function EnduserProfileEditForm({ data, sx, revalidateCallback, handleClose, })
56
56
  });
57
57
  }
58
58
  }, [formState?.strapiErrors]);
59
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Profile" }), jsx(Typography, { variant: "body1", children: "Update your profile information" })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Personal Information" }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PersonIcon, {}), jsx(Typography, { children: `${first_name} ${last_name}` })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(EmailIcon, {}), jsx(TextField, { id: "email", name: "email", label: "Email", type: "email", defaultValue: email })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PhoneIcon, {}), jsx(TextField, { id: "phone", name: "phone", label: "Phone", type: "tel", defaultValue: phone })] })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", spacing: 2, alignItems: "center", sx: { mt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Save Changes", loadingText: "Saving...", variant: "contained" })] }) })] }) }) }));
59
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Edit Profile" }), jsx(Typography, { variant: "body1", children: "Update your profile information" })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Personal Information" }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PersonIcon, {}), jsx(Typography, { children: `${first_name} ${last_name}` })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(EmailIcon, {}), jsx(TextField, { id: "email", name: "email", label: "Email", type: "email", defaultValue: email })] }), jsxs(Stack, { direction: "row", alignItems: "center", children: [jsx(PhoneIcon, {}), jsx(TextField, { id: "phone", name: "phone", label: "Phone", type: "tel", defaultValue: phone })] })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", spacing: 2, alignItems: "center", sx: { mt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Save Changes", loadingText: "Saving...", variant: "contained" })] }) })] }) }) }));
60
60
  }
61
61
 
62
62
  export { EnduserProfileEditForm as default };
@@ -117,7 +117,7 @@ function CreateInvoiceForm({ customerLabels, revalidateCallback, handleClose, sx
117
117
  }
118
118
  fetchPublicInformation();
119
119
  }, []);
120
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Create Invoice" }), jsx(Typography, { variant: "body2", children: "Create a new invoice by selecting a customer or filling in the details manually" })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Choose a user" }), jsx(CustomerSelector, { customerLabels: customerLabels, onChangeCallback: onChangeCustomer }), jsx(Typography, { variant: "h6", children: "Set user details manually" }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(TextField, { name: "buyer_first_name", label: "First Name", value: customerDefaults?.first_name ||
120
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Create Invoice" }), jsx(Typography, { variant: "body2", children: "Create a new invoice by selecting a customer or filling in the details manually" })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Choose a user" }), jsx(CustomerSelector, { customerLabels: customerLabels, onChangeCallback: onChangeCustomer }), jsx(Typography, { variant: "h6", children: "Set user details manually" }), jsxs(Stack, { spacing: 2, direction: "row", children: [jsx(TextField, { name: "buyer_first_name", label: "First Name", value: customerDefaults?.first_name ||
121
121
  invoice?.buyer_first_name ||
122
122
  "", onChange: (e) => {
123
123
  setInvoice((prev) => ({
@@ -159,14 +159,14 @@ function CreateInvoiceForm({ customerLabels, revalidateCallback, handleClose, sx
159
159
  ...prev,
160
160
  buyer_business_credentials: data,
161
161
  }));
162
- }, disabled: customerDefaults !== null ? true : false })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Invoice Items" }), jsx(InvoiceItemFields, { onChangeCallback: onChangeItems })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Add a Comment" }), jsx(MarkdownEditor, { name: "comments", label: "Comments", onChangeCallback: (data) => setInvoice((prev) => {
162
+ }, disabled: customerDefaults !== null ? true : false })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Invoice Items" }), jsx(InvoiceItemFields, { onChangeCallback: onChangeItems })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Add a Comment" }), jsx(MarkdownEditor, { name: "comments", label: "Comments", onChangeCallback: (data) => setInvoice((prev) => {
163
163
  if (!prev)
164
164
  return null;
165
165
  return {
166
166
  ...prev,
167
167
  comments: data,
168
168
  };
169
- }) })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Preview the Invoice" }), invoice !== null && jsx(InvoicePDFViewer, { invoice: invoice })] }), " ", jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Create Invoice", loadingText: "Creating...", variant: "contained" })] }) })] }) }) }));
169
+ }) })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Preview the Invoice" }), invoice !== null && jsx(InvoicePDFViewer, { invoice: invoice })] }), " ", jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Create Invoice", loadingText: "Creating...", variant: "contained" })] }) })] }) }) }));
170
170
  }
171
171
 
172
172
  export { CreateInvoiceForm };
@@ -53,7 +53,7 @@ function CreateIroForm({ sx, revalidateCallback, handleClose, customerLabels, pr
53
53
  });
54
54
  }
55
55
  }, [formState?.strapiErrors]);
56
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsx(Stack, { spacing: 2, children: jsx(Typography, { variant: "h3", component: "h1", children: "Create new return order" }) }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Choose a customer" }), jsx(Typography, { variant: "body2", children: "Select the customer for which you want to create a return order" }), jsx(CustomerSelector, { customerLabels: customerLabels })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Customer reference" }), jsx(Typography, { children: "If the customer utilizes a custom reference for inbound order management it should be left here" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", sx: { width: "100%" } })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Choose products that should be in this return order" }), jsx(IROItemFields, { productsArr: productLabels })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Confirm Order" }), jsx(Typography, { children: "Are you sure you want to confirm this return? Confirming this order means you are sure the customer wants to return the products and you are ready to process the return." }), jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [jsx(Checkbox, { value: returnConfirmed, checked: returnConfirmed, onChange: () => setReturnConfirmed(!returnConfirmed) }), returnConfirmed && (jsx(Typography, { color: "primary", children: "I am sure I want to confirm this return order" }))] }), jsx("input", { name: "status", type: "hidden", value: returnConfirmed ? "returning" : "requested" })] }), " ", jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Confirm", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
56
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsx(Stack, { spacing: 2, children: jsx(Typography, { variant: "h3", component: "h1", children: "Create new return order" }) }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Choose a customer" }), jsx(Typography, { variant: "body2", children: "Select the customer for which you want to create a return order" }), jsx(CustomerSelector, { customerLabels: customerLabels })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Customer reference" }), jsx(Typography, { children: "If the customer utilizes a custom reference for inbound order management it should be left here" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", sx: { width: "100%" } })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Choose products that should be in this return order" }), jsx(IROItemFields, { productsArr: productLabels })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Confirm Order" }), jsx(Typography, { children: "Are you sure you want to confirm this return? Confirming this order means you are sure the customer wants to return the products and you are ready to process the return." }), jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [jsx(Checkbox, { value: returnConfirmed, checked: returnConfirmed, onChange: () => setReturnConfirmed(!returnConfirmed) }), returnConfirmed && (jsx(Typography, { color: "primary", children: "I am sure I want to confirm this return order" }))] }), jsx("input", { name: "status", type: "hidden", value: returnConfirmed ? "returning" : "requested" })] }), " ", jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: 2 }, children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Confirm", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
57
57
  }
58
58
 
59
59
  export { CreateIroForm as default };
@@ -51,9 +51,9 @@ function ManageIROForm({ data, sx, revalidateCallback, handleClose, role, }) {
51
51
  return (jsx(Box, { sx: [
52
52
  // You cannot spread `sx` directly because `SxProps` (typeof sx) can be an array.
53
53
  ...(Array.isArray(sx) ? sx : [sx]),
54
- ], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Management Inbound Purchase Order" }), jsx(Typography, { variant: "body1", children: "Manage arrival, registration and recieval of purchase order" })] }), jsx(NoteTakingComponent, { content: "", related: [
54
+ ], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Management Inbound Purchase Order" }), jsx(Typography, { variant: "body1", children: "Manage arrival, registration and recieval of purchase order" })] }), jsx(NoteTakingComponent, { content: "", related: [
55
55
  { id: data.documentId, __type: "api::logistics.ipo" },
56
- ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { item: true, xs: 6, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Details" }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Purchase Order Number" }), jsx(Typography, { variant: "body2", children: data.return_number })] }), jsx(Stack, { direction: "row", spacing: 2, children: jsx(Typography, { variant: "body1", width: "250px", children: "Custom reference" }) }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Date" }), jsx(Typography, { variant: "body2", children: data.return_date })] }), jsx(Stack, { direction: "row", spacing: 2, children: jsx(Typography, { variant: "body1", width: "250px", children: "Supplier" }) }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Status" }), jsx(Typography, { variant: "body2", width: "250px", children: data.internal_status })] })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1, children: role === "enduser" && (jsx(Fragment, {})) }) })] }) }), data?.notes?.length > 0 && (jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: data.notes }), jsx(Divider, {})] }) })), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), jsx(Divider, {}), jsxs("form", { action: formAction, children: [data?.iro_items &&
56
+ ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { size: 6, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Details" }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Purchase Order Number" }), jsx(Typography, { variant: "body2", children: data.return_number })] }), jsx(Stack, { direction: "row", spacing: 2, children: jsx(Typography, { variant: "body1", width: "250px", children: "Custom reference" }) }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Date" }), jsx(Typography, { variant: "body2", children: data.return_date })] }), jsx(Stack, { direction: "row", spacing: 2, children: jsx(Typography, { variant: "body1", width: "250px", children: "Supplier" }) }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Status" }), jsx(Typography, { variant: "body2", width: "250px", children: data.internal_status })] })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1, children: role === "enduser" && (jsx(Fragment, {})) }) })] }) }), data?.notes?.length > 0 && (jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: data.notes }), jsx(Divider, {})] }) })), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), jsx(Divider, {}), jsxs("form", { action: formAction, children: [data?.iro_items &&
57
57
  data.iro_items.map((item, index) => {
58
58
  console.log("item", item);
59
59
  return (jsx(Paper, { sx: { p: 2, mb: 2 } }, index));
@@ -139,7 +139,7 @@ function RmaForm({ opo, sx, revalidateCallback, handleClose, }) {
139
139
  });
140
140
  }
141
141
  }, [formState?.strapiErrors]);
142
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsx(Typography, { variant: "h6", children: "RMA Form" }) }), jsx("input", { type: "hidden", name: "opos", value: opo.documentId }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "body1", children: "Please fill out the form below to request a return merchandise authorization. Due to the sensitive nature of the products, only unopened packages can be returned." }), jsx(Alert, { severity: "warning", children: "We urge you to carefully photograph the items you are returning. These pictures can be requested at a later time by our team to verify the condition of the items." })] }) }), jsx(Grid, { item: true, xs: 12, children: opo.opo_items ? (jsx(Stack, { spacing: 1, children: opo.opo_items && (jsx(ItemLines, { items: opo.opo_items, itemsToReturn: itemsToReturn, setItemsToReturn: setItemsToReturn, selectedItems: selectedItems, setSelectedItems: setSelectedItems })) })) : (jsx(Typography, { variant: "body1", children: "No items" })) }), jsx(ConfirmRMADialog, { formState: formState, open: open, items: itemsToReturn.filter((item) => item.returned_quantity > 0), onClose: () => setOpen(!open), submitCallback: () => {
142
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsx(Typography, { variant: "h6", children: "RMA Form" }) }), jsx("input", { type: "hidden", name: "opos", value: opo.documentId }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "body1", children: "Please fill out the form below to request a return merchandise authorization. Due to the sensitive nature of the products, only unopened packages can be returned." }), jsx(Alert, { severity: "warning", children: "We urge you to carefully photograph the items you are returning. These pictures can be requested at a later time by our team to verify the condition of the items." })] }) }), jsx(Grid, { size: 12, children: opo.opo_items ? (jsx(Stack, { spacing: 1, children: opo.opo_items && (jsx(ItemLines, { items: opo.opo_items, itemsToReturn: itemsToReturn, setItemsToReturn: setItemsToReturn, selectedItems: selectedItems, setSelectedItems: setSelectedItems })) })) : (jsx(Typography, { variant: "body1", children: "No items" })) }), jsx(ConfirmRMADialog, { formState: formState, open: open, items: itemsToReturn.filter((item) => item.returned_quantity > 0), onClose: () => setOpen(!open), submitCallback: () => {
143
143
  console.log("submit callback");
144
144
  const formElement = document.querySelector("form");
145
145
  if (formElement) {
@@ -149,7 +149,7 @@ function RmaForm({ opo, sx, revalidateCallback, handleClose, }) {
149
149
  formAction(new FormData());
150
150
  }
151
151
  setOpen(!open);
152
- } }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Button, { onClick: () => {
152
+ } }), jsxs(Grid, { size: 12, children: [jsx(Button, { onClick: () => {
153
153
  console.log(formState);
154
154
  setOpen(!open);
155
155
  }, disabled: selectedItems.length === 0 ||
@@ -341,11 +341,11 @@ revalidateCallback, handleClose, role, }) {
341
341
  setItems(data.iro_items ? data.iro_items : []);
342
342
  }
343
343
  }, [data]);
344
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Management Inbound Return" }), jsx(Typography, { variant: "body1", children: "Manage arrival, registration and release of returns" })] }), jsx(NoteTakingComponent, { content: "", related: [
344
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Management Inbound Return" }), jsx(Typography, { variant: "body1", children: "Manage arrival, registration and release of returns" })] }), jsx(NoteTakingComponent, { content: "", related: [
345
345
  { id: data.documentId, __type: "api::e-commerce.iro" },
346
- ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { item: true, xs: 12, children: jsx(Typography, { variant: "h5", sx: { py: 1 }, children: "Details" }) }), jsx(Grid, { item: true, xs: 6, children: jsx(Paper, { elevation: 2, sx: { p: 2, height: "100%" }, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(NumbersIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Number" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.return_number })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(AssignmentReturnIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "RMA Number" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.rma_number })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(DescriptionIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Customer Reference" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.customer_reference })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(CalendarTodayIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Date" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.return_date })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(BusinessIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Customer" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.customer?.business_credentials?.company_name })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(UpdateIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Status" }), jsx(IroStatusIndicator, { status: data.internal_status })] })] }) }) }), (data.internal_status === "requested" ||
346
+ ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { size: 12, children: jsx(Typography, { variant: "h5", sx: { py: 1 }, children: "Details" }) }), jsx(Grid, { size: 6, children: jsx(Paper, { elevation: 2, sx: { p: 2, height: "100%" }, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(NumbersIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Number" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.return_number })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(AssignmentReturnIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "RMA Number" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.rma_number })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(DescriptionIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Customer Reference" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.customer_reference })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(CalendarTodayIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Date" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.return_date })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(BusinessIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Customer" }), jsx(Typography, { variant: "body1", fontWeight: "medium", children: data.customer?.business_credentials?.company_name })] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", children: [jsx(UpdateIcon, { color: "primary" }), jsx(Typography, { variant: "subtitle1", color: "text.secondary", width: "200px", children: "Return Status" }), jsx(IroStatusIndicator, { status: data.internal_status })] })] }) }) }), (data.internal_status === "requested" ||
347
347
  data.internal_status === "finalising_process") &&
348
- role === "enduser" && (jsx(Grid, { item: true, xs: 6, children: jsx(Paper, { elevation: 2, sx: { p: 2, height: "100%" }, children: jsxs(Stack, { spacing: 2, children: [jsx(Button, { variant: "contained", color: "primary", onClick: () => setConfirmDialogOpen(true), children: "Confirm order" }), data.internal_status === "requested" && (jsx(Alert, { severity: "warning", children: "Please confirm the order as soon as possible, only upon confirmation this order will be assigned an RMA number and will become available to the dispatcher. Status: requested - returning" })), data.internal_status === "finalising_process" && (jsx(Alert, { severity: "warning", children: "Please finalise this return order. Make sure the customer receives a return payment if eligible and then confirm this step. Status: finalising_process - done" })), data.internal_status === "finalising_process" && (jsx(Button, { variant: "contained", sx: { color: "yellow" }, children: "// TODO RE-PAYMENT PROCESS" })), jsx(Button, { variant: "contained", color: "error", onClick: () => setCancelDialogOpen(true), children: "Cancel order" }), jsx(ConfirmFormDialog, { open: confirmDialogOpen, handleClose: () => setConfirmDialogOpen(false), orderID: data.documentId, currentStatus: data.internal_status, revalidateCallback: revalidateCallback, openOverwritesDialog: () => setOverwritesDialogOpen(true) }), jsx(OverwritesDialog, { open: overwritesDialogOpen, handleClose: () => setOverwritesDialogOpen(false), overwrites: overwrites, setOverwrites: setOverwrites, iro: data }), jsx(CancelIroDialog, { open: cancelDialogOpen, handleClose: () => setCancelDialogOpen(false), orderID: data.documentId, revalidateCallback: revalidateCallback })] }) }) })), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1 }) })] }) }), data?.notes?.length > 0 && (jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: data.notes }), jsx(Divider, {})] }) })), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 2, component: Paper, p: 1, sx: {
348
+ role === "enduser" && (jsx(Grid, { size: 6, children: jsx(Paper, { elevation: 2, sx: { p: 2, height: "100%" }, children: jsxs(Stack, { spacing: 2, children: [jsx(Button, { variant: "contained", color: "primary", onClick: () => setConfirmDialogOpen(true), children: "Confirm order" }), data.internal_status === "requested" && (jsx(Alert, { severity: "warning", children: "Please confirm the order as soon as possible, only upon confirmation this order will be assigned an RMA number and will become available to the dispatcher. Status: requested - returning" })), data.internal_status === "finalising_process" && (jsx(Alert, { severity: "warning", children: "Please finalise this return order. Make sure the customer receives a return payment if eligible and then confirm this step. Status: finalising_process - done" })), data.internal_status === "finalising_process" && (jsx(Button, { variant: "contained", sx: { color: "yellow" }, children: "// TODO RE-PAYMENT PROCESS" })), jsx(Button, { variant: "contained", color: "error", onClick: () => setCancelDialogOpen(true), children: "Cancel order" }), jsx(ConfirmFormDialog, { open: confirmDialogOpen, handleClose: () => setConfirmDialogOpen(false), orderID: data.documentId, currentStatus: data.internal_status, revalidateCallback: revalidateCallback, openOverwritesDialog: () => setOverwritesDialogOpen(true) }), jsx(OverwritesDialog, { open: overwritesDialogOpen, handleClose: () => setOverwritesDialogOpen(false), overwrites: overwrites, setOverwrites: setOverwrites, iro: data }), jsx(CancelIroDialog, { open: cancelDialogOpen, handleClose: () => setCancelDialogOpen(false), orderID: data.documentId, revalidateCallback: revalidateCallback })] }) }) })), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1 }) })] }) }), data?.notes?.length > 0 && (jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: data.notes }), jsx(Divider, {})] }) })), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 2, component: Paper, p: 1, sx: {
349
349
  bgcolor: "background.default",
350
350
  border: "1px solid",
351
351
  borderColor: "divider",
@@ -53,7 +53,7 @@ function CreateOpoForm({ sx, revalidateCallback, handleClose, customerLabels, pr
53
53
  });
54
54
  }
55
55
  }, [formState?.strapiErrors]);
56
- return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsx(Stack, { spacing: 2, children: jsx(Typography, { variant: "h3", component: "h1", children: "Create new order" }) }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Choose a customer" }), jsx(CustomerSelector, { customerLabels: customerLabels })] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Customer reference" }), jsx(Typography, { children: "If the customer utilizes a custom reference for inbound order management it should be left here" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", sx: { width: "100%" } })] }) }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Choose products for this order" }), jsx(OPOItemFields, { productsArr: productLabels })] }), jsxs(Grid, { item: true, xs: 12, children: [jsx(Typography, { variant: "h6", children: "Confirm Order" }), jsx(Typography, { children: "Are you sure you want to confirm this order? Creating a order this way will not create a shipping label nor will it invoke a payment. It does however create an invoice which you can find under invoices" }), jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [jsx(Checkbox, { value: orderConfirmed, checked: orderConfirmed, onChange: () => setOrderConfirmed(!orderConfirmed) }), orderConfirmed && (jsx(Typography, { color: "primary", children: "I am sure I want to confirm this order" }))] }), jsx("input", { name: "internal_status", type: "hidden", value: orderConfirmed ? "ordered" : "placed" })] }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Confirm", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
56
+ return (jsx(Box, { sx: [...(Array.isArray(sx) ? sx : [sx])], children: jsx("form", { action: formAction, children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsx(Stack, { spacing: 2, children: jsx(Typography, { variant: "h3", component: "h1", children: "Create new order" }) }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Choose a customer" }), jsx(CustomerSelector, { customerLabels: customerLabels })] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h6", children: "Customer reference" }), jsx(Typography, { children: "If the customer utilizes a custom reference for inbound order management it should be left here" }), jsx(TextField, { id: "customer_reference", name: "customer_reference", sx: { width: "100%" } })] }) }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Choose products for this order" }), jsx(OPOItemFields, { productsArr: productLabels })] }), jsxs(Grid, { size: 12, children: [jsx(Typography, { variant: "h6", children: "Confirm Order" }), jsx(Typography, { children: "Are you sure you want to confirm this order? Creating a order this way will not create a shipping label nor will it invoke a payment. It does however create an invoice which you can find under invoices" }), jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [jsx(Checkbox, { value: orderConfirmed, checked: orderConfirmed, onChange: () => setOrderConfirmed(!orderConfirmed) }), orderConfirmed && (jsx(Typography, { color: "primary", children: "I am sure I want to confirm this order" }))] }), jsx("input", { name: "internal_status", type: "hidden", value: orderConfirmed ? "ordered" : "placed" })] }), jsx(Grid, { size: 12, children: jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [handleClose && (jsx(Button, { onClick: handleClose, variant: "outlined", children: "Cancel" })), jsx(SubmitButton, { text: "Confirm", loadingText: "Loading...", variant: "contained" })] }) })] }) }) }));
57
57
  }
58
58
 
59
59
  export { CreateOpoForm as default };
@@ -167,13 +167,13 @@ revalidateCallback, handleClose, role, }) {
167
167
  return (jsx(Box, { sx: [
168
168
  // You cannot spread `sx` directly because `SxProps` (typeof sx) can be an array.
169
169
  ...(Array.isArray(sx) ? sx : [sx]),
170
- ], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Manage Outbound Purchase Order" }), jsx(Typography, { variant: "body1", children: "Manage picking, packing and shipping of purchase order" })] }), jsx(NoteTakingComponent, { content: "", related: [
170
+ ], children: jsxs(Grid, { container: true, spacing: 2, children: [jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "space-between", children: [jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h3", component: "h1", children: "Manage Outbound Purchase Order" }), jsx(Typography, { variant: "body1", children: "Manage picking, packing and shipping of purchase order" })] }), jsx(NoteTakingComponent, { content: "", related: [
171
171
  { id: opo.documentId, __type: "api::e-commerce.opo" },
172
- ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { item: true, xs: 6, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Details" }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Purchase Order Number" }), jsx(Typography, { variant: "body2", children: opo.opo_number })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Custom reference" }), jsx(Typography, { variant: "body2", children: opo.customer_reference })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Date" }), jsx(Typography, { variant: "body2", children: opo.order_date })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Customer" }), jsx(Typography, { variant: "body2", children: opo.customer?.business_credentials?.company_name })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Status" }), jsx(Typography, { variant: "body2", width: "250px", children: opo.internal_status })] }), (opo.internal_status === "placed" ||
172
+ ], revalidateCallback: revalidateCallback })] }), jsx(Divider, {})] }) }), jsx(Grid, { size: 6, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Details" }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Purchase Order Number" }), jsx(Typography, { variant: "body2", children: opo.opo_number })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Custom reference" }), jsx(Typography, { variant: "body2", children: opo.customer_reference })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Date" }), jsx(Typography, { variant: "body2", children: opo.order_date })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Customer" }), jsx(Typography, { variant: "body2", children: opo.customer?.business_credentials?.company_name })] }), jsxs(Stack, { direction: "row", spacing: 2, children: [jsx(Typography, { variant: "body1", width: "250px", children: "Order Status" }), jsx(Typography, { variant: "body2", width: "250px", children: opo.internal_status })] }), (opo.internal_status === "placed" ||
173
173
  opo.internal_status === "external_shipping_process") &&
174
- role === "enduser" && (jsxs(Fragment, { children: [jsx(Button, { variant: "contained", color: "primary", onClick: () => setConfirmDialogOpen(true), children: "Confirm order" }), jsx(Alert, { severity: "warning", children: "Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher" }), jsx(ConfirmFormDialog, { open: confirmDialogOpen, handleClose: () => setConfirmDialogOpen(false), orderID: opo.documentId, currentStatus: opo.internal_status, revalidateCallback: revalidateCallback })] }))] }) }), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1, children: opo.delivery_note ? (jsxs(Fragment, { children: [jsx(Typography, { variant: "h6", children: "Delivery Note" }), jsx(Typography, { children: opo.delivery_note?.name }), jsx(Button, { variant: "contained", onClick: () => {
174
+ role === "enduser" && (jsxs(Fragment, { children: [jsx(Button, { variant: "contained", color: "primary", onClick: () => setConfirmDialogOpen(true), children: "Confirm order" }), jsx(Alert, { severity: "warning", children: "Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher" }), jsx(ConfirmFormDialog, { open: confirmDialogOpen, handleClose: () => setConfirmDialogOpen(false), orderID: opo.documentId, currentStatus: opo.internal_status, revalidateCallback: revalidateCallback })] }))] }) }), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Documents" }), jsx(Paper, { sx: { p: 2 }, children: jsx(Stack, { spacing: 1, children: opo.delivery_note ? (jsxs(Fragment, { children: [jsx(Typography, { variant: "h6", children: "Delivery Note" }), jsx(Typography, { children: opo.delivery_note?.name }), jsx(Button, { variant: "contained", onClick: () => {
175
175
  downloadBase64File(`api/opos/${opo.documentId}`, "delivery_note");
176
- }, children: "Download" })] })) : (jsxs(Fragment, { children: [jsx(Typography, { variant: "h5", children: "Delivery Note" }), jsx(Typography, { variant: "body1", children: "Here you can upload the the delivery note for this order" }), jsx(Divider, {}), jsx(UploadBase64MediaForm, { reference: "api::e-commerce.opo", refID: opo.documentId, field: "delivery_note", multiple: false, accept: "text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", path: "api/opos", componentName: "delivery_note", componentReference: "common.base64-encoded-media", revalidateCallback: revalidateCallback })] })) }) })] }) }), opo?.notes?.length > 0 && (jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: opo.notes }), jsx(Divider, {})] }) })), jsx(Grid, { item: true, xs: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), opo.internal_status === "placed" && (jsx(Alert, { severity: "warning", children: "Before confirmation you cannot update the items" })), jsx(Divider, {}), jsxs("form", { action: formAction, children: [jsx("input", { name: "id", type: "hidden", value: opo.documentId }), items &&
176
+ }, children: "Download" })] })) : (jsxs(Fragment, { children: [jsx(Typography, { variant: "h5", children: "Delivery Note" }), jsx(Typography, { variant: "body1", children: "Here you can upload the the delivery note for this order" }), jsx(Divider, {}), jsx(UploadBase64MediaForm, { reference: "api::e-commerce.opo", refID: opo.documentId, field: "delivery_note", multiple: false, accept: "text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", path: "api/opos", componentName: "delivery_note", componentReference: "common.base64-encoded-media", revalidateCallback: revalidateCallback })] })) }) })] }) }), opo?.notes?.length > 0 && (jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 2, children: [jsx(Typography, { variant: "h5", children: "Notes" }), jsx(NotesDisplay, { notes: opo.notes }), jsx(Divider, {})] }) })), jsx(Grid, { size: 12, children: jsxs(Stack, { spacing: 1, children: [jsx(Typography, { variant: "h5", children: "Items" }), opo.internal_status === "placed" && (jsx(Alert, { severity: "warning", children: "Before confirmation you cannot update the items" })), jsx(Divider, {}), jsxs("form", { action: formAction, children: [jsx("input", { name: "id", type: "hidden", value: opo.documentId }), items &&
177
177
  items.map((item, index) => {
178
178
  console.log("item", item);
179
179
  return (jsx(Paper, { sx: { p: 2, mb: 2 }, children: opo.internal_status === "placed" ? (jsx(OpoItemDisplay, { item: item, index: index, image: item?.product?.image })) : (jsx(OpoItemUpdater, { item: item, index: index, handleUpdateQuantity: handleUpdateQuantity, image: item?.product?.image, revalidateCallback: revalidateCallback })) }, index));