@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.
Files changed (126) hide show
  1. package/dist/Combination-D2GKeTwa.js +1162 -0
  2. package/dist/Combination-D2GKeTwa.js.map +1 -0
  3. package/dist/Dialog-BWa_flly.js +424 -0
  4. package/dist/Dialog-BWa_flly.js.map +1 -0
  5. package/dist/Dialog-CCrUyF91.js +424 -0
  6. package/dist/Dialog-CCrUyF91.js.map +1 -0
  7. package/dist/assets/style.css +61 -8
  8. package/dist/chevron-down-CfJmko7t.js +14 -0
  9. package/dist/chevron-down-CfJmko7t.js.map +1 -0
  10. package/dist/components/Attachments.js +2 -1
  11. package/dist/components/Attachments.js.map +1 -1
  12. package/dist/components/ConfirmationModalDialog.js +1 -1
  13. package/dist/components/ConfirmationModalDialog.js.map +1 -1
  14. package/dist/components/Modal.js +1 -1
  15. package/dist/components/Modal.js.map +1 -1
  16. package/dist/components/datatable/DataTable.js +3 -2
  17. package/dist/components/datatable/DataTable.js.map +1 -1
  18. package/dist/components/datatable/DataTableServer.js +96 -61
  19. package/dist/components/datatable/DataTableServer.js.map +1 -1
  20. package/dist/components/form/AutocompleteSearchBar.js +5 -4
  21. package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
  22. package/dist/components/form/AutocompleteSearchBarServer.js +2 -1
  23. package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
  24. package/dist/components/form/DateRangeField.js +2 -2
  25. package/dist/components/form/DateRangeField.js.map +1 -1
  26. package/dist/components/form/FileInput.js +3 -2
  27. package/dist/components/form/FileInput.js.map +1 -1
  28. package/dist/components/form/FileInputMultiple.js +3 -2
  29. package/dist/components/form/FileInputMultiple.js.map +1 -1
  30. package/dist/components/form/FormField.js +8 -7
  31. package/dist/components/form/FormField.js.map +1 -1
  32. package/dist/components/form/InputField.js +3 -2
  33. package/dist/components/form/InputField.js.map +1 -1
  34. package/dist/components/form/PositionsSelectorSingle.js +2 -1
  35. package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
  36. package/dist/components/form/RadioGroup.js +1 -1
  37. package/dist/components/form/RadioGroup.js.map +1 -1
  38. package/dist/components/form/SelectField.js +5 -4
  39. package/dist/components/form/SelectField.js.map +1 -1
  40. package/dist/components/layout/Neoptimizovano.js +2 -1
  41. package/dist/components/layout/Neoptimizovano.js.map +1 -1
  42. package/dist/components/layout/PageTitle.js +1 -1
  43. package/dist/components/layout/PageTitle.js.map +1 -1
  44. package/dist/components/layout/SectionTitle.js +1 -1
  45. package/dist/components/layout/SectionTitle.js.map +1 -1
  46. package/dist/components/profiles/ProfileOverview.js +2 -1
  47. package/dist/components/profiles/ProfileOverview.js.map +1 -1
  48. package/dist/components/ui/Combobox.js +1 -1
  49. package/dist/components/ui/DatePicker.js +1 -1
  50. package/dist/components/ui/DateTimePicker.js +1 -1
  51. package/dist/components/ui/Dialog.js +1 -1
  52. package/dist/components/ui/ScrollArea.js +2 -2
  53. package/dist/components/ui/async-combobox.d.ts +40 -0
  54. package/dist/components/ui/async-combobox.js +5706 -0
  55. package/dist/components/ui/async-combobox.js.map +1 -0
  56. package/dist/components/ui/badge.d.ts +9 -0
  57. package/dist/components/ui/badge.js +27 -0
  58. package/dist/components/ui/badge.js.map +1 -0
  59. package/dist/components/ui/checkbox.js +4 -4
  60. package/dist/components/ui/command.js +2 -2
  61. package/dist/components/ui/multi-select.d.ts +67 -0
  62. package/dist/components/ui/multi-select.js +295 -0
  63. package/dist/components/ui/multi-select.js.map +1 -0
  64. package/dist/components/ui/popover.js +1 -1
  65. package/dist/components/ui/radioGroup.js +5 -5
  66. package/dist/components/ui/select.js +8 -16
  67. package/dist/components/ui/select.js.map +1 -1
  68. package/dist/components/ui/toast.js +5 -5
  69. package/dist/components/ui/tooltip.js +6 -6
  70. package/dist/index-B0wyIFEr.js +47 -0
  71. package/dist/index-B0wyIFEr.js.map +1 -0
  72. package/dist/index-BcR8DnnV.js +234 -0
  73. package/dist/index-BcR8DnnV.js.map +1 -0
  74. package/dist/index-CDptxuif.js +234 -0
  75. package/dist/index-CDptxuif.js.map +1 -0
  76. package/dist/index-CK9QfV6i.js +40 -0
  77. package/dist/index-CK9QfV6i.js.map +1 -0
  78. package/dist/index-CcNKXchf.js +2203 -0
  79. package/dist/index-CcNKXchf.js.map +1 -0
  80. package/dist/index-CpcwEIT_.js +18 -0
  81. package/dist/index-CpcwEIT_.js.map +1 -0
  82. package/dist/index-CulRZKWg.js +2212 -0
  83. package/dist/index-CulRZKWg.js.map +1 -0
  84. package/dist/index-D75exu1X.js +18 -0
  85. package/dist/index-D75exu1X.js.map +1 -0
  86. package/dist/index-DoYsULhE.js +28878 -0
  87. package/dist/index-DoYsULhE.js.map +1 -0
  88. package/dist/index-Dr6Ds0Bg.js +1162 -0
  89. package/dist/index-Dr6Ds0Bg.js.map +1 -0
  90. package/dist/index-DsU1clfi.js +36 -0
  91. package/dist/index-DsU1clfi.js.map +1 -0
  92. package/dist/index-DzfDO78K.js +15 -0
  93. package/dist/index-DzfDO78K.js.map +1 -0
  94. package/dist/index-NZPkObcw.js +110 -0
  95. package/dist/index-NZPkObcw.js.map +1 -0
  96. package/dist/index-Vp9wI6hE.js +2203 -0
  97. package/dist/index-Vp9wI6hE.js.map +1 -0
  98. package/dist/index-qqHvAsVd.js +2266 -0
  99. package/dist/index-qqHvAsVd.js.map +1 -0
  100. package/dist/index-wO-IHm1z.js +131 -0
  101. package/dist/index-wO-IHm1z.js.map +1 -0
  102. package/dist/main.d.ts +1 -0
  103. package/dist/main.js +3 -1
  104. package/dist/main.js.map +1 -1
  105. package/dist/plus-sawBIbEd.js +26 -0
  106. package/dist/plus-sawBIbEd.js.map +1 -0
  107. package/dist/popover-CcrzvSk7.js +319 -0
  108. package/dist/popover-CcrzvSk7.js.map +1 -0
  109. package/dist/popover-DhdNw4fZ.js +319 -0
  110. package/dist/popover-DhdNw4fZ.js.map +1 -0
  111. package/lib/components/ConfirmationModalDialog.tsx +1 -1
  112. package/lib/components/Modal.tsx +1 -1
  113. package/lib/components/datatable/DataTable.tsx +1 -1
  114. package/lib/components/datatable/DataTableServer.tsx +113 -58
  115. package/lib/components/form/AutocompleteSearchBar.tsx +3 -3
  116. package/lib/components/form/DateRangeField.tsx +2 -2
  117. package/lib/components/form/FormField.tsx +6 -6
  118. package/lib/components/form/InputField.tsx +3 -2
  119. package/lib/components/form/RadioGroup.tsx +1 -1
  120. package/lib/components/form/SelectField.tsx +3 -3
  121. package/lib/components/layout/PageTitle.tsx +19 -19
  122. package/lib/components/layout/SectionTitle.tsx +1 -1
  123. package/lib/components/ui/badge.tsx +36 -0
  124. package/lib/components/ui/multi-select.tsx +365 -0
  125. package/lib/main.ts +4 -0
  126. 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-BmQoVu5C.js";
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, _e, _f, _g;
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: ((_a2 = response.data) == null ? void 0 : _a2.content) ? response.data.empty : true,
21753
- first: ((_b2 = response.data) == null ? void 0 : _b2.content) ? response.data.first : true,
21754
- last: ((_c = response.data) == null ? void 0 : _c.content) ? response.data.last : true,
21755
- number: ((_d = response.data) == null ? void 0 : _d.content) ? response.data.number : 0,
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: ((_e = response.data) == null ? void 0 : _e.size) || itemsPerPage,
21758
- totalElements: ((_f = response.data) == null ? void 0 : _f.totalElements) || response.data.length,
21759
- totalPages: ((_g = response.data) == null ? void 0 : _g.totalPages) || 1
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 !== null && value !== "") {
21794
- acc[key] = value;
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: " px-0",
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-gray-900" : "text-gray-700"} ${classes || ""}`,
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: "flex inline-flex align-middle",
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
- /* @__PURE__ */ jsxs("div", { className: "w-full p-5 flex gap-5 justify-between md:flex-row flex-col", children: [
22382
- /* @__PURE__ */ jsxs("div", { className: "flex gap-5 text-sm ", children: [
22383
- data && /* @__PURE__ */ jsxs(
22384
- Button,
22385
- {
22386
- variant: "secondary",
22387
- onClick: prevPage,
22388
- className: "flex items-center",
22389
- disabled: data.first || isLoading,
22390
- children: [
22391
- /* @__PURE__ */ jsx(MdArrowBack, { className: "mr-1.5" }),
22392
- " Předchozí"
22393
- ]
22394
- }
22395
- ),
22396
- data && /* @__PURE__ */ jsxs(
22397
- Button,
22398
- {
22399
- variant: "secondary",
22400
- onClick: nextPage,
22401
- className: "flex items-center",
22402
- disabled: data.last || isLoading,
22403
- children: [
22404
- "Následující ",
22405
- /* @__PURE__ */ jsx(MdArrowForward, { className: "ml-2", size: 20 })
22406
- ]
22407
- }
22408
- )
22409
- ] }),
22410
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center text-gray-800", children: paginationDisplay }),
22411
- /* @__PURE__ */ jsxs("div", { className: "content-center w-auto items-center justify-end flex-row gap-5 flex md:mt-0 mt-5", children: [
22412
- /* @__PURE__ */ jsx("span", { className: " whitespace-nowrap flex-grow", children: "Počet řádků na stránku:" }),
22413
- /* @__PURE__ */ jsx(
22414
- SelectField,
22415
- {
22416
- name: "itemsPerPage",
22417
- onInputChange: handleItemsPerPageChange,
22418
- className: "!w-[100px]",
22419
- options: itemsPerPageOptions || defaultItemsPerPageOptions,
22420
- value: itemsPerPageLocal
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
  ) });