Fixed themes

This commit is contained in:
MaxOvs19 2023-02-06 19:18:08 +03:00
parent bcad805727
commit 038b7d627c
4 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,6 @@ const dropdown = new CGSelect({
width: '824px',
},
},
// multiselect: true,
});
dropdown.on('clear', function (e) {

View File

@ -1,3 +1,3 @@
import { CGSelect } from './src/cg-select';
import { CGSelect } from './src/cg-select.ts';
export default CGSelect;

View File

@ -5,26 +5,27 @@ export function changeTheme(element: Element, theme: string) {
const search = element!.querySelector('.inputSearch');
const path = element.querySelectorAll('.pathWhite');
select!.classList.remove('classicSelect');
list!.classList.remove('classicList');
path.forEach((elem) => {
elem.classList.remove('pathBlack');
elem.classList.remove('pathWhite');
});
switch (theme) {
case 'dark':
select!.classList.remove('classicSelect');
select!.classList.add('selectDark');
list!.classList.add('listDark');
list!.classList.remove('classicList');
path.forEach((elem) => {
elem.classList.remove('pathBlack');
elem.classList.add('pathWhite');
});
break;
case 'white':
select!.classList.remove('classicSelect');
select!.classList.add('selectWhite');
caret!.classList.add('caretWhite');
list!.classList.add('listWhite');
list!.classList.remove('classicList');
path.forEach((elem) => {
elem.classList.add('pathBlack');
elem.classList.remove('pathWhite');
});
if (search!) {

View File

@ -27,7 +27,7 @@ export interface ICgSelect {
items?: IItems[] | string[] | any;
/**
* An optional parameter responsible for switching between different themes, the classic theme is set by default.
* @type {string}
* @type {string} values: dark, white
*/
theme?: string;
/**