bananas-commerce-admin 0.20.2 → 0.21.0

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 (79) hide show
  1. package/dist/esm/components/Card/CardFieldAutoComplete.js +2 -2
  2. package/dist/esm/components/Card/CardFieldAutoComplete.js.map +1 -1
  3. package/dist/esm/components/Card/CardFieldSelect.js +6 -3
  4. package/dist/esm/components/Card/CardFieldSelect.js.map +1 -1
  5. package/dist/esm/components/Card/index.js +17 -1
  6. package/dist/esm/components/Card/index.js.map +1 -1
  7. package/dist/esm/components/ContribInlines.js +3 -2
  8. package/dist/esm/components/ContribInlines.js.map +1 -1
  9. package/dist/esm/extensions/catalog/components/ArticleCard.js +9 -4
  10. package/dist/esm/extensions/catalog/components/ArticleCard.js.map +1 -1
  11. package/dist/esm/extensions/catalog/contrib/ProductArticles.js +48 -0
  12. package/dist/esm/extensions/catalog/contrib/ProductArticles.js.map +1 -0
  13. package/dist/esm/extensions/catalog/index.js +9 -0
  14. package/dist/esm/extensions/catalog/index.js.map +1 -1
  15. package/dist/esm/extensions/pim/components/ProductCard.js +123 -0
  16. package/dist/esm/extensions/pim/components/ProductCard.js.map +1 -0
  17. package/dist/esm/extensions/pim/components/ProductPropertiesCard.js +71 -0
  18. package/dist/esm/extensions/pim/components/ProductPropertiesCard.js.map +1 -0
  19. package/dist/esm/extensions/pim/components/ProductPropertyField.js +25 -0
  20. package/dist/esm/extensions/pim/components/ProductPropertyField.js.map +1 -0
  21. package/dist/esm/extensions/pim/components/ProductRow.js +11 -0
  22. package/dist/esm/extensions/pim/components/ProductRow.js.map +1 -0
  23. package/dist/esm/extensions/pim/contrib/ArticleProduct.js +110 -0
  24. package/dist/esm/extensions/pim/contrib/ArticleProduct.js.map +1 -0
  25. package/dist/esm/extensions/pim/index.js +43 -0
  26. package/dist/esm/extensions/pim/index.js.map +1 -0
  27. package/dist/esm/extensions/pim/pages/product/create.js +41 -0
  28. package/dist/esm/extensions/pim/pages/product/create.js.map +1 -0
  29. package/dist/esm/extensions/pim/pages/product/detail.js +46 -0
  30. package/dist/esm/extensions/pim/pages/product/detail.js.map +1 -0
  31. package/dist/esm/extensions/pim/pages/product/list.js +54 -0
  32. package/dist/esm/extensions/pim/pages/product/list.js.map +1 -0
  33. package/dist/esm/extensions/pim/types/contrib.js +2 -0
  34. package/dist/esm/extensions/pim/types/contrib.js.map +1 -0
  35. package/dist/esm/extensions/pim/types/product.js +2 -0
  36. package/dist/esm/extensions/pim/types/product.js.map +1 -0
  37. package/dist/esm/index.js +1 -0
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/types/components/Card/CardFieldAutoComplete.d.ts +3 -0
  40. package/dist/types/components/Card/CardFieldSelect.d.ts +1 -0
  41. package/dist/types/components/ContribInlines.d.ts +1 -0
  42. package/dist/types/extensions/catalog/components/ArticleCard.d.ts +12 -0
  43. package/dist/types/extensions/catalog/contrib/ProductArticles.d.ts +4 -0
  44. package/dist/types/extensions/catalog/types/contrib.d.ts +8 -0
  45. package/dist/types/extensions/pim/components/ProductCard.d.ts +23 -0
  46. package/dist/types/extensions/pim/components/ProductPropertiesCard.d.ts +8 -0
  47. package/dist/types/extensions/pim/components/ProductPropertyField.d.ts +8 -0
  48. package/dist/types/extensions/pim/components/ProductRow.d.ts +6 -0
  49. package/dist/types/extensions/pim/contrib/ArticleProduct.d.ts +4 -0
  50. package/dist/types/extensions/pim/index.d.ts +7 -0
  51. package/dist/types/extensions/pim/pages/product/create.d.ts +3 -0
  52. package/dist/types/extensions/pim/pages/product/detail.d.ts +4 -0
  53. package/dist/types/extensions/pim/pages/product/list.d.ts +4 -0
  54. package/dist/types/extensions/pim/types/contrib.d.ts +19 -0
  55. package/dist/types/extensions/pim/types/product.d.ts +35 -0
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/types/types/index.d.ts +1 -1
  58. package/package.json +6 -1
  59. package/src/components/Card/CardFieldAutoComplete.tsx +14 -1
  60. package/src/components/Card/CardFieldSelect.tsx +6 -2
  61. package/src/components/Card/index.tsx +21 -1
  62. package/src/components/ContribInlines.tsx +5 -2
  63. package/src/extensions/catalog/components/ArticleCard.tsx +22 -4
  64. package/src/extensions/catalog/contrib/ProductArticles.tsx +82 -0
  65. package/src/extensions/catalog/index.tsx +9 -0
  66. package/src/extensions/catalog/types/contrib.ts +9 -0
  67. package/src/extensions/pim/components/ProductCard.tsx +242 -0
  68. package/src/extensions/pim/components/ProductPropertiesCard.tsx +114 -0
  69. package/src/extensions/pim/components/ProductPropertyField.tsx +67 -0
  70. package/src/extensions/pim/components/ProductRow.tsx +23 -0
  71. package/src/extensions/pim/contrib/ArticleProduct.tsx +215 -0
  72. package/src/extensions/pim/index.tsx +67 -0
  73. package/src/extensions/pim/pages/product/create.tsx +63 -0
  74. package/src/extensions/pim/pages/product/detail.tsx +85 -0
  75. package/src/extensions/pim/pages/product/list.tsx +87 -0
  76. package/src/extensions/pim/types/contrib.ts +21 -0
  77. package/src/extensions/pim/types/product.ts +52 -0
  78. package/src/index.ts +1 -0
  79. package/src/types/index.ts +1 -1
