@addsign/moje-agenda-shared-lib 0.0.55 → 0.0.57
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 +31 -16
- package/dist/components/datatable/DataTable.js +1 -1
- package/dist/components/datatable/DataTableServer.js +198 -186
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +3 -3
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/FileInput.js +1 -1
- package/dist/components/form/FormField.js +1 -1
- package/dist/components/form/InputField.d.ts +6 -0
- package/dist/components/form/InputField.js +144 -0
- package/dist/components/form/InputField.js.map +1 -0
- package/dist/components/form/PositionsSelectorSingle.js +1 -1
- package/dist/components/form/SelectField.d.ts +3 -19
- package/dist/components/form/SelectField.js +33 -19
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/{index-qxZYrVct.js → index-BDqNIr_C.js} +12 -12
- package/dist/{index-qxZYrVct.js.map → index-BDqNIr_C.js.map} +1 -1
- package/dist/types.d.ts +18 -0
- package/package.json +1 -1
package/dist/assets/tailwind.css
CHANGED
|
@@ -593,8 +593,8 @@ video {
|
|
|
593
593
|
.right-0 {
|
|
594
594
|
right: 0px;
|
|
595
595
|
}
|
|
596
|
-
.right-
|
|
597
|
-
right:
|
|
596
|
+
.right-6 {
|
|
597
|
+
right: 1.5rem;
|
|
598
598
|
}
|
|
599
599
|
.top-0 {
|
|
600
600
|
top: 0px;
|
|
@@ -626,12 +626,18 @@ video {
|
|
|
626
626
|
.top-\[96px\] {
|
|
627
627
|
top: 96px;
|
|
628
628
|
}
|
|
629
|
+
.top-auto {
|
|
630
|
+
top: auto;
|
|
631
|
+
}
|
|
629
632
|
.z-40 {
|
|
630
633
|
z-index: 40;
|
|
631
634
|
}
|
|
632
635
|
.z-50 {
|
|
633
636
|
z-index: 50;
|
|
634
637
|
}
|
|
638
|
+
.z-\[100000\] {
|
|
639
|
+
z-index: 100000;
|
|
640
|
+
}
|
|
635
641
|
.col-span-12 {
|
|
636
642
|
grid-column: span 12 / span 12;
|
|
637
643
|
}
|
|
@@ -692,8 +698,8 @@ video {
|
|
|
692
698
|
.mt-0 {
|
|
693
699
|
margin-top: 0px;
|
|
694
700
|
}
|
|
695
|
-
.mt-\[
|
|
696
|
-
margin-top:
|
|
701
|
+
.mt-\[4px\] {
|
|
702
|
+
margin-top: 4px;
|
|
697
703
|
}
|
|
698
704
|
.mt-auto {
|
|
699
705
|
margin-top: auto;
|
|
@@ -764,9 +770,6 @@ video {
|
|
|
764
770
|
.h-\[400px\] {
|
|
765
771
|
height: 400px;
|
|
766
772
|
}
|
|
767
|
-
.h-\[600px\] {
|
|
768
|
-
height: 600px;
|
|
769
|
-
}
|
|
770
773
|
.h-full {
|
|
771
774
|
height: 100%;
|
|
772
775
|
}
|
|
@@ -827,8 +830,8 @@ video {
|
|
|
827
830
|
.w-96 {
|
|
828
831
|
width: 24rem;
|
|
829
832
|
}
|
|
830
|
-
.w-\[
|
|
831
|
-
width:
|
|
833
|
+
.w-\[calc\(100\%-40px\)\] {
|
|
834
|
+
width: calc(100% - 40px);
|
|
832
835
|
}
|
|
833
836
|
.w-fit {
|
|
834
837
|
width: -moz-fit-content;
|
|
@@ -837,6 +840,9 @@ video {
|
|
|
837
840
|
.w-full {
|
|
838
841
|
width: 100%;
|
|
839
842
|
}
|
|
843
|
+
.min-w-32 {
|
|
844
|
+
min-width: 8rem;
|
|
845
|
+
}
|
|
840
846
|
.min-w-\[100px\] {
|
|
841
847
|
min-width: 100px;
|
|
842
848
|
}
|
|
@@ -903,6 +909,9 @@ video {
|
|
|
903
909
|
.justify-between {
|
|
904
910
|
justify-content: space-between;
|
|
905
911
|
}
|
|
912
|
+
.gap-0 {
|
|
913
|
+
gap: 0px;
|
|
914
|
+
}
|
|
906
915
|
.gap-1 {
|
|
907
916
|
gap: 0.25rem;
|
|
908
917
|
}
|
|
@@ -949,6 +958,12 @@ video {
|
|
|
949
958
|
.overflow-y-auto {
|
|
950
959
|
overflow-y: auto;
|
|
951
960
|
}
|
|
961
|
+
.overflow-ellipsis {
|
|
962
|
+
text-overflow: ellipsis;
|
|
963
|
+
}
|
|
964
|
+
.text-ellipsis {
|
|
965
|
+
text-overflow: ellipsis;
|
|
966
|
+
}
|
|
952
967
|
.whitespace-nowrap {
|
|
953
968
|
white-space: nowrap;
|
|
954
969
|
}
|
|
@@ -1063,6 +1078,10 @@ video {
|
|
|
1063
1078
|
--tw-bg-opacity: 1;
|
|
1064
1079
|
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
1065
1080
|
}
|
|
1081
|
+
.bg-gray-300 {
|
|
1082
|
+
--tw-bg-opacity: 1;
|
|
1083
|
+
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
|
1084
|
+
}
|
|
1066
1085
|
.bg-gray-50 {
|
|
1067
1086
|
--tw-bg-opacity: 1;
|
|
1068
1087
|
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
|
@@ -1130,10 +1149,6 @@ video {
|
|
|
1130
1149
|
padding-left: 0.75rem;
|
|
1131
1150
|
padding-right: 0.75rem;
|
|
1132
1151
|
}
|
|
1133
|
-
.px-3\.5 {
|
|
1134
|
-
padding-left: 0.875rem;
|
|
1135
|
-
padding-right: 0.875rem;
|
|
1136
|
-
}
|
|
1137
1152
|
.px-4 {
|
|
1138
1153
|
padding-left: 1rem;
|
|
1139
1154
|
padding-right: 1rem;
|
|
@@ -1190,9 +1205,6 @@ video {
|
|
|
1190
1205
|
.pl-1 {
|
|
1191
1206
|
padding-left: 0.25rem;
|
|
1192
1207
|
}
|
|
1193
|
-
.pl-1\.5 {
|
|
1194
|
-
padding-left: 0.375rem;
|
|
1195
|
-
}
|
|
1196
1208
|
.pl-2 {
|
|
1197
1209
|
padding-left: 0.5rem;
|
|
1198
1210
|
}
|
|
@@ -1386,6 +1398,9 @@ video {
|
|
|
1386
1398
|
.opacity-25 {
|
|
1387
1399
|
opacity: 0.25;
|
|
1388
1400
|
}
|
|
1401
|
+
.opacity-50 {
|
|
1402
|
+
opacity: 0.5;
|
|
1403
|
+
}
|
|
1389
1404
|
.opacity-75 {
|
|
1390
1405
|
opacity: 0.75;
|
|
1391
1406
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import '../../assets/tailwind.css';/* empty css */
|
|
4
4
|
import Button from "../Button.js";
|
|
5
|
-
import {
|
|
5
|
+
import { c as MdOutlineFilterAlt, d as MdOutlineFilterAltOff, e as MdSearch, b as MdClose, f as MdArrowBack, g as MdArrowForward, h as MdArrowUpward, i as MdArrowDownward } from "../../index-BDqNIr_C.js";
|
|
6
6
|
import FormField from "../form/FormField.js";
|
|
7
7
|
import Spinner from "../Spinner.js";
|
|
8
8
|
import "../../contexts/FederationContext.js";
|
|
@@ -2,11 +2,14 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import '../../assets/tailwind.css';/* empty css */
|
|
4
4
|
import Button from "../Button.js";
|
|
5
|
-
import {
|
|
5
|
+
import { c as MdOutlineFilterAlt, d as MdOutlineFilterAltOff, e as MdSearch, b as MdClose, f as MdArrowBack, g as MdArrowForward, h as MdArrowUpward, i as MdArrowDownward } from "../../index-BDqNIr_C.js";
|
|
6
6
|
import FormField from "../form/FormField.js";
|
|
7
|
+
import Spinner from "../Spinner.js";
|
|
7
8
|
import "../../contexts/FederationContext.js";
|
|
8
9
|
import { useFederationContext } from "../../contexts/useFederationContext.js";
|
|
9
10
|
import { handleErrors } from "../../utils/handleErrors.js";
|
|
11
|
+
import SelectField from "../form/SelectField.js";
|
|
12
|
+
import InputField from "../form/InputField.js";
|
|
10
13
|
function DataTableServer({
|
|
11
14
|
url,
|
|
12
15
|
columns,
|
|
@@ -79,18 +82,8 @@ function DataTableServer({
|
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
console.log(
|
|
83
|
-
"%clibcomponentsdatatableDataTable.tsx:142 newFilterOptions",
|
|
84
|
-
"color: #007acc;",
|
|
85
|
-
newFilterOptions
|
|
86
|
-
);
|
|
87
85
|
setFilterOptions(newFilterOptions);
|
|
88
86
|
};
|
|
89
|
-
console.log(
|
|
90
|
-
"%clibcomponentsDataTable.tsx:162 items, columns",
|
|
91
|
-
"color: #007acc;",
|
|
92
|
-
columns
|
|
93
|
-
);
|
|
94
87
|
updateFilterOptions();
|
|
95
88
|
}, [columns]);
|
|
96
89
|
const requestSort = (sortParam) => {
|
|
@@ -138,194 +131,213 @@ function DataTableServer({
|
|
|
138
131
|
};
|
|
139
132
|
const paginationDisplay = `Strana ${currentPage + 1} z ${data == null ? void 0 : data.totalPages}`;
|
|
140
133
|
const filterHandler = (filterParam, value) => {
|
|
141
|
-
console.log(
|
|
142
|
-
"%clibcomponentsdatatableDataTable.tsx:223 object filterParam, value, columnFilters ",
|
|
143
|
-
"color: #007acc;",
|
|
144
|
-
filterParam,
|
|
145
|
-
value,
|
|
146
|
-
columnFilters
|
|
147
|
-
);
|
|
148
134
|
setColumnFilters((prev) => ({ ...prev, [filterParam]: value }));
|
|
149
135
|
setCurrentPage(0);
|
|
150
136
|
};
|
|
151
137
|
const handleToggleShowColFilters = () => {
|
|
152
|
-
|
|
153
|
-
if (!showColFilters) {
|
|
138
|
+
if (showColFilters) {
|
|
154
139
|
setColumnFilters({});
|
|
155
140
|
}
|
|
141
|
+
setShowColFilters(!showColFilters);
|
|
156
142
|
};
|
|
157
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
fulltextSearch
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
{
|
|
202
|
-
label: header,
|
|
203
|
-
name: String(key) + "_filter",
|
|
204
|
-
onInputChange: (e) => filterHandler(
|
|
205
|
-
filterParam,
|
|
206
|
-
e.target.value
|
|
207
|
-
),
|
|
208
|
-
type: filterType,
|
|
209
|
-
options: filterOptions[String(filterParam)] || [],
|
|
210
|
-
value: columnFilters[String(filterParam)],
|
|
211
|
-
clearable: true,
|
|
212
|
-
className: "max-w-[300px] min-w-[100px]"
|
|
213
|
-
}
|
|
214
|
-
) })
|
|
215
|
-
},
|
|
216
|
-
String(key) + "_filter"
|
|
217
|
-
)) }),
|
|
218
|
-
/* @__PURE__ */ jsx("tr", { children: columns.map(({ key, header, actions, sortParam }) => /* @__PURE__ */ jsx(
|
|
219
|
-
"th",
|
|
220
|
-
{
|
|
221
|
-
className: `group font-medium leading-9 text-xs text-left px-5 text-gray-600 bg bg-gray-50 border-t border-b border-gray-200 ${!title && !subtitle ? "border-t-0" : ""} ${sortParam ? " cursor-pointer " : ""}`,
|
|
222
|
-
onClick: () => sortParam ? requestSort(sortParam) : () => {
|
|
223
|
-
},
|
|
224
|
-
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
225
|
-
header,
|
|
226
|
-
" ",
|
|
227
|
-
!actions && sortParam ? getSortIcon(sortParam) : ""
|
|
228
|
-
] })
|
|
229
|
-
},
|
|
230
|
-
String(key)
|
|
231
|
-
)) })
|
|
232
|
-
] }),
|
|
233
|
-
!isLoading && /* @__PURE__ */ jsxs("tbody", { children: [
|
|
234
|
-
data && data.content && data.content.map((item, rowIndex) => /* @__PURE__ */ jsx(
|
|
235
|
-
"tr",
|
|
236
|
-
{
|
|
237
|
-
className: `${item._isHighlighted ? " bg-gray-200 " : " "} hover:bg-gray-50 border-gray-200 border-b text-sm `,
|
|
238
|
-
children: columns.map(({ render, actions, classes }, colIndex) => /* @__PURE__ */ jsxs(
|
|
239
|
-
"td",
|
|
143
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: "shadow-lg border border-gray-200 rounded-xl overflow-x-auto",
|
|
147
|
+
style: { overflowY: "visible" },
|
|
148
|
+
children: [
|
|
149
|
+
(title || subtitle || allowSearch) && /* @__PURE__ */ jsxs("div", { className: "p-5 leading-9 flex ", children: [
|
|
150
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-grow", children: [
|
|
151
|
+
title && /* @__PURE__ */ jsx("h1", { className: "font-semibold text-xl leading-[42px] ", children: title }),
|
|
152
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "font-normal text-gray-600", children: subtitle })
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsxs(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: "flex items-center text-xl h-full p-3 cursor-pointer text-gray-500 ",
|
|
158
|
+
onClick: handleToggleShowColFilters,
|
|
159
|
+
children: [
|
|
160
|
+
!showColFilters && /* @__PURE__ */ jsx(MdOutlineFilterAlt, {}),
|
|
161
|
+
showColFilters && /* @__PURE__ */ jsx(MdOutlineFilterAltOff, {})
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
allowSearch && /* @__PURE__ */ jsx("div", { className: "ml-5", children: /* @__PURE__ */ jsxs(
|
|
166
|
+
FormField,
|
|
167
|
+
{
|
|
168
|
+
placeholder: "Vyhledávání",
|
|
169
|
+
name: "search",
|
|
170
|
+
onInputChange: handleSearchChanged,
|
|
171
|
+
type: "text",
|
|
172
|
+
value: fulltextSearch,
|
|
173
|
+
children: [
|
|
174
|
+
" ",
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: " text-gray-500 leading-5 flex items-center h-full", children: [
|
|
176
|
+
!fulltextSearch && /* @__PURE__ */ jsx(MdSearch, {}),
|
|
177
|
+
fulltextSearch && /* @__PURE__ */ jsx(MdClose, { onClick: () => setFulltextSearch("") })
|
|
178
|
+
] })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
) })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs("table", { className: "w-full leading-normal ", children: [
|
|
184
|
+
/* @__PURE__ */ jsxs("thead", { children: [
|
|
185
|
+
showColFilters && columns.findIndex((it) => it.filterType) > -1 && /* @__PURE__ */ jsx("tr", { children: columns.map(({ key, header, filterType, filterParam }) => /* @__PURE__ */ jsxs(
|
|
186
|
+
"th",
|
|
240
187
|
{
|
|
241
|
-
|
|
242
|
-
|
|
188
|
+
id: String(key) + "_filter",
|
|
189
|
+
className: ` font-medium leading-9 text-xs text-left p-0 pb-5 text-gray-600 overflow-ellipsis
|
|
190
|
+
whitespace-nowrap ${!title && !subtitle ? "border-t-0" : ""}`,
|
|
243
191
|
children: [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
192
|
+
filterType && filterType === "select" && /* @__PURE__ */ jsx(
|
|
193
|
+
SelectField,
|
|
194
|
+
{
|
|
195
|
+
label: header,
|
|
196
|
+
name: String(key) + "_filter",
|
|
197
|
+
onInputChange: (e) => filterHandler(
|
|
198
|
+
filterParam,
|
|
199
|
+
e.target.value
|
|
200
|
+
),
|
|
201
|
+
type: filterType,
|
|
202
|
+
options: filterOptions[String(filterParam)] || [],
|
|
203
|
+
value: columnFilters[String(filterParam)],
|
|
204
|
+
clearable: true,
|
|
205
|
+
className: "pl-5"
|
|
248
206
|
}
|
|
249
|
-
|
|
250
|
-
|
|
207
|
+
),
|
|
208
|
+
filterType && filterType !== "select" && /* @__PURE__ */ jsx(
|
|
209
|
+
InputField,
|
|
251
210
|
{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
),
|
|
265
|
-
!action.icon && /* @__PURE__ */ jsxs(
|
|
266
|
-
Button,
|
|
267
|
-
{
|
|
268
|
-
variant: "transparent",
|
|
269
|
-
onClick: () => action.onClick(item),
|
|
270
|
-
children: [
|
|
271
|
-
" ",
|
|
272
|
-
action.label
|
|
273
|
-
]
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
]
|
|
277
|
-
},
|
|
278
|
-
`${rowIndex}-${colIndex}-${actionIndex}`
|
|
279
|
-
))
|
|
211
|
+
label: header,
|
|
212
|
+
name: String(key) + "_filter",
|
|
213
|
+
onInputChange: (e) => filterHandler(
|
|
214
|
+
filterParam,
|
|
215
|
+
e.target.value
|
|
216
|
+
),
|
|
217
|
+
type: filterType,
|
|
218
|
+
value: columnFilters[String(filterParam)],
|
|
219
|
+
clearable: true,
|
|
220
|
+
className: "max-w-[300px] min-w-[100px] pl-5"
|
|
221
|
+
}
|
|
222
|
+
)
|
|
280
223
|
]
|
|
281
224
|
},
|
|
282
|
-
|
|
283
|
-
))
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
225
|
+
String(key) + "_filter"
|
|
226
|
+
)) }),
|
|
227
|
+
/* @__PURE__ */ jsx("tr", { children: columns.map(({ key, header, actions, sortParam }) => /* @__PURE__ */ jsx(
|
|
228
|
+
"th",
|
|
229
|
+
{
|
|
230
|
+
className: `group font-medium leading-9 text-xs text-left px-5 text-gray-600 bg bg-gray-50 border-t border-b border-gray-200 ${!title && !subtitle ? "border-t-0" : ""} ${sortParam ? " cursor-pointer " : ""}`,
|
|
231
|
+
onClick: () => sortParam ? requestSort(sortParam) : () => {
|
|
232
|
+
},
|
|
233
|
+
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
234
|
+
header,
|
|
235
|
+
" ",
|
|
236
|
+
!actions && sortParam ? getSortIcon(sortParam) : ""
|
|
237
|
+
] })
|
|
238
|
+
},
|
|
239
|
+
String(key)
|
|
240
|
+
)) })
|
|
241
|
+
] }),
|
|
242
|
+
data && (data == null ? void 0 : data.content) && (data == null ? void 0 : data.content.length) > 0 && /* @__PURE__ */ jsxs("tbody", { className: "relative", children: [
|
|
243
|
+
isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gray-300 opacity-50 z-50", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(Spinner, {}) }) }),
|
|
244
|
+
data.content.map((item, rowIndex) => /* @__PURE__ */ jsx(
|
|
245
|
+
"tr",
|
|
246
|
+
{
|
|
247
|
+
className: `${item._isHighlighted ? " bg-gray-200 " : " "} hover:bg-gray-50 border-gray-200 border-b text-sm `,
|
|
248
|
+
children: columns.map(({ render, actions, classes }, colIndex) => /* @__PURE__ */ jsxs(
|
|
249
|
+
"td",
|
|
250
|
+
{
|
|
251
|
+
className: `px-5 py-2
|
|
252
|
+
${colIndex == 0 ? " font-medium text-gray-900" : " text-gray-700"} ${classes || ""}`,
|
|
253
|
+
children: [
|
|
254
|
+
render ? render(item) : "",
|
|
255
|
+
actions && actions.filter((it) => {
|
|
256
|
+
if (it.visible) {
|
|
257
|
+
return it.visible(item);
|
|
258
|
+
}
|
|
259
|
+
}).map((action, actionIndex) => /* @__PURE__ */ jsxs(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
className: "flex inline-flex align-middle",
|
|
263
|
+
children: [
|
|
264
|
+
action.icon && /* @__PURE__ */ jsxs(
|
|
265
|
+
Button,
|
|
266
|
+
{
|
|
267
|
+
variant: "icon",
|
|
268
|
+
onClick: () => action.onClick(item),
|
|
269
|
+
children: [
|
|
270
|
+
" ",
|
|
271
|
+
action.icon
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
!action.icon && /* @__PURE__ */ jsxs(
|
|
276
|
+
Button,
|
|
277
|
+
{
|
|
278
|
+
variant: "transparent",
|
|
279
|
+
onClick: () => action.onClick(item),
|
|
280
|
+
children: [
|
|
281
|
+
" ",
|
|
282
|
+
action.label
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
`${rowIndex}-${colIndex}-${actionIndex}`
|
|
289
|
+
))
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
`${rowIndex}-${colIndex}`
|
|
293
|
+
))
|
|
294
|
+
},
|
|
295
|
+
rowIndex
|
|
296
|
+
)),
|
|
297
|
+
((_a = data == null ? void 0 : data.content) == null ? void 0 : _a.length) == 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
298
|
+
"td",
|
|
299
|
+
{
|
|
300
|
+
className: "px-5 py-3 border-b border-gray-200 bg-white text-sm items-center justify-center align-middle",
|
|
301
|
+
colSpan: columns.length,
|
|
302
|
+
children: "Žádná data"
|
|
303
|
+
},
|
|
304
|
+
"td-nodata"
|
|
305
|
+
) }, "tr-nodata ")
|
|
306
|
+
] })
|
|
307
|
+
] }) }),
|
|
308
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full p-5 grid grid-cols-3", children: [
|
|
309
|
+
/* @__PURE__ */ jsx("div", { className: "text-left items-start justify-start", children: data && !data.first && /* @__PURE__ */ jsxs(
|
|
310
|
+
Button,
|
|
311
|
+
{
|
|
312
|
+
variant: "secondary",
|
|
313
|
+
onClick: prevPage,
|
|
314
|
+
className: "flex items-center float-left",
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsx(MdArrowBack, { className: "mr-1.5" }),
|
|
317
|
+
" Předchozí"
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
) }),
|
|
321
|
+
/* @__PURE__ */ jsxs("div", { className: " text-center text-xs text-gray-800", children: [
|
|
322
|
+
paginationDisplay,
|
|
323
|
+
" "
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ jsx("div", { className: "text-right items-end justify-end", children: data && !data.last && /* @__PURE__ */ jsxs(
|
|
326
|
+
Button,
|
|
327
|
+
{
|
|
328
|
+
variant: "secondary",
|
|
329
|
+
onClick: nextPage,
|
|
330
|
+
className: "flex items-center float-right",
|
|
331
|
+
children: [
|
|
332
|
+
"Následující ",
|
|
333
|
+
/* @__PURE__ */ jsx(MdArrowForward, { className: "ml-2", size: 20 })
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
) })
|
|
337
|
+
] })
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
) });
|
|
329
341
|
}
|
|
330
342
|
export {
|
|
331
343
|
DataTableServer as default
|