@addsign/moje-agenda-shared-lib 1.0.26 → 1.0.28

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../lib/components/Modal.tsx"],"sourcesContent":["import { FaRegTrashAlt } from \"react-icons/fa\";\nimport Button from \"./Button\";\n\nexport interface IConfirmationModalDialogProps {\n title: string;\n confirmAction: () => void;\n description?: string;\n agreeeText?: string;\n}\n\nexport function Modal({\n title,\n confirmAction,\n description,\n agreeeText = \"OK\",\n}: IConfirmationModalDialogProps) {\n return (\n <div\n className=\"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4\"\n style={{ zIndex: 50 }}\n >\n <div className=\"w-[500px] h-[300px] bg-white rounded-xl shadow flex-col justify-start items-center inline-flex relative overflow-hidden\">\n <div\n id=\"graphics\"\n className=\"w-80 h-80 left-[-120px] top-[-120px] absolute \"\n >\n <div className=\"w-80 h-80 left-0 top-0 absolute\">\n <div className=\"w-24 h-24 left-[120px] top-[120px] absolute rounded-full border border-gray-150\" />\n <div className=\"w-36 h-36 left-[96px] top-[96px] absolute rounded-full border border-gray-100 \" />\n <div className=\"w-48 h-48 left-[72px] top-[72px] absolute rounded-full border border-gray-100 \" />\n <div className=\"w-60 h-60 left-[48px] top-[48px] absolute rounded-full border border-gray-50 \" />\n <div className=\"w-72 h-72 left-[24px] top-[24px] absolute rounded-full border border-gray-50\" />\n </div>\n </div>\n <div\n id=\"header\"\n className=\"self-stretch h-40 flex-col justify-start items-center flex z-40\"\n >\n <div className=\"self-stretch h-40 px-6 pt-6 flex-col justify-start items-start gap-4 flex\">\n <div className=\"w-12 h-12 relative bg-red-100 rounded-full\">\n <FaRegTrashAlt className=\"w-6 h-6 left-[12px] top-[12px] absolute\" />\n </div>\n <div className=\"self-stretch h-16 flex-col justify-start items-start gap-1 flex\">\n <div className=\"self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7\">\n {title}\n </div>\n <div className=\"self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight\">\n {description}\n </div>\n </div>\n </div>\n </div>\n <div\n id=\"actions\"\n className=\"self-stretch h-24 pt-8 flex-col justify-start items-start flex z-40\"\n >\n <div className=\"self-stretch px-6 pb-6 justify-start items-start gap-3 flex\">\n <Button\n type=\"button\"\n variant=\"primary\"\n onClick={confirmAction}\n className=\"flex-1\"\n >\n {agreeeText || \"OK\"}{\" \"}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nexport default Modal;\n"],"names":[],"mappings":";;;AAUO,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AACf,GAAkC;AAE9B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,GAAG;AAAA,MAEpB,UAAA,qBAAC,OAAI,EAAA,WAAU,2HACb,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,WAAU;AAAA,YAEV,UAAA,qBAAC,OAAI,EAAA,WAAU,mCACb,UAAA;AAAA,cAAC,oBAAA,OAAA,EAAI,WAAU,kFAAkF,CAAA;AAAA,cACjG,oBAAC,OAAI,EAAA,WAAU,kFAAkF,CAAA;AAAA,cACjG,oBAAC,OAAI,EAAA,WAAU,kFAAkF,CAAA;AAAA,cACjG,oBAAC,OAAI,EAAA,WAAU,kFAAkF,CAAA;AAAA,cACjG,oBAAC,OAAI,EAAA,WAAU,+EAA+E,CAAA;AAAA,YAAA,GAChG;AAAA,UAAA;AAAA,QACF;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,WAAU;AAAA,YAEV,UAAA,qBAAC,OAAI,EAAA,WAAU,6EACb,UAAA;AAAA,cAAA,oBAAC,SAAI,WAAU,8CACb,8BAAC,eAAc,EAAA,WAAU,2CAA0C,EACrE,CAAA;AAAA,cACA,qBAAC,OAAI,EAAA,WAAU,mEACb,UAAA;AAAA,gBAAC,oBAAA,OAAA,EAAI,WAAU,6EACZ,UACH,OAAA;AAAA,gBACC,oBAAA,OAAA,EAAI,WAAU,oFACZ,UACH,aAAA;AAAA,cAAA,GACF;AAAA,YAAA,GACF;AAAA,UAAA;AAAA,QACF;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,WAAU;AAAA,YAEV,UAAA,oBAAC,OAAI,EAAA,WAAU,gEACb,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,SAAS;AAAA,gBACT,WAAU;AAAA,gBAET,UAAA;AAAA,kBAAc,cAAA;AAAA,kBAAM;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,GAEzB;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../lib/components/Modal.tsx"],"sourcesContent":["import { FaRegTrashAlt } from \"react-icons/fa\";\r\nimport Button from \"./Button\";\r\n\r\nexport interface IConfirmationModalDialogProps {\r\n title: string;\r\n confirmAction: () => void;\r\n description?: string;\r\n agreeeText?: string;\r\n}\r\n\r\nexport function Modal({\r\n title,\r\n confirmAction,\r\n description,\r\n agreeeText = \"OK\",\r\n}: IConfirmationModalDialogProps) {\r\n return (\r\n <div\r\n className=\"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4\"\r\n style={{ zIndex: 50 }}\r\n >\r\n <div className=\"w-[500px] h-[300px] bg-white rounded-xl shadow flex-col justify-start items-center inline-flex relative overflow-hidden\">\r\n <div\r\n id=\"graphics\"\r\n className=\"w-80 h-80 left-[-120px] top-[-120px] absolute \"\r\n >\r\n <div className=\"w-80 h-80 left-0 top-0 absolute\">\r\n <div className=\"w-24 h-24 left-[120px] top-[120px] absolute rounded-full border border-gray-150\" />\r\n <div className=\"w-36 h-36 left-[96px] top-[96px] absolute rounded-full border border-gray-100 \" />\r\n <div className=\"w-48 h-48 left-[72px] top-[72px] absolute rounded-full border border-gray-100 \" />\r\n <div className=\"w-60 h-60 left-[48px] top-[48px] absolute rounded-full border border-gray-50 \" />\r\n <div className=\"w-72 h-72 left-[24px] top-[24px] absolute rounded-full border border-gray-50\" />\r\n </div>\r\n </div>\r\n <div\r\n id=\"header\"\r\n className=\"self-stretch h-40 flex-col justify-start items-center flex z-40\"\r\n >\r\n <div className=\"self-stretch h-40 px-6 pt-6 flex-col justify-start items-start gap-4 flex\">\r\n <div className=\"w-12 h-12 relative bg-red-100 rounded-full\">\r\n <FaRegTrashAlt className=\"w-6 h-6 left-[12px] top-[12px] absolute\" />\r\n </div>\r\n <div className=\"self-stretch h-16 flex-col justify-start items-start gap-1 flex\">\r\n <div className=\"self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7\">\r\n {title}\r\n </div>\r\n <div className=\"self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight\">\r\n {description}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n id=\"actions\"\r\n className=\"self-stretch h-24 pt-8 flex-col justify-start items-start flex z-40\"\r\n >\r\n <div className=\"self-stretch px-6 pb-6 justify-start items-start gap-3 flex\">\r\n <Button\r\n type=\"button\"\r\n variant=\"primary\"\r\n onClick={confirmAction}\r\n className=\"flex-1\"\r\n >\r\n {agreeeText || \"OK\"}{\" \"}\r\n </Button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Modal;\r\n"],"names":[],"mappings":";;;AAUO,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AACf,GAAkC;AAE9B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,GAAG;AAAA,MAEpB,UAAA,qBAAC,OAAI,EAAA,WA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AAAA,EAAA;AAGN;"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export interface IModalDialogProps {
3
+ title: string;
4
+ cancelAction: () => void;
5
+ description?: string;
6
+ children?: React.ReactNode;
7
+ classNameWrapper?: string;
8
+ closeOnCLickAway?: boolean;
9
+ }
10
+ export declare function ModalDialog({ title, cancelAction, description, classNameWrapper, children, closeOnCLickAway, }: IModalDialogProps): import("react/jsx-runtime").JSX.Element;
11
+ export default ModalDialog;
@@ -0,0 +1,72 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { createRef, useEffect } from "react";
3
+ import { I as IoCloseOutline } from "../index-G6UUAXAq.js";
4
+ import { u as useClickAway } from "../useClickAway-CH9ykBsx.js";
5
+ function ModalDialog({
6
+ title,
7
+ cancelAction,
8
+ description,
9
+ classNameWrapper,
10
+ children,
11
+ closeOnCLickAway = true
12
+ }) {
13
+ const ref = createRef();
14
+ useClickAway(ref, () => {
15
+ closeOnCLickAway ? cancelAction() : null;
16
+ });
17
+ useEffect(() => {
18
+ const handleKeyDown = (event) => {
19
+ if (event.key === "Escape") {
20
+ cancelAction();
21
+ }
22
+ };
23
+ window.addEventListener("keydown", handleKeyDown);
24
+ return () => {
25
+ window.removeEventListener("keydown", handleKeyDown);
26
+ };
27
+ }, [cancelAction]);
28
+ return /* @__PURE__ */ jsx(
29
+ "div",
30
+ {
31
+ className: "fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4",
32
+ style: { zIndex: 50 },
33
+ children: /* @__PURE__ */ jsxs(
34
+ "div",
35
+ {
36
+ ref,
37
+ className: `min-w-96 min-h-64 max-h-[calc(100vh_-_20px)] bg-white rounded-lg shadow-lg flex flex-col justify-start items-center
38
+ relative overflow-auto gap-5 p-5 ` + classNameWrapper,
39
+ children: [
40
+ title && /* @__PURE__ */ jsxs(
41
+ "div",
42
+ {
43
+ id: "header",
44
+ className: "self-stretch h-28 flex-col justify-start items-center flex z-40",
45
+ children: [
46
+ /* @__PURE__ */ jsx("div", { className: "self-stretch h-40 flex-col justify-start items-start gap-4 flex", children: /* @__PURE__ */ jsxs("div", { className: "self-stretch h-16 flex-col justify-start items-start gap-1 flex", children: [
47
+ /* @__PURE__ */ jsx("div", { className: "self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7", children: title }),
48
+ description && /* @__PURE__ */ jsx("div", { className: "self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight", children: description })
49
+ ] }) }),
50
+ /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ className: "w-11 h-11 p-2 right-0 top-[16px] absolute rounded-full justify-center items-center inline-flex mr-4 hover:bg-gray-100",
54
+ onClick: cancelAction,
55
+ children: /* @__PURE__ */ jsx(IoCloseOutline, { className: "w-6 h-6 relative text-gray-400" })
56
+ }
57
+ )
58
+ ]
59
+ }
60
+ ),
61
+ children && /* @__PURE__ */ jsx("div", { className: " text-left w-full ", children })
62
+ ]
63
+ }
64
+ )
65
+ }
66
+ );
67
+ }
68
+ export {
69
+ ModalDialog,
70
+ ModalDialog as default
71
+ };
72
+ //# sourceMappingURL=ModalDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalDialog.js","sources":["../../lib/components/ModalDialog.tsx"],"sourcesContent":["import { createRef, useEffect } from \"react\";\nimport { IoCloseOutline } from \"react-icons/io5\";\nimport { useClickAway } from \"react-use\";\n\nexport interface IModalDialogProps {\n title: string;\n cancelAction: () => void;\n description?: string;\n children?: React.ReactNode;\n classNameWrapper?: string;\n closeOnCLickAway?: boolean;\n}\n\nexport function ModalDialog({\n title,\n cancelAction,\n description,\n classNameWrapper,\n children,\n closeOnCLickAway = true,\n}: IModalDialogProps) {\n const ref = createRef<HTMLDivElement>();\n\n useClickAway(ref, () => {\n closeOnCLickAway ? cancelAction() : null;\n });\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n cancelAction();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [cancelAction]);\n\n return (\n <div\n className=\"fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4\"\n style={{ zIndex: 50 }}\n >\n <div\n ref={ref}\n className={\n `min-w-96 min-h-64 max-h-[calc(100vh_-_20px)] bg-white rounded-lg shadow-lg flex flex-col justify-start items-center \n relative overflow-auto gap-5 p-5 ` + classNameWrapper\n }\n >\n {title && (\n <div\n id=\"header\"\n className=\"self-stretch h-28 flex-col justify-start items-center flex z-40\"\n >\n <div className=\"self-stretch h-40 flex-col justify-start items-start gap-4 flex\">\n <div className=\"self-stretch h-16 flex-col justify-start items-start gap-1 flex\">\n <div className=\"self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7\">\n {title}\n </div>\n {description && (\n <div className=\"self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight\">\n {description}\n </div>\n )}\n </div>\n </div>\n <div\n className=\"w-11 h-11 p-2 right-0 top-[16px] absolute rounded-full justify-center items-center inline-flex mr-4 hover:bg-gray-100\"\n onClick={cancelAction}\n >\n <IoCloseOutline className=\"w-6 h-6 relative text-gray-400\" />\n </div>\n </div>\n )}\n\n {children && <div className=\" text-left w-full \">{children}</div>}\n </div>\n </div>\n );\n}\n\nexport default ModalDialog;\n"],"names":[],"mappings":";;;;AAaO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AACrB,GAAsB;AACpB,QAAM,MAAM;AAEZ,eAAa,KAAK,MAAM;AACtB,uBAAmB,aAAiB,IAAA;AAAA,EAAA,CACrC;AAED,YAAU,MAAM;AACR,UAAA,gBAAgB,CAAC,UAAyB;AAC1C,UAAA,MAAM,QAAQ,UAAU;AACb;MACf;AAAA,IAAA;AAEK,WAAA,iBAAiB,WAAW,aAAa;AAChD,WAAO,MAAM;AACJ,aAAA,oBAAoB,WAAW,aAAa;AAAA,IAAA;AAAA,EACrD,GACC,CAAC,YAAY,CAAC;AAGf,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,GAAG;AAAA,MAEpB,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WACE;AAAA,gDACsC;AAAA,UAGvC,UAAA;AAAA,YACC,SAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,WAAU;AAAA,gBAEV,UAAA;AAAA,kBAAA,oBAAC,SAAI,WAAU,oEACb,UAAC,qBAAA,OAAA,EAAI,WAAU,mEACb,UAAA;AAAA,oBAAC,oBAAA,OAAA,EAAI,WAAU,6EACZ,UACH,OAAA;AAAA,oBACC,eACC,oBAAC,OAAI,EAAA,WAAU,oFACZ,UACH,aAAA;AAAA,kBAAA,EAAA,CAEJ,EACF,CAAA;AAAA,kBACA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAU;AAAA,sBACV,SAAS;AAAA,sBAET,UAAA,oBAAC,gBAAe,EAAA,WAAU,iCAAiC,CAAA;AAAA,oBAAA;AAAA,kBAC7D;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,YAGD,YAAY,oBAAC,OAAI,EAAA,WAAU,sBAAsB,UAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAC7D;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -21822,7 +21822,9 @@ function DataTableServer({
21822
21822
  }, [id]);