@@ -0,0 +1,110 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { TableBody, TableHead, TableRow } from "@mui/material";
3
+ import Box from "@mui/material/Box";
4
+ import ImageList from "@mui/material/ImageList";
5
+ import ImageListItem from "@mui/material/ImageListItem";
6
+ import ImageListItemBar from "@mui/material/ImageListItemBar";
7
+ import Modal from "@mui/material/Modal";
8
+ import Card from "../../../components/Card";
9
+ import CardContent from "../../../components/Card/CardContent";
10
+ import CardFieldSelect from "../../../components/Card/CardFieldSelect";
11
+ import CardFieldText from "../../../components/Card/CardFieldText";
12
+ import CardHeader from "../../../components/Card/CardHeader";
13
+ import CardRow from "../../../components/Card/CardRow";
14
+ import Table from "../../../components/Table";
15
+ import { TableCell } from "../../../components/Table/TableCell";
16
+ import TableHeading from "../../../components/Table/TableHeading";
17
+ import { useApi } from "../../../contexts/ApiContext";
18
+ import { useI18n } from "../../../contexts/I18nContext";
19
+ import { ProductPropertyField } from "../components/ProductPropertyField";
20
+ const ArticleProductCard = ({ data, params }) => {
21
+ const { t } = useI18n();
22
+ const api = useApi();
23
+ const [selectedAsset, setSelectedAsset] = useState(null);
24
+ const [productItemTypes, setProductItemTypes] = useState([]);
25
+ const { code: articleCode } = params;
26
+ const { product, assets } = data;
27
+ const articleAssets = assets.filter((asset) => asset.article_code == articleCode || asset.article_code == "");
28
+ const imageAssets = articleAssets.filter((asset) => asset.asset_type == "image");
29
+ const otherAssets = articleAssets.filter((asset) => asset.asset_type !== "image");
30
+ const productProperties = product.properties;
31
+ const productItemType = productItemTypes.find((itemType) => itemType.name == product.item_type);
32
+ const productPropertiesList = productItemType ? productItemType.product_properties : [];
33
+ const productPropertiesRows = productPropertiesList.reduce((rows, prop, index) => {
34
+ if (index % 2 === 0)
35
+ rows.push([prop]);
36
+ else
37
+ rows[rows.length - 1].push(prop);
38
+ return rows;
39
+ }, []);
40
+ useEffect(() => {
41
+ api.operations["pim.item_types:options"].call({}).then(async (response) => {
42
+ if (response.ok) {
43
+ setProductItemTypes(await response.json());
44
+ }
45
+ });
46
+ }, []);
47
+ return (React.createElement(Card, { columns: 2, isEditable: false },
48
+ React.createElement(CardHeader, { title: "Product" }),
49
+ React.createElement(CardContent, null,
50
+ React.createElement(CardRow, null,
51
+ React.createElement(CardFieldText, { formName: "name", label: t("Name"), required: true, value: product.name }),
52
+ React.createElement(CardFieldSelect, { formName: "item_type", label: t("Type"), options: productItemTypes.map((itemType) => ({
53
+ id: itemType.name,
54
+ label: itemType.name,
55
+ })), required: true, size: 1, value: product.item_type ? { id: product.item_type, label: product.item_type } : undefined })),
56
+ React.createElement(CardRow, null,
57
+ React.createElement(CardFieldText, { formName: "description", label: t("Description"), required: true, value: product.description }))),
58
+ productPropertiesRows.length > 0 && (React.createElement(React.Fragment, null,
59
+ React.createElement(CardHeader, { title: t("Properties") }),
60
+ React.createElement(CardContent, null, productPropertiesRows.map((row, index) => (React.createElement(CardRow, { key: index }, row.map((prop) => (React.createElement(ProductPropertyField, { key: prop.name, property: prop, value: productProperties[prop.name] }))))))))),
61
+ articleAssets.length > 0 && React.createElement(CardHeader, { title: t("Assets") }),
62
+ imageAssets.length > 0 && (React.createElement(React.Fragment, null,
63
+ React.createElement(Modal, { "aria-describedby": "modal-modal-description", "aria-labelledby": "modal-modal-title", open: selectedAsset !== null, onClose: () => setSelectedAsset(null) },
64
+ React.createElement(Box, { sx: {
65
+ position: "absolute",
66
+ top: "50%",
67
+ left: "50%",
68
+ transform: "translate(-50%, -50%)",
69
+ width: "100vw", // Set explicit width
70
+ height: "100vh", // Set explicit height
71
+ bgcolor: "rgba(0, 0, 0, 0.7)", // Dark overlay background
72
+ boxShadow: 24,
73
+ p: 2, // Reduced padding
74
+ display: "flex",
75
+ justifyContent: "center",
76
+ alignItems: "center",
77
+ overflow: "hidden", // Hide any overflowing content
78
+ outline: "none",
79
+ }, onClick: () => setSelectedAsset(null) }, selectedAsset !== null && (React.createElement("img", { alt: selectedAsset.caption, loading: "lazy", src: selectedAsset.url, style: {
80
+ maxWidth: "100%",
81
+ maxHeight: "100%",
82
+ objectFit: "contain",
83
+ borderRadius: "8px", // Subtle rounded corners for the image
84
+ } })))),
85
+ React.createElement(CardContent, { sx: {
86
+ width: "100%",
87
+ height: 400,
88
+ overflowY: "scroll",
89
+ paddingTop: 0,
90
+ paddingBottom: 0,
91
+ paddingLeft: 3,
92
+ paddingRight: 3,
93
+ } },
94
+ React.createElement(ImageList, { cols: 3, gap: 8, variant: "masonry" }, imageAssets.map((asset) => (React.createElement(ImageListItem, { key: asset.id, onClick: () => setSelectedAsset(asset) },
95
+ React.createElement("img", { alt: asset.caption, loading: "lazy", src: asset.url }),
96
+ React.createElement(ImageListItemBar, { subtitle: asset.caption })))))))),
97
+ otherAssets.length > 0 && (React.createElement(Table, { count: otherAssets.length },
98
+ React.createElement(TableHead, null,
99
+ React.createElement(TableRow, null,
100
+ React.createElement(TableHeading, null, t("Asset ID")),
101
+ React.createElement(TableHeading, { align: "right" }, t("Type")),
102
+ React.createElement(TableHeading, { align: "right" }, t("Caption")))),
103
+ React.createElement(TableBody, { sx: { ".MuiTableRow-root:last-child > .MuiTableCell-root": { borderBottom: "none" } } }, otherAssets.map((asset) => (React.createElement(TableRow, { key: asset.id, sx: { height: 56 } },
104
+ React.createElement(TableCell, { sx: { py: 0 } },
105
+ React.createElement("a", { href: asset.url, rel: "noreferrer", target: "_blank" }, asset.id)),
106
+ React.createElement(TableCell, { align: "right", sx: { py: 0 } }, asset.asset_type),
107
+ React.createElement(TableCell, { align: "right", sx: { py: 0 } }, asset.caption)))))))));
108
+ };
109
+ export default ArticleProductCard;
110
+ //# sourceMappingURL=ArticleProduct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArticleProduct.js","sourceRoot":"","sources":["../../../../../src/extensions/pim/contrib/ArticleProduct.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAExC,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAC5C,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAC/D,OAAO,eAAe,MAAM,0CAA0C,CAAC;AACvE,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,OAAO,OAAO,MAAM,kCAAkC,CAAC;AACvD,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;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AAE,CACP,CACM;gBACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IACnC,KAAK,CAAC,UAAU,CACP;gBACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IACnC,KAAK,CAAC,OAAO,CACJ,CACH,CACZ,CAAC,CACQ,CACN,CACT,CACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,43 @@
1
+ import InventoryOutlinedIcon from "@mui/icons-material/InventoryOutlined";
2
+ import WorkspacesIcon from "../../assets/symbols/Workspaces";
3
+ export * from "./types/contrib";
4
+ export * from "./types/product";
5
+ const routes = {
6
+ product: {
7
+ create: { page: async () => (await import("./pages/product/create")).default, offline: true },
8
+ detail: { page: async () => (await import("./pages/product/detail")).default },
9
+ list: { page: async () => (await import("./pages/product/list")).default },
10
+ },
11
+ };
12
+ export const router = {
13
+ app: "pim",
14
+ pages: (route) => {
15
+ const { page, ...hit } = routes[route.view]?.[route.action] ?? {};
16
+ if (page != null) {
17
+ return {
18
+ page: page(),
19
+ ...hit,
20
+ };
21
+ }
22
+ return undefined;
23
+ },
24
+ };
25
+ export const navigation = {
26
+ "pim.product:list": {
27
+ icon: WorkspacesIcon,
28
+ permission: "pim.view_product",
29
+ },
30
+ };
31
+ export const contrib = {
32
+ catalog: {
33
+ "catalog:article:detail:product": {
34
+ title: "Product",
35
+ icon: InventoryOutlinedIcon,
36
+ component: async () => (await import("./contrib/ArticleProduct")).default,
37
+ predicate: (article) => !!article.product_number,
38
+ variant: "inline",
39
+ permission: "pim.view_product",
40
+ },
41
+ },
42
+ };
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/extensions/pim/index.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAA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E,qBAAqB;YAC3B,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,OAAO;YACzE,SAAS,EAAE,CAAC,OAAsB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc;YAC/D,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,kBAAkB;SAC/B;KACF;CACO,CAAC"}
@@ -0,0 +1,41 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import CategoryOutlinedIcon from "@mui/icons-material/CategoryOutlined";
3
+ import { Header } from "../../../../components/Header";
4
+ import { Page } from "../../../../components/Page";
5
+ import { Tab } from "../../../../components/Tab";
6
+ import { TabPanel } from "../../../../components/TabPanel";
7
+ import { TabPanels } from "../../../../components/TabPanels";
8
+ import { Tabs } from "../../../../components/Tabs";
9
+ import { TitleBar } from "../../../../components/TitleBar";
10
+ import Content, { LeftColumn } from "../../../../containers/Content";
11
+ import { useApi } from "../../../../contexts/ApiContext";
12
+ import { useRouter } from "../../../../contexts/RouterContext";
13
+ import { ProductCard } from "../../components/ProductCard";
14
+ const ProductCreatePage = () => {
15
+ const { navigate } = useRouter();
16
+ const api = useApi();
17
+ const [productItemTypes, setProductItemTypes] = useState([]);
18
+ useEffect(() => {
19
+ api.operations["pim.item_types:options"].call({}).then(async (response) => {
20
+ if (response.ok) {
21
+ setProductItemTypes(await response.json());
22
+ }
23
+ });
24
+ }, []);
25
+ return (React.createElement(Page, null,
26
+ React.createElement(Header, { variant: "opaque" },
27
+ React.createElement(TitleBar, { title: "Create Product" }),
28
+ React.createElement(Tabs, null,
29
+ React.createElement(Tab, { key: "default", icon: React.createElement(CategoryOutlinedIcon, null), label: "Product", value: "default" }))),
30
+ React.createElement(TabPanels, null,
31
+ React.createElement(TabPanel, { key: "default", value: "default" },
32
+ React.createElement(Content, { layout: "fixedWidth" },
33
+ React.createElement(LeftColumn, null,
34
+ React.createElement(ProductCard, { create: true, itemTypes: productItemTypes, onCreated: (product) => {
35
+ navigate(`pim.product:detail`, {
36
+ params: { id: product.id },
37
+ });
38
+ } })))))));
39
+ };
40
+ export default ProductCreatePage;
41
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../../src/extensions/pim/pages/product/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,iBAAiB,GAAkB,GAAG,EAAE;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAC;IAEtF,SAAS,CAAC,GAAG,EAAE;QACb,GAAG,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YACxE,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,mBAAmB,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,IAAI;QACH,oBAAC,MAAM,IAAC,OAAO,EAAC,QAAQ;YACtB,oBAAC,QAAQ,IAAC,KAAK,EAAC,gBAAgB,GAAG;YACnC,oBAAC,IAAI;gBACH,oBAAC,GAAG,IAAC,GAAG,EAAC,SAAS,EAAC,IAAI,EAAE,oBAAC,oBAAoB,OAAG,EAAE,KAAK,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS,GAAG,CAChF,CACA;QAET,oBAAC,SAAS;YACR,oBAAC,QAAQ,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS;gBACrC,oBAAC,OAAO,IAAC,MAAM,EAAC,YAAY;oBAC1B,oBAAC,UAAU;wBACT,oBAAC,WAAW,IACV,MAAM,QACN,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;gCACrB,QAAQ,CAAC,oBAAoB,EAAE;oCAC7B,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE;iCAC3B,CAAC,CAAC;4BACL,CAAC,GACD,CACS,CACL,CACD,CACD,CACP,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import CategoryOutlinedIcon from "@mui/icons-material/CategoryOutlined";
3
+ import Typography from "@mui/material/Typography";
4
+ import { ContribInlines } from "../../../../components/ContribInlines";
5
+ import { Header } from "../../../../components/Header";
6
+ import { Page } from "../../../../components/Page";
7
+ import { Tab } from "../../../../components/Tab";
8
+ import { TabPanel } from "../../../../components/TabPanel";
9
+ import { TabPanels } from "../../../../components/TabPanels";
10
+ import { Tabs } from "../../../../components/Tabs";
11
+ import { TitleBar } from "../../../../components/TitleBar";
12
+ import Content, { LeftColumn, RightColumn } from "../../../../containers/Content";
13
+ import { useApi } from "../../../../contexts/ApiContext";
14
+ import { ProductCard } from "../../components/ProductCard";
15
+ import { ProductPropertiesCard } from "../../components/ProductPropertiesCard";
16
+ const ProductDetailPage = ({ data }) => {
17
+ const [product, setProduct] = useState(data);
18
+ const [productItemTypes, setProductItemTypes] = useState([]);
19
+ const api = useApi();
20
+ useEffect(() => {
21
+ api.operations["pim.item_types:options"].call({}).then(async (response) => {
22
+ if (response.ok) {
23
+ setProductItemTypes(await response.json());
24
+ }
25
+ });
26
+ }, []);
27
+ const productItemType = productItemTypes.find((itemType) => itemType.name == product.item_type);
28
+ return (React.createElement(Page, null,
29
+ React.createElement(Header, { variant: "opaque" },
30
+ React.createElement(TitleBar, { title: React.createElement(React.Fragment, null,
31
+ data.name,
32
+ React.createElement(Typography, { sx: { pl: 1 }, variant: "button" }, data.number)) }),
33
+ React.createElement(Tabs, { data: product },
34
+ React.createElement(Tab, { key: "default", icon: React.createElement(CategoryOutlinedIcon, null), label: "Product", value: "default" }))),
35
+ React.createElement(TabPanels, { contribParams: { number: data.number } },
36
+ React.createElement(TabPanel, { key: "default", value: "default" },
37
+ React.createElement(Content, { layout: "fixedWidth" },
38
+ React.createElement(LeftColumn, null,
39
+ React.createElement(ProductCard, { itemTypes: productItemTypes, product: product, onUpdated: setProduct }),
40
+ productItemType && (React.createElement(ProductPropertiesCard, { itemType: productItemType, productProperties: product.properties, setProductProperties: (properties) => setProduct((previous) => ({ ...previous, properties })) })),
41
+ React.createElement(ContribInlines, { contribParams: { number: data.number }, data: data })),
42
+ React.createElement(RightColumn, null,
43
+ React.createElement(ContribInlines, { contribParams: { number: data.number }, data: data, variant: "sidebar" })))))));
44
+ };
45
+ export default ProductDetailPage;
46
+ //# sourceMappingURL=detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detail.js","sourceRoot":"","sources":["../../../../../../src/extensions/pim/pages/product/detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,OAAO,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,MAAM,iBAAiB,GAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,SAAS,CAAC,GAAG,EAAE;QACb,G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,oBAAC,qBAAqB,IACpB,QAAQ,EAAE,eAAe,EACzB,iBAAiB,EAAE,OAAO,CAAC,UAAU,EACrC,oBAAoB,EAAE,CAAC,UAAU,EAAE,EAAE,CACnC,UAAU,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,GAEzD,CACH;wBACD,oBAAC,cAAc,IAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI,CAC3D;oBACb,oBAAC,WAAW;wBACV,oBAAC,cAAc,IACb,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAC,SAAS,GACjB,CACU,CACN,CACD,CACD,CACP,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { Button, TableBody } from "@mui/material";
3
+ import ActionBar from "../../../../components/ActionBar";
4
+ import { Header } from "../../../../components/Header";
5
+ import { Page } from "../../../../components/Page";
6
+ import SearchBar from "../../../../components/SearchBar";
7
+ import Table from "../../../../components/Table";
8
+ import TableHead from "../../../../components/Table/TableHead";
9
+ import TableHeading from "../../../../components/Table/TableHeading";
10
+ import TableCard from "../../../../components/TableCard";
11
+ import { TitleBar } from "../../../../components/TitleBar";
12
+ import Content, { ContentWrapperWithActionBar } from "../../../../containers/Content";
13
+ import { useI18n } from "../../../../contexts/I18nContext";
14
+ import { useRouter } from "../../../../contexts/RouterContext";
15
+ import { useUser } from "../../../../contexts/UserContext";
16
+ import { hasPermission } from "../../../../util/has_permission";
17
+ import { ProductRow } from "../../components/ProductRow";
18
+ const ProductListPage = ({ data }) => {
19
+ const { navigate } = useRouter();
20
+ const { user } = useUser();
21
+ const { t } = useI18n();
22
+ return (React.createElement(Page, null,
23
+ React.createElement(Header, null,
24
+ React.createElement(TitleBar, { title: t("Products") },
25
+ React.createElement(SearchBar, { defaultValue: new URLSearchParams(window.location.search).get("search") ?? "", placeholder: t("Search for product number or name"), onSubmit: (input) => {
26
+ if (input === "") {
27
+ navigate("pim.product:list", {
28
+ replace: true,
29
+ });
30
+ }
31
+ else {
32
+ navigate("pim.product:list", {
33
+ query: {
34
+ search: input,
35
+ },
36
+ replace: true,
37
+ });
38
+ }
39
+ } }))),
40
+ React.createElement(ContentWrapperWithActionBar, null,
41
+ React.createElement(Content, { layout: "fullWidth" },
42
+ React.createElement(TableCard, null,
43
+ React.createElement(Table, { pagination: true, count: data?.count },
44
+ React.createElement(TableHead, null,
45
+ React.createElement(TableHeading, null, t("Name")),
46
+ React.createElement(TableHeading, null, t("Type")),
47
+ React.createElement(TableHeading, null, t("Product Number")),
48
+ React.createElement(TableHeading, { align: "right" }, t("Active"))),
49
+ React.createElement(TableBody, null, data?.results.map((product) => React.createElement(ProductRow, { key: product.id, product: product })))))),
50
+ hasPermission(user, "pim.add_product") && (React.createElement(ActionBar, null,
51
+ React.createElement(Button, { color: "primary", variant: "contained", onClick: () => navigate("pim.product:create") }, t("Create product")))))));
52
+ };
53
+ export default ProductListPage;
54
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../../src/extensions/pim/pages/product/list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,KAAK,MAAM,8BAA8B,CAAC;AACjD,OAAO,SAAS,MAAM,wCAAwC,CAAC;AA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E,KAAK;iCACd;gCACD,OAAO,EAAE,IAAI;6BACd,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC,GACD,CACO,CACJ;QAET,oBAAC,2BAA2B;YAC1B,oBAAC,OAAO,IAAC,MAAM,EAAC,WAAW;gBACzB,oBAAC,SAAS;oBACR,oBAAC,KAAK,IAAC,UAAU,QAAC,KAAK,EAAE,IAAI,EAAE,KAAK;wBAClC,oBAAC,SAAS;4BACR,oBAAC,YAAY,QAAE,CAAC,CAAC,MAAM,CAAC,CAAgB;4BACxC,oBAAC,YAAY,QAAE,CAAC,CAAC,MAAM,CAAC,CAAgB;4BACxC,oBAAC,YAAY,QAAE,CAAC,CAAC,gBAAgB,CAAC,CAAgB;4BAClD,oBAAC,YAAY,IAAC,KAAK,EAAC,OAAO,IAAE,CAAC,CAAC,QAAQ,CAAC,CAAgB,CAC9C;wBAEZ,oBAAC,SAAS,QACP,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAC,UAAU,IAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC,CACxE,CACN,CACE,CACJ;YAET,aAAa,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CACzC,oBAAC,SAAS;gBACR,oBAAC,MAAM,IACL,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAE5C,CAAC,CAAC,gBAAgB,CAAC,CACb,CACC,CACb,CAC2B,CACzB,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contrib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contrib.js","sourceRoot":"","sources":["../../../../../src/extensions/pim/types/contrib.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.js","sourceRoot":"","sources":["../../../../../src/extensions/pim/types/product.ts"],"names":[],"mappings":""}
package/dist/esm/index.js CHANGED
@@ -65,6 +65,7 @@ export * as catalog from "./extensions/catalog";
65
65
  export * as fulfillment from "./extensions/fulfillment";
