@almadar/ui 5.9.2 → 5.9.4
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 +15 -6
- package/dist/avl/index.js +15 -6
- package/dist/components/index.cjs +15 -6
- package/dist/components/index.js +15 -6
- package/dist/components/molecules/DataList.d.ts +4 -1
- package/dist/docs/index.cjs +3 -3
- package/dist/docs/index.js +3 -3
- package/dist/providers/index.cjs +15 -6
- package/dist/providers/index.js +15 -6
- package/dist/runtime/index.cjs +15 -6
- package/dist/runtime/index.js +15 -6
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -8264,7 +8264,7 @@ var init_Input = __esm({
|
|
|
8264
8264
|
className
|
|
8265
8265
|
);
|
|
8266
8266
|
if (type === "select") {
|
|
8267
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
8267
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
8268
8268
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
8269
8269
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8270
8270
|
"select",
|
|
@@ -8284,7 +8284,7 @@ var init_Input = __esm({
|
|
|
8284
8284
|
] });
|
|
8285
8285
|
}
|
|
8286
8286
|
if (type === "textarea") {
|
|
8287
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8287
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8288
8288
|
"textarea",
|
|
8289
8289
|
{
|
|
8290
8290
|
ref,
|
|
@@ -8315,7 +8315,7 @@ var init_Input = __esm({
|
|
|
8315
8315
|
}
|
|
8316
8316
|
);
|
|
8317
8317
|
}
|
|
8318
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
8318
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
8319
8319
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
8320
8320
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8321
8321
|
"input",
|
|
@@ -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
|
@@ -8215,7 +8215,7 @@ var init_Input = __esm({
|
|
|
8215
8215
|
className
|
|
8216
8216
|
);
|
|
8217
8217
|
if (type === "select") {
|
|
8218
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8218
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
8219
8219
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
8220
8220
|
/* @__PURE__ */ jsxs(
|
|
8221
8221
|
"select",
|
|
@@ -8235,7 +8235,7 @@ var init_Input = __esm({
|
|
|
8235
8235
|
] });
|
|
8236
8236
|
}
|
|
8237
8237
|
if (type === "textarea") {
|
|
8238
|
-
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
8238
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsx(
|
|
8239
8239
|
"textarea",
|
|
8240
8240
|
{
|
|
8241
8241
|
ref,
|
|
@@ -8266,7 +8266,7 @@ var init_Input = __esm({
|
|
|
8266
8266
|
}
|
|
8267
8267
|
);
|
|
8268
8268
|
}
|
|
8269
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8269
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
8270
8270
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
8271
8271
|
/* @__PURE__ */ jsx(
|
|
8272
8272
|
"input",
|
|
@@ -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
|
{
|
|
@@ -2116,7 +2116,7 @@ var init_Input = __esm({
|
|
|
2116
2116
|
className
|
|
2117
2117
|
);
|
|
2118
2118
|
if (type === "select") {
|
|
2119
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2119
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
2120
2120
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
2121
2121
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2122
2122
|
"select",
|
|
@@ -2136,7 +2136,7 @@ var init_Input = __esm({
|
|
|
2136
2136
|
] });
|
|
2137
2137
|
}
|
|
2138
2138
|
if (type === "textarea") {
|
|
2139
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2139
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2140
2140
|
"textarea",
|
|
2141
2141
|
{
|
|
2142
2142
|
ref,
|
|
@@ -2167,7 +2167,7 @@ var init_Input = __esm({
|
|
|
2167
2167
|
}
|
|
2168
2168
|
);
|
|
2169
2169
|
}
|
|
2170
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2170
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
2171
2171
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
2172
2172
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2173
2173
|
"input",
|
|
@@ -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
|
@@ -2067,7 +2067,7 @@ var init_Input = __esm({
|
|
|
2067
2067
|
className
|
|
2068
2068
|
);
|
|
2069
2069
|
if (type === "select") {
|
|
2070
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2070
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
2071
2071
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
2072
2072
|
/* @__PURE__ */ jsxs(
|
|
2073
2073
|
"select",
|
|
@@ -2087,7 +2087,7 @@ var init_Input = __esm({
|
|
|
2087
2087
|
] });
|
|
2088
2088
|
}
|
|
2089
2089
|
if (type === "textarea") {
|
|
2090
|
-
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
2090
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsx(
|
|
2091
2091
|
"textarea",
|
|
2092
2092
|
{
|
|
2093
2093
|
ref,
|
|
@@ -2118,7 +2118,7 @@ var init_Input = __esm({
|
|
|
2118
2118
|
}
|
|
2119
2119
|
);
|
|
2120
2120
|
}
|
|
2121
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2121
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
2122
2122
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
2123
2123
|
/* @__PURE__ */ jsx(
|
|
2124
2124
|
"input",
|
|
@@ -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/docs/index.cjs
CHANGED
|
@@ -4110,7 +4110,7 @@ var Input = React7__default.default.forwardRef(
|
|
|
4110
4110
|
className
|
|
4111
4111
|
);
|
|
4112
4112
|
if (type === "select") {
|
|
4113
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4113
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
4114
4114
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
4115
4115
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4116
4116
|
"select",
|
|
@@ -4130,7 +4130,7 @@ var Input = React7__default.default.forwardRef(
|
|
|
4130
4130
|
] });
|
|
4131
4131
|
}
|
|
4132
4132
|
if (type === "textarea") {
|
|
4133
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4133
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
4134
|
"textarea",
|
|
4135
4135
|
{
|
|
4136
4136
|
ref,
|
|
@@ -4161,7 +4161,7 @@ var Input = React7__default.default.forwardRef(
|
|
|
4161
4161
|
}
|
|
4162
4162
|
);
|
|
4163
4163
|
}
|
|
4164
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
4165
4165
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
4166
4166
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4167
4167
|
"input",
|
package/dist/docs/index.js
CHANGED
|
@@ -4083,7 +4083,7 @@ var Input = React7.forwardRef(
|
|
|
4083
4083
|
className
|
|
4084
4084
|
);
|
|
4085
4085
|
if (type === "select") {
|
|
4086
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
4086
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
4087
4087
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
4088
4088
|
/* @__PURE__ */ jsxs(
|
|
4089
4089
|
"select",
|
|
@@ -4103,7 +4103,7 @@ var Input = React7.forwardRef(
|
|
|
4103
4103
|
] });
|
|
4104
4104
|
}
|
|
4105
4105
|
if (type === "textarea") {
|
|
4106
|
-
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
4106
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsx(
|
|
4107
4107
|
"textarea",
|
|
4108
4108
|
{
|
|
4109
4109
|
ref,
|
|
@@ -4134,7 +4134,7 @@ var Input = React7.forwardRef(
|
|
|
4134
4134
|
}
|
|
4135
4135
|
);
|
|
4136
4136
|
}
|
|
4137
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
4137
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
4138
4138
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
4139
4139
|
/* @__PURE__ */ jsx(
|
|
4140
4140
|
"input",
|
package/dist/providers/index.cjs
CHANGED
|
@@ -3449,7 +3449,7 @@ var init_Input = __esm({
|
|
|
3449
3449
|
className
|
|
3450
3450
|
);
|
|
3451
3451
|
if (type === "select") {
|
|
3452
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3452
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
3453
3453
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3454
3454
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3455
3455
|
"select",
|
|
@@ -3469,7 +3469,7 @@ var init_Input = __esm({
|
|
|
3469
3469
|
] });
|
|
3470
3470
|
}
|
|
3471
3471
|
if (type === "textarea") {
|
|
3472
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3472
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3473
3473
|
"textarea",
|
|
3474
3474
|
{
|
|
3475
3475
|
ref,
|
|
@@ -3500,7 +3500,7 @@ var init_Input = __esm({
|
|
|
3500
3500
|
}
|
|
3501
3501
|
);
|
|
3502
3502
|
}
|
|
3503
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3503
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
3504
3504
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3505
3505
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3506
3506
|
"input",
|
|
@@ -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
|
@@ -3400,7 +3400,7 @@ var init_Input = __esm({
|
|
|
3400
3400
|
className
|
|
3401
3401
|
);
|
|
3402
3402
|
if (type === "select") {
|
|
3403
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3403
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
3404
3404
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3405
3405
|
/* @__PURE__ */ jsxs(
|
|
3406
3406
|
"select",
|
|
@@ -3420,7 +3420,7 @@ var init_Input = __esm({
|
|
|
3420
3420
|
] });
|
|
3421
3421
|
}
|
|
3422
3422
|
if (type === "textarea") {
|
|
3423
|
-
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
3423
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsx(
|
|
3424
3424
|
"textarea",
|
|
3425
3425
|
{
|
|
3426
3426
|
ref,
|
|
@@ -3451,7 +3451,7 @@ var init_Input = __esm({
|
|
|
3451
3451
|
}
|
|
3452
3452
|
);
|
|
3453
3453
|
}
|
|
3454
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3454
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
3455
3455
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3456
3456
|
/* @__PURE__ */ jsx(
|
|
3457
3457
|
"input",
|
|
@@ -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
|
@@ -3684,7 +3684,7 @@ var init_Input = __esm({
|
|
|
3684
3684
|
className
|
|
3685
3685
|
);
|
|
3686
3686
|
if (type === "select") {
|
|
3687
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3687
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
3688
3688
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3689
3689
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3690
3690
|
"select",
|
|
@@ -3704,7 +3704,7 @@ var init_Input = __esm({
|
|
|
3704
3704
|
] });
|
|
3705
3705
|
}
|
|
3706
3706
|
if (type === "textarea") {
|
|
3707
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3708
3708
|
"textarea",
|
|
3709
3709
|
{
|
|
3710
3710
|
ref,
|
|
@@ -3735,7 +3735,7 @@ var init_Input = __esm({
|
|
|
3735
3735
|
}
|
|
3736
3736
|
);
|
|
3737
3737
|
}
|
|
3738
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
3738
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
3739
3739
|
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3740
3740
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3741
3741
|
"input",
|
|
@@ -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
|
@@ -3635,7 +3635,7 @@ var init_Input = __esm({
|
|
|
3635
3635
|
className
|
|
3636
3636
|
);
|
|
3637
3637
|
if (type === "select") {
|
|
3638
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3638
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
3639
3639
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3640
3640
|
/* @__PURE__ */ jsxs(
|
|
3641
3641
|
"select",
|
|
@@ -3655,7 +3655,7 @@ var init_Input = __esm({
|
|
|
3655
3655
|
] });
|
|
3656
3656
|
}
|
|
3657
3657
|
if (type === "textarea") {
|
|
3658
|
-
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
3658
|
+
return /* @__PURE__ */ jsx("div", { className: "relative w-full", children: /* @__PURE__ */ jsx(
|
|
3659
3659
|
"textarea",
|
|
3660
3660
|
{
|
|
3661
3661
|
ref,
|
|
@@ -3686,7 +3686,7 @@ var init_Input = __esm({
|
|
|
3686
3686
|
}
|
|
3687
3687
|
);
|
|
3688
3688
|
}
|
|
3689
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3689
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
3690
3690
|
resolvedLeftIcon && /* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-muted-foreground", children: resolvedLeftIcon }),
|
|
3691
3691
|
/* @__PURE__ */ jsx(
|
|
3692
3692
|
"input",
|
|
@@ -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
|
{
|