next-helios-fe 1.8.70 → 1.8.72
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,37 @@ 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
|
-
|
588
|
+
<Tooltip
|
589
|
+
content={
|
590
|
+
options?.toolbar?.filter?.tooltip || "column filter"
|
591
|
+
}
|
569
592
|
>
|
570
|
-
<
|
571
|
-
|
593
|
+
<button
|
594
|
+
type="button"
|
595
|
+
className="px-2 py-2 rounded-full hover:bg-secondary-light"
|
596
|
+
>
|
597
|
+
<Icon icon="mage:filter" className="text-xl" />
|
598
|
+
</button>
|
599
|
+
</Tooltip>
|
572
600
|
}
|
573
601
|
>
|
574
602
|
{header?.map((item) => {
|
@@ -611,6 +639,7 @@ export const Table: TableComponentProps = ({
|
|
611
639
|
{options?.toolbar?.export?.show !== false && (
|
612
640
|
<Button
|
613
641
|
type="button"
|
642
|
+
tooltip={options?.toolbar?.export?.tooltip || "export data"}
|
614
643
|
options={{ variant: "primary", width: "fit" }}
|
615
644
|
onClick={() => {
|
616
645
|
const exportData = filteredData?.map((item) => {
|