@addsign/moje-agenda-shared-lib 2.0.34 → 2.0.36

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.
@@ -0,0 +1,6 @@
1
+ import { IAttachment } from '../main';
2
+
3
+ export interface IAttachmentsProps {
4
+ attachmentList: IAttachment[];
5
+ }
6
+ export declare function Attachments({ attachmentList }: IAttachmentsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "../tailwind-l0sNRNKZ.js";
3
+ import "react";
4
+ import "../index.esm-ifS8v9eQ.js";
5
+ import "../jspdf.plugin.autotable-7hp3hM-a.js";
6
+ import "../contexts/FederationContext.js";
7
+ import { getFullNameList } from "../utils/getFullName.js";
8
+ import "../Dialog-BmQoVu5C.js";
9
+ import "./ui/ScrollArea.js";
10
+ import "./ui/input.js";
11
+ import "./ui/form.js";
12
+ import "./ui/radioGroup.js";
13
+ import "./ui/command.js";
14
+ import "./ui/Combobox.js";
15
+ import "./ui/select.js";
16
+ import "./ui/tooltip.js";
17
+ import "./ui/separator.js";
18
+ import "./ui/textarea.js";
19
+ import "./ui/checkbox.js";
20
+ import "./ui/button.js";
21
+ import "../Calendar-DWT4e7Th.js";
22
+ import "./ui/DateTimePicker.js";
23
+ import "./ui/DatePicker.js";
24
+ function Attachments({ attachmentList }) {
25
+ return /* @__PURE__ */ jsx("div", { children: attachmentList.map((attachment) => /* @__PURE__ */ jsxs("div", { children: [
26
+ /* @__PURE__ */ jsx(
27
+ "a",
28
+ {
29
+ href: `/api/files/download/${attachment == null ? void 0 : attachment.id}`,
30
+ className: "flex flex-grow text-left underline text-primary",
31
+ target: "_blank",
32
+ rel: "noopener noreferrer",
33
+ children: attachment == null ? void 0 : attachment.filename
34
+ },
35
+ attachment == null ? void 0 : attachment.id
36
+ ),
37
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500", children: [
38
+ "Vložil/a: ",
39
+ getFullNameList(attachment == null ? void 0 : attachment.createdByEmp, true, false),
40
+ ", ",
41
+ new Date(attachment.created).toLocaleString()
42
+ ] })
43
+ ] })) });
44
+ }
45
+ export {
46
+ Attachments
47
+ };
48
+ //# sourceMappingURL=Attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachments.js","sources":["../../lib/components/Attachments.tsx"],"sourcesContent":["import { getFullNameList, IAttachment } from \"../main\"\r\n\r\nexport interface IAttachmentsProps {\r\n attachmentList: IAttachment[]\r\n}\r\n\r\nexport function Attachments({ attachmentList }: IAttachmentsProps) {\r\n return (\r\n <div>\r\n {attachmentList.map((attachment: IAttachment) => (\r\n <div>\r\n <a\r\n key={attachment?.id}\r\n href={`/api/files/download/${attachment?.id}`}\r\n className=\"flex flex-grow text-left underline text-primary\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n >\r\n {attachment?.filename}\r\n </a>\r\n <div className=\"text-xs text-gray-500\">\r\n Vložil/a: {getFullNameList(attachment?.createdByEmp, true, false)}, {new Date(attachment.created).toLocaleString()}\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n )\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMgB,SAAA,YAAY,EAAE,kBAAqC;AACjE,6BACG,OACE,EAAA,UAAA,eAAe,IAAI,CAAC,oCAClB,OACC,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAM,uBAAuB,yCAAY,EAAE;AAAA,QAC3C,WAAU;AAAA,QACV,QAAO;AAAA,QACP,KAAI;AAAA,QAEH,UAAY,yCAAA;AAAA,MAAA;AAAA,MANR,yCAAY;AAAA,IAOnB;AAAA,IACA,qBAAC,OAAI,EAAA,WAAU,yBAAwB,UAAA;AAAA,MAAA;AAAA,MAC1B,gBAAgB,yCAAY,cAAc,MAAM,KAAK;AAAA,MAAE;AAAA,MAAG,IAAI,KAAK,WAAW,OAAO,EAAE,eAAe;AAAA,IAAA,GACnH;AAAA,EAAA,EACF,CAAA,CACD,EACH,CAAA;AAEJ;"}
@@ -22029,6 +22029,7 @@ function DataTableServer({
22029
22029
  sortDirection: sortConfig == null ? void 0 : sortConfig.direction
22030
22030
  }
22031
22031
  }).then((response) => {
22032
+ var _a2;
22032
22033
  setIsLoading(false);
22033
22034
  const dataPageable = createDataPageable(
22034
22035
  response,
@@ -22038,16 +22039,48 @@ function DataTableServer({
22038
22039
  dataPageable.content.map((item) => {
22039
22040
  const row = {};
22040
22041
  columns.forEach((column) => {
22041
- var _a2, _b2;
22042
+ var _a3, _b2;
22043
+ let value;
22042
22044
  if (column.renderXls) {
22043
- row[column.header] = (_a2 = column.renderXls(item)) == null ? void 0 : _a2.toString();
22045
+ value = column.renderXls(item);
22044
22046
  } else if (column.render) {
22045
- row[column.header] = (_b2 = column.render(item)) == null ? void 0 : _b2.toString();
22047
+ value = (_a3 = column.render(item)) == null ? void 0 : _a3.toString();
22048
+ }
22049
+ if (((_b2 = column.renderXlsOptions) == null ? void 0 : _b2.type) === "number" || typeof value === "number" || typeof value === "string" && !isNaN(Number(value))) {
22050
+ row[column.header] = Number(value);
22051
+ } else {
22052
+ row[column.header] = value == null ? void 0 : value.toString();
22046
22053
  }
22047
22054
  });
22048
22055
  return row;
22049
22056
  })
22050
22057
  );
22058
+ const range = utils.decode_range(worksheet["!ref"] || "A1");
22059
+ for (let C = range.s.c; C <= range.e.c; ++C) {
22060
+ const col = utils.encode_col(C);
22061
+ let hasNumbers = false;
22062
+ for (let R = range.s.r; R <= range.e.r; ++R) {
22063
+ const cell = worksheet[col + (R + 1)];
22064
+ if (cell && typeof cell.v === "number") {
22065
+ hasNumbers = true;
22066
+ break;
22067
+ }
22068
+ }
22069
+ if (hasNumbers) {
22070
+ for (let R = range.s.r; R <= range.e.r; ++R) {
22071
+ const cell = worksheet[col + (R + 1)];
22072
+ if (cell && typeof cell.v === "number") {
22073
+ const colIndex = utils.decode_col(col);
22074
+ const column = columns[colIndex];
22075
+ if ((_a2 = column == null ? void 0 : column.renderXlsOptions) == null ? void 0 : _a2.format) {
22076
+ cell.z = column.renderXlsOptions.format;
22077
+ } else {
22078
+ cell.z = "#,##0";
22079
+ }
22080
+ }
22081
+ }
22082
+ }
22083
+ }
22051
22084
  const workbook = utils.book_new();
22052
22085
  utils.book_append_sheet(workbook, worksheet, "Sheet1");
22053
22086
  writeFileSync(workbook, "export.xlsx");