66
66
  export * as inventory from "./extensions/inventory";
67
67
  export * as member from "./extensions/member";
68
+ export * as pim from "./extensions/pim";
68
69
  export * as pos from "./extensions/pos";
69
70
  export * as pricing from "./extensions/pricing";
70
71
  export * as report from "./extensions/report";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA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M,2BAA2B,CAAC;AAC1D,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAE7B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
@@ -5,6 +5,9 @@ export interface CardFieldAutoCompleteProps extends CardFieldBaseProps, React.Pr
5
5
  isEditable?: boolean;
6
6
  type: "autocomplete";
7
7
  value: FormOption[];
8
+ autoSelect?: boolean;
9
+ clearOnBlur?: boolean;
10
+ freeSolo?: boolean;
8
11
  }
9
12
  export declare const CardFieldAutoComplete: React.FC<Omit<CardFieldAutoCompleteProps, "type">>;
10
13
  export default CardFieldAutoComplete;
@@ -7,6 +7,7 @@ export interface CardFieldSelectProps extends React.PropsWithChildren, Omit<Sele
7
7
  emptyValue?: FormOption;
8
8
  value: FormOption | undefined;
9
9
  isEditable?: boolean;
10
+ onUpdated?: (val: string) => void;
10
11
  }
11
12
  export declare const CardFieldSelect: React.FC<Omit<CardFieldSelectProps, "type">>;
