@object-ui/plugin-list 4.0.8 → 4.0.10
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/CHANGELOG.md +4 -0
- package/README.md +21 -0
- package/dist/index.js +83 -42
- package/dist/index.umd.cjs +2 -2
- package/dist/packages/plugin-list/src/ListView.d.ts.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -12,6 +12,27 @@ ListView plugin for ObjectUI - A unified view component with view type switching
|
|
|
12
12
|
- **Flexible Configuration**: Configure available view types per object
|
|
13
13
|
- **Custom Templates**: Support for custom view options per view type
|
|
14
14
|
|
|
15
|
+
## Visual density defaults (renderer-only, metadata always wins)
|
|
16
|
+
|
|
17
|
+
The toolbar and cell renderers are tuned for low visual noise on dense tables:
|
|
18
|
+
|
|
19
|
+
- **Unified toolbar row**: view tabs (`schema.tabs`), user filters and tool
|
|
20
|
+
buttons share a single bordered row. The previous stacked rows (`tabs` /
|
|
21
|
+
`description` / `toolbar`) are collapsed into one separator line.
|
|
22
|
+
- **Flat user-filter pills**: `userFilters` (dropdown mode) render as ghost
|
|
23
|
+
text + count. Active state is shown via `text-foreground font-medium`
|
|
24
|
+
rather than a filled / bordered pill.
|
|
25
|
+
- **Quiet active state for tool buttons**: filter / group / sort / color /
|
|
26
|
+
density / search no longer paint a `bg-primary/10 border` block when
|
|
27
|
+
active — they switch to `text-foreground font-medium` and rely on the
|
|
28
|
+
trailing count for emphasis.
|
|
29
|
+
- **Dot-style select/status cells (opt-in)**: the cell renderer supports
|
|
30
|
+
`appearance: 'dot'` to render `● label` instead of a filled badge for
|
|
31
|
+
high-density tables. **This is opt-in** — by default select/status
|
|
32
|
+
cells render as filled badges in both list and detail views, keeping
|
|
33
|
+
visual consistency across views. Set `appearance: 'dot'` on the field
|
|
34
|
+
(or column) in metadata when you want the lighter style.
|
|
35
|
+
|
|
15
36
|
## Installation
|
|
16
37
|
|
|
17
38
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var je = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
|
|
|
69
69
|
c(e.name), n?.(e);
|
|
70
70
|
}, [n]);
|
|
71
71
|
return i.length === 0 ? null : /* @__PURE__ */ P("div", {
|
|
72
|
-
className: C("
|
|
72
|
+
className: C("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
|
|
73
73
|
"data-testid": "view-tabs",
|
|
74
74
|
role: "tablist",
|
|
75
75
|
children: i.map((e) => {
|
|
@@ -77,7 +77,7 @@ var je = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
|
|
|
77
77
|
return /* @__PURE__ */ F(d, {
|
|
78
78
|
variant: "ghost",
|
|
79
79
|
size: "sm",
|
|
80
|
-
className: C("h-7 px-
|
|
80
|
+
className: C("h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150", n ? "font-medium text-foreground bg-muted" : "text-muted-foreground hover:text-foreground hover:bg-transparent"),
|
|
81
81
|
"data-testid": `view-tab-${e.name}`,
|
|
82
82
|
role: "tab",
|
|
83
83
|
"aria-selected": n,
|
|
@@ -204,18 +204,18 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
|
|
|
204
204
|
asChild: !0,
|
|
205
205
|
children: /* @__PURE__ */ F("button", {
|
|
206
206
|
"data-testid": `filter-badge-${e.field}`,
|
|
207
|
-
className: C("inline-flex items-center gap-1
|
|
207
|
+
className: C("inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md", n ? "text-foreground font-medium" : "text-muted-foreground hover:text-foreground"),
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ P("span", {
|
|
210
210
|
className: "truncate max-w-[100px]",
|
|
211
211
|
children: e.label || e.field
|
|
212
212
|
}),
|
|
213
213
|
n && /* @__PURE__ */ P("span", {
|
|
214
|
-
className: "
|
|
214
|
+
className: "text-[10px] text-muted-foreground/80 tabular-nums",
|
|
215
215
|
children: t.length
|
|
216
216
|
}),
|
|
217
217
|
n ? /* @__PURE__ */ P(he, {
|
|
218
|
-
className: "h-3 w-3 opacity-60",
|
|
218
|
+
className: "h-3 w-3 opacity-60 hover:opacity-100",
|
|
219
219
|
"data-testid": `filter-clear-${e.field}`,
|
|
220
220
|
onClick: (t) => {
|
|
221
221
|
t.stopPropagation(), h(e.field, []);
|
|
@@ -279,10 +279,10 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
|
|
|
279
279
|
})
|
|
280
280
|
})] }, e.field);
|
|
281
281
|
};
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
className: C("flex items-center gap-
|
|
282
|
+
return /* @__PURE__ */ P("div", {
|
|
283
|
+
className: C("flex items-center gap-0.5 overflow-x-auto", o),
|
|
284
284
|
"data-testid": "user-filters-dropdown",
|
|
285
|
-
children:
|
|
285
|
+
children: p.length === 0 ? /* @__PURE__ */ P("span", {
|
|
286
286
|
className: "text-xs text-muted-foreground",
|
|
287
287
|
"data-testid": "user-filters-empty",
|
|
288
288
|
children: "No filter fields"
|
|
@@ -290,11 +290,11 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
|
|
|
290
290
|
asChild: !0,
|
|
291
291
|
children: /* @__PURE__ */ F("button", {
|
|
292
292
|
"data-testid": "user-filters-more",
|
|
293
|
-
className: "inline-flex items-center gap-1
|
|
293
|
+
className: "inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md",
|
|
294
294
|
children: [
|
|
295
295
|
/* @__PURE__ */ P("span", { children: l }),
|
|
296
296
|
/* @__PURE__ */ P("span", {
|
|
297
|
-
className: "
|
|
297
|
+
className: "text-[10px] text-muted-foreground/80 tabular-nums",
|
|
298
298
|
children: v.length
|
|
299
299
|
}),
|
|
300
300
|
/* @__PURE__ */ P(T, { className: "h-3 w-3 opacity-60" })
|
|
@@ -308,7 +308,7 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
|
|
|
308
308
|
className: "space-y-1",
|
|
309
309
|
children: v.map(S)
|
|
310
310
|
})
|
|
311
|
-
})] })] })
|
|
311
|
+
})] })] })
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
function Ie({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
|
|
@@ -720,7 +720,44 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
720
720
|
e = !1;
|
|
721
721
|
};
|
|
722
722
|
}, [D.objectName, z]);
|
|
723
|
-
let Tt = a.useMemo(() =>
|
|
723
|
+
let Tt = a.useMemo(() => {
|
|
724
|
+
let e = Array.isArray(D.fields) ? D.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
|
|
725
|
+
if (!e) return;
|
|
726
|
+
let t = [
|
|
727
|
+
e.groupField,
|
|
728
|
+
e.groupBy,
|
|
729
|
+
e.titleField,
|
|
730
|
+
e.cardTitle,
|
|
731
|
+
e.startDateField,
|
|
732
|
+
e.endDateField,
|
|
733
|
+
e.dateField,
|
|
734
|
+
e.endField,
|
|
735
|
+
e.colorField,
|
|
736
|
+
e.allDayField,
|
|
737
|
+
e.coverField,
|
|
738
|
+
e.imageField,
|
|
739
|
+
e.subtitleField,
|
|
740
|
+
e.swimlaneField,
|
|
741
|
+
e.valueField,
|
|
742
|
+
...Array.isArray(e.cardFields) ? e.cardFields : [],
|
|
743
|
+
...Array.isArray(e.visibleFields) ? e.visibleFields : [],
|
|
744
|
+
...Array.isArray(e.metaFields) ? e.metaFields : []
|
|
745
|
+
];
|
|
746
|
+
for (let e of t) typeof e == "string" && e && n.add(e);
|
|
747
|
+
};
|
|
748
|
+
r(D.kanban), r(D.options?.kanban), r(D.calendar), r(D.options?.calendar), r(D.gallery), r(D.options?.gallery), r(D.timeline), r(D.options?.timeline), r(D.gantt), r(D.options?.gantt);
|
|
749
|
+
let i = n.size > 0 ? Array.from(n) : void 0;
|
|
750
|
+
return t(W?.fields, i);
|
|
751
|
+
}, [
|
|
752
|
+
W?.fields,
|
|
753
|
+
D.fields,
|
|
754
|
+
D.kanban,
|
|
755
|
+
D.calendar,
|
|
756
|
+
D.gallery,
|
|
757
|
+
D.timeline,
|
|
758
|
+
D.gantt,
|
|
759
|
+
D.options
|
|
760
|
+
]);
|
|
724
761
|
a.useEffect(() => {
|
|
725
762
|
let e = !0, t = ++ct.current;
|
|
726
763
|
if (D.data && typeof D.data == "object" && !Array.isArray(D.data)) {
|
|
@@ -1121,40 +1158,44 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1121
1158
|
children: T(St ? "list.refreshing" : "list.pullToRefresh")
|
|
1122
1159
|
}),
|
|
1123
1160
|
_ && /* @__PURE__ */ P("div", {
|
|
1124
|
-
className: "
|
|
1161
|
+
className: "px-4 py-1 flex items-center bg-background",
|
|
1125
1162
|
children: /* @__PURE__ */ P(Oe, {
|
|
1126
1163
|
currentView: j,
|
|
1127
1164
|
availableViews: Et,
|
|
1128
1165
|
onViewChange: Dt
|
|
1129
1166
|
})
|
|
1130
1167
|
}),
|
|
1131
|
-
D.tabs && D.tabs.length > 0 && /* @__PURE__ */ P(je, {
|
|
1132
|
-
tabs: D.tabs,
|
|
1133
|
-
activeTab: Ie,
|
|
1134
|
-
onTabChange: Re
|
|
1135
|
-
}),
|
|
1136
1168
|
D.description && D.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
|
|
1137
|
-
className: "
|
|
1169
|
+
className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
|
|
1138
1170
|
"data-testid": "view-description",
|
|
1139
1171
|
children: typeof D.description == "string" ? D.description : ""
|
|
1140
1172
|
}),
|
|
1141
1173
|
/* @__PURE__ */ F("div", {
|
|
1142
1174
|
className: "border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background",
|
|
1143
|
-
children: [/* @__PURE__ */
|
|
1144
|
-
className: "flex items-center gap-
|
|
1145
|
-
children:
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1175
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1176
|
+
className: "flex items-center gap-2 overflow-x-auto min-w-0",
|
|
1177
|
+
children: [
|
|
1178
|
+
D.tabs && D.tabs.length > 0 && /* @__PURE__ */ P(je, {
|
|
1179
|
+
tabs: D.tabs,
|
|
1180
|
+
activeTab: Ie,
|
|
1181
|
+
onTabChange: Re,
|
|
1182
|
+
className: "!px-0 !py-0 shrink-0"
|
|
1183
|
+
}),
|
|
1184
|
+
D.tabs && D.tabs.length > 0 && pt && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
|
|
1185
|
+
pt && /* @__PURE__ */ P("div", {
|
|
1186
|
+
className: "shrink-0 min-w-0",
|
|
1187
|
+
"data-testid": "user-filters",
|
|
1188
|
+
children: /* @__PURE__ */ P(Pe, {
|
|
1189
|
+
config: pt,
|
|
1190
|
+
objectDef: W,
|
|
1191
|
+
data: B,
|
|
1192
|
+
onFilterChange: ft,
|
|
1193
|
+
maxVisible: 3
|
|
1194
|
+
})
|
|
1154
1195
|
})
|
|
1155
|
-
|
|
1196
|
+
]
|
|
1156
1197
|
}), /* @__PURE__ */ F("div", {
|
|
1157
|
-
className: "flex items-center gap-0
|
|
1198
|
+
className: "flex items-center gap-0 shrink-0",
|
|
1158
1199
|
children: [
|
|
1159
1200
|
A.showHideFields && /* @__PURE__ */ F(y, {
|
|
1160
1201
|
open: _t,
|
|
@@ -1172,7 +1213,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1172
1213
|
children: T("list.hideFields")
|
|
1173
1214
|
}),
|
|
1174
1215
|
Y.size > 0 && /* @__PURE__ */ P("span", {
|
|
1175
|
-
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center
|
|
1216
|
+
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1176
1217
|
children: Y.size
|
|
1177
1218
|
})
|
|
1178
1219
|
]
|
|
@@ -1224,7 +1265,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1224
1265
|
children: /* @__PURE__ */ F(d, {
|
|
1225
1266
|
variant: "ghost",
|
|
1226
1267
|
size: "sm",
|
|
1227
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", jt && "
|
|
1268
|
+
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", jt && "text-foreground font-medium"),
|
|
1228
1269
|
children: [
|
|
1229
1270
|
/* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1230
1271
|
/* @__PURE__ */ P("span", {
|
|
@@ -1232,7 +1273,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1232
1273
|
children: T("list.filter")
|
|
1233
1274
|
}),
|
|
1234
1275
|
jt && /* @__PURE__ */ P("span", {
|
|
1235
|
-
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center
|
|
1276
|
+
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1236
1277
|
children: R.conditions?.length || 0
|
|
1237
1278
|
})
|
|
1238
1279
|
]
|
|
@@ -1266,7 +1307,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1266
1307
|
children: /* @__PURE__ */ F(d, {
|
|
1267
1308
|
variant: "ghost",
|
|
1268
1309
|
size: "sm",
|
|
1269
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q && "
|
|
1310
|
+
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q && "text-foreground font-medium"),
|
|
1270
1311
|
children: [
|
|
1271
1312
|
/* @__PURE__ */ P(oe, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1272
1313
|
/* @__PURE__ */ P("span", {
|
|
@@ -1274,7 +1315,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1274
1315
|
children: T("list.group")
|
|
1275
1316
|
}),
|
|
1276
1317
|
q && q.fields?.length > 0 && /* @__PURE__ */ P("span", {
|
|
1277
|
-
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center
|
|
1318
|
+
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1278
1319
|
children: q.fields.length
|
|
1279
1320
|
})
|
|
1280
1321
|
]
|
|
@@ -1325,7 +1366,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1325
1366
|
children: /* @__PURE__ */ F(d, {
|
|
1326
1367
|
variant: "ghost",
|
|
1327
1368
|
size: "sm",
|
|
1328
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", L.length > 0 && "
|
|
1369
|
+
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", L.length > 0 && "text-foreground font-medium"),
|
|
1329
1370
|
children: [
|
|
1330
1371
|
/* @__PURE__ */ P(ee, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1331
1372
|
/* @__PURE__ */ P("span", {
|
|
@@ -1333,7 +1374,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1333
1374
|
children: T("list.sort")
|
|
1334
1375
|
}),
|
|
1335
1376
|
L.length > 0 && /* @__PURE__ */ P("span", {
|
|
1336
|
-
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center
|
|
1377
|
+
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1337
1378
|
children: L.length
|
|
1338
1379
|
})
|
|
1339
1380
|
]
|
|
@@ -1368,7 +1409,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1368
1409
|
children: /* @__PURE__ */ F(d, {
|
|
1369
1410
|
variant: "ghost",
|
|
1370
1411
|
size: "sm",
|
|
1371
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J && "
|
|
1412
|
+
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J && "text-foreground font-medium"),
|
|
1372
1413
|
children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1373
1414
|
className: "hidden sm:inline",
|
|
1374
1415
|
children: T("list.color")
|
|
@@ -1427,7 +1468,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1427
1468
|
variant: "ghost",
|
|
1428
1469
|
size: "sm",
|
|
1429
1470
|
"aria-label": `Density: ${Q.mode}`,
|
|
1430
|
-
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Q.mode !== "compact" && "
|
|
1471
|
+
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Q.mode !== "compact" && "text-foreground font-medium"),
|
|
1431
1472
|
onClick: Q.cycle,
|
|
1432
1473
|
title: `Density: ${Q.mode} (click to cycle)`,
|
|
1433
1474
|
children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
|
|
@@ -1497,7 +1538,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
1497
1538
|
children: /* @__PURE__ */ P(d, {
|
|
1498
1539
|
variant: "ghost",
|
|
1499
1540
|
size: "sm",
|
|
1500
|
-
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I && "
|
|
1541
|
+
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I && "text-foreground font-medium"),
|
|
1501
1542
|
"data-testid": "search-icon-button",
|
|
1502
1543
|
title: T("list.search"),
|
|
1503
1544
|
children: /* @__PURE__ */ P(de, { className: "h-3.5 w-3.5" })
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`lucide-react`),require(`react/jsx-runtime`),require(`@object-ui/i18n`),require(`@object-ui/react`),require(`@object-ui/mobile`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:l(p(e)),h(t||!e||!e.__esModule?u(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var g={grid:(0,a.jsx)(i.Grid,{className:`h-4 w-4`}),kanban:(0,a.jsx)(i.LayoutGrid,{className:`h-4 w-4`}),gallery:(0,a.jsx)(i.Images,{className:`h-4 w-4`}),calendar:(0,a.jsx)(i.Calendar,{className:`h-4 w-4`}),timeline:(0,a.jsx)(i.Activity,{className:`h-4 w-4`}),gantt:(0,a.jsx)(i.GanttChartSquare,{className:`h-4 w-4`}),map:(0,a.jsx)(i.Map,{className:`h-4 w-4`})},_={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`},v=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:i,className:o,animated:s=!0})=>{let c=n.useCallback(t=>{if(!s||t===e){i(t);return}typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>i(t)):i(t)},[s,e,i]);return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 bg-transparent oui-view-switcher`,o),children:t.map(t=>{let n=e===t;return(0,a.jsxs)(`button`,{type:`button`,onClick:()=>c(t),"aria-label":_[t],title:_[t],"aria-pressed":n,"data-state":n?`on`:`off`,className:(0,r.cn)(`inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,`hover:bg-muted hover:text-muted-foreground`,`gap-2 px-3 py-2`,`data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50`),children:[g[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:_[t]})]},t)})})};function y(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function b(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}var x=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>b(e),[e]),c=n.useMemo(()=>s.find(e=>e.isDefault)?.name??s[0]?.name,[s]),[l,u]=n.useState(c),d=t??l,f=n.useCallback(e=>{u(e.name),i?.(e)},[i]);return s.length===0?null:(0,a.jsx)(`div`,{className:(0,r.cn)(`border-b px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background`,o),"data-testid":`view-tabs`,role:`tablist`,children:s.map(e=>{let t=y(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-3 py-1.5 text-xs rounded-none transition-colors duration-150`,n?`border-b-2 border-primary font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})};function S(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var C=new Set([`lookup`,`master_detail`,`user`,`owner`]);function w({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o}){switch(e.element){case`dropdown`:return(0,a.jsx)(T,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o});case`tabs`:return(0,a.jsx)(E,{tabs:e.tabs||[],showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o});case`toggle`:return(0,a.jsx)(D,{fields:e.fields||[],onFilterChange:r,className:o});default:return null}}function ee(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function T({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u}){let{fieldLabel:d,translateOptions:f}=(0,o.useSafeFieldLabel)(),p=S(),m=t?.name,[h,g]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),_=n.useMemo(()=>ee(e,t,s,{objectName:m,fieldLabel:d,translateOptions:f}),[e,t,s,m,d,f]),v=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),y=(e,t)=>{let n={...h,[e]:t};g(n),v(n)};n.useEffect(()=>{Object.values(h).some(e=>e.length>0)&&v(h)},[]);let b=l!==void 0&&l<_.length?_.slice(0,l):_,x=l!==void 0&&l<_.length?_.slice(l):[],w=e=>{let t=h[e.field]||[],n=t.length>0,o=C.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 rounded-full border h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,n?`border-primary/30 bg-primary/5 text-primary`:`border-border bg-background hover:bg-accent text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px]`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),y(e.field,[])}}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:(0,r.cn)(s,`p-2`),children:o?(0,a.jsx)(`div`,{"data-testid":`filter-lookup-${e.field}`,children:(0,a.jsx)(r.LookupValuePicker,{field:{value:e.field,label:e.label||e.field,type:e.type,referenceTo:e.referenceTo,displayField:e.displayField,idField:e.idField},value:t,multiple:!0,onChange:t=>{let n=Array.isArray(t)?t:t==null||t===``?[]:[t];y(e.field,n)}})}):(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-0.5`,"data-testid":`filter-options-${e.field}`,children:e.options.length===0?(0,a.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:`No options`}):e.options.map(n=>(0,a.jsxs)(`label`,{className:(0,r.cn)(`flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer`,t.includes(n.value)?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t.includes(n.value),onChange:()=>{let r=t.includes(n.value)?t.filter(e=>e!==n.value):[...t,n.value];y(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),_.length===0?(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`user-filters-empty`,children:`No filter fields`}):(0,a.jsxs)(a.Fragment,{children:[b.map(w),x.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-background hover:bg-accent text-foreground h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,children:[(0,a.jsx)(`span`,{children:p}),(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-muted text-[10px] font-medium`,children:x.length}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-2`,"data-testid":`user-filters-more-content`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:x.map(w)})})]})]})]})}function E({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c}){let[l,u]=n.useState(()=>e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),d=n.useCallback(t=>{u(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[])},[e,s]),f=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{let t=e.find(e=>e.default);t&&s(t.filters||[])},[]),(0,a.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,c),"data-testid":`user-filters-tabs`,children:[f.map(e=>(0,a.jsx)(`button`,{"data-testid":`filter-tab-${e.id}`,onClick:()=>d(e.id),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,l===e.id?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},e.id)),o&&(0,a.jsx)(`button`,{className:`inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0`,"data-testid":`filter-tab-add`,title:`Add filter tab`,children:(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5`})})]})}function D({fields:e,onFilterChange:t,className:i}){let[o,s]=n.useState(()=>{let t=new Set;return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&t.add(e.field)}),t}),c=n.useCallback(n=>{t(Array.from(n).map(t=>{let n=e.find(e=>e.field===t);return n?.defaultValues?[t,`in`,n.defaultValues]:[t,`!=`,null]}))},[e,t]),l=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c(n),n})};return n.useEffect(()=>{o.size>0&&c(o)},[]),(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,i),"data-testid":`user-filters-toggle`,children:e.map(e=>(0,a.jsx)(r.Button,{variant:o.has(e.field)?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs shrink-0`,"data-testid":`filter-toggle-${e.field}`,onClick:()=>l(e.field),children:e.label||e.field},e.field))})}function O(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;case`notContains`:return`notcontains`;case`greaterThan`:case`gt`:return`>`;case`greaterOrEqual`:case`gte`:return`>=`;case`lessThan`:case`lt`:return`<`;case`lessOrEqual`:case`lte`:return`<=`;case`in`:return`in`;case`notIn`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function k(e){if(!Array.isArray(e)||e.length<3)return e;let[t,n,r]=e;return typeof t==`string`&&(t===`and`||t===`or`)?[t,...e.slice(1).map(e=>Array.isArray(e)?k(e):e)]:n===`in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`=`,r[0]]:[`or`,...r.map(e=>[t,`=`,e])]:n===`not in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`!=`,r[0]]:[`and`,...r.map(e=>[t,`!=`,e])]:e}function A(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function te(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?k(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function j(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=te(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,O(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function M(e,n){if(!n||n.length===0)return{};for(let r of n){let n=!1,i=(`condition`in r?r.condition:void 0)||(`expression`in r?r.expression:void 0)||void 0;if(i)n=(0,t.evaluatePlainCondition)(i,e);else if(`field`in r&&`operator`in r&&r.field&&r.operator){let t=e[r.field];switch(r.operator){case`equals`:n=t===r.value;break;case`not_equals`:n=t!==r.value;break;case`contains`:n=typeof t==`string`&&typeof r.value==`string`&&t.includes(r.value);break;case`greater_than`:n=typeof t==`number`&&typeof r.value==`number`&&t>r.value;break;case`less_than`:n=typeof t==`number`&&typeof r.value==`number`&&t<r.value;break;case`in`:n=Array.isArray(r.value)&&r.value.includes(t);break}}if(n){let e={};return`style`in r&&r.style&&Object.assign(e,r.style),`backgroundColor`in r&&r.backgroundColor&&(e.backgroundColor=r.backgroundColor),`textColor`in r&&r.textColor&&(e.color=r.textColor),`borderColor`in r&&r.borderColor&&(e.borderColor=r.borderColor),e}}return{}}var N={"list.recordCount":`{{count}} records`,"list.recordCountOne":`{{count}} record`,"list.noItems":`No items found`,"list.noItemsMessage":`There are no records to display. Try adjusting your filters or adding new data.`,"list.search":`Search`,"list.filter":`Filter`,"list.filterRecords":`Filter Records`,"list.sort":`Sort`,"list.sortRecords":`Sort Records`,"list.group":`Group`,"list.groupBy":`Group By`,"list.export":`Export`,"list.exportAs":`Export as {{format}}`,"list.color":`Color`,"list.rowColor":`Row Color`,"list.colorByField":`Color by field`,"list.clear":`Clear`,"list.none":`None`,"list.hideFields":`Hide fields`,"list.showAll":`Show all`,"list.pullToRefresh":`Pull to refresh`,"list.refreshing":`Refreshing…`,"list.dataLimitReached":`Showing first {{limit}} records. More data may be available.`,"list.addRecord":`Add record`,"list.tabs":`Tabs`,"list.allRecords":`All Records`,"list.share":`Share`,"list.print":`Print`,"list.hideFieldsTitle":`Hide Fields`,"table.rowsPerPage":`Rows per page`};function ne(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=N[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}:{t:e.t}}catch{return{t:(e,t)=>{let n=N[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}}}function re(){try{let{fieldLabel:e}=(0,o.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var P=n.forwardRef(({schema:e,className:l,onViewChange:u,onFilterChange:d,onSortChange:f,onSearchChange:p,onHiddenFieldsChange:m,onColumnStateChange:h,onRowClick:g,showViewSwitcher:_=!1,...y},b)=>{let{t:S}=ne(),{fieldLabel:C}=re(),{translateOptions:ee}=(0,o.useSafeFieldLabel)(),T=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),E=n.useCallback((e,t)=>T.objectName?C(T.objectName,e,t):t,[T.objectName,C]),D=n.useMemo(()=>{let e=T.userActions,t=T.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?T.showSearch!==!1:e.search,showSort:e?.sort===void 0?T.showSort!==!1:e.sort,showFilters:e?.filter===void 0?T.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?T.showDensity!==!1:e.rowHeight,showHideFields:T.showHideFields===!0,showGroup:T.showGroup!==!1,showColor:T.showColor===!0,showAddRecord:t,addRecordPosition:T.addRecord?.position===`bottom`?`bottom`:`top`}},[T.userActions,T.showSearch,T.showSort,T.showFilters,T.showDensity,T.showHideFields,T.showGroup,T.showColor,T.addRecord,T.userActions?.addRecordForm]),[O,k]=n.useState(T.viewType),[M,N]=n.useState(``),[P,ie]=n.useState(!1),[ae,oe]=n.useState(!1),[F,se]=n.useState(()=>T.sort&&T.sort.length>0?T.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}}):[]),ce=n.useMemo(()=>JSON.stringify(T.sort||[]),[T.sort]);n.useEffect(()=>{T.sort&&T.sort.length>0?se(T.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}})):se([])},[ce]);let[le,ue]=n.useState(!1),[I,de]=n.useState({id:`root`,logic:`and`,conditions:[]}),[fe,pe]=n.useState(()=>{if(!(!T.tabs||T.tabs.length===0))return T.tabs.find(e=>e.isDefault)?.name??T.tabs[0]?.name}),me=n.useCallback(e=>{if(pe(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};de(t),d?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};de(e),d?.(e)}},[d]),L=y.dataSource,[R,he]=n.useState([]),[ge,z]=n.useState(!1),[B,_e]=n.useState(null),[ve,V]=n.useState(!1),[ye,be]=n.useState(0),[xe,Se]=n.useState(!1);n.useImperativeHandle(b,()=>({refresh:()=>be(e=>e+1)}),[]),n.useEffect(()=>{if(!(!L?.onMutation||!T.objectName||T.refreshTrigger))return L.onMutation(e=>{e.resource===T.objectName&&be(e=>e+1)})},[L,T.objectName,T.refreshTrigger]);let[Ce,we]=n.useState(void 0),H=Ce??T.pagination?.pageSize??100,U=n.useMemo(()=>{if(T.grouping?.fields?.length)return T.grouping;let e=typeof T.groupBy==`string`?T.groupBy.trim():``,t=typeof T.groupBy2==`string`?T.groupBy2.trim():``,n=[];return e&&n.push({field:e,order:`asc`,collapsed:!1}),t&&t!==e&&n.push({field:t,order:`asc`,collapsed:!1}),n.length>0?{fields:n}:void 0},[T.grouping,T.groupBy,T.groupBy2]),[W,Te]=n.useState(U),[Ee,De]=n.useState(!1),Oe=n.useRef(U);n.useEffect(()=>{Oe.current!==U&&(Oe.current=U,Te(U))},[U]);let[G,ke]=n.useState(T.rowColor),[Ae,je]=n.useState(!1),[K,Me]=n.useState([]),q=n.useRef(0),[J,Ne]=n.useState(()=>{let e=new Set;return T.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[Pe,Fe]=n.useState([]),Ie=n.useMemo(()=>{if(T.userFilters)return T.userFilters;if(!B?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(B.fields)?B.fields.map(e=>[e.name,e]):Object.entries(B.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:E(r,i.label||r),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});if(t.length!==0)return{element:`dropdown`,fields:t}},[T.userFilters,B]),[Y,Le]=n.useState(()=>new Set(T.hiddenFields||[])),Re=n.useMemo(()=>JSON.stringify(T.hiddenFields||[]),[T.hiddenFields]);n.useEffect(()=>{Le(new Set(T.hiddenFields||[]))},[Re]);let ze=n.useCallback(e=>{Le(e),m?.(Array.from(e))},[m]),[Be,Ve]=n.useState(!1),[He,Ue]=n.useState(!1),X=n.useMemo(()=>(0,t.normalizeQuickFilters)(T.quickFilters),[T.quickFilters]),Z=n.useMemo(()=>{if(T.exportOptions)return Array.isArray(T.exportOptions)?{formats:T.exportOptions}:T.exportOptions},[T.exportOptions]),Q=(0,s.useDensityMode)(n.useMemo(()=>T.densityMode?T.densityMode:T.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[T.rowHeight]||`comfortable`:`compact`,[T.densityMode,T.rowHeight]),{onChange:T.onDensityChange}),{ref:We,isRefreshing:Ge,pullDistance:Ke}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{be(e=>e+1)},[]),enabled:!!L&&!!T.objectName}),qe=n.useMemo(()=>T.id?`listview-${T.objectName}-${T.id}-view`:`listview-${T.objectName}-view`,[T.objectName,T.id]);n.useEffect(()=>{let e=!0;return V(!1),_e(null),(async()=>{if(!L||!T.objectName){V(!0);return}if(typeof L.getObjectSchema!=`function`){V(!0);return}try{let t=await L.getObjectSchema(T.objectName);e&&_e(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&V(!0)}})(),()=>{e=!1}},[T.objectName,L]);let Je=n.useMemo(()=>(0,t.buildExpandFields)(B?.fields,T.fields),[B?.fields,T.fields]);n.useEffect(()=>{let e=!0,t=++q.current;if(T.data&&typeof T.data==`object`&&!Array.isArray(T.data)){let e=T.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(M){let e=M.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}he(t),z(!1),Se(!1);return}}if(Array.isArray(T.data)){let e=T.data;if(M){let t=M.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}he(e),z(!1),Se(!1);return}return ve?((async()=>{if(!(!L||!T.objectName)){z(!0);try{let n=[],r=T.filters||[],i=j(I),a=[];X&&J.size>0&&X.forEach(e=>{J.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=te(Pe),s=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a,...o].filter(e=>Array.isArray(e)&&e.length>0);s.length>1?n=[`and`,...s]:s.length===1&&(n=s[0]);let c=F.length>0?F.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(T.fields)?T.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[];if(e.length===0)return;let t=new Set([`id`]);for(let n of e)t.add(n);for(let e of Je)t.add(e);let n=e=>{if(!e)return;let n=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};n(T.kanban),n(T.options?.kanban),n(T.calendar),n(T.options?.calendar),n(T.gallery),n(T.options?.gallery),n(T.timeline),n(T.options?.timeline);{let e=T.timeline??T.options?.timeline;e&&!Array.isArray(e.metaFields)&&(t.add(`status`),t.add(`priority`))}return n(T.gantt),n(T.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await L.find(T.objectName,{...u?{$filter:n}:{},$orderby:c,$top:H,...l?{$select:l}:{},...Je.length>0?{$expand:Je}:{},...M?{$search:M,...T.searchableFields&&T.searchableFields.length>0?{$searchFields:T.searchableFields}:{}}:{}});if(!e||t!==q.current)return;let f=[];Array.isArray(d)?f=d:d&&typeof d==`object`&&(Array.isArray(d.data)?f=d.data:Array.isArray(d.records)?f=d.records:Array.isArray(d.value)&&(f=d.value)),he(f),Se(f.length>=H)}catch(e){t===q.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===q.current&&z(!1)}}})(),()=>{e=!1}):void 0},[T.objectName,T.data,L,T.filters,H,F,I,J,X,Pe,ye,M,T.searchableFields,Je,ve,T.refreshTrigger]);let Ye=n.useMemo(()=>{if(T.appearance?.allowedVisualizations&&T.appearance.allowedVisualizations.length>0)return T.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(T.kanban?.groupField||T.options?.kanban?.groupField)&&e.push(`kanban`),(T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField)&&e.push(`gallery`),(T.calendar?.startDateField||T.options?.calendar?.startDateField)&&e.push(`calendar`),(T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||T.options?.calendar?.startDateField)&&e.push(`timeline`),(T.gantt?.startDateField||T.options?.gantt?.startDateField)&&e.push(`gantt`),(T.options?.map?.locationField||T.options?.map?.latitudeField&&T.options?.map?.longitudeField)&&e.push(`map`),T.viewType&&!e.includes(T.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(T.viewType)&&e.push(T.viewType),e},[T.options,T.viewType,T.kanban,T.calendar,T.gantt,T.gallery,T.timeline,T.appearance?.allowedVisualizations]);n.useEffect(()=>{T.viewType&&k(T.viewType)},[T.viewType]);let Xe=n.useCallback(e=>{k(e);try{localStorage.setItem(qe,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}u?.(e)},[qe,u]),Ze=n.useCallback(e=>{N(e),p?.(e)},[p]),Qe=(0,s.useNavigationOverlay)({navigation:T.navigation,objectName:T.objectName,onNavigate:T.onNavigate,onRowClick:g}),$=n.useMemo(()=>{let e=T.fields||[];if(Array.isArray(e)||(e=[]),Y.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!Y.has(t)})),T.fieldOrder&&T.fieldOrder.length>0){let t=new Map(T.fieldOrder.map((e,t)=>[e,t]));e=[...e].sort((e,n)=>{let r=typeof e==`string`?e:e?.name||e?.fieldName||e?.field,i=typeof n==`string`?n:n?.name||n?.fieldName||n?.field;return(t.get(r)??1/0)-(t.get(i)??1/0)})}return e},[T.fields,Y,T.fieldOrder]),$e=n.useMemo(()=>{let e=Q.mode===`compact`?`compact`:Q.mode===`spacious`?`tall`:`medium`,t={objectName:T.objectName,fields:$,filters:T.filters,sort:F,className:`h-full w-full`,showSearch:!1,onRowClick:Qe.handleClick,rowHeight:e,hideRowHeightToggle:!0,...T.striped==null?{}:{striped:T.striped},...T.bordered==null?{}:{bordered:T.bordered},...h?{onColumnStateChange:h}:{},...T.columnState?{columnState:T.columnState}:{}};switch(O){case`grid`:return{type:`object-grid`,...t,columns:$,...T.conditionalFormatting?{conditionalFormatting:T.conditionalFormatting}:{},...T.inlineEdit==null?{}:{editable:T.inlineEdit},...T.wrapHeaders==null?{}:{wrapHeaders:T.wrapHeaders},...T.virtualScroll==null?{}:{virtualScroll:T.virtualScroll},...T.resizable==null?{}:{resizable:T.resizable},...T.selection?{selection:T.selection}:{},...T.pagination?{pagination:T.pagination}:{},...W?{grouping:W}:{},...G?{rowColor:G}:{},...T.rowActions?{rowActions:T.rowActions}:{},...T.bulkActions?{batchActions:T.bulkActions}:{},...T.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,groupField:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,...T.kanban?.titleField||T.options?.kanban?.titleField?{titleField:T.kanban?.titleField||T.options?.kanban?.titleField}:{},cardFields:T.kanban?.cardFields||$||[],...W?{grouping:W}:{},...T.options?.kanban||{},...T.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:T.calendar?.startDateField||T.options?.calendar?.startDateField||`start_date`,endDateField:T.calendar?.endDateField||T.options?.calendar?.endDateField||`end_date`,...T.calendar?.titleField||T.options?.calendar?.titleField?{titleField:T.calendar?.titleField||T.options?.calendar?.titleField}:{},...T.calendar?.defaultView?{defaultView:T.calendar.defaultView}:{},...T.options?.calendar||{},...T.calendar||{}};case`gallery`:{let e={...T.options?.gallery||{},...T.gallery||{}};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField,titleField:T.gallery?.titleField||T.options?.gallery?.titleField||`name`,subtitleField:T.gallery?.subtitleField||T.options?.gallery?.subtitleField,...W?{grouping:W}:{}}}case`timeline`:{let e={...T.options?.timeline||{},...T.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||`created_at`,titleField:T.timeline?.titleField||T.options?.timeline?.titleField||`name`,...T.timeline?.endDateField?{endDateField:T.timeline.endDateField}:{},...T.timeline?.groupByField?{groupByField:T.timeline.groupByField}:{},...T.timeline?.colorField?{colorField:T.timeline.colorField}:{},...T.timeline?.scale?{scale:T.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:T.gantt?.startDateField||T.options?.gantt?.startDateField||`start_date`,endDateField:T.gantt?.endDateField||T.options?.gantt?.endDateField||`end_date`,progressField:T.gantt?.progressField||T.options?.gantt?.progressField||`progress`,dependenciesField:T.gantt?.dependenciesField||T.options?.gantt?.dependenciesField||`dependencies`,...T.gantt?.titleField?{titleField:T.gantt.titleField}:{},...T.options?.gantt||{},...T.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:T.options?.map?.locationField||`location`,...T.options?.map||{}};default:return t}},[O,T,F,$,W,G,Qe.handleClick,Q.mode]),et=I.conditions&&I.conditions.length>0,tt=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return T.objectName?ee(T.objectName,e,n):n};if(e=B?.fields?Object.entries(B.fields).map(([e,n])=>({value:e,label:E(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(T.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:E(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),T.filterableFields&&T.filterableFields.length>0){let t=new Set(T.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[B,T.fields,T.filterableFields,T.objectName,E,ee]),nt=n.useCallback(e=>{Ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),rt=n.useCallback(e=>{let t=Z,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||T.objectName||`export`,a=n>0?R.slice(0,n):R;if(e===`csv`){let e=$.map(e=>typeof e==`string`?e:e.name||e.fieldName||e.field),t=[];r&&t.push(e.join(`,`)),a.forEach(n=>{t.push(e.map(e=>{let t=n[e],r;return r=t==null?``:Array.isArray(t)?t.map(e=>typeof e==`object`&&e?JSON.stringify(e):String(e??``)).join(`; `):typeof t==`object`?JSON.stringify(t):String(t),r.includes(`,`)||r.includes(`"`)||r.includes(`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`lucide-react`),require(`react/jsx-runtime`),require(`@object-ui/i18n`),require(`@object-ui/react`),require(`@object-ui/mobile`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:l(p(e)),h(t||!e||!e.__esModule?u(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var g={grid:(0,a.jsx)(i.Grid,{className:`h-4 w-4`}),kanban:(0,a.jsx)(i.LayoutGrid,{className:`h-4 w-4`}),gallery:(0,a.jsx)(i.Images,{className:`h-4 w-4`}),calendar:(0,a.jsx)(i.Calendar,{className:`h-4 w-4`}),timeline:(0,a.jsx)(i.Activity,{className:`h-4 w-4`}),gantt:(0,a.jsx)(i.GanttChartSquare,{className:`h-4 w-4`}),map:(0,a.jsx)(i.Map,{className:`h-4 w-4`})},_={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`},v=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:i,className:o,animated:s=!0})=>{let c=n.useCallback(t=>{if(!s||t===e){i(t);return}typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>i(t)):i(t)},[s,e,i]);return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 bg-transparent oui-view-switcher`,o),children:t.map(t=>{let n=e===t;return(0,a.jsxs)(`button`,{type:`button`,onClick:()=>c(t),"aria-label":_[t],title:_[t],"aria-pressed":n,"data-state":n?`on`:`off`,className:(0,r.cn)(`inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,`hover:bg-muted hover:text-muted-foreground`,`gap-2 px-3 py-2`,`data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50`),children:[g[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:_[t]})]},t)})})};function y(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function b(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}var x=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>b(e),[e]),c=n.useMemo(()=>s.find(e=>e.isDefault)?.name??s[0]?.name,[s]),[l,u]=n.useState(c),d=t??l,f=n.useCallback(e=>{u(e.name),i?.(e)},[i]);return s.length===0?null:(0,a.jsx)(`div`,{className:(0,r.cn)(`px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background`,o),"data-testid":`view-tabs`,role:`tablist`,children:s.map(e=>{let t=y(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150`,n?`font-medium text-foreground bg-muted`:`text-muted-foreground hover:text-foreground hover:bg-transparent`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})};function S(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var C=new Set([`lookup`,`master_detail`,`user`,`owner`]);function w({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o}){switch(e.element){case`dropdown`:return(0,a.jsx)(T,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o});case`tabs`:return(0,a.jsx)(E,{tabs:e.tabs||[],showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o});case`toggle`:return(0,a.jsx)(D,{fields:e.fields||[],onFilterChange:r,className:o});default:return null}}function ee(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function T({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u}){let{fieldLabel:d,translateOptions:f}=(0,o.useSafeFieldLabel)(),p=S(),m=t?.name,[h,g]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),_=n.useMemo(()=>ee(e,t,s,{objectName:m,fieldLabel:d,translateOptions:f}),[e,t,s,m,d,f]),v=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),y=(e,t)=>{let n={...h,[e]:t};g(n),v(n)};n.useEffect(()=>{Object.values(h).some(e=>e.length>0)&&v(h)},[]);let b=l!==void 0&&l<_.length?_.slice(0,l):_,x=l!==void 0&&l<_.length?_.slice(l):[],w=e=>{let t=h[e.field]||[],n=t.length>0,o=C.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md`,n?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60 hover:opacity-100`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),y(e.field,[])}}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:(0,r.cn)(s,`p-2`),children:o?(0,a.jsx)(`div`,{"data-testid":`filter-lookup-${e.field}`,children:(0,a.jsx)(r.LookupValuePicker,{field:{value:e.field,label:e.label||e.field,type:e.type,referenceTo:e.referenceTo,displayField:e.displayField,idField:e.idField},value:t,multiple:!0,onChange:t=>{let n=Array.isArray(t)?t:t==null||t===``?[]:[t];y(e.field,n)}})}):(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-0.5`,"data-testid":`filter-options-${e.field}`,children:e.options.length===0?(0,a.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:`No options`}):e.options.map(n=>(0,a.jsxs)(`label`,{className:(0,r.cn)(`flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer`,t.includes(n.value)?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t.includes(n.value),onChange:()=>{let r=t.includes(n.value)?t.filter(e=>e!==n.value):[...t,n.value];y(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:_.length===0?(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`user-filters-empty`,children:`No filter fields`}):(0,a.jsxs)(a.Fragment,{children:[b.map(w),x.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md`,children:[(0,a.jsx)(`span`,{children:p}),(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:x.length}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-2`,"data-testid":`user-filters-more-content`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:x.map(w)})})]})]})})}function E({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c}){let[l,u]=n.useState(()=>e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),d=n.useCallback(t=>{u(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[])},[e,s]),f=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{let t=e.find(e=>e.default);t&&s(t.filters||[])},[]),(0,a.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,c),"data-testid":`user-filters-tabs`,children:[f.map(e=>(0,a.jsx)(`button`,{"data-testid":`filter-tab-${e.id}`,onClick:()=>d(e.id),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,l===e.id?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},e.id)),o&&(0,a.jsx)(`button`,{className:`inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0`,"data-testid":`filter-tab-add`,title:`Add filter tab`,children:(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5`})})]})}function D({fields:e,onFilterChange:t,className:i}){let[o,s]=n.useState(()=>{let t=new Set;return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&t.add(e.field)}),t}),c=n.useCallback(n=>{t(Array.from(n).map(t=>{let n=e.find(e=>e.field===t);return n?.defaultValues?[t,`in`,n.defaultValues]:[t,`!=`,null]}))},[e,t]),l=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c(n),n})};return n.useEffect(()=>{o.size>0&&c(o)},[]),(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,i),"data-testid":`user-filters-toggle`,children:e.map(e=>(0,a.jsx)(r.Button,{variant:o.has(e.field)?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs shrink-0`,"data-testid":`filter-toggle-${e.field}`,onClick:()=>l(e.field),children:e.label||e.field},e.field))})}function O(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;case`notContains`:return`notcontains`;case`greaterThan`:case`gt`:return`>`;case`greaterOrEqual`:case`gte`:return`>=`;case`lessThan`:case`lt`:return`<`;case`lessOrEqual`:case`lte`:return`<=`;case`in`:return`in`;case`notIn`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function k(e){if(!Array.isArray(e)||e.length<3)return e;let[t,n,r]=e;return typeof t==`string`&&(t===`and`||t===`or`)?[t,...e.slice(1).map(e=>Array.isArray(e)?k(e):e)]:n===`in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`=`,r[0]]:[`or`,...r.map(e=>[t,`=`,e])]:n===`not in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`!=`,r[0]]:[`and`,...r.map(e=>[t,`!=`,e])]:e}function A(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function te(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?k(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function j(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=te(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,O(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function M(e,n){if(!n||n.length===0)return{};for(let r of n){let n=!1,i=(`condition`in r?r.condition:void 0)||(`expression`in r?r.expression:void 0)||void 0;if(i)n=(0,t.evaluatePlainCondition)(i,e);else if(`field`in r&&`operator`in r&&r.field&&r.operator){let t=e[r.field];switch(r.operator){case`equals`:n=t===r.value;break;case`not_equals`:n=t!==r.value;break;case`contains`:n=typeof t==`string`&&typeof r.value==`string`&&t.includes(r.value);break;case`greater_than`:n=typeof t==`number`&&typeof r.value==`number`&&t>r.value;break;case`less_than`:n=typeof t==`number`&&typeof r.value==`number`&&t<r.value;break;case`in`:n=Array.isArray(r.value)&&r.value.includes(t);break}}if(n){let e={};return`style`in r&&r.style&&Object.assign(e,r.style),`backgroundColor`in r&&r.backgroundColor&&(e.backgroundColor=r.backgroundColor),`textColor`in r&&r.textColor&&(e.color=r.textColor),`borderColor`in r&&r.borderColor&&(e.borderColor=r.borderColor),e}}return{}}var N={"list.recordCount":`{{count}} records`,"list.recordCountOne":`{{count}} record`,"list.noItems":`No items found`,"list.noItemsMessage":`There are no records to display. Try adjusting your filters or adding new data.`,"list.search":`Search`,"list.filter":`Filter`,"list.filterRecords":`Filter Records`,"list.sort":`Sort`,"list.sortRecords":`Sort Records`,"list.group":`Group`,"list.groupBy":`Group By`,"list.export":`Export`,"list.exportAs":`Export as {{format}}`,"list.color":`Color`,"list.rowColor":`Row Color`,"list.colorByField":`Color by field`,"list.clear":`Clear`,"list.none":`None`,"list.hideFields":`Hide fields`,"list.showAll":`Show all`,"list.pullToRefresh":`Pull to refresh`,"list.refreshing":`Refreshing…`,"list.dataLimitReached":`Showing first {{limit}} records. More data may be available.`,"list.addRecord":`Add record`,"list.tabs":`Tabs`,"list.allRecords":`All Records`,"list.share":`Share`,"list.print":`Print`,"list.hideFieldsTitle":`Hide Fields`,"table.rowsPerPage":`Rows per page`};function ne(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=N[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}:{t:e.t}}catch{return{t:(e,t)=>{let n=N[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}}}function re(){try{let{fieldLabel:e}=(0,o.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var P=n.forwardRef(({schema:e,className:l,onViewChange:u,onFilterChange:d,onSortChange:f,onSearchChange:p,onHiddenFieldsChange:m,onColumnStateChange:h,onRowClick:g,showViewSwitcher:_=!1,...y},b)=>{let{t:S}=ne(),{fieldLabel:C}=re(),{translateOptions:ee}=(0,o.useSafeFieldLabel)(),T=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),E=n.useCallback((e,t)=>T.objectName?C(T.objectName,e,t):t,[T.objectName,C]),D=n.useMemo(()=>{let e=T.userActions,t=T.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?T.showSearch!==!1:e.search,showSort:e?.sort===void 0?T.showSort!==!1:e.sort,showFilters:e?.filter===void 0?T.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?T.showDensity!==!1:e.rowHeight,showHideFields:T.showHideFields===!0,showGroup:T.showGroup!==!1,showColor:T.showColor===!0,showAddRecord:t,addRecordPosition:T.addRecord?.position===`bottom`?`bottom`:`top`}},[T.userActions,T.showSearch,T.showSort,T.showFilters,T.showDensity,T.showHideFields,T.showGroup,T.showColor,T.addRecord,T.userActions?.addRecordForm]),[O,k]=n.useState(T.viewType),[M,N]=n.useState(``),[P,ie]=n.useState(!1),[ae,oe]=n.useState(!1),[F,se]=n.useState(()=>T.sort&&T.sort.length>0?T.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}}):[]),ce=n.useMemo(()=>JSON.stringify(T.sort||[]),[T.sort]);n.useEffect(()=>{T.sort&&T.sort.length>0?se(T.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}})):se([])},[ce]);let[le,ue]=n.useState(!1),[I,de]=n.useState({id:`root`,logic:`and`,conditions:[]}),[fe,pe]=n.useState(()=>{if(!(!T.tabs||T.tabs.length===0))return T.tabs.find(e=>e.isDefault)?.name??T.tabs[0]?.name}),me=n.useCallback(e=>{if(pe(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};de(t),d?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};de(e),d?.(e)}},[d]),L=y.dataSource,[R,he]=n.useState([]),[ge,z]=n.useState(!1),[B,_e]=n.useState(null),[ve,V]=n.useState(!1),[ye,be]=n.useState(0),[xe,Se]=n.useState(!1);n.useImperativeHandle(b,()=>({refresh:()=>be(e=>e+1)}),[]),n.useEffect(()=>{if(!(!L?.onMutation||!T.objectName||T.refreshTrigger))return L.onMutation(e=>{e.resource===T.objectName&&be(e=>e+1)})},[L,T.objectName,T.refreshTrigger]);let[Ce,we]=n.useState(void 0),H=Ce??T.pagination?.pageSize??100,U=n.useMemo(()=>{if(T.grouping?.fields?.length)return T.grouping;let e=typeof T.groupBy==`string`?T.groupBy.trim():``,t=typeof T.groupBy2==`string`?T.groupBy2.trim():``,n=[];return e&&n.push({field:e,order:`asc`,collapsed:!1}),t&&t!==e&&n.push({field:t,order:`asc`,collapsed:!1}),n.length>0?{fields:n}:void 0},[T.grouping,T.groupBy,T.groupBy2]),[W,Te]=n.useState(U),[Ee,De]=n.useState(!1),Oe=n.useRef(U);n.useEffect(()=>{Oe.current!==U&&(Oe.current=U,Te(U))},[U]);let[G,ke]=n.useState(T.rowColor),[Ae,je]=n.useState(!1),[K,Me]=n.useState([]),q=n.useRef(0),[J,Ne]=n.useState(()=>{let e=new Set;return T.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[Pe,Fe]=n.useState([]),Ie=n.useMemo(()=>{if(T.userFilters)return T.userFilters;if(!B?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(B.fields)?B.fields.map(e=>[e.name,e]):Object.entries(B.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:E(r,i.label||r),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});if(t.length!==0)return{element:`dropdown`,fields:t}},[T.userFilters,B]),[Y,Le]=n.useState(()=>new Set(T.hiddenFields||[])),Re=n.useMemo(()=>JSON.stringify(T.hiddenFields||[]),[T.hiddenFields]);n.useEffect(()=>{Le(new Set(T.hiddenFields||[]))},[Re]);let ze=n.useCallback(e=>{Le(e),m?.(Array.from(e))},[m]),[Be,Ve]=n.useState(!1),[He,Ue]=n.useState(!1),X=n.useMemo(()=>(0,t.normalizeQuickFilters)(T.quickFilters),[T.quickFilters]),Z=n.useMemo(()=>{if(T.exportOptions)return Array.isArray(T.exportOptions)?{formats:T.exportOptions}:T.exportOptions},[T.exportOptions]),Q=(0,s.useDensityMode)(n.useMemo(()=>T.densityMode?T.densityMode:T.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[T.rowHeight]||`comfortable`:`compact`,[T.densityMode,T.rowHeight]),{onChange:T.onDensityChange}),{ref:We,isRefreshing:Ge,pullDistance:Ke}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{be(e=>e+1)},[]),enabled:!!L&&!!T.objectName}),qe=n.useMemo(()=>T.id?`listview-${T.objectName}-${T.id}-view`:`listview-${T.objectName}-view`,[T.objectName,T.id]);n.useEffect(()=>{let e=!0;return V(!1),_e(null),(async()=>{if(!L||!T.objectName){V(!0);return}if(typeof L.getObjectSchema!=`function`){V(!0);return}try{let t=await L.getObjectSchema(T.objectName);e&&_e(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&V(!0)}})(),()=>{e=!1}},[T.objectName,L]);let Je=n.useMemo(()=>{let e=Array.isArray(T.fields)?T.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],n=new Set(e),r=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)typeof e==`string`&&e&&n.add(e)};r(T.kanban),r(T.options?.kanban),r(T.calendar),r(T.options?.calendar),r(T.gallery),r(T.options?.gallery),r(T.timeline),r(T.options?.timeline),r(T.gantt),r(T.options?.gantt);let i=n.size>0?Array.from(n):void 0;return(0,t.buildExpandFields)(B?.fields,i)},[B?.fields,T.fields,T.kanban,T.calendar,T.gallery,T.timeline,T.gantt,T.options]);n.useEffect(()=>{let e=!0,t=++q.current;if(T.data&&typeof T.data==`object`&&!Array.isArray(T.data)){let e=T.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(M){let e=M.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}he(t),z(!1),Se(!1);return}}if(Array.isArray(T.data)){let e=T.data;if(M){let t=M.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}he(e),z(!1),Se(!1);return}return ve?((async()=>{if(!(!L||!T.objectName)){z(!0);try{let n=[],r=T.filters||[],i=j(I),a=[];X&&J.size>0&&X.forEach(e=>{J.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=te(Pe),s=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a,...o].filter(e=>Array.isArray(e)&&e.length>0);s.length>1?n=[`and`,...s]:s.length===1&&(n=s[0]);let c=F.length>0?F.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(T.fields)?T.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[];if(e.length===0)return;let t=new Set([`id`]);for(let n of e)t.add(n);for(let e of Je)t.add(e);let n=e=>{if(!e)return;let n=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};n(T.kanban),n(T.options?.kanban),n(T.calendar),n(T.options?.calendar),n(T.gallery),n(T.options?.gallery),n(T.timeline),n(T.options?.timeline);{let e=T.timeline??T.options?.timeline;e&&!Array.isArray(e.metaFields)&&(t.add(`status`),t.add(`priority`))}return n(T.gantt),n(T.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await L.find(T.objectName,{...u?{$filter:n}:{},$orderby:c,$top:H,...l?{$select:l}:{},...Je.length>0?{$expand:Je}:{},...M?{$search:M,...T.searchableFields&&T.searchableFields.length>0?{$searchFields:T.searchableFields}:{}}:{}});if(!e||t!==q.current)return;let f=[];Array.isArray(d)?f=d:d&&typeof d==`object`&&(Array.isArray(d.data)?f=d.data:Array.isArray(d.records)?f=d.records:Array.isArray(d.value)&&(f=d.value)),he(f),Se(f.length>=H)}catch(e){t===q.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===q.current&&z(!1)}}})(),()=>{e=!1}):void 0},[T.objectName,T.data,L,T.filters,H,F,I,J,X,Pe,ye,M,T.searchableFields,Je,ve,T.refreshTrigger]);let Ye=n.useMemo(()=>{if(T.appearance?.allowedVisualizations&&T.appearance.allowedVisualizations.length>0)return T.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(T.kanban?.groupField||T.options?.kanban?.groupField)&&e.push(`kanban`),(T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField)&&e.push(`gallery`),(T.calendar?.startDateField||T.options?.calendar?.startDateField)&&e.push(`calendar`),(T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||T.options?.calendar?.startDateField)&&e.push(`timeline`),(T.gantt?.startDateField||T.options?.gantt?.startDateField)&&e.push(`gantt`),(T.options?.map?.locationField||T.options?.map?.latitudeField&&T.options?.map?.longitudeField)&&e.push(`map`),T.viewType&&!e.includes(T.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(T.viewType)&&e.push(T.viewType),e},[T.options,T.viewType,T.kanban,T.calendar,T.gantt,T.gallery,T.timeline,T.appearance?.allowedVisualizations]);n.useEffect(()=>{T.viewType&&k(T.viewType)},[T.viewType]);let Xe=n.useCallback(e=>{k(e);try{localStorage.setItem(qe,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}u?.(e)},[qe,u]),Ze=n.useCallback(e=>{N(e),p?.(e)},[p]),Qe=(0,s.useNavigationOverlay)({navigation:T.navigation,objectName:T.objectName,onNavigate:T.onNavigate,onRowClick:g}),$=n.useMemo(()=>{let e=T.fields||[];if(Array.isArray(e)||(e=[]),Y.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!Y.has(t)})),T.fieldOrder&&T.fieldOrder.length>0){let t=new Map(T.fieldOrder.map((e,t)=>[e,t]));e=[...e].sort((e,n)=>{let r=typeof e==`string`?e:e?.name||e?.fieldName||e?.field,i=typeof n==`string`?n:n?.name||n?.fieldName||n?.field;return(t.get(r)??1/0)-(t.get(i)??1/0)})}return e},[T.fields,Y,T.fieldOrder]),$e=n.useMemo(()=>{let e=Q.mode===`compact`?`compact`:Q.mode===`spacious`?`tall`:`medium`,t={objectName:T.objectName,fields:$,filters:T.filters,sort:F,className:`h-full w-full`,showSearch:!1,onRowClick:Qe.handleClick,rowHeight:e,hideRowHeightToggle:!0,...T.striped==null?{}:{striped:T.striped},...T.bordered==null?{}:{bordered:T.bordered},...h?{onColumnStateChange:h}:{},...T.columnState?{columnState:T.columnState}:{}};switch(O){case`grid`:return{type:`object-grid`,...t,columns:$,...T.conditionalFormatting?{conditionalFormatting:T.conditionalFormatting}:{},...T.inlineEdit==null?{}:{editable:T.inlineEdit},...T.wrapHeaders==null?{}:{wrapHeaders:T.wrapHeaders},...T.virtualScroll==null?{}:{virtualScroll:T.virtualScroll},...T.resizable==null?{}:{resizable:T.resizable},...T.selection?{selection:T.selection}:{},...T.pagination?{pagination:T.pagination}:{},...W?{grouping:W}:{},...G?{rowColor:G}:{},...T.rowActions?{rowActions:T.rowActions}:{},...T.bulkActions?{batchActions:T.bulkActions}:{},...T.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,groupField:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,...T.kanban?.titleField||T.options?.kanban?.titleField?{titleField:T.kanban?.titleField||T.options?.kanban?.titleField}:{},cardFields:T.kanban?.cardFields||$||[],...W?{grouping:W}:{},...T.options?.kanban||{},...T.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:T.calendar?.startDateField||T.options?.calendar?.startDateField||`start_date`,endDateField:T.calendar?.endDateField||T.options?.calendar?.endDateField||`end_date`,...T.calendar?.titleField||T.options?.calendar?.titleField?{titleField:T.calendar?.titleField||T.options?.calendar?.titleField}:{},...T.calendar?.defaultView?{defaultView:T.calendar.defaultView}:{},...T.options?.calendar||{},...T.calendar||{}};case`gallery`:{let e={...T.options?.gallery||{},...T.gallery||{}};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField,titleField:T.gallery?.titleField||T.options?.gallery?.titleField||`name`,subtitleField:T.gallery?.subtitleField||T.options?.gallery?.subtitleField,...W?{grouping:W}:{}}}case`timeline`:{let e={...T.options?.timeline||{},...T.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||`created_at`,titleField:T.timeline?.titleField||T.options?.timeline?.titleField||`name`,...T.timeline?.endDateField?{endDateField:T.timeline.endDateField}:{},...T.timeline?.groupByField?{groupByField:T.timeline.groupByField}:{},...T.timeline?.colorField?{colorField:T.timeline.colorField}:{},...T.timeline?.scale?{scale:T.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:T.gantt?.startDateField||T.options?.gantt?.startDateField||`start_date`,endDateField:T.gantt?.endDateField||T.options?.gantt?.endDateField||`end_date`,progressField:T.gantt?.progressField||T.options?.gantt?.progressField||`progress`,dependenciesField:T.gantt?.dependenciesField||T.options?.gantt?.dependenciesField||`dependencies`,...T.gantt?.titleField?{titleField:T.gantt.titleField}:{},...T.options?.gantt||{},...T.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:T.options?.map?.locationField||`location`,...T.options?.map||{}};default:return t}},[O,T,F,$,W,G,Qe.handleClick,Q.mode]),et=I.conditions&&I.conditions.length>0,tt=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return T.objectName?ee(T.objectName,e,n):n};if(e=B?.fields?Object.entries(B.fields).map(([e,n])=>({value:e,label:E(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(T.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:E(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),T.filterableFields&&T.filterableFields.length>0){let t=new Set(T.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[B,T.fields,T.filterableFields,T.objectName,E,ee]),nt=n.useCallback(e=>{Ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),rt=n.useCallback(e=>{let t=Z,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||T.objectName||`export`,a=n>0?R.slice(0,n):R;if(e===`csv`){let e=$.map(e=>typeof e==`string`?e:e.name||e.fieldName||e.field),t=[];r&&t.push(e.join(`,`)),a.forEach(n=>{t.push(e.map(e=>{let t=n[e],r;return r=t==null?``:Array.isArray(t)?t.map(e=>typeof e==`object`&&e?JSON.stringify(e):String(e??``)).join(`; `):typeof t==`object`?JSON.stringify(t):String(t),r.includes(`,`)||r.includes(`"`)||r.includes(`
|
|
2
2
|
`)||r.includes(`\r`)?`"${r.replace(/"/g,`""`)}"`:r}).join(`,`))});let n=new Blob([t.join(`
|
|
3
|
-
`)],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(n),s=document.createElement(`a`);s.href=o,s.download=`${i}.csv`,s.click(),URL.revokeObjectURL(o)}else if(e===`json`){let e=new Blob([JSON.stringify(a,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i}.json`,n.click(),URL.revokeObjectURL(t)}Ue(!1)},[R,$,Z,T.objectName]),it=n.useMemo(()=>(T.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:E(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:E(t,e.label||e.name||e.field)}}),[T.fields,E]);return(0,a.jsxs)(`div`,{ref:We,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,l),...T.aria?.label?{"aria-label":T.aria.label}:{},...T.aria?.describedBy?{"aria-describedby":T.aria.describedBy}:{},...T.aria?.live?{"aria-live":T.aria.live}:{},role:`region`,children:[Ke>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:Ke},children:S(Ge?`list.refreshing`:`list.pullToRefresh`)}),_&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1 flex items-center bg-background`,children:(0,a.jsx)(v,{currentView:O,availableViews:Ye,onViewChange:Xe})}),T.tabs&&T.tabs.length>0&&(0,a.jsx)(x,{tabs:T.tabs,activeTab:fe,onTabChange:me}),T.description&&T.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof T.description==`string`?T.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto min-w-0`,children:Ie&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0`,"data-testid":`user-filters`,children:(0,a.jsx)(w,{config:Ie,objectDef:B,data:R,onFilterChange:Fe,maxVisible:3})})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[D.showHideFields&&(0,a.jsxs)(r.Popover,{open:Be,onOpenChange:Ve,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,Y.size>0&&`text-primary`),children:[(0,a.jsx)(i.EyeOff,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.hideFields`)}),Y.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:Y.size})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.hideFieldsTitle`)}),Y.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ze(new Set),children:S(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:it.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!Y.has(e.name),onChange:()=>{let t=new Set(Y);t.has(e.name)?t.delete(e.name):t.add(e.name),ze(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),D.showHideFields&&(D.showFilters||D.showSort||D.showGroup)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showFilters&&(0,a.jsxs)(r.Popover,{open:le,onOpenChange:ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,et&&`bg-primary/10 border border-primary/20 text-primary`),children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.filter`)}),et&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:I.conditions?.length||0})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:tt,value:I,onChange:e=>{de(e),d&&d(e)}})]})})]}),D.showGroup&&(0,a.jsxs)(r.Popover,{open:Ee,onOpenChange:De,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,W&&`bg-primary/10 border border-primary/20 text-primary`),children:[(0,a.jsx)(i.Group,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.group`)}),W&&W.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:W.fields.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-72 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.groupBy`)}),W&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Te(void 0),"data-testid":`clear-grouping`,children:S(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:W,fieldOptions:it.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:S(`list.addGroup`,`Add group field`),collapseTitle:S(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:S(`list.removeGroup`,`Remove`)},onChange:e=>Te(e)})})]})})]}),D.showSort&&(0,a.jsxs)(r.Popover,{open:ae,onOpenChange:oe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,F.length>0&&`bg-primary/10 border border-primary/20 text-primary`),children:[(0,a.jsx)(i.ArrowUpDown,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.sort`)}),F.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:F.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:tt,value:F,onChange:e=>{se(e),f&&f(e)}})]})})]}),(D.showFilters||D.showSort||D.showGroup)&&(D.showColor||D.showDensity)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showColor&&(0,a.jsxs)(r.Popover,{open:Ae,onOpenChange:je,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,G&&`bg-primary/10 border border-primary/20 text-primary`),children:[(0,a.jsx)(i.Paintbrush,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.color`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.rowColor`)}),G&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ke(void 0),"data-testid":`clear-row-color`,children:S(`list.clear`)})]}),(0,a.jsxs)(`div`,{className:`space-y-2`,"data-testid":`color-field-list`,children:[(0,a.jsx)(`label`,{className:`text-xs text-muted-foreground`,children:S(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:G?.field||``,onChange:e=>{let t=e.target.value;ke(t?{field:t,colors:G?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:S(`list.none`)}),it.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),D.showDensity&&(()=>{let e=Q.mode===`compact`?i.Rows4:Q.mode===`comfortable`?i.Rows3:i.Rows2;return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":`Density: ${Q.mode}`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,Q.mode!==`compact`&&`bg-primary/10 border border-primary/20 text-primary`),onClick:Q.cycle,title:`Density: ${Q.mode} (click to cycle)`,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),(D.showColor||D.showDensity)&&Z&&T.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),Z&&T.allowExport!==!1&&(0,a.jsxs)(r.Popover,{open:He,onOpenChange:Ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.export`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-48 p-2`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:(Z.formats||[`csv`,`json`]).map(e=>(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full justify-start h-8 text-xs`,onClick:()=>rt(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),S(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(T.sharing?.enabled||T.sharing?.type)&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,title:`Sharing: ${T.sharing?.visibility||T.sharing?.type||`private`}`,"data-testid":`share-button`,children:[(0,a.jsx)(i.Share2,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.share`)})]}),T.allowPrinting&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,onClick:()=>window.print(),"data-testid":`print-button`,children:[(0,a.jsx)(i.Printer,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.print`)})]}),(()=>{let e=T.allowPrinting||T.sharing?.enabled||T.sharing?.type||Z&&T.allowExport!==!1;return D.showSearch&&e?(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}):null})(),D.showSearch&&(0,a.jsxs)(r.Popover,{open:P,onOpenChange:ie,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,M&&`bg-primary/10 border border-primary/20 text-primary`),"data-testid":`search-icon-button`,title:S(`list.search`),children:(0,a.jsx)(i.Search,{className:`h-3.5 w-3.5`})})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-[calc(100vw-2rem)] sm:w-64 p-2`,"data-testid":`search-popover`,children:(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(i.Search,{className:`absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,a.jsx)(r.Input,{placeholder:S(`list.search`)+`...`,value:M,onChange:e=>Ze(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),M&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20`,onClick:()=>Ze(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),D.showAddRecord&&D.addRecordPosition===`top`&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.addRecord`)})]})]})]}),X&&X.length>0&&(0,a.jsx)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background`,"data-testid":`quick-filters`,children:X.map(e=>{let t=J.has(e.id),n=e.icon?i.icons[e.icon.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null;return(0,a.jsxs)(r.Button,{variant:t?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs`,onClick:()=>nt(e.id),children:[n&&(0,a.jsx)(n,{className:`h-3 w-3 mr-1.5`}),e.label]},e.id)})}),(0,a.jsx)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:!ge&&R.length===0&&(O===`grid`||O===`list`)?(()=>{let e=T.emptyState?.icon;return(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8`,"data-testid":`empty-state`,children:[(0,a.jsx)(e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,a.jsx)(`h3`,{className:`text-lg font-medium text-foreground mb-1`,children:(typeof T.emptyState?.title==`string`?T.emptyState.title:void 0)??`No items found`}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground max-w-md`,children:(typeof T.emptyState?.message==`string`?T.emptyState.message:void 0)??`There are no records to display. Try adjusting your filters or adding new data.`}),D.showAddRecord&&(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,className:`mt-4`,"data-testid":`empty-state-add-record`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),S(`list.addRecord`)]})]})})():(0,a.jsx)(s.SchemaRenderer,{schema:$e,...y,data:R,loading:ge,onRowSelect:Me})},O),D.showAddRecord&&D.addRecordPosition===`bottom`&&(0,a.jsx)(`div`,{className:`border-t px-2 sm:px-4 py-1 bg-background shrink-0`,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.addRecord`)})]})}),T.bulkActions&&T.bulkActions.length>0&&K.length>0&&O!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm`,role:`region`,"aria-label":`Bulk actions`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsx)(i.CheckSquare,{className:`h-3.5 w-3.5 text-primary shrink-0`}),(0,a.jsxs)(`span`,{className:`font-medium`,children:[K.length,` `,K.length===1?`item`:`items`,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1.5 ml-3`,children:T.bulkActions.map(e=>{let t=String(e).toLowerCase(),n=t.includes(`delete`)||t.includes(`remove`)||t.includes(`destroy`),o=n?i.Trash2:null;return(0,a.jsxs)(r.Button,{variant:n?`destructive`:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs gap-1.5`,onClick:()=>y.onBulkAction?.(e,K),"data-testid":`bulk-action-${e}`,children:[o&&(0,a.jsx)(o,{className:`h-3 w-3`}),A(e)]},e)})}),(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs ml-auto gap-1`,onClick:()=>Me([]),children:[(0,a.jsx)(i.X,{className:`h-3 w-3`}),`Clear`]})]}),!ge&&R.length>0&&T.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{className:`font-medium text-foreground/80`,children:R.length===1?S(`list.recordCountOne`,{count:R.length}):S(`list.recordCount`,{count:R.length})}),xe&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:S(`list.dataLimitReached`,{limit:H})}),T.pagination?.pageSizeOptions&&T.pagination.pageSizeOptions.length>0&&(0,a.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,a.jsx)(`span`,{children:S(`table.rowsPerPage`,{defaultValue:`Rows per page`})}),(0,a.jsx)(`select`,{"data-testid":`page-size-selector`,className:`h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background`,value:String(H),onChange:e=>{let t=Number(e.target.value);we(t),y.onPageSizeChange&&y.onPageSizeChange(t)},children:T.pagination.pageSizeOptions.map(e=>(0,a.jsx)(`option`,{value:String(e),children:e},e))})]})]}),Qe.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...Qe,title:T.label?`${T.label} Detail`:T.objectName?`${T.objectName.charAt(0).toUpperCase()+T.objectName.slice(1)} Detail`:`Record Detail`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})});P.displayName=`ListView`;var ie={small:`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`,medium:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4`,large:`grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3`},ae={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},oe=e=>{let{schema:o}=e,c=(0,n.useContext)(s.SchemaRendererContext),l=e.dataSource||c?.dataSource,u=(0,s.useDataScope)(o.bind),[d,f]=(0,n.useState)([]),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),_=(0,s.useNavigationOverlay)({navigation:o.navigation,objectName:o.objectName,onRowClick:e.onRowClick??e.onCardClick}),v=o.gallery,y=v?.coverField??o.imageField??`image`,b=v?.coverFit??`cover`,x=v?.cardSize??`medium`,S=v?.titleField??o.titleField??`name`,C=v?.visibleFields,{fieldOptionLabel:w}=(0,s.useSafeFieldLabel)(),ee=(0,n.useCallback)((e,t)=>{if(t==null||t===``)return``;if(typeof t==`object`)return t.label??t.name??t.id??JSON.stringify(t);let n=h?.fields?.[e];if((n?.type===`select`||n?.type===`status`||n?.type===`multiselect`)&&o.objectName){let r=String(t);if(Array.isArray(n.options)){let e=n.options.find(e=>String(e?.value??e)===String(t));e&&(r=e.label??r)}else if(n.options&&typeof n.options==`object`){let e=n.options[String(t)];e&&(r=e.label??r)}return w(o.objectName,e,String(t),r)}return String(t)},[h,o.objectName,w]);(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!o.objectName))try{let t=await l.getObjectSchema(o.objectName);e&&g(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[o.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){f(e.data);return}return o.objectName&&!u&&!o.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!o.objectName)){n&&m(!0);try{let e=(0,t.buildExpandFields)(h?.fields),r=await l.find(o.objectName,{$filter:o.filter,...e.length>0?{$expand:e}:{}}),i=[];if(Array.isArray(r))i=r;else if(r&&typeof r==`object`){let e=r;Array.isArray(e.records)?i=e.records:Array.isArray(e.data)&&(i=e.data)}n&&f(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&m(!1)}}})(),()=>{n=!1}},[o.objectName,l,u,o.data,o.filter,e.data,h]);let T=e.data||u||o.data||d||[],E=(0,n.useMemo)(()=>T.some(e=>typeof e[y]==`string`&&!!e[y]),[T,y]),D=!!v?.coverField||E,O=o.grouping?.fields,k=!!(O&&O.length>0),[A,te]=(0,n.useState)({}),j=(0,n.useMemo)(()=>O?O.some(e=>e.collapsed):!1,[O]),M=(0,n.useCallback)(e=>{te(t=>({...t,[e]:t[e]===void 0?!j:!t[e]}))},[j]),N=(0,n.useMemo)(()=>{if(!k||!O)return[];let e=new Map,t=[];for(let n of T){let r=O.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=O.map(e=>{let t=n[e.field];return t!=null&&t!==``?String(t):`(empty)`}).join(` / `);e.set(r,{label:i,items:[]}),t.push(r)}e.get(r).items.push(n)}let n=O[0]?.order??`asc`;return t.sort((e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});return n===`desc`?-r:r}),t.map(t=>{let n=e.get(t),r=t in A?A[t]:j;return{key:t,label:n.label,items:n.items,collapsed:r}})},[T,O,k,A,j]);if(p&&!T.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!T.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let ne=(t,n)=>{let i=t.id??t._id??n,s=String(t[S]??`Untitled`),c=t[y];return(0,a.jsxs)(r.Card,{role:`listitem`,className:(0,r.cn)(`group overflow-hidden transition-all hover:shadow-md`,(e.onCardClick||e.onRowClick||o.navigation)&&`cursor-pointer`),onClick:()=>_.handleClick(t),children:[(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden bg-muted relative`,ae[x]),hidden:!D,children:c?(0,a.jsx)(`img`,{src:c,alt:s,className:(0,r.cn)(`h-full w-full transition-transform group-hover:scale-105`,b===`cover`&&`object-cover`,b===`contain`&&`object-contain`)}):(0,a.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-secondary/50 text-muted-foreground`,children:(0,a.jsx)(`span`,{className:`text-4xl font-light opacity-20`,children:s[0]?.toUpperCase()})})}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,D&&`border-t`),children:[(0,a.jsx)(`h3`,{className:`font-medium truncate text-sm`,title:s,children:s}),C&&C.length>0&&(0,a.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:C.map(e=>{let n=t[e];return n==null||n===``?null:(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:ee(e,n)},e)})})]})]},i)},re=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,ie[x],o.className),role:`list`,children:e.map((e,t)=>ne(e,t))});return(0,a.jsxs)(a.Fragment,{children:[k?(0,a.jsx)(`div`,{className:`space-y-2`,children:N.map(e=>(0,a.jsxs)(`div`,{className:`border rounded-md`,children:[(0,a.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-left bg-muted/50 hover:bg-muted transition-colors`,onClick:()=>M(e.key),children:[e.collapsed?(0,a.jsx)(i.ChevronRight,{className:`h-4 w-4 shrink-0`}):(0,a.jsx)(i.ChevronDown,{className:`h-4 w-4 shrink-0`}),(0,a.jsx)(`span`,{children:e.label}),(0,a.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.items.length})]}),!e.collapsed&&re(e.items)]},e.key))}):re(T),_.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{..._,title:`Gallery Item`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})};t.ComponentRegistry.register(`object-gallery`,oe,{namespace:`plugin-list`,label:`Gallery View`,category:`view`}),t.ComponentRegistry.register(`list-view`,P,{namespace:`plugin-list`,label:`List View`,category:`Views`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}],defaultProps:{objectName:``,viewType:`grid`,fields:[],filters:[],sort:[],options:{}}}),t.ComponentRegistry.register(`list`,P,{namespace:`view`,category:`view`,label:`List`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}]}),e.ListView=P,e.ObjectGallery=oe,e.TabBar=x,e.UserFilters=w,e.ViewSwitcher=v,e.evaluateConditionalFormatting=M,e.normalizeFilterCondition=k,e.normalizeFilters=te});
|
|
3
|
+
`)],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(n),s=document.createElement(`a`);s.href=o,s.download=`${i}.csv`,s.click(),URL.revokeObjectURL(o)}else if(e===`json`){let e=new Blob([JSON.stringify(a,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i}.json`,n.click(),URL.revokeObjectURL(t)}Ue(!1)},[R,$,Z,T.objectName]),it=n.useMemo(()=>(T.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:E(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:E(t,e.label||e.name||e.field)}}),[T.fields,E]);return(0,a.jsxs)(`div`,{ref:We,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,l),...T.aria?.label?{"aria-label":T.aria.label}:{},...T.aria?.describedBy?{"aria-describedby":T.aria.describedBy}:{},...T.aria?.live?{"aria-live":T.aria.live}:{},role:`region`,children:[Ke>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:Ke},children:S(Ge?`list.refreshing`:`list.pullToRefresh`)}),_&&(0,a.jsx)(`div`,{className:`px-4 py-1 flex items-center bg-background`,children:(0,a.jsx)(v,{currentView:O,availableViews:Ye,onViewChange:Xe})}),T.description&&T.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`px-4 pt-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof T.description==`string`?T.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2 overflow-x-auto min-w-0`,children:[T.tabs&&T.tabs.length>0&&(0,a.jsx)(x,{tabs:T.tabs,activeTab:fe,onTabChange:me,className:`!px-0 !py-0 shrink-0`}),T.tabs&&T.tabs.length>0&&Ie&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-1 shrink-0`}),Ie&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0`,"data-testid":`user-filters`,children:(0,a.jsx)(w,{config:Ie,objectDef:B,data:R,onFilterChange:Fe,maxVisible:3})})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0 shrink-0`,children:[D.showHideFields&&(0,a.jsxs)(r.Popover,{open:Be,onOpenChange:Ve,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,Y.size>0&&`text-primary`),children:[(0,a.jsx)(i.EyeOff,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.hideFields`)}),Y.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:Y.size})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.hideFieldsTitle`)}),Y.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ze(new Set),children:S(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:it.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!Y.has(e.name),onChange:()=>{let t=new Set(Y);t.has(e.name)?t.delete(e.name):t.add(e.name),ze(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),D.showHideFields&&(D.showFilters||D.showSort||D.showGroup)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showFilters&&(0,a.jsxs)(r.Popover,{open:le,onOpenChange:ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,et&&`text-foreground font-medium`),children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.filter`)}),et&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:I.conditions?.length||0})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:tt,value:I,onChange:e=>{de(e),d&&d(e)}})]})})]}),D.showGroup&&(0,a.jsxs)(r.Popover,{open:Ee,onOpenChange:De,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,W&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Group,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.group`)}),W&&W.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:W.fields.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-72 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.groupBy`)}),W&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Te(void 0),"data-testid":`clear-grouping`,children:S(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:W,fieldOptions:it.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:S(`list.addGroup`,`Add group field`),collapseTitle:S(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:S(`list.removeGroup`,`Remove`)},onChange:e=>Te(e)})})]})})]}),D.showSort&&(0,a.jsxs)(r.Popover,{open:ae,onOpenChange:oe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,F.length>0&&`text-foreground font-medium`),children:[(0,a.jsx)(i.ArrowUpDown,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.sort`)}),F.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:F.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:tt,value:F,onChange:e=>{se(e),f&&f(e)}})]})})]}),(D.showFilters||D.showSort||D.showGroup)&&(D.showColor||D.showDensity)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showColor&&(0,a.jsxs)(r.Popover,{open:Ae,onOpenChange:je,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,G&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Paintbrush,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.color`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:S(`list.rowColor`)}),G&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ke(void 0),"data-testid":`clear-row-color`,children:S(`list.clear`)})]}),(0,a.jsxs)(`div`,{className:`space-y-2`,"data-testid":`color-field-list`,children:[(0,a.jsx)(`label`,{className:`text-xs text-muted-foreground`,children:S(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:G?.field||``,onChange:e=>{let t=e.target.value;ke(t?{field:t,colors:G?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:S(`list.none`)}),it.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),D.showDensity&&(()=>{let e=Q.mode===`compact`?i.Rows4:Q.mode===`comfortable`?i.Rows3:i.Rows2;return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":`Density: ${Q.mode}`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,Q.mode!==`compact`&&`text-foreground font-medium`),onClick:Q.cycle,title:`Density: ${Q.mode} (click to cycle)`,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),(D.showColor||D.showDensity)&&Z&&T.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),Z&&T.allowExport!==!1&&(0,a.jsxs)(r.Popover,{open:He,onOpenChange:Ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.export`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-48 p-2`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:(Z.formats||[`csv`,`json`]).map(e=>(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full justify-start h-8 text-xs`,onClick:()=>rt(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),S(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(T.sharing?.enabled||T.sharing?.type)&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,title:`Sharing: ${T.sharing?.visibility||T.sharing?.type||`private`}`,"data-testid":`share-button`,children:[(0,a.jsx)(i.Share2,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.share`)})]}),T.allowPrinting&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,onClick:()=>window.print(),"data-testid":`print-button`,children:[(0,a.jsx)(i.Printer,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.print`)})]}),(()=>{let e=T.allowPrinting||T.sharing?.enabled||T.sharing?.type||Z&&T.allowExport!==!1;return D.showSearch&&e?(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}):null})(),D.showSearch&&(0,a.jsxs)(r.Popover,{open:P,onOpenChange:ie,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,M&&`text-foreground font-medium`),"data-testid":`search-icon-button`,title:S(`list.search`),children:(0,a.jsx)(i.Search,{className:`h-3.5 w-3.5`})})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-[calc(100vw-2rem)] sm:w-64 p-2`,"data-testid":`search-popover`,children:(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(i.Search,{className:`absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,a.jsx)(r.Input,{placeholder:S(`list.search`)+`...`,value:M,onChange:e=>Ze(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),M&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20`,onClick:()=>Ze(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),D.showAddRecord&&D.addRecordPosition===`top`&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.addRecord`)})]})]})]}),X&&X.length>0&&(0,a.jsx)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background`,"data-testid":`quick-filters`,children:X.map(e=>{let t=J.has(e.id),n=e.icon?i.icons[e.icon.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null;return(0,a.jsxs)(r.Button,{variant:t?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs`,onClick:()=>nt(e.id),children:[n&&(0,a.jsx)(n,{className:`h-3 w-3 mr-1.5`}),e.label]},e.id)})}),(0,a.jsx)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:!ge&&R.length===0&&(O===`grid`||O===`list`)?(()=>{let e=T.emptyState?.icon;return(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8`,"data-testid":`empty-state`,children:[(0,a.jsx)(e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,a.jsx)(`h3`,{className:`text-lg font-medium text-foreground mb-1`,children:(typeof T.emptyState?.title==`string`?T.emptyState.title:void 0)??`No items found`}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground max-w-md`,children:(typeof T.emptyState?.message==`string`?T.emptyState.message:void 0)??`There are no records to display. Try adjusting your filters or adding new data.`}),D.showAddRecord&&(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,className:`mt-4`,"data-testid":`empty-state-add-record`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),S(`list.addRecord`)]})]})})():(0,a.jsx)(s.SchemaRenderer,{schema:$e,...y,data:R,loading:ge,onRowSelect:Me})},O),D.showAddRecord&&D.addRecordPosition===`bottom`&&(0,a.jsx)(`div`,{className:`border-t px-2 sm:px-4 py-1 bg-background shrink-0`,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.addRecord`)})]})}),T.bulkActions&&T.bulkActions.length>0&&K.length>0&&O!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm`,role:`region`,"aria-label":`Bulk actions`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsx)(i.CheckSquare,{className:`h-3.5 w-3.5 text-primary shrink-0`}),(0,a.jsxs)(`span`,{className:`font-medium`,children:[K.length,` `,K.length===1?`item`:`items`,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1.5 ml-3`,children:T.bulkActions.map(e=>{let t=String(e).toLowerCase(),n=t.includes(`delete`)||t.includes(`remove`)||t.includes(`destroy`),o=n?i.Trash2:null;return(0,a.jsxs)(r.Button,{variant:n?`destructive`:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs gap-1.5`,onClick:()=>y.onBulkAction?.(e,K),"data-testid":`bulk-action-${e}`,children:[o&&(0,a.jsx)(o,{className:`h-3 w-3`}),A(e)]},e)})}),(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs ml-auto gap-1`,onClick:()=>Me([]),children:[(0,a.jsx)(i.X,{className:`h-3 w-3`}),`Clear`]})]}),!ge&&R.length>0&&T.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{className:`font-medium text-foreground/80`,children:R.length===1?S(`list.recordCountOne`,{count:R.length}):S(`list.recordCount`,{count:R.length})}),xe&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:S(`list.dataLimitReached`,{limit:H})}),T.pagination?.pageSizeOptions&&T.pagination.pageSizeOptions.length>0&&(0,a.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,a.jsx)(`span`,{children:S(`table.rowsPerPage`,{defaultValue:`Rows per page`})}),(0,a.jsx)(`select`,{"data-testid":`page-size-selector`,className:`h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background`,value:String(H),onChange:e=>{let t=Number(e.target.value);we(t),y.onPageSizeChange&&y.onPageSizeChange(t)},children:T.pagination.pageSizeOptions.map(e=>(0,a.jsx)(`option`,{value:String(e),children:e},e))})]})]}),Qe.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...Qe,title:T.label?`${T.label} Detail`:T.objectName?`${T.objectName.charAt(0).toUpperCase()+T.objectName.slice(1)} Detail`:`Record Detail`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})});P.displayName=`ListView`;var ie={small:`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`,medium:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4`,large:`grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3`},ae={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},oe=e=>{let{schema:o}=e,c=(0,n.useContext)(s.SchemaRendererContext),l=e.dataSource||c?.dataSource,u=(0,s.useDataScope)(o.bind),[d,f]=(0,n.useState)([]),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),_=(0,s.useNavigationOverlay)({navigation:o.navigation,objectName:o.objectName,onRowClick:e.onRowClick??e.onCardClick}),v=o.gallery,y=v?.coverField??o.imageField??`image`,b=v?.coverFit??`cover`,x=v?.cardSize??`medium`,S=v?.titleField??o.titleField??`name`,C=v?.visibleFields,{fieldOptionLabel:w}=(0,s.useSafeFieldLabel)(),ee=(0,n.useCallback)((e,t)=>{if(t==null||t===``)return``;if(typeof t==`object`)return t.label??t.name??t.id??JSON.stringify(t);let n=h?.fields?.[e];if((n?.type===`select`||n?.type===`status`||n?.type===`multiselect`)&&o.objectName){let r=String(t);if(Array.isArray(n.options)){let e=n.options.find(e=>String(e?.value??e)===String(t));e&&(r=e.label??r)}else if(n.options&&typeof n.options==`object`){let e=n.options[String(t)];e&&(r=e.label??r)}return w(o.objectName,e,String(t),r)}return String(t)},[h,o.objectName,w]);(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!o.objectName))try{let t=await l.getObjectSchema(o.objectName);e&&g(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[o.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){f(e.data);return}return o.objectName&&!u&&!o.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!o.objectName)){n&&m(!0);try{let e=(0,t.buildExpandFields)(h?.fields),r=await l.find(o.objectName,{$filter:o.filter,...e.length>0?{$expand:e}:{}}),i=[];if(Array.isArray(r))i=r;else if(r&&typeof r==`object`){let e=r;Array.isArray(e.records)?i=e.records:Array.isArray(e.data)&&(i=e.data)}n&&f(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&m(!1)}}})(),()=>{n=!1}},[o.objectName,l,u,o.data,o.filter,e.data,h]);let T=e.data||u||o.data||d||[],E=(0,n.useMemo)(()=>T.some(e=>typeof e[y]==`string`&&!!e[y]),[T,y]),D=!!v?.coverField||E,O=o.grouping?.fields,k=!!(O&&O.length>0),[A,te]=(0,n.useState)({}),j=(0,n.useMemo)(()=>O?O.some(e=>e.collapsed):!1,[O]),M=(0,n.useCallback)(e=>{te(t=>({...t,[e]:t[e]===void 0?!j:!t[e]}))},[j]),N=(0,n.useMemo)(()=>{if(!k||!O)return[];let e=new Map,t=[];for(let n of T){let r=O.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=O.map(e=>{let t=n[e.field];return t!=null&&t!==``?String(t):`(empty)`}).join(` / `);e.set(r,{label:i,items:[]}),t.push(r)}e.get(r).items.push(n)}let n=O[0]?.order??`asc`;return t.sort((e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});return n===`desc`?-r:r}),t.map(t=>{let n=e.get(t),r=t in A?A[t]:j;return{key:t,label:n.label,items:n.items,collapsed:r}})},[T,O,k,A,j]);if(p&&!T.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!T.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let ne=(t,n)=>{let i=t.id??t._id??n,s=String(t[S]??`Untitled`),c=t[y];return(0,a.jsxs)(r.Card,{role:`listitem`,className:(0,r.cn)(`group overflow-hidden transition-all hover:shadow-md`,(e.onCardClick||e.onRowClick||o.navigation)&&`cursor-pointer`),onClick:()=>_.handleClick(t),children:[(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden bg-muted relative`,ae[x]),hidden:!D,children:c?(0,a.jsx)(`img`,{src:c,alt:s,className:(0,r.cn)(`h-full w-full transition-transform group-hover:scale-105`,b===`cover`&&`object-cover`,b===`contain`&&`object-contain`)}):(0,a.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-secondary/50 text-muted-foreground`,children:(0,a.jsx)(`span`,{className:`text-4xl font-light opacity-20`,children:s[0]?.toUpperCase()})})}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,D&&`border-t`),children:[(0,a.jsx)(`h3`,{className:`font-medium truncate text-sm`,title:s,children:s}),C&&C.length>0&&(0,a.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:C.map(e=>{let n=t[e];return n==null||n===``?null:(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:ee(e,n)},e)})})]})]},i)},re=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,ie[x],o.className),role:`list`,children:e.map((e,t)=>ne(e,t))});return(0,a.jsxs)(a.Fragment,{children:[k?(0,a.jsx)(`div`,{className:`space-y-2`,children:N.map(e=>(0,a.jsxs)(`div`,{className:`border rounded-md`,children:[(0,a.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-left bg-muted/50 hover:bg-muted transition-colors`,onClick:()=>M(e.key),children:[e.collapsed?(0,a.jsx)(i.ChevronRight,{className:`h-4 w-4 shrink-0`}):(0,a.jsx)(i.ChevronDown,{className:`h-4 w-4 shrink-0`}),(0,a.jsx)(`span`,{children:e.label}),(0,a.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.items.length})]}),!e.collapsed&&re(e.items)]},e.key))}):re(T),_.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{..._,title:`Gallery Item`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})};t.ComponentRegistry.register(`object-gallery`,oe,{namespace:`plugin-list`,label:`Gallery View`,category:`view`}),t.ComponentRegistry.register(`list-view`,P,{namespace:`plugin-list`,label:`List View`,category:`Views`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}],defaultProps:{objectName:``,viewType:`grid`,fields:[],filters:[],sort:[],options:{}}}),t.ComponentRegistry.register(`list`,P,{namespace:`view`,category:`view`,label:`List`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}]}),e.ListView=P,e.ObjectGallery=oe,e.TabBar=x,e.UserFilters=w,e.ViewSwitcher=v,e.evaluateConditionalFormatting=M,e.normalizeFilterCondition=k,e.normalizeFilters=te});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClD,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACvD,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAqBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAyBhE;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAKtD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,GAC9C,KAAK,CAAC,aAAa,CAoDrB;AAwFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClD,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACvD,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAqBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAyBhE;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAKtD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,GAC9C,KAAK,CAAC,aAAa,CAoDrB;AAwFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,mGA8rDnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-list",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "ListView plugin for Object UI - unified view component with view type switching",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^18.0.0 || ^19.0.0",
|
|
31
31
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
32
|
-
"@object-ui/components": "^4.0.
|
|
33
|
-
"@object-ui/core": "^4.0.
|
|
34
|
-
"@object-ui/i18n": "^4.0.
|
|
35
|
-
"@object-ui/mobile": "^4.0.
|
|
36
|
-
"@object-ui/react": "^4.0.
|
|
37
|
-
"@object-ui/types": "^4.0.
|
|
32
|
+
"@object-ui/components": "^4.0.10",
|
|
33
|
+
"@object-ui/core": "^4.0.10",
|
|
34
|
+
"@object-ui/i18n": "^4.0.10",
|
|
35
|
+
"@object-ui/mobile": "^4.0.10",
|
|
36
|
+
"@object-ui/react": "^4.0.10",
|
|
37
|
+
"@object-ui/types": "^4.0.10"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "19.2.14",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"vite": "^8.0.12",
|
|
45
45
|
"vite-plugin-dts": "^5.0.0",
|
|
46
46
|
"vitest": "^4.1.6",
|
|
47
|
-
"@object-ui/components": "4.0.
|
|
48
|
-
"@object-ui/core": "4.0.
|
|
49
|
-
"@object-ui/i18n": "4.0.
|
|
50
|
-
"@object-ui/mobile": "4.0.
|
|
51
|
-
"@object-ui/react": "4.0.
|
|
52
|
-
"@object-ui/types": "4.0.
|
|
47
|
+
"@object-ui/components": "4.0.10",
|
|
48
|
+
"@object-ui/core": "4.0.10",
|
|
49
|
+
"@object-ui/i18n": "4.0.10",
|
|
50
|
+
"@object-ui/mobile": "4.0.10",
|
|
51
|
+
"@object-ui/react": "4.0.10",
|
|
52
|
+
"@object-ui/types": "4.0.10"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"objectui",
|