next-helios-fe 1.8.70 → 1.8.71
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/package.json
CHANGED
@@ -23,6 +23,7 @@ interface TableProps {
|
|
23
23
|
customDataIdName?: string;
|
24
24
|
toolbar?: {
|
25
25
|
addData?: {
|
26
|
+
tooltip?: string;
|
26
27
|
show?: boolean;
|
27
28
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
28
29
|
};
|
@@ -30,9 +31,11 @@ interface TableProps {
|
|
30
31
|
show: boolean;
|
31
32
|
};
|
32
33
|
filter?: {
|
34
|
+
tooltip?: string;
|
33
35
|
show: boolean;
|
34
36
|
};
|
35
37
|
export?: {
|
38
|
+
tooltip?: string;
|
36
39
|
show: boolean;
|
37
40
|
};
|
38
41
|
columnSearch?: {
|
@@ -43,6 +46,7 @@ interface TableProps {
|
|
43
46
|
};
|
44
47
|
customTool?: {
|
45
48
|
icon: string;
|
49
|
+
tooltip?: string;
|
46
50
|
variant: "primary" | "secondary" | "success" | "warning" | "danger";
|
47
51
|
show?: boolean;
|
48
52
|
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
@@ -533,9 +537,23 @@ export const Table: TableComponentProps = ({
|
|
533
537
|
: "bg-primary hover:bg-primary-dark";
|
534
538
|
|
535
539
|
if (item.show !== false) {
|
536
|
-
return (
|
537
|
-
<
|
540
|
+
return item?.tooltip ? (
|
541
|
+
<Tooltip
|
538
542
|
key={index}
|
543
|
+
content={item.tooltip || "custom tool"}
|
544
|
+
>
|
545
|
+
<button
|
546
|
+
type="button"
|
547
|
+
className={`p-1.5 rounded-full text-white ${variant}`}
|
548
|
+
onClick={(e) => {
|
549
|
+
item.onClick && item.onClick(e);
|
550
|
+
}}
|
551
|
+
>
|
552
|
+
<Icon icon={item.icon} className="text-2xl" />
|
553
|
+
</button>
|
554
|
+
</Tooltip>
|
555
|
+
) : (
|
556
|
+
<button
|
539
557
|
type="button"
|
540
558
|
className={`p-1.5 rounded-full text-white ${variant}`}
|
541
559
|
onClick={(e) => {
|
@@ -548,27 +566,46 @@ export const Table: TableComponentProps = ({
|
|
548
566
|
}
|
549
567
|
})}
|
550
568
|
{options?.toolbar?.addData?.show !== false && (
|
551
|
-
<
|
552
|
-
|
553
|
-
className="p-1.5 rounded-full bg-primary text-white hover:bg-primary-dark"
|
554
|
-
onClick={(e) => {
|
555
|
-
options?.toolbar?.addData?.onClick &&
|
556
|
-
options?.toolbar?.addData?.onClick(e);
|
557
|
-
}}
|
569
|
+
<Tooltip
|
570
|
+
content={options?.toolbar?.addData?.tooltip || "add data"}
|
558
571
|
>
|
559
|
-
<
|
560
|
-
|
572
|
+
<button
|
573
|
+
type="button"
|
574
|
+
className="p-1.5 rounded-full bg-primary text-white hover:bg-primary-dark"
|
575
|
+
onClick={(e) => {
|
576
|
+
options?.toolbar?.addData?.onClick &&
|
577
|
+
options?.toolbar?.addData?.onClick(e);
|
578
|
+
}}
|
579
|
+
>
|
580
|
+
<Icon icon="ic:round-plus" className="text-2xl" />
|
581
|
+
</button>
|
582
|
+
</Tooltip>
|
561
583
|
)}
|
562
584
|
{options?.toolbar?.filter?.show !== false && (
|
563
585
|
<Dropdown
|
564
586
|
dismissOnClick={false}
|
565
587
|
trigger={
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
588
|
+
options?.toolbar?.filter?.tooltip ? (
|
589
|
+
<Tooltip
|
590
|
+
content={
|
591
|
+
options?.toolbar?.filter?.tooltip || "column filter"
|
592
|
+
}
|
593
|
+
>
|
594
|
+
<button
|
595
|
+
type="button"
|
596
|
+
className="px-2 py-2 rounded-full hover:bg-secondary-light"
|
597
|
+
>
|
598
|
+
<Icon icon="mage:filter" className="text-xl" />
|
599
|
+
</button>
|
600
|
+
</Tooltip>
|
601
|
+
) : (
|
602
|
+
<button
|
603
|
+
type="button"
|
604
|
+
className="px-2 py-2 rounded-full hover:bg-secondary-light"
|
605
|
+
>
|
606
|
+
<Icon icon="mage:filter" className="text-xl" />
|
607
|
+
</button>
|
608
|
+
)
|
572
609
|
}
|
573
610
|
>
|
574
611
|
{header?.map((item) => {
|
@@ -611,6 +648,7 @@ export const Table: TableComponentProps = ({
|
|
611
648
|
{options?.toolbar?.export?.show !== false && (
|
612
649
|
<Button
|
613
650
|
type="button"
|
651
|
+
tooltip={options?.toolbar?.export?.tooltip || "export data"}
|
614
652
|
options={{ variant: "primary", width: "fit" }}
|
615
653
|
onClick={() => {
|
616
654
|
const exportData = filteredData?.map((item) => {
|