@visns-studio/visns-components 5.6.1 → 5.6.2
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
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
85
85
|
},
|
|
86
86
|
"name": "@visns-studio/visns-components",
|
|
87
|
-
"version": "5.6.
|
|
87
|
+
"version": "5.6.2",
|
|
88
88
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
89
89
|
"main": "src/index.js",
|
|
90
90
|
"files": [
|
|
@@ -9,6 +9,7 @@ function TableFilter({
|
|
|
9
9
|
type,
|
|
10
10
|
}) {
|
|
11
11
|
const [visibleChildren, setVisibleChildren] = useState(null);
|
|
12
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
12
13
|
const isFirstRender = useRef(true);
|
|
13
14
|
|
|
14
15
|
useEffect(() => {
|
|
@@ -116,6 +117,9 @@ function TableFilter({
|
|
|
116
117
|
if (collapsible && filtertype === 'parent') {
|
|
117
118
|
setVisibleChildren(id);
|
|
118
119
|
}
|
|
120
|
+
|
|
121
|
+
// Close mobile menu after selection on small screens
|
|
122
|
+
setMobileMenuOpen(false);
|
|
119
123
|
};
|
|
120
124
|
|
|
121
125
|
const renderContent = (d) => {
|
|
@@ -184,14 +188,40 @@ function TableFilter({
|
|
|
184
188
|
}
|
|
185
189
|
};
|
|
186
190
|
|
|
191
|
+
const toggleMobileMenu = () => {
|
|
192
|
+
setMobileMenuOpen(!mobileMenuOpen);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// Find active filter for mobile display
|
|
196
|
+
const activeFilter = filters.find((filter) => filter.show === true);
|
|
197
|
+
const activeLabel = activeFilter ? activeFilter.label : 'Select Option';
|
|
198
|
+
|
|
187
199
|
return (
|
|
188
|
-
<
|
|
189
|
-
{
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
<div className={styles.tableFilterContainer}>
|
|
201
|
+
<div className={styles.mobileToggle} onClick={toggleMobileMenu}>
|
|
202
|
+
<span className={styles.activeFilterLabel}>{activeLabel}</span>
|
|
203
|
+
<span
|
|
204
|
+
className={`${styles.mobileMenuIcon} ${
|
|
205
|
+
mobileMenuOpen ? styles.open : ''
|
|
206
|
+
}`}
|
|
207
|
+
>
|
|
208
|
+
<span></span>
|
|
209
|
+
<span></span>
|
|
210
|
+
<span></span>
|
|
211
|
+
</span>
|
|
212
|
+
</div>
|
|
213
|
+
<ul
|
|
214
|
+
className={`${styles.tableFilter} ${
|
|
215
|
+
mobileMenuOpen ? styles.mobileOpen : ''
|
|
216
|
+
}`}
|
|
217
|
+
>
|
|
218
|
+
{filters.map((item, key) => (
|
|
219
|
+
<React.Fragment key={'table-filter-' + key}>
|
|
220
|
+
{renderContent(item)}
|
|
221
|
+
</React.Fragment>
|
|
222
|
+
))}
|
|
223
|
+
</ul>
|
|
224
|
+
</div>
|
|
195
225
|
);
|
|
196
226
|
}
|
|
197
227
|
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
.tableFilterContainer {
|
|
2
|
+
width: 100%;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.tableFilter {
|
|
2
8
|
list-style: none;
|
|
3
9
|
padding: 0;
|
|
4
10
|
margin: 0;
|
|
5
11
|
font-size: 1rem;
|
|
12
|
+
width: 100%;
|
|
6
13
|
}
|
|
7
14
|
|
|
8
15
|
.collapsibleMenu {
|
|
@@ -51,3 +58,81 @@
|
|
|
51
58
|
background: var(--item-color) !important;
|
|
52
59
|
color: var(--paragraph-color) !important;
|
|
53
60
|
}
|
|
61
|
+
|
|
62
|
+
/* Mobile menu toggle button */
|
|
63
|
+
.mobileToggle {
|
|
64
|
+
display: none;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
padding: 12px 15px;
|
|
68
|
+
background: var(--primary-color, #0b3b2e);
|
|
69
|
+
color: white;
|
|
70
|
+
border-radius: 4px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
margin-bottom: 10px;
|
|
73
|
+
border: none;
|
|
74
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.activeFilterLabel {
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
color: white;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mobileMenuIcon {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
justify-content: space-between;
|
|
86
|
+
width: 20px;
|
|
87
|
+
height: 14px;
|
|
88
|
+
position: relative;
|
|
89
|
+
transition: all 0.3s ease;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.mobileMenuIcon span {
|
|
93
|
+
display: block;
|
|
94
|
+
height: 2px;
|
|
95
|
+
width: 100%;
|
|
96
|
+
background-color: white;
|
|
97
|
+
border-radius: 2px;
|
|
98
|
+
transition: all 0.3s ease;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.mobileMenuIcon.open span:nth-child(1) {
|
|
102
|
+
transform: translateY(6px) rotate(45deg);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.mobileMenuIcon.open span:nth-child(2) {
|
|
106
|
+
opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mobileMenuIcon.open span:nth-child(3) {
|
|
110
|
+
transform: translateY(-6px) rotate(-45deg);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Media queries for responsive design */
|
|
114
|
+
@media (max-width: 1024px) {
|
|
115
|
+
.mobileToggle {
|
|
116
|
+
display: flex;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.tableFilter {
|
|
120
|
+
display: none;
|
|
121
|
+
max-height: 0;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
transition: max-height 0.3s ease;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.tableFilter.mobileOpen {
|
|
127
|
+
display: block;
|
|
128
|
+
max-height: 1000px;
|
|
129
|
+
overflow-y: auto;
|
|
130
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
margin-bottom: 10px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.link {
|
|
136
|
+
padding: 12px 20px; /* Larger touch targets for mobile */
|
|
137
|
+
}
|
|
138
|
+
}
|