12
13
  export default CardFieldSelect;
@@ -2,5 +2,6 @@ import React from "react";
2
2
  export interface ContribInlinesProps {
3
3
  contribParams?: Record<string | number | symbol, unknown>;
4
4
  data?: unknown;
5
+ variant?: string;
5
6
  }
6
7
  export declare const ContribInlines: React.FC<ContribInlinesProps>;
@@ -11,4 +11,16 @@ export type ArticleCardProps = {
11
11
  onCreated?: never;
12
12
  onUpdated: (article: ArticleDetail) => void;
13
13
  };
14
+ export interface ArticleCardFormValues {
15
+ code: string;
16
+ item_type: string;
17
+ is_active: string;
18
+ name: string;
19
+ description: string;
20
+ product_number: string;
21
+ model_number: string;
22
+ tax_code: string;
23
+ gtin: string;
24
+ variant: string;
25
+ }
14
26
  export declare const ArticleCard: React.FC<ArticleCardProps>;
@@ -0,0 +1,4 @@
1
+ import { ContribComponent } from "../../../types";
2
+ import { ProductArticle } from "../types/contrib";
3
+ declare const ProductArticlesCard: ContribComponent<ProductArticle[]>;
4
+ export default ProductArticlesCard;
@@ -13,3 +13,11 @@ export interface SiteItem {
13
13
  export interface SiteItemsResponse {
14
14
  items: SiteItem[];
15
15
  }
16
+ export interface ProductArticle {
17
+ id: number;
18
+ item_type: string;
19
+ name: string;
20
+ variant: string;
21
+ code: string;
22
+ is_active: boolean;
23
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { ProductCreated, ProductDetail, ProductItemTypeOption } from "../types/product";
3
+ export type ProductCardProps = {
4
+ create: true;
5
+ product?: ProductDetail;
6
+ onCreated: (product: ProductCreated) => void;
7
+ onUpdated?: never;
8
+ itemTypes: ProductItemTypeOption[];
9
+ } | {
10
+ create?: false;
11
+ product: ProductDetail;
12
+ onCreated?: never;
13
+ onUpdated: (product: ProductDetail) => void;
14
+ itemTypes: ProductItemTypeOption[];
15
+ };
16
+ export interface ProductCardFormValues {
17
+ number: string;
18
+ item_type: string;
19
+ is_active: string;
20
+ name: string;
21
+ description: string;
22
+ }
23
+ export declare const ProductCard: React.FC<ProductCardProps>;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { ProductItemTypeOption, ProductPropertiesData } from "../types/product";
3
+ export interface ProductPropertiesCardProps {
4
+ itemType: ProductItemTypeOption;
5
+ productProperties: ProductPropertiesData;
6
+ setProductProperties: (properties: ProductPropertiesData) => void;
7
+ }
8
+ export declare const ProductPropertiesCard: React.FC<ProductPropertiesCardProps>;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { ProductProperty, ProductPropertyValue } from "../types/product";
3
+ export interface ProductPropertyFieldProps {
4
+ property: ProductProperty;
5
+ value: ProductPropertyValue;
6
+ formName?: string;
7
+ }
8
+ export declare const ProductPropertyField: React.FC<ProductPropertyFieldProps>;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { ProductList } from "../types/product";
3
+ export interface ProductRowProps {
4
+ product: ProductList;
5
+ }
6
+ export declare const ProductRow: React.FC<ProductRowProps>;
@@ -0,0 +1,4 @@
1
+ import { ContribComponent } from "../../../types";
2
+ import { ArticleProductResponse } from "../types/contrib";
3
+ declare const ArticleProductCard: ContribComponent<ArticleProductResponse>;
4
+ export default ArticleProductCard;
@@ -0,0 +1,7 @@
1
+ import { RouterExtension } from "../../router/Router";
2
+ import { ContribComponentMap, NavigationOverrides } from "../../types";
3
+ export * from "./types/contrib";
4
+ export * from "./types/product";
5
+ export declare const router: RouterExtension;
6
+ export declare const navigation: NavigationOverrides;
7
+ export declare const contrib: Record<string, ContribComponentMap>;
@@ -0,0 +1,3 @@
1
+ import { PageComponent } from "../../../../types";
2
+ declare const ProductCreatePage: PageComponent;
3
+ export default ProductCreatePage;
@@ -0,0 +1,4 @@
1
+ import { PageComponent } from "../../../../types";
2
+ import { ProductDetail } from "../../types/product";
3
+ declare const ProductDetailPage: PageComponent<ProductDetail>;
4
+ export default ProductDetailPage;
@@ -0,0 +1,4 @@
1
+ import { LimitOffset, PageComponent } from "../../../../types";
2
+ import { ProductList } from "../../types/product";
3
+ declare const ProductListPage: PageComponent<LimitOffset<ProductList>>;
4
+ export default ProductListPage;
@@ -0,0 +1,19 @@
1
+ export interface ArticleProduct {
2
+ number: string;
3
+ item_type: string;
4
+ name: string;
5
+ description: string;
6
+ properties: object;
7
+ is_active: boolean;
8
+ }
9
+ export interface ArticleAsset {
10
+ id: string;
11
+ asset_type: string;
12
+ caption: string;
13
+ article_code: string;
14
+ url: string;
15
+ }
16
+ export interface ArticleProductResponse {
17
+ product: ArticleProduct;
18
+ assets: ArticleAsset[];
19
+ }
@@ -0,0 +1,35 @@
1
+ export interface ProductList {
2
+ id: number;
3
+ number: string;
4
+ item_type: string;
5
+ name: string;
6
+ description: string;
7
+ is_active: boolean;
8
+ }
9
+ export type ProductPropertyValue = string | number | boolean | string[] | number[] | boolean[] | null | undefined;
10
+ export type ProductPropertiesData = Record<string, string | number | boolean | string[] | number[] | boolean[]>;
11
+ export interface ProductDetail {
12
+ id: number;
13
+ number: string;
14
+ item_type: string;
15
+ name: string;
16
+ description: string;
17
+ is_active: boolean;
18
+ properties: ProductPropertiesData;
19
+ }
20
+ export interface ProductCreated {
21
+ id: number;
22
+ }
23
+ export interface ProductProperty {
24
+ name: string;
25
+ title: string;
26
+ type: string;
27
+ min_length?: number;
28
+ min_value?: number;
29
+ max_value?: number;
30
+ array_type?: string;
31
+ }
32
+ export interface ProductItemTypeOption {
33
+ name: string;
34
+ product_properties: ProductProperty[];
35
+ }
@@ -65,6 +65,7 @@ export * as catalog from "./extensions/catalog";
65
65
  export * as fulfillment from "./extensions/fulfillment";
66
66
  export * as inventory from "./extensions/inventory";
67
67
  export * as member from "./extensions/member";
68
+ export * as pim from "./extensions/pim";
68
69
  export * as pos from "./extensions/pos";
69
70
  export * as pricing from "./extensions/pricing";
70
71
  export * as report from "./extensions/report";
@@ -66,7 +66,7 @@ export type ContribComponent<T = any> = React.ComponentType<PageProps<T> & OpenA
66
66
  * The variant of the component, either a tab, inline or action menu item.
67
67
  * Still requires a `Page` that loads the contrib.
68
68
  */
69
- export type ContribVariant = "tab" | "inline" | "action";
69
+ export type ContribVariant = "tab" | "inline" | "action" | "sidebar";
70
70
  export interface PageContribComponent<T = any> extends OpenAPI.Request {
71
71
  /**
72
72
  * The title shown in the NavRail.