@addsign/moje-agenda-shared-lib 2.0.40 → 2.0.42
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/Combination-D2GKeTwa.js +1162 -0
- package/dist/Combination-D2GKeTwa.js.map +1 -0
- package/dist/Dialog-BWa_flly.js +424 -0
- package/dist/Dialog-BWa_flly.js.map +1 -0
- package/dist/Dialog-CCrUyF91.js +424 -0
- package/dist/Dialog-CCrUyF91.js.map +1 -0
- package/dist/assets/style.css +61 -8
- package/dist/chevron-down-CfJmko7t.js +14 -0
- package/dist/chevron-down-CfJmko7t.js.map +1 -0
- package/dist/components/Attachments.js +2 -1
- package/dist/components/Attachments.js.map +1 -1
- package/dist/components/ConfirmationModalDialog.js +1 -1
- package/dist/components/ConfirmationModalDialog.js.map +1 -1
- package/dist/components/Modal.js +1 -1
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/datatable/DataTable.js +3 -2
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +96 -61
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +5 -4
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/DateRangeField.js +2 -2
- package/dist/components/form/DateRangeField.js.map +1 -1
- package/dist/components/form/FileInput.js +3 -2
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +3 -2
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +8 -7
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/InputField.js +3 -2
- package/dist/components/form/InputField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +2 -1
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/RadioGroup.js +1 -1
- package/dist/components/form/RadioGroup.js.map +1 -1
- package/dist/components/form/SelectField.js +5 -4
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/layout/Neoptimizovano.js +2 -1
- package/dist/components/layout/Neoptimizovano.js.map +1 -1
- package/dist/components/layout/PageTitle.js +1 -1
- package/dist/components/layout/PageTitle.js.map +1 -1
- package/dist/components/layout/SectionTitle.js +1 -1
- package/dist/components/layout/SectionTitle.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +2 -1
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.js +1 -1
- package/dist/components/ui/DatePicker.js +1 -1
- package/dist/components/ui/DateTimePicker.js +1 -1
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/ScrollArea.js +2 -2
- package/dist/components/ui/async-combobox.d.ts +40 -0
- package/dist/components/ui/async-combobox.js +5706 -0
- package/dist/components/ui/async-combobox.js.map +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +27 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/checkbox.js +4 -4
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/multi-select.d.ts +67 -0
- package/dist/components/ui/multi-select.js +295 -0
- package/dist/components/ui/multi-select.js.map +1 -0
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/radioGroup.js +5 -5
- package/dist/components/ui/select.js +8 -16
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/toast.js +5 -5
- package/dist/components/ui/tooltip.js +6 -6
- package/dist/index-B0wyIFEr.js +47 -0
- package/dist/index-B0wyIFEr.js.map +1 -0
- package/dist/index-BcR8DnnV.js +234 -0
- package/dist/index-BcR8DnnV.js.map +1 -0
- package/dist/index-CDptxuif.js +234 -0
- package/dist/index-CDptxuif.js.map +1 -0
- package/dist/index-CK9QfV6i.js +40 -0
- package/dist/index-CK9QfV6i.js.map +1 -0
- package/dist/index-CcNKXchf.js +2203 -0
- package/dist/index-CcNKXchf.js.map +1 -0
- package/dist/index-CpcwEIT_.js +18 -0
- package/dist/index-CpcwEIT_.js.map +1 -0
- package/dist/index-CulRZKWg.js +2212 -0
- package/dist/index-CulRZKWg.js.map +1 -0
- package/dist/index-D75exu1X.js +18 -0
- package/dist/index-D75exu1X.js.map +1 -0
- package/dist/index-DoYsULhE.js +28878 -0
- package/dist/index-DoYsULhE.js.map +1 -0
- package/dist/index-Dr6Ds0Bg.js +1162 -0
- package/dist/index-Dr6Ds0Bg.js.map +1 -0
- package/dist/index-DsU1clfi.js +36 -0
- package/dist/index-DsU1clfi.js.map +1 -0
- package/dist/index-DzfDO78K.js +15 -0
- package/dist/index-DzfDO78K.js.map +1 -0
- package/dist/index-NZPkObcw.js +110 -0
- package/dist/index-NZPkObcw.js.map +1 -0
- package/dist/index-Vp9wI6hE.js +2203 -0
- package/dist/index-Vp9wI6hE.js.map +1 -0
- package/dist/index-qqHvAsVd.js +2266 -0
- package/dist/index-qqHvAsVd.js.map +1 -0
- package/dist/index-wO-IHm1z.js +131 -0
- package/dist/index-wO-IHm1z.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +3 -1
- package/dist/main.js.map +1 -1
- package/dist/plus-sawBIbEd.js +26 -0
- package/dist/plus-sawBIbEd.js.map +1 -0
- package/dist/popover-CcrzvSk7.js +319 -0
- package/dist/popover-CcrzvSk7.js.map +1 -0
- package/dist/popover-DhdNw4fZ.js +319 -0
- package/dist/popover-DhdNw4fZ.js.map +1 -0
- package/lib/components/ConfirmationModalDialog.tsx +1 -1
- package/lib/components/Modal.tsx +1 -1
- package/lib/components/datatable/DataTable.tsx +1 -1
- package/lib/components/datatable/DataTableServer.tsx +113 -58
- package/lib/components/form/AutocompleteSearchBar.tsx +3 -3
- package/lib/components/form/DateRangeField.tsx +2 -2
- package/lib/components/form/FormField.tsx +6 -6
- package/lib/components/form/InputField.tsx +3 -2
- package/lib/components/form/RadioGroup.tsx +1 -1
- package/lib/components/form/SelectField.tsx +3 -3
- package/lib/components/layout/PageTitle.tsx +19 -19
- package/lib/components/layout/SectionTitle.tsx +1 -1
- package/lib/components/ui/badge.tsx +36 -0
- package/lib/components/ui/multi-select.tsx +365 -0
- package/lib/main.ts +4 -0
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import "../../jspdf.plugin.autotable-7hp3hM-a.js";
|
|
|
13
13
|
import "../../contexts/FederationContext.js";
|
|
14
14
|
import { useFederationContext } from "../../contexts/useFederationContext.js";
|
|
15
15
|
import { handleErrors } from "../../utils/handleErrors.js";
|
|
16
|
-
import "../../Dialog-
|
|
16
|
+
import "../../Dialog-CCrUyF91.js";
|
|
17
17
|
import "../ui/ScrollArea.js";
|
|
18
18
|
import "../ui/input.js";
|
|
19
19
|
import "../ui/form.js";
|
|
@@ -25,6 +25,7 @@ import "../ui/tooltip.js";
|
|
|
25
25
|
import "../ui/separator.js";
|
|
26
26
|
import "../ui/textarea.js";
|
|
27
27
|
import "../ui/checkbox.js";
|
|
28
|
+
import { MultiSelect } from "../ui/multi-select.js";
|
|
28
29
|
import "../ui/button.js";
|
|
29
30
|
import "../../Calendar-DWT4e7Th.js";
|
|
30
31
|
import "../ui/DateTimePicker.js";
|
|
@@ -21746,17 +21747,19 @@ function DataTableServer({
|
|
|
21746
21747
|
const [showColFilters, setShowColFilters] = useState();
|
|
21747
21748
|
const [sortConfig, setSortConfig] = useState(null);
|
|
21748
21749
|
const createDataPageable = (response, itemsPerPage) => {
|
|
21749
|
-
var _a2, _b2, _c, _d
|
|
21750
|
+
var _a2, _b2, _c, _d;
|
|
21751
|
+
const isPageable = !!((_a2 = response.data) == null ? void 0 : _a2.content);
|
|
21750
21752
|
return {
|
|
21751
21753
|
content: response.data.content || response.data,
|
|
21752
|
-
empty:
|
|
21753
|
-
first:
|
|
21754
|
-
last:
|
|
21755
|
-
number:
|
|
21754
|
+
empty: isPageable ? response.data.empty : true,
|
|
21755
|
+
first: isPageable ? response.data.first : true,
|
|
21756
|
+
last: isPageable ? response.data.last : true,
|
|
21757
|
+
number: isPageable ? response.data.number : 0,
|
|
21756
21758
|
numberOfElements: response.data.numberOfElements || response.data.length,
|
|
21757
|
-
size: ((
|
|
21758
|
-
totalElements: ((
|
|
21759
|
-
totalPages: ((
|
|
21759
|
+
size: ((_b2 = response.data) == null ? void 0 : _b2.size) || itemsPerPage,
|
|
21760
|
+
totalElements: ((_c = response.data) == null ? void 0 : _c.totalElements) || response.data.length,
|
|
21761
|
+
totalPages: ((_d = response.data) == null ? void 0 : _d.totalPages) || 1,
|
|
21762
|
+
isPageable
|
|
21760
21763
|
};
|
|
21761
21764
|
};
|
|
21762
21765
|
const [reloadData, setReloadData] = useState(false);
|
|
@@ -21790,16 +21793,22 @@ function DataTableServer({
|
|
|
21790
21793
|
setIsLoading(true);
|
|
21791
21794
|
const filteredMergedFilters = Object.entries(mergedFilters).reduce(
|
|
21792
21795
|
(acc, [key, value]) => {
|
|
21793
|
-
if (value
|
|
21794
|
-
acc
|
|
21796
|
+
if (value === null || value === "") {
|
|
21797
|
+
return acc;
|
|
21795
21798
|
}
|
|
21799
|
+
if (Array.isArray(value)) {
|
|
21800
|
+
if (value.length > 0) {
|
|
21801
|
+
acc[key] = value.join(",");
|
|
21802
|
+
}
|
|
21803
|
+
return acc;
|
|
21804
|
+
}
|
|
21805
|
+
acc[key] = value;
|
|
21796
21806
|
return acc;
|
|
21797
21807
|
},
|
|
21798
21808
|
{}
|
|
21799
21809
|
);
|
|
21800
21810
|
federationContext.apiClient.get(url, {
|
|
21801
21811
|
signal: currentAbortController.signal,
|
|
21802
|
-
// Pass the AbortController signal to the request
|
|
21803
21812
|
params: {
|
|
21804
21813
|
...filteredMergedFilters,
|
|
21805
21814
|
pageSize: itemsPerPageLocal,
|
|
@@ -21889,13 +21898,15 @@ function DataTableServer({
|
|
|
21889
21898
|
const updateFilterOptions = async () => {
|
|
21890
21899
|
const newFilterOptions = {};
|
|
21891
21900
|
for (const column of columns) {
|
|
21892
|
-
if (column.filterType === "select" && (column.filterSource || column.filterOptions) && column.filterValueKey && column.filterLabelKey && column.filterParam) {
|
|
21901
|
+
if ((column.filterType === "select" || column.filterType === "multi-select") && (column.filterSource || column.filterOptions) && column.filterValueKey && column.filterLabelKey && column.filterParam) {
|
|
21893
21902
|
const options = await fetchFilterOptions(column);
|
|
21894
|
-
if (options) {
|
|
21903
|
+
if (options && column.filterType === "select") {
|
|
21895
21904
|
newFilterOptions[column.filterParam] = [
|
|
21896
21905
|
{ value: "", label: "" },
|
|
21897
21906
|
...options
|
|
21898
21907
|
];
|
|
21908
|
+
} else if (options && column.filterType === "multi-select") {
|
|
21909
|
+
newFilterOptions[column.filterParam] = options;
|
|
21899
21910
|
}
|
|
21900
21911
|
}
|
|
21901
21912
|
}
|
|
@@ -22219,7 +22230,7 @@ function DataTableServer({
|
|
|
22219
22230
|
options: filterOptions[String(filterParam)] || [],
|
|
22220
22231
|
value: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam)]) ?? "",
|
|
22221
22232
|
clearable: true,
|
|
22222
|
-
className: "
|
|
22233
|
+
className: "px-0",
|
|
22223
22234
|
placeholder: "Zadejte filtr",
|
|
22224
22235
|
rounded: true,
|
|
22225
22236
|
disabled: Object.keys(
|
|
@@ -22227,6 +22238,23 @@ function DataTableServer({
|
|
|
22227
22238
|
).includes(String(filterParam))
|
|
22228
22239
|
},
|
|
22229
22240
|
JSON.stringify(mergedFilters)
|
|
22241
|
+
) : filterType === "multi-select" ? /* @__PURE__ */ jsx(
|
|
22242
|
+
MultiSelect,
|
|
22243
|
+
{
|
|
22244
|
+
options: filterOptions[String(filterParam)] || [],
|
|
22245
|
+
onChange: (values) => filterHandler(
|
|
22246
|
+
filterParam,
|
|
22247
|
+
values
|
|
22248
|
+
),
|
|
22249
|
+
value: (mergedFilters == null ? void 0 : mergedFilters[String(filterParam)]) || [],
|
|
22250
|
+
placeholder: "Zadejte filtr",
|
|
22251
|
+
className: "px-0",
|
|
22252
|
+
disabled: Object.keys(
|
|
22253
|
+
filters || {}
|
|
22254
|
+
).includes(String(filterParam)),
|
|
22255
|
+
variant: "secondary"
|
|
22256
|
+
},
|
|
22257
|
+
JSON.stringify(mergedFilters)
|
|
22230
22258
|
) : filterType === "dateRange" ? /* @__PURE__ */ jsx(
|
|
22231
22259
|
DateRangeField,
|
|
22232
22260
|
{
|
|
@@ -22319,7 +22347,7 @@ function DataTableServer({
|
|
|
22319
22347
|
"td",
|
|
22320
22348
|
{
|
|
22321
22349
|
onClick: rowAction ? () => rowAction(item) : void 0,
|
|
22322
|
-
className: `px-3 py-2 ${rowAction ? "cursor-pointer" : ""} ${colIndex === 0 ? "font-medium text-
|
|
22350
|
+
className: `px-3 py-2 ${rowAction ? "cursor-pointer" : ""} ${colIndex === 0 ? "font-medium text-muted-foreground" : "text-gray-700"} ${classes || ""}`,
|
|
22323
22351
|
children: [
|
|
22324
22352
|
render ? render(item) : "",
|
|
22325
22353
|
actions && actions.filter((it) => {
|
|
@@ -22332,7 +22360,7 @@ function DataTableServer({
|
|
|
22332
22360
|
}).map((action, actionIndex) => /* @__PURE__ */ jsxs(
|
|
22333
22361
|
"div",
|
|
22334
22362
|
{
|
|
22335
|
-
className: "
|
|
22363
|
+
className: "inline-flex align-middle",
|
|
22336
22364
|
children: [
|
|
22337
22365
|
action.icon && /* @__PURE__ */ jsx(
|
|
22338
22366
|
Button,
|
|
@@ -22378,50 +22406,57 @@ function DataTableServer({
|
|
|
22378
22406
|
isLoading && /* @__PURE__ */ jsx("tbody", { className: "relative", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-[500px] py-2", children: /* @__PURE__ */ jsx(Spinner, {}) }) }) }) }),
|
|
22379
22407
|
!isLoading && (!data || ((_b = data == null ? void 0 : data.content) == null ? void 0 : _b.length) === 0) && /* @__PURE__ */ jsx("tbody", { className: "relative h-[440px]", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 100, children: /* @__PURE__ */ jsx("div", { className: "w-full flex items-center justify-center h-full py-2 text-gray-600 font-medium text-xs ", children: "Žádná data" }) }) }) })
|
|
22380
22408
|
] }, tableKey) }),
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
|
|
22387
|
-
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
|
|
22394
|
-
|
|
22395
|
-
|
|
22396
|
-
|
|
22397
|
-
|
|
22398
|
-
|
|
22399
|
-
|
|
22400
|
-
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22412
|
-
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
{
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
|
|
22420
|
-
|
|
22421
|
-
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
|
|
22409
|
+
(data == null ? void 0 : data.isPageable) && /* @__PURE__ */ jsxs(
|
|
22410
|
+
"div",
|
|
22411
|
+
{
|
|
22412
|
+
"data-cy": "pagination",
|
|
22413
|
+
className: "w-full p-5 flex gap-5 justify-between md:flex-row flex-col",
|
|
22414
|
+
children: [
|
|
22415
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-5 text-sm ", children: [
|
|
22416
|
+
data && /* @__PURE__ */ jsxs(
|
|
22417
|
+
Button,
|
|
22418
|
+
{
|
|
22419
|
+
variant: "secondary",
|
|
22420
|
+
onClick: prevPage,
|
|
22421
|
+
className: "flex items-center",
|
|
22422
|
+
disabled: data.first || isLoading,
|
|
22423
|
+
children: [
|
|
22424
|
+
/* @__PURE__ */ jsx(MdArrowBack, { className: "mr-1.5" }),
|
|
22425
|
+
" Předchozí"
|
|
22426
|
+
]
|
|
22427
|
+
}
|
|
22428
|
+
),
|
|
22429
|
+
data && /* @__PURE__ */ jsxs(
|
|
22430
|
+
Button,
|
|
22431
|
+
{
|
|
22432
|
+
variant: "secondary",
|
|
22433
|
+
onClick: nextPage,
|
|
22434
|
+
className: "flex items-center",
|
|
22435
|
+
disabled: data.last || isLoading,
|
|
22436
|
+
children: [
|
|
22437
|
+
"Následující ",
|
|
22438
|
+
/* @__PURE__ */ jsx(MdArrowForward, { className: "ml-2", size: 20 })
|
|
22439
|
+
]
|
|
22440
|
+
}
|
|
22441
|
+
)
|
|
22442
|
+
] }),
|
|
22443
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center text-gray-800", children: paginationDisplay }),
|
|
22444
|
+
/* @__PURE__ */ jsxs("div", { className: "content-center w-auto items-center justify-end flex-row gap-5 flex md:mt-0 mt-5", children: [
|
|
22445
|
+
/* @__PURE__ */ jsx("span", { className: " whitespace-nowrap flex-grow", children: "Počet řádků na stránku:" }),
|
|
22446
|
+
/* @__PURE__ */ jsx(
|
|
22447
|
+
SelectField,
|
|
22448
|
+
{
|
|
22449
|
+
name: "itemsPerPage",
|
|
22450
|
+
onInputChange: handleItemsPerPageChange,
|
|
22451
|
+
className: "!w-[100px]",
|
|
22452
|
+
options: itemsPerPageOptions || defaultItemsPerPageOptions,
|
|
22453
|
+
value: itemsPerPageLocal
|
|
22454
|
+
}
|
|
22455
|
+
)
|
|
22456
|
+
] })
|
|
22457
|
+
]
|
|
22458
|
+
}
|
|
22459
|
+
)
|
|
22425
22460
|
]
|
|
22426
22461
|
}
|
|
22427
22462
|
) });
|