@almadar/ui 5.9.2 → 5.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +12 -3
- package/dist/avl/index.js +12 -3
- package/dist/components/index.cjs +12 -3
- package/dist/components/index.js +12 -3
- package/dist/components/molecules/DataList.d.ts +4 -1
- package/dist/providers/index.cjs +12 -3
- package/dist/providers/index.js +12 -3
- package/dist/runtime/index.cjs +12 -3
- package/dist/runtime/index.js +12 -3
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -27446,6 +27446,7 @@ function DataList({
|
|
|
27446
27446
|
fields,
|
|
27447
27447
|
columns,
|
|
27448
27448
|
itemActions,
|
|
27449
|
+
itemClickEvent,
|
|
27449
27450
|
gap = "none",
|
|
27450
27451
|
variant = "default",
|
|
27451
27452
|
groupBy,
|
|
@@ -27535,6 +27536,14 @@ function DataList({
|
|
|
27535
27536
|
};
|
|
27536
27537
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
27537
27538
|
};
|
|
27539
|
+
const handleRowClick = (itemData) => () => {
|
|
27540
|
+
if (!itemClickEvent) return;
|
|
27541
|
+
const payload = {
|
|
27542
|
+
id: itemData.id,
|
|
27543
|
+
row: itemData
|
|
27544
|
+
};
|
|
27545
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
27546
|
+
};
|
|
27538
27547
|
if (isLoading) {
|
|
27539
27548
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
27540
27549
|
}
|
|
@@ -27583,7 +27592,7 @@ function DataList({
|
|
|
27583
27592
|
),
|
|
27584
27593
|
children: [
|
|
27585
27594
|
!isSent && senderField && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
27586
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
27595
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
27587
27596
|
timestamp != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
27588
27597
|
Typography,
|
|
27589
27598
|
{
|
|
@@ -27613,7 +27622,7 @@ function DataList({
|
|
|
27613
27622
|
if (hasRenderProp) {
|
|
27614
27623
|
const id2 = itemData.id || String(index);
|
|
27615
27624
|
return wrapDnd(
|
|
27616
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
27625
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
27617
27626
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
27618
27627
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
27619
27628
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -27649,7 +27658,7 @@ function DataList({
|
|
|
27649
27658
|
const id = itemData.id || String(index);
|
|
27650
27659
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
27651
27660
|
return wrapDnd(
|
|
27652
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
27661
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
27653
27662
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
27654
27663
|
Box,
|
|
27655
27664
|
{
|
package/dist/avl/index.js
CHANGED
|
@@ -27397,6 +27397,7 @@ function DataList({
|
|
|
27397
27397
|
fields,
|
|
27398
27398
|
columns,
|
|
27399
27399
|
itemActions,
|
|
27400
|
+
itemClickEvent,
|
|
27400
27401
|
gap = "none",
|
|
27401
27402
|
variant = "default",
|
|
27402
27403
|
groupBy,
|
|
@@ -27486,6 +27487,14 @@ function DataList({
|
|
|
27486
27487
|
};
|
|
27487
27488
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
27488
27489
|
};
|
|
27490
|
+
const handleRowClick = (itemData) => () => {
|
|
27491
|
+
if (!itemClickEvent) return;
|
|
27492
|
+
const payload = {
|
|
27493
|
+
id: itemData.id,
|
|
27494
|
+
row: itemData
|
|
27495
|
+
};
|
|
27496
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
27497
|
+
};
|
|
27489
27498
|
if (isLoading) {
|
|
27490
27499
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
27491
27500
|
}
|
|
@@ -27534,7 +27543,7 @@ function DataList({
|
|
|
27534
27543
|
),
|
|
27535
27544
|
children: [
|
|
27536
27545
|
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
27537
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
27546
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
27538
27547
|
timestamp != null ? /* @__PURE__ */ jsx(
|
|
27539
27548
|
Typography,
|
|
27540
27549
|
{
|
|
@@ -27564,7 +27573,7 @@ function DataList({
|
|
|
27564
27573
|
if (hasRenderProp) {
|
|
27565
27574
|
const id2 = itemData.id || String(index);
|
|
27566
27575
|
return wrapDnd(
|
|
27567
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
27576
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
27568
27577
|
/* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
27569
27578
|
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
27570
27579
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -27600,7 +27609,7 @@ function DataList({
|
|
|
27600
27609
|
const id = itemData.id || String(index);
|
|
27601
27610
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
27602
27611
|
return wrapDnd(
|
|
27603
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
27612
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
27604
27613
|
/* @__PURE__ */ jsxs(
|
|
27605
27614
|
Box,
|
|
27606
27615
|
{
|
|
@@ -22613,6 +22613,7 @@ function DataList({
|
|
|
22613
22613
|
fields,
|
|
22614
22614
|
columns,
|
|
22615
22615
|
itemActions,
|
|
22616
|
+
itemClickEvent,
|
|
22616
22617
|
gap = "none",
|
|
22617
22618
|
variant = "default",
|
|
22618
22619
|
groupBy,
|
|
@@ -22702,6 +22703,14 @@ function DataList({
|
|
|
22702
22703
|
};
|
|
22703
22704
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
22704
22705
|
};
|
|
22706
|
+
const handleRowClick = (itemData) => () => {
|
|
22707
|
+
if (!itemClickEvent) return;
|
|
22708
|
+
const payload = {
|
|
22709
|
+
id: itemData.id,
|
|
22710
|
+
row: itemData
|
|
22711
|
+
};
|
|
22712
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
22713
|
+
};
|
|
22705
22714
|
if (isLoading) {
|
|
22706
22715
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
22707
22716
|
}
|
|
@@ -22750,7 +22759,7 @@ function DataList({
|
|
|
22750
22759
|
),
|
|
22751
22760
|
children: [
|
|
22752
22761
|
!isSent && senderField && /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
22753
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
22762
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
22754
22763
|
timestamp != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
22755
22764
|
exports.Typography,
|
|
22756
22765
|
{
|
|
@@ -22780,7 +22789,7 @@ function DataList({
|
|
|
22780
22789
|
if (hasRenderProp) {
|
|
22781
22790
|
const id2 = itemData.id || String(index);
|
|
22782
22791
|
return wrapDnd(
|
|
22783
|
-
/* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
22792
|
+
/* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
22784
22793
|
/* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { className: "group flex items-stretch gap-2", children: [
|
|
22785
22794
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
22786
22795
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -22816,7 +22825,7 @@ function DataList({
|
|
|
22816
22825
|
const id = itemData.id || String(index);
|
|
22817
22826
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
22818
22827
|
return wrapDnd(
|
|
22819
|
-
/* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
22828
|
+
/* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
22820
22829
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22821
22830
|
exports.Box,
|
|
22822
22831
|
{
|
package/dist/components/index.js
CHANGED
|
@@ -22564,6 +22564,7 @@ function DataList({
|
|
|
22564
22564
|
fields,
|
|
22565
22565
|
columns,
|
|
22566
22566
|
itemActions,
|
|
22567
|
+
itemClickEvent,
|
|
22567
22568
|
gap = "none",
|
|
22568
22569
|
variant = "default",
|
|
22569
22570
|
groupBy,
|
|
@@ -22653,6 +22654,14 @@ function DataList({
|
|
|
22653
22654
|
};
|
|
22654
22655
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
22655
22656
|
};
|
|
22657
|
+
const handleRowClick = (itemData) => () => {
|
|
22658
|
+
if (!itemClickEvent) return;
|
|
22659
|
+
const payload = {
|
|
22660
|
+
id: itemData.id,
|
|
22661
|
+
row: itemData
|
|
22662
|
+
};
|
|
22663
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
22664
|
+
};
|
|
22656
22665
|
if (isLoading) {
|
|
22657
22666
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
22658
22667
|
}
|
|
@@ -22701,7 +22710,7 @@ function DataList({
|
|
|
22701
22710
|
),
|
|
22702
22711
|
children: [
|
|
22703
22712
|
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
22704
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
22713
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
22705
22714
|
timestamp != null ? /* @__PURE__ */ jsx(
|
|
22706
22715
|
Typography,
|
|
22707
22716
|
{
|
|
@@ -22731,7 +22740,7 @@ function DataList({
|
|
|
22731
22740
|
if (hasRenderProp) {
|
|
22732
22741
|
const id2 = itemData.id || String(index);
|
|
22733
22742
|
return wrapDnd(
|
|
22734
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
22743
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
22735
22744
|
/* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
22736
22745
|
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
22737
22746
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -22767,7 +22776,7 @@ function DataList({
|
|
|
22767
22776
|
const id = itemData.id || String(index);
|
|
22768
22777
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
22769
22778
|
return wrapDnd(
|
|
22770
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
22779
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
22771
22780
|
/* @__PURE__ */ jsxs(
|
|
22772
22781
|
Box,
|
|
22773
22782
|
{
|
|
@@ -56,6 +56,9 @@ export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndP
|
|
|
56
56
|
columns?: readonly DataListField[];
|
|
57
57
|
/** Per-item action buttons */
|
|
58
58
|
itemActions?: readonly DataListItemAction[];
|
|
59
|
+
/** When set, the whole row is clickable and emits UI:{itemClickEvent} with
|
|
60
|
+
* { id, row } (action-button clicks stopPropagation so they still win). */
|
|
61
|
+
itemClickEvent?: EventKey;
|
|
59
62
|
/** Gap between rows */
|
|
60
63
|
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
61
64
|
/** Visual variant */
|
|
@@ -122,7 +125,7 @@ export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndP
|
|
|
122
125
|
*/
|
|
123
126
|
look?: "dense" | "spacious" | "striped" | "borderless" | "card-rows";
|
|
124
127
|
}
|
|
125
|
-
export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps<T>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
128
|
+
export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, itemClickEvent, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, look, }: DataListProps<T>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
126
129
|
export declare namespace DataList {
|
|
127
130
|
var displayName: string;
|
|
128
131
|
}
|
package/dist/providers/index.cjs
CHANGED
|
@@ -23858,6 +23858,7 @@ function DataList({
|
|
|
23858
23858
|
fields,
|
|
23859
23859
|
columns,
|
|
23860
23860
|
itemActions,
|
|
23861
|
+
itemClickEvent,
|
|
23861
23862
|
gap = "none",
|
|
23862
23863
|
variant = "default",
|
|
23863
23864
|
groupBy,
|
|
@@ -23947,6 +23948,14 @@ function DataList({
|
|
|
23947
23948
|
};
|
|
23948
23949
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
23949
23950
|
};
|
|
23951
|
+
const handleRowClick = (itemData) => () => {
|
|
23952
|
+
if (!itemClickEvent) return;
|
|
23953
|
+
const payload = {
|
|
23954
|
+
id: itemData.id,
|
|
23955
|
+
row: itemData
|
|
23956
|
+
};
|
|
23957
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
23958
|
+
};
|
|
23950
23959
|
if (isLoading) {
|
|
23951
23960
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
23952
23961
|
}
|
|
@@ -23995,7 +24004,7 @@ function DataList({
|
|
|
23995
24004
|
),
|
|
23996
24005
|
children: [
|
|
23997
24006
|
!isSent && senderField && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
23998
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
24007
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23999
24008
|
timestamp != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
24000
24009
|
Typography,
|
|
24001
24010
|
{
|
|
@@ -24025,7 +24034,7 @@ function DataList({
|
|
|
24025
24034
|
if (hasRenderProp) {
|
|
24026
24035
|
const id2 = itemData.id || String(index);
|
|
24027
24036
|
return wrapDnd(
|
|
24028
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
24037
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
24029
24038
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
24030
24039
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
24031
24040
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -24061,7 +24070,7 @@ function DataList({
|
|
|
24061
24070
|
const id = itemData.id || String(index);
|
|
24062
24071
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
24063
24072
|
return wrapDnd(
|
|
24064
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
24073
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
24065
24074
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
24066
24075
|
Box,
|
|
24067
24076
|
{
|
package/dist/providers/index.js
CHANGED
|
@@ -23809,6 +23809,7 @@ function DataList({
|
|
|
23809
23809
|
fields,
|
|
23810
23810
|
columns,
|
|
23811
23811
|
itemActions,
|
|
23812
|
+
itemClickEvent,
|
|
23812
23813
|
gap = "none",
|
|
23813
23814
|
variant = "default",
|
|
23814
23815
|
groupBy,
|
|
@@ -23898,6 +23899,14 @@ function DataList({
|
|
|
23898
23899
|
};
|
|
23899
23900
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
23900
23901
|
};
|
|
23902
|
+
const handleRowClick = (itemData) => () => {
|
|
23903
|
+
if (!itemClickEvent) return;
|
|
23904
|
+
const payload = {
|
|
23905
|
+
id: itemData.id,
|
|
23906
|
+
row: itemData
|
|
23907
|
+
};
|
|
23908
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
23909
|
+
};
|
|
23901
23910
|
if (isLoading) {
|
|
23902
23911
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
23903
23912
|
}
|
|
@@ -23946,7 +23955,7 @@ function DataList({
|
|
|
23946
23955
|
),
|
|
23947
23956
|
children: [
|
|
23948
23957
|
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
23949
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23958
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23950
23959
|
timestamp != null ? /* @__PURE__ */ jsx(
|
|
23951
23960
|
Typography,
|
|
23952
23961
|
{
|
|
@@ -23976,7 +23985,7 @@ function DataList({
|
|
|
23976
23985
|
if (hasRenderProp) {
|
|
23977
23986
|
const id2 = itemData.id || String(index);
|
|
23978
23987
|
return wrapDnd(
|
|
23979
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
23988
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
23980
23989
|
/* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
23981
23990
|
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
23982
23991
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -24012,7 +24021,7 @@ function DataList({
|
|
|
24012
24021
|
const id = itemData.id || String(index);
|
|
24013
24022
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
24014
24023
|
return wrapDnd(
|
|
24015
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
24024
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
24016
24025
|
/* @__PURE__ */ jsxs(
|
|
24017
24026
|
Box,
|
|
24018
24027
|
{
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -23627,6 +23627,7 @@ function DataList({
|
|
|
23627
23627
|
fields,
|
|
23628
23628
|
columns,
|
|
23629
23629
|
itemActions,
|
|
23630
|
+
itemClickEvent,
|
|
23630
23631
|
gap = "none",
|
|
23631
23632
|
variant = "default",
|
|
23632
23633
|
groupBy,
|
|
@@ -23716,6 +23717,14 @@ function DataList({
|
|
|
23716
23717
|
};
|
|
23717
23718
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
23718
23719
|
};
|
|
23720
|
+
const handleRowClick = (itemData) => () => {
|
|
23721
|
+
if (!itemClickEvent) return;
|
|
23722
|
+
const payload = {
|
|
23723
|
+
id: itemData.id,
|
|
23724
|
+
row: itemData
|
|
23725
|
+
};
|
|
23726
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
23727
|
+
};
|
|
23719
23728
|
if (isLoading) {
|
|
23720
23729
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
23721
23730
|
}
|
|
@@ -23764,7 +23773,7 @@ function DataList({
|
|
|
23764
23773
|
),
|
|
23765
23774
|
children: [
|
|
23766
23775
|
!isSent && senderField && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
23767
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23776
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23768
23777
|
timestamp != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
23769
23778
|
Typography,
|
|
23770
23779
|
{
|
|
@@ -23794,7 +23803,7 @@ function DataList({
|
|
|
23794
23803
|
if (hasRenderProp) {
|
|
23795
23804
|
const id2 = itemData.id || String(index);
|
|
23796
23805
|
return wrapDnd(
|
|
23797
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
23806
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
23798
23807
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
23799
23808
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
23800
23809
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -23830,7 +23839,7 @@ function DataList({
|
|
|
23830
23839
|
const id = itemData.id || String(index);
|
|
23831
23840
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
23832
23841
|
return wrapDnd(
|
|
23833
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
23842
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
23834
23843
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
23835
23844
|
Box,
|
|
23836
23845
|
{
|
package/dist/runtime/index.js
CHANGED
|
@@ -23578,6 +23578,7 @@ function DataList({
|
|
|
23578
23578
|
fields,
|
|
23579
23579
|
columns,
|
|
23580
23580
|
itemActions,
|
|
23581
|
+
itemClickEvent,
|
|
23581
23582
|
gap = "none",
|
|
23582
23583
|
variant = "default",
|
|
23583
23584
|
groupBy,
|
|
@@ -23667,6 +23668,14 @@ function DataList({
|
|
|
23667
23668
|
};
|
|
23668
23669
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
23669
23670
|
};
|
|
23671
|
+
const handleRowClick = (itemData) => () => {
|
|
23672
|
+
if (!itemClickEvent) return;
|
|
23673
|
+
const payload = {
|
|
23674
|
+
id: itemData.id,
|
|
23675
|
+
row: itemData
|
|
23676
|
+
};
|
|
23677
|
+
eventBus.emit(`UI:${itemClickEvent}`, payload);
|
|
23678
|
+
};
|
|
23670
23679
|
if (isLoading) {
|
|
23671
23680
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
23672
23681
|
}
|
|
@@ -23715,7 +23724,7 @@ function DataList({
|
|
|
23715
23724
|
),
|
|
23716
23725
|
children: [
|
|
23717
23726
|
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: sender }),
|
|
23718
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23727
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23719
23728
|
timestamp != null ? /* @__PURE__ */ jsx(
|
|
23720
23729
|
Typography,
|
|
23721
23730
|
{
|
|
@@ -23745,7 +23754,7 @@ function DataList({
|
|
|
23745
23754
|
if (hasRenderProp) {
|
|
23746
23755
|
const id2 = itemData.id || String(index);
|
|
23747
23756
|
return wrapDnd(
|
|
23748
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, children: [
|
|
23757
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id2, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
23749
23758
|
/* @__PURE__ */ jsxs(Box, { className: "group flex items-stretch gap-2", children: [
|
|
23750
23759
|
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(itemData, index) }),
|
|
23751
23760
|
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -23781,7 +23790,7 @@ function DataList({
|
|
|
23781
23790
|
const id = itemData.id || String(index);
|
|
23782
23791
|
const titleValue = getNestedValue(itemData, titleField?.name ?? "");
|
|
23783
23792
|
return wrapDnd(
|
|
23784
|
-
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, children: [
|
|
23793
|
+
/* @__PURE__ */ jsxs(Box, { "data-entity-row": true, "data-entity-id": id, onClick: itemClickEvent ? handleRowClick(itemData) : void 0, className: cn(itemClickEvent && "cursor-pointer"), children: [
|
|
23785
23794
|
/* @__PURE__ */ jsxs(
|
|
23786
23795
|
Box,
|
|
23787
23796
|
{
|