@panneau/lists 5.0.0-alpha.15 → 5.0.0-alpha.16
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/ListView.d.ts.map +1 -1
- package/dist/ListView.js +270 -271
- package/dist/ListView.js.map +1 -1
- package/dist/displays/Displays.css +13 -0
- package/dist/displays/Displays.module.js +5 -1
- package/dist/displays/Displays.module.js.map +1 -1
- package/dist/displays/displays.d.ts +28 -6
- package/dist/displays/displays.d.ts.map +1 -1
- package/dist/displays/displays.js +524 -125
- package/dist/displays/displays.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/CalendarLayout.d.ts +4 -4
- package/dist/layouts/CalendarLayout.d.ts.map +1 -1
- package/dist/layouts/CalendarLayout.js +25 -20
- package/dist/layouts/CalendarLayout.js.map +1 -1
- package/dist/layouts/calendarDays.d.ts +14 -0
- package/dist/layouts/calendarDays.d.ts.map +1 -0
- package/dist/layouts/calendarDays.js +44 -0
- package/dist/layouts/calendarDays.js.map +1 -0
- package/dist/query.d.ts +3 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +15 -4
- package/dist/query.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/ListView.js
CHANGED
|
@@ -2,6 +2,7 @@ import { getActionHref, groupListActions, hasScope, isAllowedOn } from "./action
|
|
|
2
2
|
import { messages } from "./messages.js";
|
|
3
3
|
import { ConfirmDialog, needsConfirmation } from "./actions/ConfirmDialog.js";
|
|
4
4
|
import { getColumnValue, toText } from "./values.js";
|
|
5
|
+
import { getCalendarTimeZone } from "./layouts/calendarDays.js";
|
|
5
6
|
import { cx } from "./cx.js";
|
|
6
7
|
import { builtInLayouts } from "./layouts/builtIn.js";
|
|
7
8
|
import { useRenderValue } from "./useRenderValue.js";
|
|
@@ -37,7 +38,7 @@ function keyOf(action, item) {
|
|
|
37
38
|
* fetches nothing: the caller gives the items of the list's query and their total.
|
|
38
39
|
*/
|
|
39
40
|
function ListView(t0) {
|
|
40
|
-
const $ = c(
|
|
41
|
+
const $ = c(116);
|
|
41
42
|
const { list, items, columns: allColumns, columnChoice: t1, total, cursors, isLoading: t2, error: t3, onRetry, filters: t4, fields: t5, search: t6, layouts: t7, layout: controlledLayout, onLayoutChange, perPageOptions, selectable: selectableProp, actions: actionsProp, onAction, previewAction, actionIcons, itemTitle, itemImage, calendar: t8, getItemLabel: getItemLabelProp, getItemHref, getLinkHref, currentItemId: t9, displays, layoutComponents, filterControls, inlineEdit: t10, onInlineEdit, formatError: t11, toolbar, emptyMessage, "aria-label": ariaLabel, className } = t0;
|
|
42
43
|
const columnChoice = t1 === void 0 ? true : t1;
|
|
43
44
|
const isLoading = t2 === void 0 ? false : t2;
|
|
@@ -49,13 +50,7 @@ function ListView(t0) {
|
|
|
49
50
|
$[1] = t12;
|
|
50
51
|
} else t12 = $[1];
|
|
51
52
|
const filtersProp = t12;
|
|
52
|
-
|
|
53
|
-
if ($[2] !== t5) {
|
|
54
|
-
t13 = t5 === void 0 ? [] : t5;
|
|
55
|
-
$[2] = t5;
|
|
56
|
-
$[3] = t13;
|
|
57
|
-
} else t13 = $[3];
|
|
58
|
-
const fields = t13;
|
|
53
|
+
const fields = t5 === void 0 ? [] : t5;
|
|
59
54
|
const search = t6 === void 0 ? false : t6;
|
|
60
55
|
const layoutsProp = t7 === void 0 ? ["table"] : t7;
|
|
61
56
|
const calendar = t8 === void 0 ? null : t8;
|
|
@@ -71,15 +66,15 @@ function ListView(t0) {
|
|
|
71
66
|
const [preview, setPreview] = useState(null);
|
|
72
67
|
const confirmation = useRef(0);
|
|
73
68
|
const [pending, setPending] = useState(null);
|
|
69
|
+
let t13;
|
|
70
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t13 = {};
|
|
72
|
+
$[2] = t13;
|
|
73
|
+
} else t13 = $[2];
|
|
74
|
+
const [saved, setSaved] = useState(t13);
|
|
74
75
|
let t14;
|
|
75
|
-
if ($[
|
|
76
|
-
t14 = {
|
|
77
|
-
$[4] = t14;
|
|
78
|
-
} else t14 = $[4];
|
|
79
|
-
const [saved, setSaved] = useState(t14);
|
|
80
|
-
let t15;
|
|
81
|
-
if ($[5] !== items) {
|
|
82
|
-
t15 = (item) => {
|
|
76
|
+
if ($[3] !== items) {
|
|
77
|
+
t14 = (item) => {
|
|
83
78
|
const base = items?.find((candidate) => candidate.id === item.id);
|
|
84
79
|
if (base !== void 0) setSaved((current) => ({
|
|
85
80
|
...current,
|
|
@@ -89,109 +84,109 @@ function ListView(t0) {
|
|
|
89
84
|
}
|
|
90
85
|
}));
|
|
91
86
|
};
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
} else
|
|
95
|
-
const showItem =
|
|
87
|
+
$[3] = items;
|
|
88
|
+
$[4] = t14;
|
|
89
|
+
} else t14 = $[4];
|
|
90
|
+
const showItem = t14;
|
|
91
|
+
let t15;
|
|
92
|
+
if ($[5] !== ariaLabel || $[6] !== intl) {
|
|
93
|
+
t15 = ariaLabel ?? intl.formatMessage(messages.list);
|
|
94
|
+
$[5] = ariaLabel;
|
|
95
|
+
$[6] = intl;
|
|
96
|
+
$[7] = t15;
|
|
97
|
+
} else t15 = $[7];
|
|
98
|
+
const label = t15;
|
|
96
99
|
let t16;
|
|
97
|
-
if ($[
|
|
98
|
-
t16 =
|
|
99
|
-
$[
|
|
100
|
-
$[8] = intl;
|
|
100
|
+
if ($[8] !== saved) {
|
|
101
|
+
t16 = (item_0) => saved[item_0.id]?.base === item_0 ? saved[item_0.id]?.item ?? item_0 : item_0;
|
|
102
|
+
$[8] = saved;
|
|
101
103
|
$[9] = t16;
|
|
102
104
|
} else t16 = $[9];
|
|
103
|
-
const
|
|
105
|
+
const pageItems = (items ?? []).map(t16);
|
|
106
|
+
const count = total ?? pageItems.length;
|
|
104
107
|
let t17;
|
|
105
|
-
if ($[10] !==
|
|
106
|
-
t17 =
|
|
107
|
-
$[10] =
|
|
108
|
+
if ($[10] !== query.sort) {
|
|
109
|
+
t17 = query.sort ?? [];
|
|
110
|
+
$[10] = query.sort;
|
|
108
111
|
$[11] = t17;
|
|
109
112
|
} else t17 = $[11];
|
|
110
|
-
const
|
|
111
|
-
const count = total ?? pageItems.length;
|
|
113
|
+
const sort = t17;
|
|
112
114
|
let t18;
|
|
113
|
-
if ($[12] !==
|
|
114
|
-
t18 =
|
|
115
|
-
$[12] =
|
|
115
|
+
if ($[12] !== plugins.listLayouts) {
|
|
116
|
+
t18 = Object.fromEntries(plugins.listLayouts);
|
|
117
|
+
$[12] = plugins.listLayouts;
|
|
116
118
|
$[13] = t18;
|
|
117
119
|
} else t18 = $[13];
|
|
118
|
-
const
|
|
119
|
-
let
|
|
120
|
-
if ($[14] !==
|
|
121
|
-
|
|
122
|
-
$[14] = plugins.listLayouts;
|
|
123
|
-
$[15] = t19;
|
|
124
|
-
} else t19 = $[15];
|
|
125
|
-
const t20 = t19;
|
|
126
|
-
let t21;
|
|
127
|
-
if ($[16] !== layoutComponents || $[17] !== t20) {
|
|
128
|
-
t21 = {
|
|
120
|
+
const t19 = t18;
|
|
121
|
+
let t20;
|
|
122
|
+
if ($[14] !== layoutComponents || $[15] !== t19) {
|
|
123
|
+
t20 = {
|
|
129
124
|
...builtInLayouts,
|
|
130
|
-
...
|
|
125
|
+
...t19,
|
|
131
126
|
...layoutComponents
|
|
132
127
|
};
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else
|
|
137
|
-
const allLayouts =
|
|
138
|
-
let
|
|
139
|
-
if ($[
|
|
140
|
-
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
} else
|
|
146
|
-
const available = layoutsProp.filter(
|
|
128
|
+
$[14] = layoutComponents;
|
|
129
|
+
$[15] = t19;
|
|
130
|
+
$[16] = t20;
|
|
131
|
+
} else t20 = $[16];
|
|
132
|
+
const allLayouts = t20;
|
|
133
|
+
let t21;
|
|
134
|
+
if ($[17] !== allLayouts || $[18] !== calendar || $[19] !== itemImage) {
|
|
135
|
+
t21 = (id) => allLayouts[id] !== void 0 && (id !== "gallery" || itemImage !== void 0) && (id !== "calendar" || calendar !== null);
|
|
136
|
+
$[17] = allLayouts;
|
|
137
|
+
$[18] = calendar;
|
|
138
|
+
$[19] = itemImage;
|
|
139
|
+
$[20] = t21;
|
|
140
|
+
} else t21 = $[20];
|
|
141
|
+
const available = layoutsProp.filter(t21);
|
|
147
142
|
const layouts = available.length > 0 ? available : ["table"];
|
|
148
143
|
const chosenLayout = view.layout !== void 0 && layouts.includes(view.layout) ? view.layout : void 0;
|
|
149
144
|
const layout = controlledLayout ?? chosenLayout ?? layouts[0] ?? "table";
|
|
150
145
|
const columns = getShownColumns(allColumns, view.columns);
|
|
151
146
|
const Layout = allLayouts[layout] ?? builtInLayouts.table;
|
|
152
147
|
const inCalendar = layout === "calendar" && calendar !== null;
|
|
148
|
+
let t22;
|
|
149
|
+
if ($[21] !== calendar || $[22] !== filtersProp || $[23] !== inCalendar) {
|
|
150
|
+
t22 = inCalendar ? filtersProp.filter((filter) => filter.id !== calendar.filter) : filtersProp;
|
|
151
|
+
$[21] = calendar;
|
|
152
|
+
$[22] = filtersProp;
|
|
153
|
+
$[23] = inCalendar;
|
|
154
|
+
$[24] = t22;
|
|
155
|
+
} else t22 = $[24];
|
|
156
|
+
const filters = t22;
|
|
153
157
|
let t23;
|
|
154
|
-
if ($[
|
|
155
|
-
t23 =
|
|
156
|
-
|
|
157
|
-
$[24] = filtersProp;
|
|
158
|
-
$[25] = inCalendar;
|
|
159
|
-
$[26] = t23;
|
|
160
|
-
} else t23 = $[26];
|
|
161
|
-
const filters = t23;
|
|
162
|
-
let t24;
|
|
163
|
-
if ($[27] !== calendar || $[28] !== inCalendar || $[29] !== query.filter) {
|
|
164
|
-
t24 = Object.fromEntries(Object.entries(query.filter ?? {}).filter((t25) => {
|
|
165
|
-
const [id_0] = t25;
|
|
158
|
+
if ($[25] !== calendar || $[26] !== inCalendar || $[27] !== query.filter) {
|
|
159
|
+
t23 = Object.fromEntries(Object.entries(query.filter ?? {}).filter((t24) => {
|
|
160
|
+
const [id_0] = t24;
|
|
166
161
|
return !(inCalendar && id_0 === calendar.filter);
|
|
167
162
|
}));
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else
|
|
173
|
-
const filterValues =
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
const hasQuery =
|
|
163
|
+
$[25] = calendar;
|
|
164
|
+
$[26] = inCalendar;
|
|
165
|
+
$[27] = query.filter;
|
|
166
|
+
$[28] = t23;
|
|
167
|
+
} else t23 = $[28];
|
|
168
|
+
const filterValues = t23;
|
|
169
|
+
let t24;
|
|
170
|
+
if ($[29] !== filterValues || $[30] !== query.q) {
|
|
171
|
+
t24 = Object.keys(filterValues).length > 0 || (query.q ?? "") !== "";
|
|
172
|
+
$[29] = filterValues;
|
|
173
|
+
$[30] = query.q;
|
|
174
|
+
$[31] = t24;
|
|
175
|
+
} else t24 = $[31];
|
|
176
|
+
const hasQuery = t24;
|
|
182
177
|
const grouped = groupListActions(actionsProp);
|
|
183
178
|
const toolbarActions = [...grouped.toolbar, ...grouped.menu].filter(_temp);
|
|
184
179
|
const selectionActions = toolbarActions.filter(_temp2);
|
|
185
180
|
const resourceActions = toolbarActions.filter(_temp3);
|
|
186
181
|
const selectable = selectableProp ?? selectionActions.length > 0;
|
|
187
182
|
const selectedCount = selectable ? countSelected(selection, count) : 0;
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
} else
|
|
194
|
-
const selectedItems = pageItems.filter(
|
|
183
|
+
let t25;
|
|
184
|
+
if ($[32] !== selection) {
|
|
185
|
+
t25 = (item_1) => isItemSelected(selection, item_1.id);
|
|
186
|
+
$[32] = selection;
|
|
187
|
+
$[33] = t25;
|
|
188
|
+
} else t25 = $[33];
|
|
189
|
+
const selectedItems = pageItems.filter(t25);
|
|
195
190
|
const pageSelection = getPageSelection(selection, pageItems);
|
|
196
191
|
const getItemLabel = (item_2) => {
|
|
197
192
|
if (getItemLabelProp !== void 0) return getItemLabelProp(item_2);
|
|
@@ -299,14 +294,14 @@ function ListView(t0) {
|
|
|
299
294
|
icons: actionIcons
|
|
300
295
|
});
|
|
301
296
|
};
|
|
302
|
-
let
|
|
303
|
-
if ($[
|
|
304
|
-
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
} else
|
|
297
|
+
let t26;
|
|
298
|
+
if ($[34] !== intl) {
|
|
299
|
+
t26 = intl.formatMessage(messages.selectPage);
|
|
300
|
+
$[34] = intl;
|
|
301
|
+
$[35] = t26;
|
|
302
|
+
} else t26 = $[35];
|
|
308
303
|
const pageCheckbox = /* @__PURE__ */ jsx(Checkbox, {
|
|
309
|
-
"aria-label":
|
|
304
|
+
"aria-label": t26,
|
|
310
305
|
isSelected: pageSelection === "all",
|
|
311
306
|
isIndeterminate: pageSelection === "some",
|
|
312
307
|
isDisabled: pageItems.length === 0,
|
|
@@ -319,56 +314,56 @@ function ListView(t0) {
|
|
|
319
314
|
const sortable = allColumns.some(_temp5);
|
|
320
315
|
const choosesColumns = columnChoice && allColumns.length > 1;
|
|
321
316
|
const showToolbar = search || filters.length > 0 || sortable || choosesColumns || layouts.length > 1 || resourceActions.length > 0 || toolbar !== void 0;
|
|
322
|
-
let
|
|
323
|
-
if ($[
|
|
324
|
-
|
|
317
|
+
let t27;
|
|
318
|
+
if ($[36] !== filterValues || $[37] !== list || $[38] !== query.q) {
|
|
319
|
+
t27 = function clearFilters() {
|
|
325
320
|
Object.keys(filterValues).forEach((id_1) => list.setFilter(id_1, void 0));
|
|
326
321
|
if ((query.q ?? "") !== "") list.setSearch("");
|
|
327
322
|
};
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
} else
|
|
333
|
-
const clearFilters =
|
|
334
|
-
let
|
|
323
|
+
$[36] = filterValues;
|
|
324
|
+
$[37] = list;
|
|
325
|
+
$[38] = query.q;
|
|
326
|
+
$[39] = t27;
|
|
327
|
+
} else t27 = $[39];
|
|
328
|
+
const clearFilters = t27;
|
|
329
|
+
let t28;
|
|
335
330
|
bb0: {
|
|
336
331
|
if (error !== null) {
|
|
332
|
+
let t29;
|
|
333
|
+
if ($[40] !== intl) {
|
|
334
|
+
t29 = intl.formatMessage(messages.loadFailed);
|
|
335
|
+
$[40] = intl;
|
|
336
|
+
$[41] = t29;
|
|
337
|
+
} else t29 = $[41];
|
|
337
338
|
let t30;
|
|
338
|
-
if ($[42] !== intl) {
|
|
339
|
-
t30 =
|
|
340
|
-
$[42] = intl;
|
|
341
|
-
$[43] = t30;
|
|
342
|
-
} else t30 = $[43];
|
|
343
|
-
let t31;
|
|
344
|
-
if ($[44] !== intl || $[45] !== onRetry) {
|
|
345
|
-
t31 = onRetry !== void 0 ? /* @__PURE__ */ jsx(Button, {
|
|
339
|
+
if ($[42] !== intl || $[43] !== onRetry) {
|
|
340
|
+
t30 = onRetry !== void 0 ? /* @__PURE__ */ jsx(Button, {
|
|
346
341
|
size: "sm",
|
|
347
342
|
onPress: onRetry,
|
|
348
343
|
children: intl.formatMessage(messages.retry)
|
|
349
344
|
}) : void 0;
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
} else
|
|
354
|
-
let
|
|
355
|
-
if ($[
|
|
356
|
-
|
|
345
|
+
$[42] = intl;
|
|
346
|
+
$[43] = onRetry;
|
|
347
|
+
$[44] = t30;
|
|
348
|
+
} else t30 = $[44];
|
|
349
|
+
let t31;
|
|
350
|
+
if ($[45] !== error.message || $[46] !== t29 || $[47] !== t30) {
|
|
351
|
+
t31 = /* @__PURE__ */ jsx(Alert, {
|
|
357
352
|
tone: "danger",
|
|
358
|
-
title:
|
|
359
|
-
actions:
|
|
353
|
+
title: t29,
|
|
354
|
+
actions: t30,
|
|
360
355
|
children: error.message
|
|
361
356
|
});
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
} else
|
|
367
|
-
|
|
357
|
+
$[45] = error.message;
|
|
358
|
+
$[46] = t29;
|
|
359
|
+
$[47] = t30;
|
|
360
|
+
$[48] = t31;
|
|
361
|
+
} else t31 = $[48];
|
|
362
|
+
t28 = t31;
|
|
368
363
|
break bb0;
|
|
369
364
|
}
|
|
370
365
|
if (items === void 0) {
|
|
371
|
-
|
|
366
|
+
t28 = /* @__PURE__ */ jsx(ListSkeleton, {
|
|
372
367
|
Layout,
|
|
373
368
|
columns,
|
|
374
369
|
perPage: query.perPage,
|
|
@@ -378,108 +373,109 @@ function ListView(t0) {
|
|
|
378
373
|
break bb0;
|
|
379
374
|
}
|
|
380
375
|
if (pageItems.length === 0 && !inCalendar) {
|
|
376
|
+
let t29;
|
|
377
|
+
if ($[49] !== emptyMessage || $[50] !== hasQuery || $[51] !== intl) {
|
|
378
|
+
t29 = hasQuery ? intl.formatMessage(messages.noResults) : emptyMessage ?? intl.formatMessage(messages.empty);
|
|
379
|
+
$[49] = emptyMessage;
|
|
380
|
+
$[50] = hasQuery;
|
|
381
|
+
$[51] = intl;
|
|
382
|
+
$[52] = t29;
|
|
383
|
+
} else t29 = $[52];
|
|
381
384
|
let t30;
|
|
382
|
-
if ($[
|
|
383
|
-
t30 =
|
|
384
|
-
$[
|
|
385
|
-
$[52] = hasQuery;
|
|
386
|
-
$[53] = intl;
|
|
385
|
+
if ($[53] !== t29) {
|
|
386
|
+
t30 = /* @__PURE__ */ jsx("p", { children: t29 });
|
|
387
|
+
$[53] = t29;
|
|
387
388
|
$[54] = t30;
|
|
388
389
|
} else t30 = $[54];
|
|
389
390
|
let t31;
|
|
390
|
-
if ($[55] !==
|
|
391
|
-
t31 = /* @__PURE__ */ jsx(
|
|
392
|
-
$[55] = t30;
|
|
393
|
-
$[56] = t31;
|
|
394
|
-
} else t31 = $[56];
|
|
395
|
-
let t32;
|
|
396
|
-
if ($[57] !== clearFilters || $[58] !== hasQuery || $[59] !== intl) {
|
|
397
|
-
t32 = hasQuery ? /* @__PURE__ */ jsx(Button, {
|
|
391
|
+
if ($[55] !== clearFilters || $[56] !== hasQuery || $[57] !== intl) {
|
|
392
|
+
t31 = hasQuery ? /* @__PURE__ */ jsx(Button, {
|
|
398
393
|
size: "sm",
|
|
399
394
|
onPress: () => clearFilters(),
|
|
400
395
|
children: intl.formatMessage(messages.clearFilters)
|
|
401
396
|
}) : null;
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
} else
|
|
407
|
-
let
|
|
408
|
-
if ($[
|
|
409
|
-
|
|
397
|
+
$[55] = clearFilters;
|
|
398
|
+
$[56] = hasQuery;
|
|
399
|
+
$[57] = intl;
|
|
400
|
+
$[58] = t31;
|
|
401
|
+
} else t31 = $[58];
|
|
402
|
+
let t32;
|
|
403
|
+
if ($[59] !== t30 || $[60] !== t31) {
|
|
404
|
+
t32 = /* @__PURE__ */ jsxs("div", {
|
|
410
405
|
className: ListView_module_default.state,
|
|
411
|
-
children: [
|
|
406
|
+
children: [t30, t31]
|
|
412
407
|
});
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
} else
|
|
417
|
-
|
|
408
|
+
$[59] = t30;
|
|
409
|
+
$[60] = t31;
|
|
410
|
+
$[61] = t32;
|
|
411
|
+
} else t32 = $[61];
|
|
412
|
+
t28 = t32;
|
|
418
413
|
break bb0;
|
|
419
414
|
}
|
|
415
|
+
let t29;
|
|
416
|
+
if ($[62] !== itemImage) {
|
|
417
|
+
t29 = itemImage !== void 0 ? (item_8) => getImageUrl(item_8[itemImage]) : void 0;
|
|
418
|
+
$[62] = itemImage;
|
|
419
|
+
$[63] = t29;
|
|
420
|
+
} else t29 = $[63];
|
|
420
421
|
let t30;
|
|
421
|
-
if ($[64] !==
|
|
422
|
-
t30 =
|
|
423
|
-
$[64] =
|
|
422
|
+
if ($[64] !== currentItemId) {
|
|
423
|
+
t30 = (item_9) => item_9.id === currentItemId;
|
|
424
|
+
$[64] = currentItemId;
|
|
424
425
|
$[65] = t30;
|
|
425
426
|
} else t30 = $[65];
|
|
426
427
|
let t31;
|
|
427
|
-
if ($[66] !==
|
|
428
|
-
t31 = (
|
|
429
|
-
$[66] =
|
|
428
|
+
if ($[66] !== selection) {
|
|
429
|
+
t31 = (item_10) => isItemSelected(selection, item_10.id);
|
|
430
|
+
$[66] = selection;
|
|
430
431
|
$[67] = t31;
|
|
431
432
|
} else t31 = $[67];
|
|
432
433
|
let t32;
|
|
433
|
-
if ($[68] !==
|
|
434
|
-
t32 = (
|
|
435
|
-
$[68] =
|
|
434
|
+
if ($[68] !== list) {
|
|
435
|
+
t32 = (item_11) => list.toggle(item_11.id);
|
|
436
|
+
$[68] = list;
|
|
436
437
|
$[69] = t32;
|
|
437
438
|
} else t32 = $[69];
|
|
438
439
|
let t33;
|
|
439
440
|
if ($[70] !== list) {
|
|
440
|
-
t33 = (
|
|
441
|
+
t33 = (column_3) => list.toggleSort(column_3.id);
|
|
441
442
|
$[70] = list;
|
|
442
443
|
$[71] = t33;
|
|
443
444
|
} else t33 = $[71];
|
|
444
|
-
|
|
445
|
-
if ($[72] !== list) {
|
|
446
|
-
t34 = (column_2) => list.toggleSort(column_2.id);
|
|
447
|
-
$[72] = list;
|
|
448
|
-
$[73] = t34;
|
|
449
|
-
} else t34 = $[73];
|
|
450
|
-
t29 = /* @__PURE__ */ jsx(Layout, {
|
|
445
|
+
t28 = /* @__PURE__ */ jsx(Layout, {
|
|
451
446
|
items: pageItems,
|
|
452
447
|
columns,
|
|
453
448
|
renderValue,
|
|
454
449
|
getItemLabel,
|
|
455
450
|
getItemHref,
|
|
456
|
-
getItemImage:
|
|
451
|
+
getItemImage: t29,
|
|
457
452
|
calendar: inCalendar ? {
|
|
458
453
|
field: calendar.field,
|
|
454
|
+
timeZone: getCalendarTimeZone([...fields, ...allColumns.map(_temp6)].find((field_0) => field_0?.name === calendar.field)),
|
|
459
455
|
month: view.month ?? currentMonth(),
|
|
460
456
|
onMonthChange: (month) => list.setMonth(month),
|
|
461
457
|
more: total !== void 0 && total > pageItems.length ? { total } : cursors !== void 0 && cursors.next !== null ? { total: null } : null
|
|
462
458
|
} : void 0,
|
|
463
|
-
isCurrent:
|
|
459
|
+
isCurrent: t30,
|
|
464
460
|
selectable,
|
|
465
|
-
isSelected:
|
|
466
|
-
onToggle:
|
|
461
|
+
isSelected: t31,
|
|
462
|
+
onToggle: t32,
|
|
467
463
|
renderActions,
|
|
468
464
|
sort,
|
|
469
|
-
onSort:
|
|
465
|
+
onSort: t33,
|
|
470
466
|
label,
|
|
471
467
|
pageSelection: pageCheckbox,
|
|
472
468
|
renderCell
|
|
473
469
|
});
|
|
474
470
|
}
|
|
475
|
-
const body =
|
|
476
|
-
let
|
|
477
|
-
if ($[
|
|
478
|
-
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
} else
|
|
482
|
-
const
|
|
471
|
+
const body = t28;
|
|
472
|
+
let t29;
|
|
473
|
+
if ($[72] !== className) {
|
|
474
|
+
t29 = cx(ListView_module_default.list, className);
|
|
475
|
+
$[72] = className;
|
|
476
|
+
$[73] = t29;
|
|
477
|
+
} else t29 = $[73];
|
|
478
|
+
const t30 = showToolbar ? /* @__PURE__ */ jsxs("div", {
|
|
483
479
|
className: ListView_module_default.toolbar,
|
|
484
480
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
485
481
|
className: ListView_module_default.toolbarStart,
|
|
@@ -533,43 +529,43 @@ function ListView(t0) {
|
|
|
533
529
|
]
|
|
534
530
|
})]
|
|
535
531
|
}) : null;
|
|
532
|
+
let t31;
|
|
536
533
|
let t32;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
t32 = (
|
|
540
|
-
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
543
|
-
$[78] = t33;
|
|
534
|
+
if ($[74] !== list) {
|
|
535
|
+
t31 = (id_3) => list.setFilter(id_3, void 0);
|
|
536
|
+
t32 = () => list.setSearch("");
|
|
537
|
+
$[74] = list;
|
|
538
|
+
$[75] = t31;
|
|
539
|
+
$[76] = t32;
|
|
544
540
|
} else {
|
|
545
|
-
|
|
546
|
-
|
|
541
|
+
t31 = $[75];
|
|
542
|
+
t32 = $[76];
|
|
547
543
|
}
|
|
548
|
-
let
|
|
549
|
-
if ($[
|
|
550
|
-
|
|
544
|
+
let t33;
|
|
545
|
+
if ($[77] !== allColumns || $[78] !== clearFilters || $[79] !== fields || $[80] !== filterLabels.labels || $[81] !== filterValues || $[82] !== filters || $[83] !== query.q || $[84] !== t31 || $[85] !== t32) {
|
|
546
|
+
t33 = /* @__PURE__ */ jsx(FilterChips, {
|
|
551
547
|
filters,
|
|
552
548
|
values: filterValues,
|
|
553
549
|
q: query.q,
|
|
554
|
-
onRemove:
|
|
555
|
-
onClearSearch:
|
|
550
|
+
onRemove: t31,
|
|
551
|
+
onClearSearch: t32,
|
|
556
552
|
onClear: clearFilters,
|
|
557
553
|
columns: allColumns,
|
|
558
554
|
fields,
|
|
559
555
|
labels: filterLabels.labels
|
|
560
556
|
});
|
|
561
|
-
$[
|
|
562
|
-
$[
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
571
|
-
} else
|
|
572
|
-
const
|
|
557
|
+
$[77] = allColumns;
|
|
558
|
+
$[78] = clearFilters;
|
|
559
|
+
$[79] = fields;
|
|
560
|
+
$[80] = filterLabels.labels;
|
|
561
|
+
$[81] = filterValues;
|
|
562
|
+
$[82] = filters;
|
|
563
|
+
$[83] = query.q;
|
|
564
|
+
$[84] = t31;
|
|
565
|
+
$[85] = t32;
|
|
566
|
+
$[86] = t33;
|
|
567
|
+
} else t33 = $[86];
|
|
568
|
+
const t34 = selectedCount > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
573
569
|
className: ListView_module_default.selection,
|
|
574
570
|
children: [
|
|
575
571
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -606,21 +602,21 @@ function ListView(t0) {
|
|
|
606
602
|
}) : null
|
|
607
603
|
]
|
|
608
604
|
}) : null;
|
|
609
|
-
const
|
|
610
|
-
let
|
|
611
|
-
if ($[
|
|
612
|
-
|
|
605
|
+
const t35 = isLoading && items !== void 0;
|
|
606
|
+
let t36;
|
|
607
|
+
if ($[87] !== body || $[88] !== t35) {
|
|
608
|
+
t36 = /* @__PURE__ */ jsx("div", {
|
|
613
609
|
className: ListView_module_default.body,
|
|
614
|
-
"aria-busy":
|
|
610
|
+
"aria-busy": t35,
|
|
615
611
|
children: body
|
|
616
612
|
});
|
|
617
|
-
$[
|
|
618
|
-
$[
|
|
619
|
-
$[
|
|
620
|
-
} else
|
|
621
|
-
let
|
|
622
|
-
if ($[
|
|
623
|
-
|
|
613
|
+
$[87] = body;
|
|
614
|
+
$[88] = t35;
|
|
615
|
+
$[89] = t36;
|
|
616
|
+
} else t36 = $[89];
|
|
617
|
+
let t37;
|
|
618
|
+
if ($[90] !== cursors || $[91] !== error || $[92] !== inCalendar || $[93] !== list || $[94] !== pageItems || $[95] !== perPageOptions || $[96] !== query.cursor || $[97] !== query.page || $[98] !== query.perPage || $[99] !== total) {
|
|
619
|
+
t37 = inCalendar ? null : cursors !== void 0 && error === null ? /* @__PURE__ */ jsx(CursorPagination, {
|
|
624
620
|
perPage: query.perPage ?? pageItems.length,
|
|
625
621
|
hasPrevious: query.cursor !== void 0,
|
|
626
622
|
hasNext: cursors.next !== null,
|
|
@@ -638,61 +634,64 @@ function ListView(t0) {
|
|
|
638
634
|
perPageOptions,
|
|
639
635
|
onPerPageChange: (perPage_0) => list.setPerPage(perPage_0)
|
|
640
636
|
}) : null;
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
637
|
+
$[90] = cursors;
|
|
638
|
+
$[91] = error;
|
|
639
|
+
$[92] = inCalendar;
|
|
640
|
+
$[93] = list;
|
|
641
|
+
$[94] = pageItems;
|
|
642
|
+
$[95] = perPageOptions;
|
|
643
|
+
$[96] = query.cursor;
|
|
644
|
+
$[97] = query.page;
|
|
645
|
+
$[98] = query.perPage;
|
|
646
|
+
$[99] = total;
|
|
647
|
+
$[100] = t37;
|
|
648
|
+
} else t37 = $[100];
|
|
649
|
+
let t38;
|
|
650
|
+
if ($[101] !== execute) {
|
|
651
|
+
t38 = (event_1) => void execute(event_1);
|
|
652
|
+
$[101] = execute;
|
|
651
653
|
$[102] = t38;
|
|
652
654
|
} else t38 = $[102];
|
|
653
655
|
let t39;
|
|
654
|
-
if ($[103] !==
|
|
655
|
-
t39 =
|
|
656
|
-
$[103] = execute;
|
|
657
|
-
$[104] = t39;
|
|
658
|
-
} else t39 = $[104];
|
|
659
|
-
let t40;
|
|
660
|
-
if ($[105] !== closeConfirmation || $[106] !== confirming || $[107] !== preview || $[108] !== t39) {
|
|
661
|
-
t40 = /* @__PURE__ */ jsx(ConfirmDialog, {
|
|
656
|
+
if ($[103] !== closeConfirmation || $[104] !== confirming || $[105] !== preview || $[106] !== t38) {
|
|
657
|
+
t39 = /* @__PURE__ */ jsx(ConfirmDialog, {
|
|
662
658
|
event: confirming,
|
|
663
659
|
preview,
|
|
664
|
-
onConfirm:
|
|
660
|
+
onConfirm: t38,
|
|
665
661
|
onCancel: closeConfirmation
|
|
666
662
|
});
|
|
667
|
-
$[
|
|
668
|
-
$[
|
|
669
|
-
$[
|
|
670
|
-
$[
|
|
671
|
-
$[
|
|
672
|
-
} else
|
|
673
|
-
let
|
|
674
|
-
if ($[
|
|
675
|
-
|
|
676
|
-
className:
|
|
663
|
+
$[103] = closeConfirmation;
|
|
664
|
+
$[104] = confirming;
|
|
665
|
+
$[105] = preview;
|
|
666
|
+
$[106] = t38;
|
|
667
|
+
$[107] = t39;
|
|
668
|
+
} else t39 = $[107];
|
|
669
|
+
let t40;
|
|
670
|
+
if ($[108] !== t29 || $[109] !== t30 || $[110] !== t33 || $[111] !== t34 || $[112] !== t36 || $[113] !== t37 || $[114] !== t39) {
|
|
671
|
+
t40 = /* @__PURE__ */ jsxs("div", {
|
|
672
|
+
className: t29,
|
|
677
673
|
children: [
|
|
678
|
-
|
|
674
|
+
t30,
|
|
675
|
+
t33,
|
|
679
676
|
t34,
|
|
680
|
-
|
|
677
|
+
t36,
|
|
681
678
|
t37,
|
|
682
|
-
|
|
683
|
-
t40
|
|
679
|
+
t39
|
|
684
680
|
]
|
|
685
681
|
});
|
|
686
|
-
$[
|
|
687
|
-
$[
|
|
688
|
-
$[
|
|
689
|
-
$[
|
|
690
|
-
$[
|
|
691
|
-
$[
|
|
692
|
-
$[
|
|
693
|
-
$[
|
|
694
|
-
} else
|
|
695
|
-
return
|
|
682
|
+
$[108] = t29;
|
|
683
|
+
$[109] = t30;
|
|
684
|
+
$[110] = t33;
|
|
685
|
+
$[111] = t34;
|
|
686
|
+
$[112] = t36;
|
|
687
|
+
$[113] = t37;
|
|
688
|
+
$[114] = t39;
|
|
689
|
+
$[115] = t40;
|
|
690
|
+
} else t40 = $[115];
|
|
691
|
+
return t40;
|
|
692
|
+
}
|
|
693
|
+
function _temp6(column_2) {
|
|
694
|
+
return column_2.field;
|
|
696
695
|
}
|
|
697
696
|
function _temp5(column_1) {
|
|
698
697
|
return column_1.sortable === true;
|