@addsign/moje-agenda-shared-lib 2.0.65 → 2.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/Calendar-DWT4e7Th.js.map +1 -1
  2. package/dist/Combination-DmhTQmbL.js +996 -0
  3. package/dist/Combination-DmhTQmbL.js.map +1 -0
  4. package/dist/Dialog-3u5-ws89.js +424 -0
  5. package/dist/Dialog-3u5-ws89.js.map +1 -0
  6. package/dist/Dialog-CCrUyF91.js.map +1 -1
  7. package/dist/assets/style.css +0 -3
  8. package/dist/components/datatable/DataTableServer.js +254 -245
  9. package/dist/components/datatable/DataTableServer.js.map +1 -1
  10. package/dist/components/form/FileInputForm.d.ts +14 -0
  11. package/dist/components/form/FileInputForm.js +173 -0
  12. package/dist/components/form/FileInputForm.js.map +1 -0
  13. package/dist/components/form/FileInputFormMultiple.d.ts +16 -0
  14. package/dist/components/form/FileInputFormMultiple.js +240 -0
  15. package/dist/components/form/FileInputFormMultiple.js.map +1 -0
  16. package/dist/components/form/FileInputFull.d.ts +17 -0
  17. package/dist/components/form/FileInputFull.js +188 -0
  18. package/dist/components/form/FileInputFull.js.map +1 -0
  19. package/dist/components/form/FileInputFullMultiple.d.ts +19 -0
  20. package/dist/components/form/FileInputFullMultiple.js +226 -0
  21. package/dist/components/form/FileInputFullMultiple.js.map +1 -0
  22. package/dist/components/ui/Combobox.js.map +1 -1
  23. package/dist/components/ui/checkbox.js.map +1 -1
  24. package/dist/components/ui/command.js.map +1 -1
  25. package/dist/components/ui/multi-select.js +6 -3
  26. package/dist/components/ui/multi-select.js.map +1 -1
  27. package/dist/components/ui/radioGroup.js.map +1 -1
  28. package/dist/components/ui/toast.js.map +1 -1
  29. package/dist/handleErrors-B2be_Hgy.js +31615 -0
  30. package/dist/handleErrors-B2be_Hgy.js.map +1 -0
  31. package/dist/handleErrors-P52guX3U.js +32 -0
  32. package/dist/handleErrors-P52guX3U.js.map +1 -0
  33. package/dist/index-BikTN7j8.js +2266 -0
  34. package/dist/index-BikTN7j8.js.map +1 -0
  35. package/dist/main.d.ts +2 -0
  36. package/dist/main.js +34 -30
  37. package/dist/main.js.map +1 -1
  38. package/dist/popover-BLI2Jq-c.js +319 -0
  39. package/dist/popover-BLI2Jq-c.js.map +1 -0
  40. package/dist/popover-CcrzvSk7.js.map +1 -1
  41. package/dist/tslib.es6-e8r3nMQ9.js +172 -0
  42. package/dist/tslib.es6-e8r3nMQ9.js.map +1 -0
  43. package/dist/types.d.ts +1 -0
  44. package/dist/types.js.map +1 -1
  45. package/lib/components/datatable/DataTableServer.tsx +14 -23
  46. package/lib/components/form/FileInputForm.tsx +184 -0
  47. package/lib/components/form/FileInputFormMultiple.tsx +220 -0
  48. package/lib/components/ui/Calendar.tsx +0 -2
  49. package/lib/components/ui/Combobox.tsx +0 -2
  50. package/lib/components/ui/Dialog.tsx +0 -2
  51. package/lib/components/ui/checkbox.tsx +0 -2
  52. package/lib/components/ui/command.tsx +0 -2
  53. package/lib/components/ui/multi-select.tsx +10 -4
  54. package/lib/components/ui/popover.tsx +0 -2
  55. package/lib/components/ui/radioGroup.tsx +0 -2
  56. package/lib/components/ui/toast.tsx +0 -1
  57. package/lib/main.ts +2 -0
  58. package/lib/types.ts +1 -0
  59. package/package.json +1 -2
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { IAttachment } from '../../types';
3
+
4
+ export interface FileInputFormProps {
5
+ name: string;
6
+ value?: IAttachment | null;
7
+ onFileChanged: (file: IAttachment | null) => void;
8
+ description?: string;
9
+ disabled?: boolean;
10
+ attachmentName?: string;
11
+ attachmentType?: string;
12
+ }
13
+ declare const FileInputForm: React.FC<FileInputFormProps>;
14
+ export default FileInputForm;
@@ -0,0 +1,173 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect, useCallback } from "react";
3
+ import { u as useDropzone } from "../../index-qqHvAsVd.js";
4
+ import { d as MdInsertDriveFile, e as MdDeleteOutline } from "../../index-CrfjcbOs.js";
5
+ import { cn } from "../../utils/utils.js";
6
+ import "../../tailwind-l0sNRNKZ.js";
7
+ import "../ui/input.js";
8
+ import "../ui/multi-select.js";
9
+ import "../ui/select.js";
10
+ import "../../index.esm-ifS8v9eQ.js";
11
+ import "../../jspdf.plugin.autotable-7hp3hM-a.js";
12
+ import "../../contexts/FederationContext.js";
13
+ import { useFederationContext } from "../../contexts/useFederationContext.js";
14
+ import { handleErrors } from "../../utils/handleErrors.js";
15
+ import "../../Dialog-CCrUyF91.js";
16
+ import "../ui/ScrollArea.js";
17
+ import { useFormField } from "../ui/form.js";
18
+ import "../ui/radioGroup.js";
19
+ import "../ui/command.js";
20
+ import "../ui/Combobox.js";
21
+ import "../ui/tooltip.js";
22
+ import "../ui/separator.js";
23
+ import "../ui/textarea.js";
24
+ import "../ui/checkbox.js";
25
+ import "../ui/button.js";
26
+ import "../../Calendar-DWT4e7Th.js";
27
+ import "../ui/DateTimePicker.js";
28
+ import "../ui/DatePicker.js";
29
+ const MAX_FILE_SIZE = 1024 * 1024;
30
+ const FileInputForm = ({
31
+ value,
32
+ onFileChanged,
33
+ name,
34
+ description,
35
+ disabled,
36
+ attachmentName,
37
+ attachmentType
38
+ }) => {
39
+ const [fileData, setFileData] = useState(value || null);
40
+ const [isFocused, setIsFocused] = useState(false);
41
+ const federationContext = useFederationContext();
42
+ const { error } = useFormField();
43
+ const hasError = !!error;
44
+ useEffect(() => {
45
+ setFileData(value || null);
46
+ }, [value]);
47
+ const onDrop = useCallback(
48
+ async (acceptedFiles) => {
49
+ if (acceptedFiles.length > 0) {
50
+ const file = acceptedFiles[0];
51
+ if (file.size > MAX_FILE_SIZE) {
52
+ federationContext.emitter.emit("message", {
53
+ title: "Velikost souboru byla překročena",
54
+ message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,
55
+ classes: "bg-danger ",
56
+ timeout: 0,
57
+ type: "error"
58
+ });
59
+ return;
60
+ }
61
+ const formData = new FormData();
62
+ const dataObject = {
63
+ ...attachmentName && { attachmentName },
64
+ ...attachmentType && { attachmentType }
65
+ };
66
+ formData.append(
67
+ "data",
68
+ new Blob([JSON.stringify(dataObject)], { type: "application/json" })
69
+ );
70
+ formData.append("file", file);
71
+ try {
72
+ const response = await federationContext.apiClient.post(
73
+ "/files/upload",
74
+ formData,
75
+ {
76
+ headers: {
77
+ "Content-Type": "multipart/form-data"
78
+ }
79
+ }
80
+ );
81
+ const uploadedFile = response.data;
82
+ setFileData(uploadedFile);
83
+ onFileChanged(uploadedFile);
84
+ setIsFocused(false);
85
+ } catch (error2) {
86
+ handleErrors(error2, federationContext.emitter);
87
+ console.error("There was an error!", error2);
88
+ }
89
+ }
90
+ },
91
+ [
92
+ federationContext.apiClient,
93
+ federationContext.emitter,
94
+ onFileChanged,
95
+ attachmentName,
96
+ attachmentType
97
+ ]
98
+ );
99
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
100
+ onDrop,
101
+ disabled,
102
+ multiple: false
103
+ });
104
+ const handleRemove = () => {
105
+ setFileData(null);
106
+ onFileChanged(null);
107
+ };
108
+ return /* @__PURE__ */ jsxs("div", { className: "w-full min-h-30 flex-col justify-start items-start gap-1.5 inline-flex sharedLibrary", children: [
109
+ /* @__PURE__ */ jsx("div", { className: "self-stretch flex-col justify-start items-start gap-1.5 flex", children: /* @__PURE__ */ jsx(
110
+ "div",
111
+ {
112
+ className: cn(
113
+ `self-stretch px-2 py-2 rounded-lg justify-start items-center gap-2 inline-flex outline-none border`,
114
+ isFocused && !hasError && "outline-4 outline-indigo-200 outline-offset-0 border-indigo-300",
115
+ hasError && "outline-4 outline-red-200 outline-offset-0 border-none",
116
+ !isFocused && hasError && "border-red-200 ",
117
+ disabled ? "bg-gray-100" : "bg-transparent"
118
+ ),
119
+ onFocus: () => setIsFocused(true),
120
+ onBlur: () => setIsFocused(false),
121
+ children: /* @__PURE__ */ jsx("div", { className: "flex relative grow shrink basis-0 min-h-5 lg:min-h-[32px] justify-start items-stretch gap-2 max-w-full ", children: !fileData ? /* @__PURE__ */ jsxs(
122
+ "div",
123
+ {
124
+ ...getRootProps(),
125
+ className: `w-full p-4 border-dashed border-2 rounded-lg text-center ${isDragActive ? "border-indigo-300 bg-indigo-50" : "border-gray-300"}`,
126
+ children: [
127
+ /* @__PURE__ */ jsx("input", { ...getInputProps(), id: name }),
128
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: isDragActive ? "Sem přetáhněte soubor" : "Klikněte pro nahrání, nebo nahrajte přetažením souboru" })
129
+ ]
130
+ }
131
+ ) : /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
132
+ /* @__PURE__ */ jsxs("div", { className: " flex", children: [
133
+ /* @__PURE__ */ jsx(MdInsertDriveFile, { style: { fontSize: "2rem" } }),
134
+ /* @__PURE__ */ jsx(
135
+ "a",
136
+ {
137
+ href: `/api/files/download/${fileData.id}`,
138
+ className: "pl-2 text-left underline text-primary",
139
+ target: "_blank",
140
+ children: fileData.filename
141
+ }
142
+ )
143
+ ] }),
144
+ !disabled && /* @__PURE__ */ jsx(
145
+ "div",
146
+ {
147
+ onClick: handleRemove,
148
+ className: "text-gray-600 cursor-pointer hover:text-primary hover:bg-gray-200 rounded-full ml-4",
149
+ children: /* @__PURE__ */ jsx(
150
+ MdDeleteOutline,
151
+ {
152
+ style: { fontSize: "1.5rem", margin: "15px" }
153
+ }
154
+ )
155
+ }
156
+ )
157
+ ] }) })
158
+ }
159
+ ) }),
160
+ description && /* @__PURE__ */ jsx(
161
+ "div",
162
+ {
163
+ className: "HintText self-stretch text-slate-600 text-sm font-normal leading-tight",
164
+ id: name + ":description",
165
+ children: description
166
+ }
167
+ )
168
+ ] });
169
+ };
170
+ export {
171
+ FileInputForm as default
172
+ };
173
+ //# sourceMappingURL=FileInputForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInputForm.js","sources":["../../../lib/components/form/FileInputForm.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from \"react\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { MdDeleteOutline, MdInsertDriveFile } from \"react-icons/md\";\r\nimport { AxiosError } from \"axios\";\r\nimport { cn } from \"../../utils/utils\";\r\nimport { IAttachment } from \"../../types\";\r\nimport { handleErrors, useFederationContext, useFormField } from \"../../main\";\r\n\r\nexport interface FileInputFormProps {\r\n name: string;\r\n value?: IAttachment | null;\r\n onFileChanged: (file: IAttachment | null) => void;\r\n description?: string;\r\n disabled?: boolean;\r\n attachmentName?: string;\r\n attachmentType?: string;\r\n}\r\n\r\nconst MAX_FILE_SIZE = 1024 * 1024; // 1MB\r\n\r\nconst FileInputForm: React.FC<FileInputFormProps> = ({\r\n value,\r\n onFileChanged,\r\n name,\r\n description,\r\n disabled,\r\n attachmentName,\r\n attachmentType,\r\n}) => {\r\n const [fileData, setFileData] = useState<IAttachment | null>(value || null);\r\n const [isFocused, setIsFocused] = useState(false);\r\n\r\n const federationContext = useFederationContext();\r\n const { error } = useFormField();\r\n const hasError = !!error;\r\n useEffect(() => {\r\n setFileData(value || null);\r\n }, [value]);\r\n const onDrop = useCallback(\r\n async (acceptedFiles: File[]) => {\r\n if (acceptedFiles.length > 0) {\r\n const file = acceptedFiles[0];\r\n\r\n if (file.size > MAX_FILE_SIZE) {\r\n // Handle the case when the file size is exceeded\r\n federationContext.emitter.emit(\"message\", {\r\n title: \"Velikost souboru byla překročena\",\r\n message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,\r\n classes: \"bg-danger \",\r\n timeout: 0,\r\n type: \"error\",\r\n });\r\n return;\r\n }\r\n\r\n const formData = new FormData();\r\n\r\n // Add the JSON data object\r\n const dataObject = {\r\n ...(attachmentName && { attachmentName }),\r\n ...(attachmentType && { attachmentType }),\r\n };\r\n\r\n formData.append(\r\n \"data\",\r\n new Blob([JSON.stringify(dataObject)], { type: \"application/json\" })\r\n );\r\n formData.append(\"file\", file);\r\n\r\n try {\r\n const response = await federationContext.apiClient.post<IAttachment>(\r\n \"/files/upload\",\r\n formData,\r\n {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n }\r\n );\r\n const uploadedFile = response.data;\r\n setFileData(uploadedFile);\r\n onFileChanged(uploadedFile);\r\n setIsFocused(false);\r\n } catch (error) {\r\n handleErrors(error as AxiosError, federationContext.emitter);\r\n console.error(\"There was an error!\", error);\r\n }\r\n }\r\n },\r\n [\r\n federationContext.apiClient,\r\n federationContext.emitter,\r\n onFileChanged,\r\n attachmentName,\r\n attachmentType,\r\n ]\r\n );\r\n\r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDrop,\r\n disabled,\r\n multiple: false,\r\n });\r\n\r\n const handleRemove = () => {\r\n setFileData(null);\r\n onFileChanged(null);\r\n };\r\n\r\n return (\r\n <div className=\"w-full min-h-30 flex-col justify-start items-start gap-1.5 inline-flex sharedLibrary\">\r\n <div className=\"self-stretch flex-col justify-start items-start gap-1.5 flex\">\r\n <div\r\n className={cn(\r\n `self-stretch px-2 py-2 rounded-lg justify-start items-center gap-2 inline-flex outline-none border`,\r\n isFocused &&\r\n !hasError &&\r\n \"outline-4 outline-indigo-200 outline-offset-0 border-indigo-300\",\r\n\r\n hasError &&\r\n \"outline-4 outline-red-200 outline-offset-0 border-none\",\r\n !isFocused && hasError && \"border-red-200 \",\r\n disabled ? \"bg-gray-100\" : \"bg-transparent\"\r\n )}\r\n onFocus={() => setIsFocused(true)}\r\n onBlur={() => setIsFocused(false)}\r\n >\r\n <div className=\"flex relative grow shrink basis-0 min-h-5 lg:min-h-[32px] justify-start items-stretch gap-2 max-w-full \">\r\n {!fileData ? (\r\n <div\r\n {...getRootProps()}\r\n className={`w-full p-4 border-dashed border-2 rounded-lg text-center ${\r\n isDragActive\r\n ? \"border-indigo-300 bg-indigo-50\"\r\n : \"border-gray-300\"\r\n }`}\r\n >\r\n <input {...getInputProps()} id={name} />\r\n <p className=\"text-gray-500\">\r\n {isDragActive\r\n ? \"Sem přetáhněte soubor\"\r\n : \"Klikněte pro nahrání, nebo nahrajte přetažením souboru\"}\r\n </p>\r\n </div>\r\n ) : (\r\n <div className=\"w-full flex items-center justify-between\">\r\n <div className=\" flex\">\r\n <MdInsertDriveFile style={{ fontSize: \"2rem\" }} />\r\n <a\r\n href={`/api/files/download/${fileData.id}`}\r\n className=\"pl-2 text-left underline text-primary\"\r\n target=\"_blank\"\r\n >\r\n {fileData.filename}\r\n </a>\r\n </div>\r\n {!disabled && (\r\n <div\r\n onClick={handleRemove}\r\n className=\"text-gray-600 cursor-pointer hover:text-primary hover:bg-gray-200 rounded-full ml-4\"\r\n >\r\n <MdDeleteOutline\r\n style={{ fontSize: \"1.5rem\", margin: \"15px\" }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n {description && (\r\n <div\r\n className=\"HintText self-stretch text-slate-600 text-sm font-normal leading-tight\"\r\n id={name + \":description\"}\r\n >\r\n {description}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default FileInputForm;\r\n"],"names":["error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,gBAAgB,OAAO;AAE7B,MAAM,gBAA8C,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAA6B,SAAS,IAAI;AAC1E,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,QAAM,oBAAoB;AACpB,QAAA,EAAE,UAAU;AACZ,QAAA,WAAW,CAAC,CAAC;AACnB,YAAU,MAAM;AACd,gBAAY,SAAS,IAAI;AAAA,EAAA,GACxB,CAAC,KAAK,CAAC;AACV,QAAM,SAAS;AAAA,IACb,OAAO,kBAA0B;AAC3B,UAAA,cAAc,SAAS,GAAG;AACtB,cAAA,OAAO,cAAc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AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,IAAI,OAAO;AAAA,QAEV,UAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { IAttachment } from '../../types';
3
+
4
+ interface FileInputFormMultipleProps {
5
+ name: string;
6
+ value?: IAttachment[] | null;
7
+ onFilesChanged: (files: IAttachment[]) => void;
8
+ description?: string;
9
+ disabled?: boolean;
10
+ initialFilesReadOnly?: boolean;
11
+ initialFileIds?: number[];
12
+ attachmentName?: string;
13
+ attachmentType?: string;
14
+ }
15
+ declare const FileInputFormMultiple: React.FC<FileInputFormMultipleProps>;
16
+ export default FileInputFormMultiple;
@@ -0,0 +1,240 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect, useCallback } from "react";
3
+ import { u as useDropzone } from "../../index-qqHvAsVd.js";
4
+ import { d as MdInsertDriveFile, e as MdDeleteOutline } from "../../index-CrfjcbOs.js";
5
+ import { cn } from "../../utils/utils.js";
6
+ import "../../tailwind-l0sNRNKZ.js";
7
+ import "../ui/input.js";
8
+ import "../ui/multi-select.js";
9
+ import "../ui/select.js";
10
+ import "../../index.esm-ifS8v9eQ.js";
11
+ import "../../jspdf.plugin.autotable-7hp3hM-a.js";
12
+ import "../../contexts/FederationContext.js";
13
+ import { useFederationContext } from "../../contexts/useFederationContext.js";
14
+ import "../../Dialog-CCrUyF91.js";
15
+ import "../ui/ScrollArea.js";
16
+ import { useFormField } from "../ui/form.js";
17
+ import "../ui/radioGroup.js";
18
+ import "../ui/command.js";
19
+ import "../ui/Combobox.js";
20
+ import "../ui/tooltip.js";
21
+ import "../ui/separator.js";
22
+ import "../ui/textarea.js";
23
+ import "../ui/checkbox.js";
24
+ import "../ui/button.js";
25
+ import "../../Calendar-DWT4e7Th.js";
26
+ import "../ui/DateTimePicker.js";
27
+ import "../ui/DatePicker.js";
28
+ const handleErrors = (error, emitter, customMessage) => {
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
30
+ let errmsgToDisplay = " " + (((_c = (_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.error) == null ? void 0 : _c.message) || error.message || "");
31
+ let errorTitle = "";
32
+ if (error.code == "ERR_NETWORK") {
33
+ errorTitle = "Síťová chyba";
34
+ errmsgToDisplay = errmsgToDisplay + " " + (/* @__PURE__ */ new Date()).toLocaleString();
35
+ } else if (error.code == "ERR_BAD_REQUEST") {
36
+ if (((_d = error.response) == null ? void 0 : _d.status) == 403) {
37
+ errorTitle = "Přístup zamítnut";
38
+ } else if (((_e = error.response) == null ? void 0 : _e.status) == 409) {
39
+ errorTitle = "Konflikt";
40
+ } else {
41
+ errorTitle = "Interní chyba aplikace";
42
+ }
43
+ errmsgToDisplay = (/* @__PURE__ */ new Date()).toLocaleString() + " (" + ((_f = error.response) == null ? void 0 : _f.status) + ") \n" + errmsgToDisplay;
44
+ }
45
+ console.error(error);
46
+ const bgColor = ((_g = error.response) == null ? void 0 : _g.status) && ((_h = error.response) == null ? void 0 : _h.status) >= 400 ? " bg-danger " : " bg-warning ";
47
+ const type = ((_i = error.response) == null ? void 0 : _i.status) && ((_j = error.response) == null ? void 0 : _j.status) >= 400 ? "error" : "warning";
48
+ emitter.emit("message", {
49
+ title: errorTitle,
50
+ message: errmsgToDisplay,
51
+ classes: bgColor || " bg-danger ",
52
+ timeout: 0,
53
+ type
54
+ });
55
+ };
56
+ const MAX_FILE_SIZE = 1024 * 1024;
57
+ const FileInputFormMultiple = ({
58
+ value,
59
+ onFilesChanged,
60
+ name,
61
+ description,
62
+ disabled,
63
+ initialFilesReadOnly = true,
64
+ initialFileIds,
65
+ attachmentName,
66
+ attachmentType
67
+ }) => {
68
+ const [fileDataList, setFileDataList] = useState(
69
+ (value == null ? void 0 : value.map((file) => ({
70
+ ...file,
71
+ readonly: initialFilesReadOnly && (initialFileIds == null ? void 0 : initialFileIds.includes(file.id))
72
+ }))) || []
73
+ );
74
+ const federationContext = useFederationContext();
75
+ const { error } = useFormField();
76
+ const hasError = !!error;
77
+ useEffect(() => {
78
+ if (!value || value.length === 0) {
79
+ setFileDataList([]);
80
+ return;
81
+ }
82
+ setFileDataList(
83
+ value.map((file) => ({
84
+ ...file,
85
+ readonly: initialFilesReadOnly && (initialFileIds == null ? void 0 : initialFileIds.includes(file.id))
86
+ }))
87
+ );
88
+ }, [value, initialFilesReadOnly, initialFileIds]);
89
+ const onDrop = useCallback(
90
+ async (acceptedFiles) => {
91
+ const uploadedFiles = await Promise.all(
92
+ acceptedFiles.map(async (file) => {
93
+ if (file.size > MAX_FILE_SIZE) {
94
+ federationContext.emitter.emit("message", {
95
+ title: "Velikost souboru byla překročena",
96
+ message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,
97
+ classes: "bg-danger ",
98
+ timeout: 0,
99
+ type: "error"
100
+ });
101
+ return null;
102
+ }
103
+ const formData = new FormData();
104
+ const dataObject = {
105
+ ...attachmentName && { attachmentName },
106
+ ...attachmentType && { attachmentType }
107
+ };
108
+ formData.append(
109
+ "data",
110
+ new Blob([JSON.stringify(dataObject)], { type: "application/json" })
111
+ );
112
+ formData.append("file", file);
113
+ try {
114
+ const response = await federationContext.apiClient.post(
115
+ "/files/upload",
116
+ formData,
117
+ {
118
+ headers: {
119
+ "Content-Type": "multipart/form-data"
120
+ }
121
+ }
122
+ );
123
+ return response.data;
124
+ } catch (error2) {
125
+ handleErrors(error2, federationContext.emitter);
126
+ console.error("There was an error!", error2);
127
+ return null;
128
+ }
129
+ })
130
+ );
131
+ const validFiles = uploadedFiles.filter(
132
+ (file) => file !== null
133
+ );
134
+ const updatedFileDataList = [...fileDataList, ...validFiles];
135
+ setFileDataList(updatedFileDataList);
136
+ onFilesChanged(updatedFileDataList);
137
+ },
138
+ [
139
+ federationContext,
140
+ fileDataList,
141
+ onFilesChanged,
142
+ attachmentName,
143
+ attachmentType
144
+ ]
145
+ );
146
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
147
+ onDrop,
148
+ disabled
149
+ });
150
+ const handleRemove = (fileId) => {
151
+ const updatedFileDataList = fileDataList.filter(
152
+ (file) => file.id !== fileId
153
+ );
154
+ setFileDataList(updatedFileDataList);
155
+ onFilesChanged(updatedFileDataList);
156
+ };
157
+ if (disabled === true && fileDataList.length === 0) {
158
+ return null;
159
+ }
160
+ return /* @__PURE__ */ jsxs(
161
+ "div",
162
+ {
163
+ className: "w-full min-h-30 flex-col justify-start items-start gap-1.5 inline-flex sharedLibrary",
164
+ "data-cy": "file-input-form-multiple-" + name,
165
+ children: [
166
+ /* @__PURE__ */ jsx("div", { className: "self-stretch flex-col justify-start items-start gap-1.5 flex", children: /* @__PURE__ */ jsxs(
167
+ "div",
168
+ {
169
+ className: cn(
170
+ `self-stretch px-3 py-2 rounded-lg justify-start items-center gap-2 outline-none border bg-transparent `,
171
+ hasError && "outline-4 outline-red-200 outline-offset-0 border-none ",
172
+ disabled ? "bg-gray-100" : "bg-transparent"
173
+ ),
174
+ children: [
175
+ !disabled && /* @__PURE__ */ jsxs(
176
+ "div",
177
+ {
178
+ ...getRootProps(),
179
+ className: `w-full p-4 border-dashed cursor-pointer
180
+ border-2 rounded-lg text-center hover:bg-gray-100
181
+ ${isDragActive ? "border-indigo-300 bg-indigo-50" : "border-gray-300"}`,
182
+ children: [
183
+ /* @__PURE__ */ jsx("input", { ...getInputProps(), id: name }),
184
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: isDragActive ? "Sem přetáhněte soubory" : "Klikněte pro nahrání, nebo nahrajte přetažením souborů" })
185
+ ]
186
+ }
187
+ ),
188
+ /* @__PURE__ */ jsx("div", { className: "w-full", children: fileDataList.map((file) => /* @__PURE__ */ jsxs(
189
+ "div",
190
+ {
191
+ className: "w-full flex items-center justify-between py-2 border-b ",
192
+ children: [
193
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center content-center", children: [
194
+ /* @__PURE__ */ jsx(MdInsertDriveFile, { style: { fontSize: "2rem" } }),
195
+ /* @__PURE__ */ jsx(
196
+ "a",
197
+ {
198
+ href: `/api/files/download/${file.id}`,
199
+ className: "pl-2 text-left underline text-primary",
200
+ target: "_blank",
201
+ children: file.filename
202
+ }
203
+ )
204
+ ] }),
205
+ !disabled && file.readonly !== true && /* @__PURE__ */ jsx(
206
+ "div",
207
+ {
208
+ onClick: () => handleRemove(file.id),
209
+ className: "text-gray-600 cursor-pointer hover:text-primary hover:bg-gray-200 rounded-full ml-4",
210
+ children: /* @__PURE__ */ jsx(
211
+ MdDeleteOutline,
212
+ {
213
+ style: { fontSize: "1.5rem", margin: "10px" }
214
+ }
215
+ )
216
+ }
217
+ )
218
+ ]
219
+ },
220
+ file.id
221
+ )) })
222
+ ]
223
+ }
224
+ ) }),
225
+ description && /* @__PURE__ */ jsx(
226
+ "div",
227
+ {
228
+ className: "HintText self-stretch text-slate-600 text-sm font-normal leading-tight",
229
+ id: name + ":description",
230
+ children: description
231
+ }
232
+ )
233
+ ]
234
+ }
235
+ );
236
+ };
237
+ export {
238
+ FileInputFormMultiple as default
239
+ };
240
+ //# sourceMappingURL=FileInputFormMultiple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInputFormMultiple.js","sources":["../../utils/handleErrors.js","../../../lib/components/form/FileInputFormMultiple.tsx"],"sourcesContent":["const handleErrors = (error, emitter, customMessage) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n let errmsgToDisplay = (customMessage || \"\") + \" \" + (((_c = (_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.error) == null ? void 0 : _c.message) || error.message || \"\");\n let errorTitle = \"\";\n if (error.code == \"ERR_NETWORK\") {\n errorTitle = \"Síťová chyba\";\n errmsgToDisplay = errmsgToDisplay + \" \" + (/* @__PURE__ */ new Date()).toLocaleString();\n } else if (error.code == \"ERR_BAD_REQUEST\") {\n if (((_d = error.response) == null ? void 0 : _d.status) == 403) {\n errorTitle = \"Přístup zamítnut\";\n } else if (((_e = error.response) == null ? void 0 : _e.status) == 409) {\n errorTitle = \"Konflikt\";\n } else {\n errorTitle = \"Interní chyba aplikace\";\n }\n errmsgToDisplay = (/* @__PURE__ */ new Date()).toLocaleString() + \" (\" + ((_f = error.response) == null ? void 0 : _f.status) + \") \\n\" + errmsgToDisplay;\n }\n console.error(error);\n const bgColor = ((_g = error.response) == null ? void 0 : _g.status) && ((_h = error.response) == null ? void 0 : _h.status) >= 400 ? \" bg-danger \" : \" bg-warning \";\n const type = ((_i = error.response) == null ? void 0 : _i.status) && ((_j = error.response) == null ? void 0 : _j.status) >= 400 ? \"error\" : \"warning\";\n emitter.emit(\"message\", {\n title: errorTitle,\n message: errmsgToDisplay,\n classes: bgColor || \" bg-danger \",\n timeout: 0,\n type\n });\n};\nexport {\n handleErrors\n};\n//# sourceMappingURL=handleErrors.js.map\n","import React, { useState, useCallback, useEffect } from \"react\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { MdDeleteOutline, MdInsertDriveFile } from \"react-icons/md\";\r\nimport { AxiosError } from \"axios\";\r\nimport { cn } from \"../../utils/utils\";\r\nimport { handleErrors } from \"@addsign/moje-agenda-shared-lib\";\r\nimport { IAttachment } from \"../../types\";\r\nimport { useFederationContext, useFormField } from \"../../main\";\r\n\r\ninterface FileInputFormMultipleProps {\r\n name: string;\r\n value?: IAttachment[] | null;\r\n onFilesChanged: (files: IAttachment[]) => void;\r\n description?: string;\r\n disabled?: boolean;\r\n initialFilesReadOnly?: boolean;\r\n initialFileIds?: number[];\r\n attachmentName?: string;\r\n attachmentType?: string;\r\n}\r\n\r\ninterface IAttachmentReadOnly extends IAttachment {\r\n readonly?: boolean;\r\n}\r\n\r\nconst MAX_FILE_SIZE = 1024 * 1024; // 1MB\r\n\r\nconst FileInputFormMultiple: React.FC<FileInputFormMultipleProps> = ({\r\n value,\r\n onFilesChanged,\r\n name,\r\n description,\r\n disabled,\r\n initialFilesReadOnly = true,\r\n initialFileIds,\r\n attachmentName,\r\n attachmentType,\r\n}) => {\r\n const [fileDataList, setFileDataList] = useState<IAttachmentReadOnly[]>(\r\n value?.map((file) => ({\r\n ...file,\r\n readonly: initialFilesReadOnly && initialFileIds?.includes(file.id),\r\n })) || []\r\n );\r\n\r\n const federationContext = useFederationContext();\r\n\r\n const { error } = useFormField();\r\n const hasError = !!error;\r\n useEffect(() => {\r\n if (!value || value.length === 0) {\r\n setFileDataList([]);\r\n return;\r\n }\r\n\r\n setFileDataList(\r\n value.map((file) => ({\r\n ...file,\r\n readonly: initialFilesReadOnly && initialFileIds?.includes(file.id),\r\n }))\r\n );\r\n }, [value, initialFilesReadOnly, initialFileIds]);\r\n\r\n const onDrop = useCallback(\r\n async (acceptedFiles: File[]) => {\r\n const uploadedFiles = await Promise.all(\r\n acceptedFiles.map(async (file) => {\r\n if (file.size > MAX_FILE_SIZE) {\r\n // Handle the case when the file size is exceeded\r\n federationContext.emitter.emit(\"message\", {\r\n title: \"Velikost souboru byla překročena\",\r\n message: `Maximální povolená velikost je ${MAX_FILE_SIZE / (1024 * 1024)} MB.`,\r\n classes: \"bg-danger \",\r\n timeout: 0,\r\n type: \"error\",\r\n });\r\n\r\n return null;\r\n }\r\n\r\n const formData = new FormData();\r\n\r\n // Add the JSON data object\r\n const dataObject = {\r\n ...(attachmentName && { attachmentName }),\r\n ...(attachmentType && { attachmentType }),\r\n };\r\n\r\n formData.append(\r\n \"data\",\r\n new Blob([JSON.stringify(dataObject)], { type: \"application/json\" })\r\n );\r\n formData.append(\"file\", file);\r\n\r\n try {\r\n const response =\r\n await federationContext.apiClient.post<IAttachment>(\r\n \"/files/upload\",\r\n formData,\r\n {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n }\r\n );\r\n return response.data;\r\n } catch (error) {\r\n handleErrors(error as AxiosError, federationContext.emitter);\r\n console.error(\"There was an error!\", error);\r\n return null;\r\n }\r\n })\r\n );\r\n\r\n const validFiles = uploadedFiles.filter(\r\n (file) => file !== null\r\n ) as IAttachment[];\r\n const updatedFileDataList = [...fileDataList, ...validFiles];\r\n setFileDataList(updatedFileDataList);\r\n onFilesChanged(updatedFileDataList);\r\n },\r\n [\r\n federationContext,\r\n fileDataList,\r\n onFilesChanged,\r\n attachmentName,\r\n attachmentType,\r\n ]\r\n );\r\n\r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDrop,\r\n disabled,\r\n });\r\n\r\n const handleRemove = (fileId: number) => {\r\n const updatedFileDataList = fileDataList.filter(\r\n (file) => file.id !== fileId\r\n );\r\n setFileDataList(updatedFileDataList);\r\n onFilesChanged(updatedFileDataList);\r\n };\r\n\r\n if (disabled === true && fileDataList.length === 0) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div\r\n className=\"w-full min-h-30 flex-col justify-start items-start gap-1.5 inline-flex sharedLibrary\"\r\n data-cy={\"file-input-form-multiple-\" + name}\r\n >\r\n <div className=\"self-stretch flex-col justify-start items-start gap-1.5 flex\">\r\n <div\r\n className={cn(\r\n `self-stretch px-3 py-2 rounded-lg justify-start items-center gap-2 outline-none border bg-transparent `,\r\n hasError &&\r\n \"outline-4 outline-red-200 outline-offset-0 border-none \",\r\n disabled ? \"bg-gray-100\" : \"bg-transparent\"\r\n )}\r\n >\r\n {!disabled && (\r\n <div\r\n {...getRootProps()}\r\n className={`w-full p-4 border-dashed cursor-pointer \r\n border-2 rounded-lg text-center hover:bg-gray-100\r\n ${isDragActive ? \"border-indigo-300 bg-indigo-50\" : \"border-gray-300\"}`}\r\n >\r\n <input {...getInputProps()} id={name} />\r\n <p className=\"text-gray-500\">\r\n {isDragActive\r\n ? \"Sem přetáhněte soubory\"\r\n : \"Klikněte pro nahrání, nebo nahrajte přetažením souborů\"}\r\n </p>\r\n </div>\r\n )}\r\n <div className=\"w-full\">\r\n {fileDataList.map((file) => (\r\n <div\r\n key={file.id}\r\n className=\"w-full flex items-center justify-between py-2 border-b \"\r\n >\r\n <div className=\"flex items-center content-center\">\r\n <MdInsertDriveFile style={{ fontSize: \"2rem\" }} />\r\n <a\r\n href={`/api/files/download/${file.id}`}\r\n className=\"pl-2 text-left underline text-primary\"\r\n target=\"_blank\"\r\n >\r\n {file.filename}\r\n </a>\r\n </div>\r\n {!disabled && file.readonly !== true && (\r\n <div\r\n onClick={() => handleRemove(file.id)}\r\n className=\"text-gray-600 cursor-pointer hover:text-primary hover:bg-gray-200 rounded-full ml-4\"\r\n >\r\n <MdDeleteOutline\r\n style={{ fontSize: \"1.5rem\", margin: \"10px\" }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n {description && (\r\n <div\r\n className=\"HintText self-stretch text-slate-600 text-sm font-normal leading-tight\"\r\n id={name + \":description\"}\r\n >\r\n {description}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default FileInputFormMultiple;\r\n"],"names":["error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,CAAC,OAAO,SAAS,kBAAkB;AACtD,MAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;AACxC,MAAI,kBAAoC,SAAe,MAAM,MAAM,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,SAAS,OAAO,SAAS,GAAG,UAAU,OAAO,SAAS,GAAG,YAAY,MAAM,WAAW;AACpM,MAAI,aAAa;AACjB,MAAI,MAAM,QAAQ,eAAe;AAC/B,iBAAa;AACb,sBAAkB,kBAAkB,OAAuB,oBAAI,KAAI,GAAI;EAC3E,WAAa,MAAM,QAAQ,mBAAmB;AAC1C,UAAM,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,WAAW,KAAK;AAC/D,mBAAa;AAAA,IACd,aAAY,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,WAAW,KAAK;AACtE,mBAAa;AAAA,IACnB,OAAW;AACL,mBAAa;AAAA,IACd;AACD,uBAAmC,oBAAI,KAAM,GAAE,eAAc,IAA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BAAA,GACF;AAAA,oBACC,CAAC,YAAY,KAAK,aAAa,QAC9B;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,SAAS,MAAM,aAAa,KAAK,EAAE;AAAA,wBACnC,WAAU;AAAA,wBAEV,UAAA;AAAA,0BAAC;AAAA,0BAAA;AAAA,4BACC,OAAO,EAAE,UAAU,UAAU,QAAQ,OAAO;AAAA,0BAAA;AAAA,wBAC9C;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBArBG,KAAK;AAAA,cAwBb,CAAA,GACH;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QACC,eACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,IAAI,OAAO;AAAA,YAEV,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { IAttachment } from '../../types';
3
+
4
+ export interface FileInputFullProps {
5
+ name: string;
6
+ label?: string;
7
+ value?: IAttachment | null;
8
+ onFileChanged: (file: IAttachment | null) => void;
9
+ required?: boolean;
10
+ description?: string;
11
+ disabled?: boolean;
12
+ attachmentName?: string;
13
+ attachmentType?: string;
14
+ hasError?: boolean;
15
+ }
16
+ declare const FileInputFull: React.FC<FileInputFullProps>;
17
+ export default FileInputFull;