next-helios-fe 1.8.123 → 1.8.125

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.123",
3
+ "version": "1.8.125",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,6 +12,20 @@ interface BigCalendarProps {
12
12
  title?: string;
13
13
  options?: {
14
14
  showEventListFilter?: boolean;
15
+ toolbar?: {
16
+ month?: {
17
+ show?: boolean
18
+ },
19
+ week?: {
20
+ show?: boolean
21
+ },
22
+ day?: {
23
+ show?: boolean
24
+ },
25
+ list?: {
26
+ show?: boolean
27
+ },
28
+ }
15
29
  };
16
30
  eventList: {
17
31
  id: number | string;
@@ -102,6 +116,7 @@ export const BigCalendar: React.FC<BigCalendarProps> = ({
102
116
  return (
103
117
  <Toolbar
104
118
  toolbar={toolbar}
119
+ option={options?.toolbar}
105
120
  active={active}
106
121
  setActive={setActive}
107
122
  />
@@ -5,12 +5,27 @@ import dayjs from "dayjs";
5
5
 
6
6
  interface ToolbarProps {
7
7
  toolbar: any;
8
+ option?: {
9
+ month?: {
10
+ show?: boolean;
11
+ };
12
+ week?: {
13
+ show?: boolean;
14
+ };
15
+ day?: {
16
+ show?: boolean;
17
+ };
18
+ list?: {
19
+ show?: boolean;
20
+ };
21
+ };
8
22
  active: string;
9
23
  setActive: (active: string) => void;
10
24
  }
11
25
 
12
26
  export const Toolbar: React.FC<ToolbarProps> = ({
13
27
  toolbar,
28
+ option,
14
29
  active,
15
30
  setActive,
16
31
  }) => {
@@ -44,54 +59,64 @@ export const Toolbar: React.FC<ToolbarProps> = ({
44
59
  </span>
45
60
  </div>
46
61
  <div className="flex">
47
- <button
48
- type="button"
49
- className={`px-4 py-1.5 rounded-l-md text-primary hover:bg-primary-light ${
50
- active === "month" ? "bg-primary-light" : "bg-primary-transparent"
51
- }`}
52
- onClick={() => {
53
- toolbar.onView("month");
54
- setActive("month");
55
- }}
56
- >
57
- Month
58
- </button>
59
- <button
60
- type="button"
61
- className={`px-4 py-1.5 border-x border-primary/30 text-primary hover:bg-primary-light ${
62
- active === "week" ? "bg-primary-light" : "bg-primary-transparent"
63
- }`}
64
- onClick={() => {
65
- toolbar.onView("week");
66
- setActive("week");
67
- }}
68
- >
69
- Week
70
- </button>
71
- <button
72
- type="button"
73
- className={`px-4 py-1.5 border-r border-primary/30 text-primary hover:bg-primary-light ${
74
- active === "day" ? "bg-primary-light" : "bg-primary-transparent"
75
- }`}
76
- onClick={() => {
77
- toolbar.onView("day");
78
- setActive("day");
79
- }}
80
- >
81
- Day
82
- </button>
83
- <button
84
- type="button"
85
- className={`px-3 py-1.5 rounded-r-md text-primary hover:bg-primary-light ${
86
- active === "agenda" ? "bg-primary-light" : "bg-primary-transparent"
87
- }`}
88
- onClick={() => {
89
- toolbar.onView("agenda");
90
- setActive("agenda");
91
- }}
92
- >
93
- List
94
- </button>
62
+ {option?.month?.show !== false && (
63
+ <button
64
+ type="button"
65
+ className={`px-4 py-1.5 rounded-l-md text-primary hover:bg-primary-light ${
66
+ active === "month" ? "bg-primary-light" : "bg-primary-transparent"
67
+ }`}
68
+ onClick={() => {
69
+ toolbar.onView("month");
70
+ setActive("month");
71
+ }}
72
+ >
73
+ Month
74
+ </button>
75
+ )}
76
+ {option?.week?.show !== false && (
77
+ <button
78
+ type="button"
79
+ className={`px-4 py-1.5 border-x border-primary/30 text-primary hover:bg-primary-light ${
80
+ active === "week" ? "bg-primary-light" : "bg-primary-transparent"
81
+ }`}
82
+ onClick={() => {
83
+ toolbar.onView("week");
84
+ setActive("week");
85
+ }}
86
+ >
87
+ Week
88
+ </button>
89
+ )}
90
+ {option?.day?.show !== false && (
91
+ <button
92
+ type="button"
93
+ className={`px-4 py-1.5 border-r border-primary/30 text-primary hover:bg-primary-light ${
94
+ active === "day" ? "bg-primary-light" : "bg-primary-transparent"
95
+ }`}
96
+ onClick={() => {
97
+ toolbar.onView("day");
98
+ setActive("day");
99
+ }}
100
+ >
101
+ Day
102
+ </button>
103
+ )}
104
+ {option?.list?.show !== false && (
105
+ <button
106
+ type="button"
107
+ className={`px-3 py-1.5 rounded-r-md text-primary hover:bg-primary-light ${
108
+ active === "agenda"
109
+ ? "bg-primary-light"
110
+ : "bg-primary-transparent"
111
+ }`}
112
+ onClick={() => {
113
+ toolbar.onView("agenda");
114
+ setActive("agenda");
115
+ }}
116
+ >
117
+ List
118
+ </button>
119
+ )}
95
120
  </div>
96
121
  </div>
97
122
  );
@@ -694,7 +694,7 @@ export const Table: TableComponentProps = ({
694
694
  })}
695
695
  {options?.toolbar?.addData?.show !== false && (
696
696
  <Tooltip
697
- content={options?.toolbar?.addData?.tooltip || "add data"}
697
+ content={options?.toolbar?.addData?.tooltip || "Add Data"}
698
698
  >
699
699
  <button
700
700
  type="button"
@@ -715,7 +715,7 @@ export const Table: TableComponentProps = ({
715
715
  trigger={
716
716
  <Tooltip
717
717
  content={
718
- options?.toolbar?.filter?.tooltip || "column filter"
718
+ options?.toolbar?.filter?.tooltip || "Column Filter"
719
719
  }
720
720
  >
721
721
  <button
@@ -771,7 +771,7 @@ export const Table: TableComponentProps = ({
771
771
  {options?.toolbar?.export?.show !== false && (
772
772
  <Button
773
773
  type="button"
774
- tooltip={options?.toolbar?.export?.tooltip || "export data"}
774
+ tooltip={options?.toolbar?.export?.tooltip || "Export Data"}
775
775
  options={{ variant: "primary", width: "fit" }}
776
776
  onClick={() => {
777
777
  const exportData = filteredData?.map((item) => {