@deenruv/order-line-attributes-plugin 1.0.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.
- package/LICENSE +23 -0
- package/README.md +36 -0
- package/dist/plugin-server/index.d.ts +2 -0
- package/dist/plugin-server/index.js +77 -0
- package/dist/plugin-server/zeus/const.d.ts +6 -0
- package/dist/plugin-server/zeus/const.js +3857 -0
- package/dist/plugin-server/zeus/index.d.ts +19816 -0
- package/dist/plugin-server/zeus/index.js +1101 -0
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +1 -0
- package/dist/plugin-server/zeus/typedDocumentNode.js +31 -0
- package/dist/plugin-ui/components/AttributesInput.d.ts +16 -0
- package/dist/plugin-ui/components/AttributesInput.js +24 -0
- package/dist/plugin-ui/components/FacetValues.d.ts +9 -0
- package/dist/plugin-ui/components/FacetValues.js +126 -0
- package/dist/plugin-ui/components/GroupValue.d.ts +7 -0
- package/dist/plugin-ui/components/GroupValue.js +13 -0
- package/dist/plugin-ui/components/index.d.ts +3 -0
- package/dist/plugin-ui/components/index.js +3 -0
- package/dist/plugin-ui/graphql/index.d.ts +1 -0
- package/dist/plugin-ui/graphql/index.js +1 -0
- package/dist/plugin-ui/graphql/queries.d.ts +24 -0
- package/dist/plugin-ui/graphql/queries.js +7 -0
- package/dist/plugin-ui/graphql/selectors.d.ts +54 -0
- package/dist/plugin-ui/graphql/selectors.js +25 -0
- package/dist/plugin-ui/index.d.ts +1 -0
- package/dist/plugin-ui/index.js +11 -0
- package/dist/plugin-ui/locales/en/facetValues.json +12 -0
- package/dist/plugin-ui/locales/en/index.d.ts +13 -0
- package/dist/plugin-ui/locales/en/index.js +2 -0
- package/dist/plugin-ui/locales/pl/facetValues.json +12 -0
- package/dist/plugin-ui/locales/pl/index.d.ts +13 -0
- package/dist/plugin-ui/locales/pl/index.js +2 -0
- package/dist/plugin-ui/translation-ns.d.ts +1 -0
- package/dist/plugin-ui/translation-ns.js +1 -0
- package/dist/plugin-ui/tsconfig.json +18 -0
- package/dist/plugin-ui/zeus/const.d.ts +6 -0
- package/dist/plugin-ui/zeus/const.js +3854 -0
- package/dist/plugin-ui/zeus/index.d.ts +19816 -0
- package/dist/plugin-ui/zeus/index.js +1093 -0
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
- package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// /* eslint-disable */
|
|
3
|
+
// import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
4
|
+
// import gql from 'graphql-tag';
|
|
5
|
+
// import {
|
|
6
|
+
// ValueTypes,
|
|
7
|
+
// GenericOperation,
|
|
8
|
+
// OperationOptions,
|
|
9
|
+
// GraphQLTypes,
|
|
10
|
+
// InputType,
|
|
11
|
+
// ScalarDefinition,
|
|
12
|
+
// ThunderGraphQLOptions,
|
|
13
|
+
// Zeus,
|
|
14
|
+
// ExtractVariables,
|
|
15
|
+
// } from './';
|
|
16
|
+
// import { Ops } from './const';
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
// export const typedGql =
|
|
19
|
+
// <O extends keyof typeof Ops, SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(
|
|
20
|
+
// operation: O,
|
|
21
|
+
// graphqlOptions?: ThunderGraphQLOptions<SCLR>,
|
|
22
|
+
// ) =>
|
|
23
|
+
// <Z extends ValueTypes[R]>(o: Z & {
|
|
24
|
+
// [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never;
|
|
25
|
+
// }, ops?: OperationOptions) => {
|
|
26
|
+
// const str = Zeus(operation, o, {
|
|
27
|
+
// operationOptions: ops,
|
|
28
|
+
// scalars: graphqlOptions?.scalars,
|
|
29
|
+
// });
|
|
30
|
+
// return gql(str) as TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
|
31
|
+
// };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type FacetValueData = {
|
|
3
|
+
id: string;
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
hexColor?: string;
|
|
7
|
+
imagePreview?: string;
|
|
8
|
+
};
|
|
9
|
+
export type Data = {
|
|
10
|
+
id: string;
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
usedForProductCreations: boolean;
|
|
14
|
+
facetValues: FacetValueData[];
|
|
15
|
+
};
|
|
16
|
+
export declare const AttributesInput: React.FC;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCustomFields } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { FacetValues } from "./FacetValues";
|
|
4
|
+
export const AttributesInput = () => {
|
|
5
|
+
const { disabled, setValue, value, additionalData } = useCustomFields();
|
|
6
|
+
const parsedValues = useMemo(() => {
|
|
7
|
+
if (!value || value === "")
|
|
8
|
+
return undefined;
|
|
9
|
+
try {
|
|
10
|
+
const parsed = JSON.parse(value);
|
|
11
|
+
if (Object.keys(parsed).length === 0)
|
|
12
|
+
return undefined;
|
|
13
|
+
return parsed;
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
}, [value]);
|
|
19
|
+
return (React.createElement("div", { className: "flex flex-col gap-4" },
|
|
20
|
+
React.createElement(FacetValues, { disabled: disabled, value: value, setValue: setValue, additionalData: additionalData }),
|
|
21
|
+
React.createElement("div", { className: "flex flex-col gap-2" }, parsedValues ? (Object.entries(parsedValues).map(([key, value]) => (React.createElement("div", { key: key, className: "flex gap-2" },
|
|
22
|
+
React.createElement("span", { className: "capitalize" }, key),
|
|
23
|
+
React.createElement("span", { className: "capitalize" }, value))))) : (React.createElement("span", null, "There are no attributes")))));
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface FacetsAccordionsProps {
|
|
3
|
+
setValue: (value: string) => void;
|
|
4
|
+
value?: string | null;
|
|
5
|
+
additionalData?: Record<string, unknown>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const FacetValues: React.FC<FacetsAccordionsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, Input, Label, useLazyQuery, } from "@deenruv/react-ui-devkit";
|
|
4
|
+
import { translationNS } from "../translation-ns";
|
|
5
|
+
import { ProductFacetValuesQuery } from "../graphql/queries";
|
|
6
|
+
import { GroupValue } from "./GroupValue";
|
|
7
|
+
import { Trash } from "lucide-react";
|
|
8
|
+
import { v4 as uuidv4 } from "uuid";
|
|
9
|
+
const match = (facetValues) => {
|
|
10
|
+
if (!facetValues)
|
|
11
|
+
return [];
|
|
12
|
+
const facets = facetValues.reduce((acc, item) => {
|
|
13
|
+
const facet = acc.find((f) => f.id === item.facet.id);
|
|
14
|
+
const newItem = {
|
|
15
|
+
code: item.code,
|
|
16
|
+
id: item.id,
|
|
17
|
+
name: item.name,
|
|
18
|
+
hexColor: item.customFields?.hexColor || "",
|
|
19
|
+
imagePreview: item.customFields?.image?.preview ||
|
|
20
|
+
"",
|
|
21
|
+
};
|
|
22
|
+
if (facet) {
|
|
23
|
+
facet.facetValues.push(newItem);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
acc.push({
|
|
27
|
+
id: item.facet.id,
|
|
28
|
+
code: item.facet.code,
|
|
29
|
+
name: item.facet.name,
|
|
30
|
+
usedForProductCreations: !!item.facet.customFields?.usedForProductCreations,
|
|
31
|
+
facetValues: [newItem],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return acc;
|
|
35
|
+
}, []);
|
|
36
|
+
return facets;
|
|
37
|
+
};
|
|
38
|
+
export const FacetValues = ({ disabled, additionalData, setValue, value, }) => {
|
|
39
|
+
const { t } = useTranslation(translationNS);
|
|
40
|
+
const [fetchFacetValues, { loading }] = useLazyQuery(ProductFacetValuesQuery);
|
|
41
|
+
const id = additionalData?.product &&
|
|
42
|
+
typeof additionalData.product === "object" &&
|
|
43
|
+
"id" in additionalData.product
|
|
44
|
+
? additionalData.product.id
|
|
45
|
+
: null;
|
|
46
|
+
const [facets, setFacets] = useState([]);
|
|
47
|
+
const currentValue = useMemo(() => value ? JSON.parse(value) : {}, [value]);
|
|
48
|
+
const [defined, setDefined] = useState({});
|
|
49
|
+
const [custom, setCustom] = useState([]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!id || facets.length)
|
|
52
|
+
return;
|
|
53
|
+
fetchFacetValues({ productId: id })
|
|
54
|
+
.then((resp) => {
|
|
55
|
+
setFacets(match(resp.product?.facetValues));
|
|
56
|
+
})
|
|
57
|
+
.catch();
|
|
58
|
+
}, [id]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (!facets)
|
|
61
|
+
return;
|
|
62
|
+
const defined = Object.keys(currentValue)
|
|
63
|
+
.filter((i) => facets.some((a) => a.code === i))
|
|
64
|
+
.reduce((acc, val) => ({ ...acc, [val]: currentValue[val] }), {});
|
|
65
|
+
setDefined(defined);
|
|
66
|
+
const custom = Object.keys(currentValue)
|
|
67
|
+
.filter((i) => !facets.some((a) => a.code === i))
|
|
68
|
+
.map((i) => ({ id: uuidv4(), value: currentValue[i], key: i }));
|
|
69
|
+
setCustom(custom);
|
|
70
|
+
}, [facets, currentValue]);
|
|
71
|
+
const onCustomChange = (id, key, value) => {
|
|
72
|
+
if (!id)
|
|
73
|
+
return;
|
|
74
|
+
const newCustomValues = custom.filter((i) => i.id !== id);
|
|
75
|
+
if (key && value) {
|
|
76
|
+
newCustomValues.push({ id, key, value });
|
|
77
|
+
}
|
|
78
|
+
setCustom(newCustomValues);
|
|
79
|
+
setValue(JSON.stringify({
|
|
80
|
+
...defined,
|
|
81
|
+
...newCustomValues.reduce((acc, { key, value }) => ({ ...acc, [key]: value }), {}),
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
const onDefinedChange = (key, value) => {
|
|
85
|
+
const newDefined = { ...defined, [key]: value };
|
|
86
|
+
setDefined(newDefined);
|
|
87
|
+
setValue(JSON.stringify({
|
|
88
|
+
...newDefined,
|
|
89
|
+
...custom.reduce((acc, { key, value }) => ({ ...acc, [key]: value }), {}),
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
92
|
+
if (!facets.length)
|
|
93
|
+
return null;
|
|
94
|
+
return (React.createElement(Dialog, null,
|
|
95
|
+
React.createElement(DialogTrigger, { asChild: true },
|
|
96
|
+
React.createElement(Button, { disabled: disabled, variant: "outline" }, t("custom.editAttributes"))),
|
|
97
|
+
React.createElement(DialogContent, { className: "w-[800px] max-w-[800px]" },
|
|
98
|
+
React.createElement(DialogHeader, null,
|
|
99
|
+
React.createElement(DialogTitle, null, t("custom.editAttributes")),
|
|
100
|
+
React.createElement(DialogDescription, null, t("custom.editAttributesDescription"))),
|
|
101
|
+
React.createElement("div", { className: "flex h-full flex-col overflow-auto" },
|
|
102
|
+
React.createElement("div", { className: "flex items-center justify-between gap-4 pb-2 " },
|
|
103
|
+
React.createElement(Button, { variant: "secondary", className: "w-min", onClick: () => onCustomChange(uuidv4()) }, t("custom.addCustomKey")),
|
|
104
|
+
React.createElement(Label, null, t("custom.customAdditional", { value: custom.length }))),
|
|
105
|
+
React.createElement("div", { className: "grow overflow-y-auto py-2 pr-4" },
|
|
106
|
+
React.createElement("div", { className: "flex flex-col gap-4" },
|
|
107
|
+
React.createElement("div", { className: "flex flex-col gap-4 border-b pb-4 " }, custom.map((i) => (React.createElement("div", { className: "flex items-center justify-start gap-4 ", key: i.id },
|
|
108
|
+
React.createElement(Input, { label: t("custom.customKey"), value: i.key, onChange: (e) => {
|
|
109
|
+
onCustomChange(i.id, e.currentTarget.value, i.value);
|
|
110
|
+
} }),
|
|
111
|
+
React.createElement(Input, { label: t("custom.customValue"), value: i.value, onChange: (e) => {
|
|
112
|
+
onCustomChange(i.id, i.key, e.currentTarget.value);
|
|
113
|
+
} }),
|
|
114
|
+
React.createElement(Trash, { className: "mt-[20px] shrink-0 cursor-pointer text-red-600", onClick: () => {
|
|
115
|
+
onCustomChange(i.id);
|
|
116
|
+
} }))))),
|
|
117
|
+
facets.map((facet) => {
|
|
118
|
+
const isCustom = !facet.facetValues.some((i) => i.code === defined[facet.code]);
|
|
119
|
+
return (React.createElement("div", { key: facet.id, className: "border-b pb-2" },
|
|
120
|
+
React.createElement("div", { className: "mb-2 font-bold" }, facet.name),
|
|
121
|
+
React.createElement("div", { className: "grid grid-cols-4 items-center gap-2" }, facet.facetValues.map((value) => (React.createElement(GroupValue, { key: value.id, entry: value, isValueSelected: defined[facet.code] === value.code, handleFacetValueSelect: () => onDefinedChange(facet.code, value.code) })))),
|
|
122
|
+
React.createElement("div", { className: "my-2 flex items-center gap-2" },
|
|
123
|
+
React.createElement("span", { className: "shrink-0" }, t("custom.customLabel")),
|
|
124
|
+
React.createElement(Input, { placeholder: t("custom.customPlaceholder"), value: isCustom ? defined[facet.code] : "", onChange: (e) => onDefinedChange(facet.code, e.currentTarget.value) }))));
|
|
125
|
+
})))))));
|
|
126
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FacetValueData } from "./AttributesInput";
|
|
3
|
+
export declare const GroupValue: ({ entry, handleFacetValueSelect, isValueSelected, }: {
|
|
4
|
+
entry: FacetValueData;
|
|
5
|
+
handleFacetValueSelect: () => void;
|
|
6
|
+
isValueSelected: boolean;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkbox, HoverCard, HoverCardContent, HoverCardTrigger, cn, } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export const GroupValue = ({ entry, handleFacetValueSelect, isValueSelected, }) => {
|
|
4
|
+
return (React.createElement("div", { className: "flex items-center gap-2 px-1" },
|
|
5
|
+
React.createElement(Checkbox, { id: entry.id, checked: isValueSelected, onCheckedChange: handleFacetValueSelect }),
|
|
6
|
+
React.createElement("label", { htmlFor: entry.id },
|
|
7
|
+
React.createElement(HoverCard, { openDelay: 300 },
|
|
8
|
+
React.createElement(HoverCardTrigger, { asChild: true },
|
|
9
|
+
React.createElement("div", { className: "flex items-center gap-2" },
|
|
10
|
+
entry.imagePreview ? (React.createElement("img", { className: "size-5 rounded-full", src: entry.imagePreview || "placeholder" })) : (React.createElement("div", { className: "size-5 shrink-0 rounded-full border border-[rgba(0,0,0,0.4)]", style: { backgroundColor: entry?.hexColor || "transparent" } })),
|
|
11
|
+
React.createElement("div", { className: "" }, entry.name))),
|
|
12
|
+
React.createElement(HoverCardContent, { className: cn("w-80 p-0", !entry.imagePreview && "h-40 w-40") }, entry?.imagePreview ? (React.createElement("img", { className: "rounded object-cover", src: entry.imagePreview || "placeholder" })) : (React.createElement("div", { className: "size-40 rounded", style: { backgroundColor: entry?.hexColor || "transparent" } })))))));
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./selectors";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./selectors";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const ProductFacetValuesQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
2
|
+
product?: {
|
|
3
|
+
slug: string;
|
|
4
|
+
facetValues: {
|
|
5
|
+
id: string;
|
|
6
|
+
customFields?: {
|
|
7
|
+
hexColor?: string | null | undefined;
|
|
8
|
+
image: never;
|
|
9
|
+
} | undefined;
|
|
10
|
+
name: string;
|
|
11
|
+
code: string;
|
|
12
|
+
facet: {
|
|
13
|
+
id: string;
|
|
14
|
+
customFields?: {
|
|
15
|
+
usedForProductCreations?: boolean | null | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
name: string;
|
|
18
|
+
code: string;
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
} | undefined;
|
|
22
|
+
}, {} & {
|
|
23
|
+
productId: {};
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { typedGql } from "../zeus/typedDocumentNode";
|
|
2
|
+
import { $ } from "../zeus";
|
|
3
|
+
import { scalars } from "@deenruv/admin-types";
|
|
4
|
+
import { ProductFacetValueSelector } from "./selectors";
|
|
5
|
+
export const ProductFacetValuesQuery = typedGql("query", { scalars })({
|
|
6
|
+
product: [{ id: $("productId", "ID!") }, ProductFacetValueSelector],
|
|
7
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { FromSelector } from "../zeus";
|
|
2
|
+
declare const FacetSelector: {
|
|
3
|
+
id: true;
|
|
4
|
+
name: true;
|
|
5
|
+
code: true;
|
|
6
|
+
customFields: {
|
|
7
|
+
usedForProductCreations: true;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const FacetValueSelector: {
|
|
11
|
+
id: true;
|
|
12
|
+
name: true;
|
|
13
|
+
code: true;
|
|
14
|
+
customFields: {
|
|
15
|
+
hexColor: true;
|
|
16
|
+
image: {
|
|
17
|
+
preview: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
facet: {
|
|
21
|
+
id: true;
|
|
22
|
+
name: true;
|
|
23
|
+
code: true;
|
|
24
|
+
customFields: {
|
|
25
|
+
usedForProductCreations: true;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const ProductFacetValueSelector: {
|
|
30
|
+
slug: true;
|
|
31
|
+
facetValues: {
|
|
32
|
+
id: true;
|
|
33
|
+
name: true;
|
|
34
|
+
code: true;
|
|
35
|
+
customFields: {
|
|
36
|
+
hexColor: true;
|
|
37
|
+
image: {
|
|
38
|
+
preview: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
facet: {
|
|
42
|
+
id: true;
|
|
43
|
+
name: true;
|
|
44
|
+
code: true;
|
|
45
|
+
customFields: {
|
|
46
|
+
usedForProductCreations: true;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type ProductFacetValueType = FromSelector<typeof ProductFacetValueSelector, "Product">;
|
|
52
|
+
export type FacetValueType = FromSelector<typeof FacetValueSelector, "FacetValue">;
|
|
53
|
+
export type FacetType = FromSelector<typeof FacetSelector, "Facet">;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Selector } from "../zeus";
|
|
2
|
+
const FacetSelector = Selector("Facet")({
|
|
3
|
+
id: true,
|
|
4
|
+
name: true,
|
|
5
|
+
code: true,
|
|
6
|
+
customFields: {
|
|
7
|
+
usedForProductCreations: true,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
const FacetValueSelector = Selector("FacetValue")({
|
|
11
|
+
id: true,
|
|
12
|
+
name: true,
|
|
13
|
+
code: true,
|
|
14
|
+
customFields: {
|
|
15
|
+
hexColor: true,
|
|
16
|
+
image: {
|
|
17
|
+
preview: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
facet: FacetSelector,
|
|
21
|
+
});
|
|
22
|
+
export const ProductFacetValueSelector = Selector("Product")({
|
|
23
|
+
slug: true,
|
|
24
|
+
facetValues: FacetValueSelector,
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OrderLineAttributesUiPlugin: import("@deenruv/react-ui-devkit").DeenruvUIPlugin<Record<string, any>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createDeenruvUIPlugin } from "@deenruv/react-ui-devkit";
|
|
2
|
+
import pl from "./locales/pl";
|
|
3
|
+
import en from "./locales/en";
|
|
4
|
+
import { translationNS } from "./translation-ns";
|
|
5
|
+
import { AttributesInput } from "./components/AttributesInput";
|
|
6
|
+
export const OrderLineAttributesUiPlugin = createDeenruvUIPlugin({
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
name: "Order Line Attributes",
|
|
9
|
+
inputs: [{ id: "attributes-input", component: AttributesInput }],
|
|
10
|
+
translations: { ns: translationNS, data: { en, pl } },
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"custom": {
|
|
3
|
+
"customLabel": "Custom value",
|
|
4
|
+
"customPlaceholder": "Value",
|
|
5
|
+
"addCustomKey": "Add custom attribute",
|
|
6
|
+
"customKey": "Key",
|
|
7
|
+
"customValue": "Value",
|
|
8
|
+
"customAdditional": "Additional custom attributes: {{value}}",
|
|
9
|
+
"editAttributes": "Edit attributes",
|
|
10
|
+
"editAttributesDescription": "Edit custom attributes"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
custom: {
|
|
3
|
+
customLabel: string;
|
|
4
|
+
customPlaceholder: string;
|
|
5
|
+
addCustomKey: string;
|
|
6
|
+
customKey: string;
|
|
7
|
+
customValue: string;
|
|
8
|
+
customAdditional: string;
|
|
9
|
+
editAttributes: string;
|
|
10
|
+
editAttributesDescription: string;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"custom": {
|
|
3
|
+
"customLabel": "Wartość niestandardowa",
|
|
4
|
+
"customPlaceholder": "Wartość",
|
|
5
|
+
"addCustomKey": "Dodaj atrybut niestandardowy",
|
|
6
|
+
"customKey": "Klucz",
|
|
7
|
+
"customValue": "Wartość",
|
|
8
|
+
"customAdditional": "Dodatkowe atrybuty niestandardowe: {{value}}",
|
|
9
|
+
"editAttributes": "Edytuj atrybuty",
|
|
10
|
+
"editAttributesDescription": "Edytuj atrybuty niestandardowe"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
custom: {
|
|
3
|
+
customLabel: string;
|
|
4
|
+
customPlaceholder: string;
|
|
5
|
+
addCustomKey: string;
|
|
6
|
+
customKey: string;
|
|
7
|
+
customValue: string;
|
|
8
|
+
customAdditional: string;
|
|
9
|
+
editAttributes: string;
|
|
10
|
+
editAttributesDescription: string;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const translationNS: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const translationNS = Symbol("order-line-attributes-plugin").toString();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "ESNext",
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"jsx": "react",
|
|
7
|
+
"outDir": "../../dist/plugin-ui",
|
|
8
|
+
"importHelpers": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"allowSyntheticDefaultImports": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["./**/*.tsx", "./**/*.json", "./**/*.ts"]
|
|
18
|
+
}
|