Skip to content

Commit 49cfbdc

Browse files
author
NarrowsProjects
committed
create: activeFilterIndicator
1 parent f8f88f6 commit 49cfbdc

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

lib/public/app.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,33 @@ label {
718718
opacity: 0.5;
719719
}
720720

721+
.active-filters-indicator {
722+
border-radius: .25rem;
723+
padding: var(--space-xs) var(--space-s) var(--space-xs) var(--space-s);
724+
margin: 0 0 0 var(--space-s);
725+
}
726+
727+
.inactive {
728+
opacity: 0.5;
729+
pointer-events: none;
730+
}
731+
732+
.pulse-green {
733+
animation: pulseGreen 2s infinite;
734+
}
735+
736+
@keyframes pulseGreen {
737+
0% {
738+
box-shadow: 0 0 0px rgba(102, 255, 7, 0.6);
739+
}
740+
50% {
741+
box-shadow: 0 0 10px rgba(102, 255, 7, 0.9);
742+
}
743+
100% {
744+
box-shadow: 0 0 0px rgba(102, 255, 7, 0.6);
745+
}
746+
}
747+
721748
/**
722749
* Breakpoints :
723750
* small : x < 600 (default styles)

lib/public/components/Filters/common/filtersPanelPopover.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,21 @@ const pasteButtonOption = (model) => {
168168
}, 'Paste filters');
169169
};
170170

171+
/**
172+
* A indicates if any filters are currently active on the page
173+
*
174+
* @param {boolean} activeFilters if true, component will turn green and glow
175+
* @returns {Component} the active filters indicator
176+
*/
177+
const activeFilterIndicator = (activeFilters) => {
178+
const innerText = `Filters ${activeFilters ? 'Active' : 'Inactive'}`;
179+
180+
let element = '.active-filters-indicator.b1';
181+
element += activeFilters ? '.pulse-green.b-success.success' : '.inactive';
182+
183+
return h(element, innerText);
184+
};
185+
171186
/**
172187
* Return component composed of the filter popover button and a dropdown trigger
173188
*
@@ -195,6 +210,7 @@ export const filtersPanelPopover = (filteringModel, filtersConfiguration, config
195210
],
196211
),
197212
),
213+
activeFilterIndicator(hasActiveFilters),
198214
],
199215
);
200216
};

0 commit comments

Comments
 (0)