@konoma-development/react-components 0.0.11 → 0.0.13
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.
|
@@ -54345,6 +54345,7 @@ function Table({
|
|
|
54345
54345
|
rowCenterWrapperClasses = baseClasses$2.rowCenterWrapperClasses,
|
|
54346
54346
|
rowRightWrapperClasses = baseClasses$2.rowRightWrapperClasses,
|
|
54347
54347
|
paginationClasses,
|
|
54348
|
+
filterComponents,
|
|
54348
54349
|
columnsCenter,
|
|
54349
54350
|
columnsRight,
|
|
54350
54351
|
columnsLeft,
|
|
@@ -54434,41 +54435,51 @@ function Table({
|
|
|
54434
54435
|
}
|
|
54435
54436
|
) })
|
|
54436
54437
|
] }),
|
|
54437
|
-
hasFilters && /* @__PURE__ */ jsx$1(
|
|
54438
|
-
|
|
54438
|
+
hasFilters && /* @__PURE__ */ jsx$1(
|
|
54439
|
+
"div",
|
|
54439
54440
|
{
|
|
54440
|
-
|
|
54441
|
-
onKeyDown: async (e) => {
|
|
54442
|
-
if (e.key === "Enter" && column.filterKey) {
|
|
54443
|
-
const key = column.filterKey;
|
|
54444
|
-
const value = e.currentTarget.value;
|
|
54445
|
-
if (e) {
|
|
54446
|
-
await updateFilters({ ...filters, [key]: value });
|
|
54447
|
-
} else {
|
|
54448
|
-
const newFilters = { ...filters };
|
|
54449
|
-
delete newFilters[key];
|
|
54450
|
-
await updateFilters(newFilters);
|
|
54451
|
-
}
|
|
54452
|
-
}
|
|
54453
|
-
},
|
|
54441
|
+
className: "bg-krc-table-header w-full text-xs font-medium text-secondary-500",
|
|
54454
54442
|
onClick: (e) => {
|
|
54455
54443
|
e.stopPropagation();
|
|
54456
54444
|
},
|
|
54457
|
-
|
|
54458
|
-
|
|
54459
|
-
|
|
54460
|
-
|
|
54461
|
-
|
|
54462
|
-
|
|
54463
|
-
|
|
54464
|
-
|
|
54465
|
-
|
|
54466
|
-
|
|
54467
|
-
|
|
54468
|
-
|
|
54445
|
+
children: column.filterable && column.filterKey && /* @__PURE__ */ jsx$1(Fragment, { children: column.filterComponent?.(filters, updateFilters) || filterComponents?.[column.id]?.(filters, updateFilters) || /* @__PURE__ */ jsx$1(
|
|
54446
|
+
Input$2,
|
|
54447
|
+
{
|
|
54448
|
+
defaultValue: filters[column.filterKey],
|
|
54449
|
+
onKeyDown: async (e) => {
|
|
54450
|
+
if (e.key === "Enter" && column.filterKey) {
|
|
54451
|
+
const key = column.filterKey;
|
|
54452
|
+
const value = e.currentTarget.value;
|
|
54453
|
+
if (e) {
|
|
54454
|
+
await updateFilters({ ...filters, [key]: value });
|
|
54455
|
+
} else {
|
|
54456
|
+
const newFilters = { ...filters };
|
|
54457
|
+
delete newFilters[key];
|
|
54458
|
+
await updateFilters(newFilters);
|
|
54459
|
+
}
|
|
54460
|
+
}
|
|
54461
|
+
},
|
|
54462
|
+
onClick: (e) => {
|
|
54463
|
+
e.stopPropagation();
|
|
54464
|
+
},
|
|
54465
|
+
onIconRightClick: async (e) => {
|
|
54466
|
+
e.stopPropagation();
|
|
54467
|
+
const key = column.filterKey;
|
|
54468
|
+
if (key) {
|
|
54469
|
+
const newFilters = { ...filters };
|
|
54470
|
+
delete newFilters[key];
|
|
54471
|
+
await updateFilters(newFilters);
|
|
54472
|
+
}
|
|
54473
|
+
},
|
|
54474
|
+
isClearable: true,
|
|
54475
|
+
className: "h-10",
|
|
54476
|
+
iconRightName: filters[column.filterKey] ? "heroicons:x-mark" : ""
|
|
54477
|
+
},
|
|
54478
|
+
filters[column.filterKey]
|
|
54479
|
+
) })
|
|
54469
54480
|
},
|
|
54470
|
-
filters
|
|
54471
|
-
)
|
|
54481
|
+
Object.keys(filters).join("-")
|
|
54482
|
+
)
|
|
54472
54483
|
]
|
|
54473
54484
|
},
|
|
54474
54485
|
column.id.toString()
|
|
@@ -54506,41 +54517,51 @@ function Table({
|
|
|
54506
54517
|
}
|
|
54507
54518
|
) })
|
|
54508
54519
|
] }),
|
|
54509
|
-
hasFilters && /* @__PURE__ */ jsx$1(
|
|
54510
|
-
|
|
54520
|
+
hasFilters && /* @__PURE__ */ jsx$1(
|
|
54521
|
+
"div",
|
|
54511
54522
|
{
|
|
54512
|
-
|
|
54513
|
-
onKeyDown: async (e) => {
|
|
54514
|
-
if (e.key === "Enter" && column.filterKey) {
|
|
54515
|
-
const key = column.filterKey;
|
|
54516
|
-
const value = e.currentTarget.value;
|
|
54517
|
-
if (e) {
|
|
54518
|
-
await updateFilters({ ...filters, [key]: value });
|
|
54519
|
-
} else {
|
|
54520
|
-
const newFilters = { ...filters };
|
|
54521
|
-
delete newFilters[key];
|
|
54522
|
-
await updateFilters(newFilters);
|
|
54523
|
-
}
|
|
54524
|
-
}
|
|
54525
|
-
},
|
|
54523
|
+
className: "bg-krc-table-header text-xs font-medium w-full text-secondary-500",
|
|
54526
54524
|
onClick: (e) => {
|
|
54527
54525
|
e.stopPropagation();
|
|
54528
54526
|
},
|
|
54529
|
-
|
|
54530
|
-
|
|
54531
|
-
|
|
54532
|
-
|
|
54533
|
-
|
|
54534
|
-
|
|
54535
|
-
|
|
54536
|
-
|
|
54537
|
-
|
|
54538
|
-
|
|
54539
|
-
|
|
54540
|
-
|
|
54527
|
+
children: column.filterable && column.filterKey && /* @__PURE__ */ jsx$1(Fragment, { children: column.filterComponent?.(filters, updateFilters) || filterComponents?.[column.id]?.(filters, updateFilters) || /* @__PURE__ */ jsx$1(
|
|
54528
|
+
Input$2,
|
|
54529
|
+
{
|
|
54530
|
+
defaultValue: filters[column.filterKey],
|
|
54531
|
+
onKeyDown: async (e) => {
|
|
54532
|
+
if (e.key === "Enter" && column.filterKey) {
|
|
54533
|
+
const key = column.filterKey;
|
|
54534
|
+
const value = e.currentTarget.value;
|
|
54535
|
+
if (e) {
|
|
54536
|
+
await updateFilters({ ...filters, [key]: value });
|
|
54537
|
+
} else {
|
|
54538
|
+
const newFilters = { ...filters };
|
|
54539
|
+
delete newFilters[key];
|
|
54540
|
+
await updateFilters(newFilters);
|
|
54541
|
+
}
|
|
54542
|
+
}
|
|
54543
|
+
},
|
|
54544
|
+
onClick: (e) => {
|
|
54545
|
+
e.stopPropagation();
|
|
54546
|
+
},
|
|
54547
|
+
onIconRightClick: async (e) => {
|
|
54548
|
+
e.stopPropagation();
|
|
54549
|
+
const key = column.filterKey;
|
|
54550
|
+
if (key) {
|
|
54551
|
+
const newFilters = { ...filters };
|
|
54552
|
+
delete newFilters[key];
|
|
54553
|
+
await updateFilters(newFilters);
|
|
54554
|
+
}
|
|
54555
|
+
},
|
|
54556
|
+
isClearable: true,
|
|
54557
|
+
className: "h-10",
|
|
54558
|
+
iconRightName: filters[column.filterKey] ? "heroicons:x-mark" : ""
|
|
54559
|
+
},
|
|
54560
|
+
filters[column.filterKey]
|
|
54561
|
+
) })
|
|
54541
54562
|
},
|
|
54542
|
-
filters
|
|
54543
|
-
)
|
|
54563
|
+
Object.keys(filters).join("-")
|
|
54564
|
+
)
|
|
54544
54565
|
]
|
|
54545
54566
|
},
|
|
54546
54567
|
column.id.toString()
|