@addsign/moje-agenda-shared-lib 0.0.29 → 0.0.30
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/assets/tailwind.css +1484 -1
- package/dist/components/Button.js +23 -20
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Calendar.js +89 -57
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/ConfirmationModalDialog.js +52 -47
- package/dist/components/ConfirmationModalDialog.js.map +1 -0
- package/dist/components/DataTable.js +211 -145
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/Spinner.js +9 -8
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/form/AutocompleteSearchBar.js +323 -239
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -0
- package/dist/components/form/FormField.js +171 -142
- package/dist/components/form/FormField.js.map +1 -0
- package/dist/components/form/PositionsSelectorSingle.js +143 -113
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -0
- package/dist/components/layout/PageTitle.js +9 -8
- package/dist/components/layout/PageTitle.js.map +1 -0
- package/dist/components/layout/SectionTitle.js +9 -8
- package/dist/components/layout/SectionTitle.js.map +1 -0
- package/dist/contexts/FederationContext.js +12 -8
- package/dist/contexts/FederationContext.js.map +1 -0
- package/dist/contexts/useFederationContext.js +5 -4
- package/dist/contexts/useFederationContext.js.map +1 -0
- package/dist/iconBase-BY_L6Cb_.js +144 -0
- package/dist/iconBase-BY_L6Cb_.js.map +1 -0
- package/dist/index-C0yNf1cc.js +48 -0
- package/dist/index-C0yNf1cc.js.map +1 -0
- package/dist/main.js +29 -28
- package/dist/main.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/getFullName.js +9 -3
- package/dist/utils/getFullName.js.map +1 -0
- package/package.json +1 -1
- package/dist/iconBase-DkR9t2l_.js +0 -117
- package/dist/index-CO5g84CR.js +0 -47
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import '../assets/tailwind.css';/* empty css */
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const commonStyles = " py-2 px-4 leading-[25px] ";
|
|
4
|
+
const buttonStyles = {
|
|
5
|
+
primary: "!bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50",
|
|
6
|
+
secondary: "!bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium disabled:opacity-50",
|
|
7
|
+
transparent: "!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit disabled:opacity-50",
|
|
8
|
+
success: "!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
|
|
9
|
+
danger: "!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
|
|
9
10
|
icon: "text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full disabled:opacity-50"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
};
|
|
12
|
+
const Button = ({
|
|
13
|
+
variant = "primary",
|
|
14
|
+
children,
|
|
15
|
+
onClick,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
16
18
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
const classNames = commonStyles + buttonStyles[variant];
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
19
21
|
"button",
|
|
20
22
|
{
|
|
21
|
-
className:
|
|
22
|
-
onClick
|
|
23
|
-
...
|
|
24
|
-
children
|
|
23
|
+
className: classNames + " " + (className || " sharedLibraryource "),
|
|
24
|
+
onClick,
|
|
25
|
+
...props,
|
|
26
|
+
children
|
|
25
27
|
}
|
|
26
28
|
);
|
|
27
29
|
};
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
Button as default
|
|
30
32
|
};
|
|
33
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../lib/components/Button.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport \"../css/tailwind.css\";\r\n\r\ntype ButtonVariant =\r\n | \"primary\"\r\n | \"secondary\"\r\n | \"transparent\"\r\n | \"success\"\r\n | \"danger\"\r\n | \"icon\";\r\n\r\ninterface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n variant?: ButtonVariant;\r\n}\r\nconst commonStyles = \" py-2 px-4 leading-[25px] \";\r\nconst buttonStyles: { [key in ButtonVariant]: string } = {\r\n primary:\r\n \"!bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50\",\r\n secondary:\r\n \"!bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium disabled:opacity-50\",\r\n transparent:\r\n \"!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit disabled:opacity-50\",\r\n success:\r\n \"!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50\",\r\n danger:\r\n \"!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50\",\r\n icon: \"text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full disabled:opacity-50\",\r\n};\r\nconst Button: React.FC<IButtonProps> = ({\r\n variant = \"primary\",\r\n children,\r\n onClick,\r\n className,\r\n ...props\r\n}) => {\r\n const classNames = commonStyles + buttonStyles[variant];\r\n\r\n return (\r\n <button\r\n className={classNames + \" \" + (className || \" sharedLibraryource \")}\r\n onClick={onClick}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n\r\nexport default Button;\r\n"],"names":[],"mappings":";;AAcA,MAAM,eAAe;AACrB,MAAM,eAAmD;AAAA,EACvD,SACE;AAAA,EACF,WACE;AAAA,EACF,aACE;AAAA,EACF,SACE;AAAA,EACF,QACE;AAAA,EACF,MAAM;AACR;AACA,MAAM,SAAiC,CAAC;AAAA,EACtC,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,aAAa,eAAe,aAAa,OAAO;AAGpD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,aAAa,OAAO,aAAa;AAAA,MAC5C;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
const [
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useCallback, useEffect } from "react";
|
|
3
|
+
const Calendar = ({ items }) => {
|
|
4
|
+
const [currentMonth, setCurrentMonth] = useState(
|
|
5
5
|
(/* @__PURE__ */ new Date()).getMonth()
|
|
6
|
-
)
|
|
6
|
+
);
|
|
7
|
+
const [currentYear, setCurrentYear] = useState(
|
|
7
8
|
(/* @__PURE__ */ new Date()).getFullYear()
|
|
8
|
-
)
|
|
9
|
+
);
|
|
10
|
+
const [calendarData, setCalendarData] = useState([]);
|
|
11
|
+
const monthNames = [
|
|
9
12
|
"Leden",
|
|
10
13
|
"Únor",
|
|
11
14
|
"Březen",
|
|
@@ -18,7 +21,8 @@ const Y = ({ items: b }) => {
|
|
|
18
21
|
"Říjen",
|
|
19
22
|
"Listopad",
|
|
20
23
|
"Prosinec"
|
|
21
|
-
]
|
|
24
|
+
];
|
|
25
|
+
const dayNames = [
|
|
22
26
|
"Pondělí",
|
|
23
27
|
"Úterý",
|
|
24
28
|
"Středa",
|
|
@@ -26,94 +30,122 @@ const Y = ({ items: b }) => {
|
|
|
26
30
|
"Pátek",
|
|
27
31
|
"Sobota",
|
|
28
32
|
"Neděle"
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
];
|
|
34
|
+
const isLeapYear = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
35
|
+
const daysInMonth = useCallback((month, year) => {
|
|
36
|
+
if (month === 1) {
|
|
37
|
+
return isLeapYear(year) ? 29 : 28;
|
|
38
|
+
}
|
|
39
|
+
if ([0, 2, 4, 6, 7, 9, 11].includes(month)) {
|
|
40
|
+
return 31;
|
|
41
|
+
}
|
|
42
|
+
return 30;
|
|
43
|
+
}, []);
|
|
44
|
+
const generateMonthDays = useCallback(
|
|
45
|
+
(month, year) => {
|
|
46
|
+
const days = [];
|
|
47
|
+
let firstDayOfMonth = new Date(year, month, 1).getDay() - 1;
|
|
48
|
+
if (firstDayOfMonth === -1)
|
|
49
|
+
firstDayOfMonth = 6;
|
|
50
|
+
let dayCounter = 1;
|
|
51
|
+
for (let week = 0; week < 6; week++) {
|
|
52
|
+
const weekDays = [];
|
|
53
|
+
for (let day = 0; day < 7; day++) {
|
|
54
|
+
if (week === 0 && day < firstDayOfMonth) {
|
|
55
|
+
weekDays.push("");
|
|
56
|
+
} else if (dayCounter > daysInMonth(month, year)) {
|
|
57
|
+
weekDays.push("");
|
|
58
|
+
} else {
|
|
59
|
+
weekDays.push(dayCounter++);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
days.push(weekDays);
|
|
40
63
|
}
|
|
41
|
-
return
|
|
64
|
+
return days;
|
|
42
65
|
},
|
|
43
|
-
[
|
|
66
|
+
[daysInMonth]
|
|
44
67
|
);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
setCalendarData(generateMonthDays(currentMonth, currentYear));
|
|
70
|
+
}, [currentMonth, currentYear, generateMonthDays]);
|
|
71
|
+
const goToNextMonth = () => {
|
|
72
|
+
setCurrentMonth((prev) => prev === 11 ? 0 : prev + 1);
|
|
73
|
+
if (currentMonth === 11) {
|
|
74
|
+
setCurrentYear((prev) => prev + 1);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const goToPreviousMonth = () => {
|
|
78
|
+
setCurrentMonth((prev) => prev === 0 ? 11 : prev - 1);
|
|
79
|
+
if (currentMonth === 0) {
|
|
80
|
+
setCurrentYear((prev) => prev - 1);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const findItemsForDay = (day, month, year) => {
|
|
84
|
+
const date = new Date(year, month, day);
|
|
85
|
+
return items.filter((item) => date >= item.from && date <= item.to);
|
|
55
86
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
87
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col bg-white shadow-lg flex-grow text-xs", children: [
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center bg-gray-200 text-black p-4", children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("h2", { className: "font-semibold text-xl", children: [
|
|
90
|
+
monthNames[currentMonth],
|
|
60
91
|
" ",
|
|
61
|
-
|
|
92
|
+
currentYear
|
|
62
93
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
65
96
|
"button",
|
|
66
97
|
{
|
|
67
|
-
onClick:
|
|
98
|
+
onClick: goToPreviousMonth,
|
|
68
99
|
className: "mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500",
|
|
69
100
|
children: "Předchozí"
|
|
70
101
|
}
|
|
71
102
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
73
104
|
"button",
|
|
74
105
|
{
|
|
75
|
-
onClick:
|
|
106
|
+
onClick: goToNextMonth,
|
|
76
107
|
className: "mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500",
|
|
77
108
|
children: "Následující"
|
|
78
109
|
}
|
|
79
110
|
)
|
|
80
111
|
] })
|
|
81
112
|
] }),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
return /* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 divide-x divide-y", children: [
|
|
114
|
+
dayNames.map((day, index) => /* @__PURE__ */ jsx("div", { className: "p-4 text-center font-semibold", children: day }, index)),
|
|
115
|
+
calendarData.map((week, weekIndex) => /* @__PURE__ */ jsx(React.Fragment, { children: week.map((day, dayIndex) => {
|
|
116
|
+
const itemsForDay = day ? findItemsForDay(day, currentMonth, currentYear) : [];
|
|
117
|
+
return /* @__PURE__ */ jsxs(
|
|
87
118
|
"div",
|
|
88
119
|
{
|
|
89
120
|
className: "p-0 align-middle justify-center text-center",
|
|
90
121
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
122
|
+
/* @__PURE__ */ jsxs("div", { className: "py-1 font-bold", children: [
|
|
123
|
+
day,
|
|
93
124
|
" "
|
|
94
125
|
] }),
|
|
95
|
-
|
|
126
|
+
itemsForDay.map((item, itemIndex) => /* @__PURE__ */ jsx(
|
|
96
127
|
"div",
|
|
97
128
|
{
|
|
98
129
|
className: "dataItem w-full py-1 bg-primary text-white text-center mt-0",
|
|
99
130
|
style: {
|
|
100
|
-
backgroundColor:
|
|
101
|
-
color:
|
|
131
|
+
backgroundColor: item.background,
|
|
132
|
+
color: item.color
|
|
102
133
|
},
|
|
103
|
-
"data-tooltip-target": "tooltip-" +
|
|
104
|
-
title:
|
|
105
|
-
children:
|
|
134
|
+
"data-tooltip-target": "tooltip-" + item.id,
|
|
135
|
+
title: item.tooltip,
|
|
136
|
+
children: item.label
|
|
106
137
|
},
|
|
107
|
-
|
|
138
|
+
itemIndex
|
|
108
139
|
))
|
|
109
140
|
]
|
|
110
141
|
},
|
|
111
|
-
|
|
142
|
+
dayIndex
|
|
112
143
|
);
|
|
113
|
-
}) },
|
|
144
|
+
}) }, weekIndex))
|
|
114
145
|
] })
|
|
115
146
|
] });
|
|
116
147
|
};
|
|
117
148
|
export {
|
|
118
|
-
|
|
149
|
+
Calendar as default
|
|
119
150
|
};
|
|
151
|
+
//# sourceMappingURL=Calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.js","sources":["../../lib/components/Calendar.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from \"react\";\n\nexport interface ICalendarItem {\n id: number;\n label: string;\n from: Date;\n to: Date;\n background?: string;\n color?: string;\n tooltip?: string;\n}\n\ntype ICalendarProps = {\n items: ICalendarItem[];\n};\n\n// Check if a day is within any item's date range\n\nconst Calendar: React.FunctionComponent<ICalendarProps> = ({ items }) => {\n const [currentMonth, setCurrentMonth] = useState<number>(\n new Date().getMonth()\n );\n const [currentYear, setCurrentYear] = useState<number>(\n new Date().getFullYear()\n );\n const [calendarData, setCalendarData] = useState<(string | number)[][]>([]);\n\n const monthNames: string[] = [\n \"Leden\",\n \"Únor\",\n \"Březen\",\n \"Duben\",\n \"Květen\",\n \"Červen\",\n \"Červenec\",\n \"Srpen\",\n \"Září\",\n \"Říjen\",\n \"Listopad\",\n \"Prosinec\",\n ];\n const dayNames: string[] = [\n \"Pondělí\",\n \"Úterý\",\n \"Středa\",\n \"Čtvrtek\",\n \"Pátek\",\n \"Sobota\",\n \"Neděle\",\n ];\n\n // Leap year check\n const isLeapYear = (year: number) =>\n (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n // Days in each month\n const daysInMonth = useCallback((month: number, year: number) => {\n if (month === 1) {\n // February\n return isLeapYear(year) ? 29 : 28;\n }\n if ([0, 2, 4, 6, 7, 9, 11].includes(month)) {\n // Months with 31 days\n\n return 31;\n }\n\n return 30; // Months with 30 days\n }, []);\n\n // Generate days for a month\n const generateMonthDays = useCallback(\n (month: number, year: number) => {\n const days = [];\n // const firstDayOfMonth = new Date(year, month, 1).getDay()\n\n // Adjusted to make week start from Monday\n let firstDayOfMonth = new Date(year, month, 1).getDay() - 1;\n if (firstDayOfMonth === -1) firstDayOfMonth = 6; // Sunday becomes 6 instead of -1\n\n let dayCounter = 1;\n\n for (let week = 0; week < 6; week++) {\n const weekDays = [];\n for (let day = 0; day < 7; day++) {\n if (week === 0 && day < firstDayOfMonth) {\n weekDays.push(\"\");\n } else if (dayCounter > daysInMonth(month, year)) {\n weekDays.push(\"\");\n } else {\n weekDays.push(dayCounter++);\n }\n }\n days.push(weekDays);\n }\n return days;\n },\n [daysInMonth]\n );\n\n useEffect(() => {\n setCalendarData(generateMonthDays(currentMonth, currentYear));\n }, [currentMonth, currentYear, generateMonthDays]);\n\n // Navigation handlers\n const goToNextMonth = () => {\n setCurrentMonth((prev) => (prev === 11 ? 0 : prev + 1));\n if (currentMonth === 11) {\n setCurrentYear((prev) => prev + 1);\n }\n };\n\n const goToPreviousMonth = () => {\n setCurrentMonth((prev) => (prev === 0 ? 11 : prev - 1));\n if (currentMonth === 0) {\n setCurrentYear((prev) => prev - 1);\n }\n };\n const findItemsForDay = (\n day: number,\n month: number,\n year: number\n ): ICalendarItem[] => {\n const date = new Date(year, month, day);\n return items.filter((item) => date >= item.from && date <= item.to);\n };\n return (\n <div className=\"flex flex-col bg-white shadow-lg flex-grow text-xs\">\n <div className=\"flex justify-between items-center bg-gray-200 text-black p-4\">\n <h2 className=\"font-semibold text-xl\">\n {monthNames[currentMonth]} {currentYear}\n </h2>\n <div>\n <button\n onClick={goToPreviousMonth}\n className=\"mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500\"\n >\n Předchozí\n </button>\n <button\n onClick={goToNextMonth}\n className=\"mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500\"\n >\n Následující\n </button>\n </div>\n </div>\n <div className=\"grid grid-cols-7 divide-x divide-y\">\n {dayNames.map((day, index) => (\n <div key={index} className=\"p-4 text-center font-semibold\">\n {day}\n </div>\n ))}\n {calendarData.map((week, weekIndex) => (\n <React.Fragment key={weekIndex}>\n {week.map((day, dayIndex) => {\n const itemsForDay = day\n ? findItemsForDay(day as number, currentMonth, currentYear)\n : [];\n return (\n <div\n key={dayIndex}\n className=\"p-0 align-middle justify-center text-center\"\n >\n <div className=\"py-1 font-bold\">{day} </div>\n {itemsForDay.map((item, itemIndex) => (\n <div\n key={itemIndex}\n className=\"dataItem w-full py-1 bg-primary text-white text-center mt-0\"\n style={{\n backgroundColor: item.background,\n color: item.color,\n }}\n data-tooltip-target={\"tooltip-\" + item.id}\n title={item.tooltip}\n >\n {item.label}\n </div>\n ))}\n </div>\n );\n })}\n </React.Fragment>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Calendar;\n"],"names":[],"mappings":";;AAkBA,MAAM,WAAoD,CAAC,EAAE,YAAY;AACjE,QAAA,CAAC,cAAc,eAAe,IAAI;AAAA,KACtC,oBAAI,KAAK,GAAE,SAAS;AAAA,EAAA;AAEhB,QAAA,CAAC,aAAa,cAAc,IAAI;AAAA,KACpC,oBAAI,KAAK,GAAE,YAAY;AAAA,EAAA;AAEzB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAgC,CAAE,CAAA;AAE1E,QAAM,aAAuB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,QAAM,WAAqB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AA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AA,UAAA;AAAA,YAEC,WAAU;AAAA,YAEV,UAAA;AAAA,cAAC,qBAAA,OAAA,EAAI,WAAU,kBAAkB,UAAA;AAAA,gBAAA;AAAA,gBAAI;AAAA,cAAA,GAAC;AAAA,cACrC,YAAY,IAAI,CAAC,MAAM,cACtB;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,iBAAiB,KAAK;AAAA,oBACtB,OAAO,KAAK;AAAA,kBACd;AAAA,kBACA,uBAAqB,aAAa,KAAK;AAAA,kBACvC,OAAO,KAAK;AAAA,kBAEX,UAAK,KAAA;AAAA,gBAAA;AAAA,gBATD;AAAA,cAAA,CAWR;AAAA,YAAA;AAAA,UAAA;AAAA,UAjBI;AAAA,QAAA;AAAA,MAkBP,CAEH,EA3BkB,GAAA,SA4BrB,CACD;AAAA,IAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,91 +1,95 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useEffect
|
|
3
|
-
import { G as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { G as GenIcon } from "../iconBase-BY_L6Cb_.js";
|
|
4
|
+
function FaRegTrashAlt(props) {
|
|
5
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z" }, "child": [] }] })(props);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
7
|
+
function IoCloseOutline(props) {
|
|
8
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round", "strokeWidth": "32", "d": "M368 368 144 144m224 0L144 368" }, "child": [] }] })(props);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
title
|
|
12
|
-
confirmAction
|
|
13
|
-
cancelAction
|
|
14
|
-
description
|
|
15
|
-
agreeeText
|
|
16
|
-
cancelText
|
|
10
|
+
function ConfirmationModalDialog({
|
|
11
|
+
title,
|
|
12
|
+
confirmAction,
|
|
13
|
+
cancelAction,
|
|
14
|
+
description,
|
|
15
|
+
agreeeText,
|
|
16
|
+
cancelText
|
|
17
17
|
}) {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const handleKeyDown = (event) => {
|
|
20
|
+
if (event.key === "Escape") {
|
|
21
|
+
cancelAction();
|
|
22
|
+
}
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
25
|
+
return () => {
|
|
26
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
24
27
|
};
|
|
25
|
-
}, [
|
|
28
|
+
}, [cancelAction]);
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
26
30
|
"div",
|
|
27
31
|
{
|
|
28
32
|
className: "fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4",
|
|
29
33
|
style: { zIndex: 50 },
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-96 h-64 bg-white rounded-xl shadow flex-col justify-start items-center inline-flex relative overflow-hidden", children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
32
36
|
"div",
|
|
33
37
|
{
|
|
34
38
|
id: "graphics",
|
|
35
39
|
className: "w-80 h-80 left-[-120px] top-[-120px] absolute ",
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-80 h-80 left-0 top-0 absolute", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "w-24 h-24 left-[120px] top-[120px] absolute rounded-full border border-gray-150" }),
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: "w-36 h-36 left-[96px] top-[96px] absolute rounded-full border border-gray-100 " }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "w-48 h-48 left-[72px] top-[72px] absolute rounded-full border border-gray-100 " }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: "w-60 h-60 left-[48px] top-[48px] absolute rounded-full border border-gray-50 " }),
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "w-72 h-72 left-[24px] top-[24px] absolute rounded-full border border-gray-50" })
|
|
42
46
|
] })
|
|
43
47
|
}
|
|
44
48
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
46
50
|
"div",
|
|
47
51
|
{
|
|
48
52
|
id: "header",
|
|
49
53
|
className: "self-stretch h-40 flex-col justify-start items-center flex z-40",
|
|
50
54
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "self-stretch h-40 px-6 pt-6 flex-col justify-start items-start gap-4 flex", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 relative bg-red-100 rounded-full", children: /* @__PURE__ */ jsx(FaRegTrashAlt, { className: "w-6 h-6 left-[12px] top-[12px] absolute" }) }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "self-stretch h-16 flex-col justify-start items-start gap-1 flex", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7", children: title }),
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: "self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight", children: description })
|
|
56
60
|
] })
|
|
57
61
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
59
63
|
"div",
|
|
60
64
|
{
|
|
61
65
|
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",
|
|
62
|
-
onClick:
|
|
63
|
-
children: /* @__PURE__ */
|
|
66
|
+
onClick: cancelAction,
|
|
67
|
+
children: /* @__PURE__ */ jsx(IoCloseOutline, { className: "w-6 h-6 relative text-gray-400" })
|
|
64
68
|
}
|
|
65
69
|
)
|
|
66
70
|
]
|
|
67
71
|
}
|
|
68
72
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
70
74
|
"div",
|
|
71
75
|
{
|
|
72
76
|
id: "actions",
|
|
73
77
|
className: "self-stretch h-24 pt-8 flex-col justify-start items-start flex z-40",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ jsxs("div", { className: "self-stretch px-6 pb-6 justify-start items-start gap-3 inline-flex", children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
76
80
|
"div",
|
|
77
81
|
{
|
|
78
82
|
className: "grow shrink basis-0 h-11 px-4 py-2.5 bg-white rounded-lg shadow border border-gray-300 justify-center items-center gap-1.5 flex cursor-pointer",
|
|
79
|
-
onClick:
|
|
80
|
-
children: /* @__PURE__ */
|
|
83
|
+
onClick: cancelAction,
|
|
84
|
+
children: /* @__PURE__ */ jsx("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ jsx("button", { className: "text-slate-700 text-base font-semibold font-['Inter'] leading-normal", children: cancelText || "Zrušit" }) })
|
|
81
85
|
}
|
|
82
86
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
84
88
|
"div",
|
|
85
89
|
{
|
|
86
90
|
className: "grow shrink basis-0 h-11 px-4 py-2.5 bg-red-600 rounded-lg shadow border border-red-600 justify-center items-center gap-1.5 flex cursor-pointer",
|
|
87
|
-
onClick:
|
|
88
|
-
children: /* @__PURE__ */
|
|
91
|
+
onClick: confirmAction,
|
|
92
|
+
children: /* @__PURE__ */ jsx("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ jsx("button", { className: "text-white text-base font-semibold font-['Inter'] leading-normal", children: agreeeText || "OK" }) })
|
|
89
93
|
}
|
|
90
94
|
)
|
|
91
95
|
] })
|
|
@@ -96,6 +100,7 @@ function b({
|
|
|
96
100
|
);
|
|
97
101
|
}
|
|
98
102
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
ConfirmationModalDialog,
|
|
104
|
+
ConfirmationModalDialog as default
|
|
101
105
|
};
|
|
106
|
+
//# sourceMappingURL=ConfirmationModalDialog.js.map
|