21823
21823
  useEffect(() => {
21824
21824
  const fetchFilterOptions = async (column) => {
21825
- if (column.filterSource) {
21825
+ if (column.filterOptions) {
21826
+ return column.filterOptions;
21827
+ } else if (column.filterSource) {
21826
21828
  try {
21827
21829
  const response = await federationContext.apiClient.get(
21828
21830
  column.filterSource
@@ -21836,12 +21838,14 @@ function DataTableServer({
21836
21838
  console.error("Error fetching filter options:", error);
21837
21839
  return [];
21838
21840
  }
21841
+ } else {
21842
+ return [];
21839
21843
  }
21840
21844
  };
21841
21845
  const updateFilterOptions = async () => {
21842
21846
  const newFilterOptions = {};
21843
21847
  for (const column of columns) {
21844
- if (column.filterType && column.filterSource && column.filterValueKey && column.filterLabelKey && column.filterParam) {
21848
+ if (column.filterType === "select" && (column.filterSource || column.filterOptions) && column.filterValueKey && column.filterLabelKey && column.filterParam) {
21845
21849
  const options = await fetchFilterOptions(column);
21846
21850
  if (options) {
21847
21851
  newFilterOptions[column.filterParam] = [
@@ -21914,7 +21918,7 @@ function DataTableServer({
21914
21918
  setFulltextSearch((_a2 = e.target) == null ? void 0 : _a2.value);
21915
21919
  setCurrentPage(0);
21916
21920
  };
21917
- const paginationDisplay = `Strana ${(currentPage || 0) + 1} z ${data == null ? void 0 : data.totalPages}`;
21921
+ const paginationDisplay = `Strana ${(currentPage || 0) + 1} z ${(data == null ? void 0 : data.totalPages) || 1}`;
21918
21922
  const filterHandler = (filterParam, value) => {
21919
21923
  setColumnFilters((prev) => ({ ...prev, [filterParam]: value }));
21920
21924
  setCurrentPage(0);
@@ -22060,7 +22064,7 @@ function DataTableServer({
22060
22064
  }
22061
22065
  ) })
22062
22066
  ] }),
22063
- /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs("table", { className: "w-full leading-normal ", children: [
22067
+ /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full leading-normal ", children: [
22064
22068
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
22065
22069
  data && bulkAction && /* @__PURE__ */ jsx("th", { className: "w-[20px] h-10 hover:bg-gray-200 bg-gray-50 font-medium text-xs text-center text-gray-600 cursor-pointer border-t border-b border-gray-200", children: /* @__PURE__ */ jsx("label", { className: "w-full h-full flex items-center justify-center cursor-pointer px-2", children: /* @__PURE__ */ jsx(
22066
22070
  "input",