@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.
- package/dist/Calendar-DWT4e7Th.js.map +1 -1
- package/dist/Combination-DmhTQmbL.js +996 -0
- package/dist/Combination-DmhTQmbL.js.map +1 -0
- package/dist/Dialog-3u5-ws89.js +424 -0
- package/dist/Dialog-3u5-ws89.js.map +1 -0
- package/dist/Dialog-CCrUyF91.js.map +1 -1
- package/dist/assets/style.css +0 -3
- package/dist/components/datatable/DataTableServer.js +254 -245
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/FileInputForm.d.ts +14 -0
- package/dist/components/form/FileInputForm.js +173 -0
- package/dist/components/form/FileInputForm.js.map +1 -0
- package/dist/components/form/FileInputFormMultiple.d.ts +16 -0
- package/dist/components/form/FileInputFormMultiple.js +240 -0
- package/dist/components/form/FileInputFormMultiple.js.map +1 -0
- package/dist/components/form/FileInputFull.d.ts +17 -0
- package/dist/components/form/FileInputFull.js +188 -0
- package/dist/components/form/FileInputFull.js.map +1 -0
- package/dist/components/form/FileInputFullMultiple.d.ts +19 -0
- package/dist/components/form/FileInputFullMultiple.js +226 -0
- package/dist/components/form/FileInputFullMultiple.js.map +1 -0
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/multi-select.js +6 -3
- package/dist/components/ui/multi-select.js.map +1 -1
- package/dist/components/ui/radioGroup.js.map +1 -1
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/handleErrors-B2be_Hgy.js +31615 -0
- package/dist/handleErrors-B2be_Hgy.js.map +1 -0
- package/dist/handleErrors-P52guX3U.js +32 -0
- package/dist/handleErrors-P52guX3U.js.map +1 -0
- package/dist/index-BikTN7j8.js +2266 -0
- package/dist/index-BikTN7j8.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +34 -30
- package/dist/main.js.map +1 -1
- package/dist/popover-BLI2Jq-c.js +319 -0
- package/dist/popover-BLI2Jq-c.js.map +1 -0
- package/dist/popover-CcrzvSk7.js.map +1 -1
- package/dist/tslib.es6-e8r3nMQ9.js +172 -0
- package/dist/tslib.es6-e8r3nMQ9.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js.map +1 -1
- package/lib/components/datatable/DataTableServer.tsx +14 -23
- package/lib/components/form/FileInputForm.tsx +184 -0
- package/lib/components/form/FileInputFormMultiple.tsx +220 -0
- package/lib/components/ui/Calendar.tsx +0 -2
- package/lib/components/ui/Combobox.tsx +0 -2
- package/lib/components/ui/Dialog.tsx +0 -2
- package/lib/components/ui/checkbox.tsx +0 -2
- package/lib/components/ui/command.tsx +0 -2
- package/lib/components/ui/multi-select.tsx +10 -4
- package/lib/components/ui/popover.tsx +0 -2
- package/lib/components/ui/radioGroup.tsx +0 -2
- package/lib/components/ui/toast.tsx +0 -1
- package/lib/main.ts +2 -0
- package/lib/types.ts +1 -0
- package/package.json +1 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const handleErrors = (error, emitter, customMessage) => {
|
|
2
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3
|
+
let errmsgToDisplay = " " + (((_c = (_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.error) == null ? void 0 : _c.message) || error.message || "");
|
|
4
|
+
let errorTitle = "";
|
|
5
|
+
if (error.code == "ERR_NETWORK") {
|
|
6
|
+
errorTitle = "Síťová chyba";
|
|
7
|
+
errmsgToDisplay = errmsgToDisplay + " " + (/* @__PURE__ */ new Date()).toLocaleString();
|
|
8
|
+
} else if (error.code == "ERR_BAD_REQUEST") {
|
|
9
|
+
if (((_d = error.response) == null ? void 0 : _d.status) == 403) {
|
|
10
|
+
errorTitle = "Přístup zamítnut";
|
|
11
|
+
} else if (((_e = error.response) == null ? void 0 : _e.status) == 409) {
|
|
12
|
+
errorTitle = "Konflikt";
|
|
13
|
+
} else {
|
|
14
|
+
errorTitle = "Interní chyba aplikace";
|
|
15
|
+
}
|
|
16
|
+
errmsgToDisplay = (/* @__PURE__ */ new Date()).toLocaleString() + " (" + ((_f = error.response) == null ? void 0 : _f.status) + ") \n" + errmsgToDisplay;
|
|
17
|
+
}
|
|
18
|
+
console.error(error);
|
|
19
|
+
const bgColor = ((_g = error.response) == null ? void 0 : _g.status) && ((_h = error.response) == null ? void 0 : _h.status) >= 400 ? " bg-danger " : " bg-warning ";
|
|
20
|
+
const type = ((_i = error.response) == null ? void 0 : _i.status) && ((_j = error.response) == null ? void 0 : _j.status) >= 400 ? "error" : "warning";
|
|
21
|
+
emitter.emit("message", {
|
|
22
|
+
title: errorTitle,
|
|
23
|
+
message: errmsgToDisplay,
|
|
24
|
+
classes: bgColor || " bg-danger ",
|
|
25
|
+
timeout: 0,
|
|
26
|
+
type
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
handleErrors as h
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=handleErrors-P52guX3U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleErrors-P52guX3U.js","sources":["utils/handleErrors.js"],"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"],"names":[],"mappings":"AAAK,MAAC,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,IAAK,SAAS,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,UAAU,SAAS;AAAA,EAC1I;AACD,UAAQ,MAAM,KAAK;AACnB,QAAM,YAAY,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,aAAa,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,WAAW,MAAM,gBAAgB;AACtJ,QAAM,SAAS,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,aAAa,KAAK,MAAM,aAAa,OAAO,SAAS,GAAG,WAAW,MAAM,UAAU;AAC7I,UAAQ,KAAK,WAAW;AAAA,IACtB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS,WAAW;AAAA,IACpB,SAAS;AAAA,IACT;AAAA,EACJ,CAAG;AACH;"}
|