Skip to content
Snippets Groups Projects
Commit 4be3f698 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: put checkbox style in global style + small fixes

parent 82f2a129
Branches
Tags
3 merge requests!14Recette,!13Dev,!6Topic search
...@@ -99,58 +99,3 @@ ...@@ -99,58 +99,3 @@
} }
} }
} }
.checkbox {
list-style-type: none;
input {
opacity: 0;
display: none;
&:checked ~ .customCheck {
background-color: $orange-light;
border-color: transparent;
}
&:checked ~ .customCheck:after {
display: block;
}
}
label {
align-items: center;
grid-template-columns: min-content auto;
display: inline-grid;
cursor: pointer;
}
.label {
padding-left: 8px;
@include cn-regular-14;
}
.customCheck {
display: inline-grid;
width: 18px;
height: 18px;
background-color: $white;
border: 1px solid $grey;
cursor: pointer;
position: relative;
top: 0;
left: 0;
&:hover {
background-color: $grey-5;
}
&:after {
content: '';
position: absolute;
display: none;
}
&:after {
left: 7px;
top: 3px;
width: 4px;
height: 8px;
border: solid $white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
}
}
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
@include background-hash; @include background-hash;
padding: 0 0 4px 5px; padding: 0 0 4px 5px;
button { button {
border-radius: 6px;
@include btn-search; @include btn-search;
@include cn-bold-14; @include cn-bold-14;
} }
...@@ -87,59 +88,6 @@ ...@@ -87,59 +88,6 @@
} }
} }
.checkbox {
list-style-type: none;
input {
opacity: 0;
display: none;
&:checked ~ .customCheck {
background-color: $orange-light;
border-color: transparent;
}
&:checked ~ .customCheck:after {
display: block;
}
}
label {
align-items: center;
grid-template-columns: min-content auto;
display: inline-grid;
cursor: pointer;
}
.label {
padding-left: 8px;
@include cn-regular-14;
}
.customCheck {
display: inline-grid;
width: 18px;
height: 18px;
background-color: $white;
border: 1px solid $grey;
cursor: pointer;
position: relative;
top: 0;
left: 0;
&:hover {
background-color: $grey-5;
}
&:after {
content: '';
position: absolute;
display: none;
left: 7px;
top: 3px;
width: 4px;
height: 8px;
border: solid $white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
}
}
.footerSearchSection { .footerSearchSection {
margin: 17px 0px 17px 0px; margin: 17px 0px 17px 0px;
......
...@@ -51,7 +51,7 @@ export class SearchComponent implements OnInit { ...@@ -51,7 +51,7 @@ export class SearchComponent implements OnInit {
// Sends an array containing all filters // Sends an array containing all filters
public applyFilter(term: string): void { public applyFilter(term: string): void {
// Add search input filter // Add search input filter
let filters: Filter[] = []; const filters: Filter[] = [];
if (term) { if (term) {
filters.push(new Filter('nomDeVotreStructure', term, false)); filters.push(new Filter('nomDeVotreStructure', term, false));
} }
...@@ -69,7 +69,7 @@ export class SearchComponent implements OnInit { ...@@ -69,7 +69,7 @@ export class SearchComponent implements OnInit {
} }
public fetchResults(checkedModules: Module[]): void { public fetchResults(checkedModules: Module[]): void {
let inputTerm = this.searchForm.get('searchTerm').value; const inputTerm = this.searchForm.get('searchTerm').value;
// Store checked modules // Store checked modules
this.checkedModulesFilter = checkedModules; this.checkedModulesFilter = checkedModules;
...@@ -91,7 +91,7 @@ export class SearchComponent implements OnInit { ...@@ -91,7 +91,7 @@ export class SearchComponent implements OnInit {
} }
private fromStringToIdExcel(categ: string): string { private fromStringToIdExcel(categ: string): string {
let splitStr = categ.toLowerCase().split(' '); const splitStr = categ.toLowerCase().split(' ');
for (let i = 1; i < splitStr.length; i++) { for (let i = 1; i < splitStr.length; i++) {
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
} }
...@@ -105,9 +105,7 @@ export class SearchComponent implements OnInit { ...@@ -105,9 +105,7 @@ export class SearchComponent implements OnInit {
// Fake service api // Fake service api
private mockService(module: Category[], titre: string, categ: any, nbCateg: number): void { private mockService(module: Category[], titre: string, categ: any, nbCateg: number): void {
const category = new Category(); const category = new Category({ name: titre, modules: [] });
category.name = titre;
category.modules = [];
for (let i = 0; i < nbCateg; i++) { for (let i = 0; i < nbCateg; i++) {
category.modules.push(new Module(categ.id + i, categ.name + i)); category.modules.push(new Module(categ.id + i, categ.name + i));
} }
......
...@@ -68,3 +68,59 @@ a { ...@@ -68,3 +68,59 @@ a {
width: unset; width: unset;
} }
} }
/** Checkboxes **/
.checkbox {
list-style-type: none;
input {
opacity: 0;
display: none;
&:checked ~ .customCheck {
background-color: $primary-color;
border-color: transparent;
}
&:checked ~ .customCheck:after {
display: block;
}
}
label {
align-items: center;
grid-template-columns: min-content auto;
display: inline-grid;
cursor: pointer;
}
.label {
padding-left: 8px;
@include cn-regular-14;
}
.customCheck {
display: inline-grid;
width: 18px;
height: 18px;
background-color: $white;
border: 1px solid $grey;
cursor: pointer;
position: relative;
top: 0;
left: 0;
&:hover {
background-color: $grey-5;
}
&:after {
content: '';
position: absolute;
display: none;
left: 7px;
top: 3px;
width: 4px;
height: 8px;
border: solid $white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment