diff --git a/example/index.js b/example/index.js index 1802f47..853b3c0 100644 --- a/example/index.js +++ b/example/index.js @@ -25,7 +25,6 @@ const dropdown = new CGSelect({ width: '824px', }, }, - // multiselect: true, }); dropdown.on('clear', function (e) { diff --git a/index.js b/index.js index d3c8b2f..cae98de 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ -import { CGSelect } from './src/cg-select'; +import { CGSelect } from './src/cg-select.ts'; export default CGSelect; diff --git a/src/components/theme/theme.ts b/src/components/theme/theme.ts index 6904a94..3b4f393 100644 --- a/src/components/theme/theme.ts +++ b/src/components/theme/theme.ts @@ -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!) { diff --git a/src/interfaces/cg-select.interface.ts b/src/interfaces/cg-select.interface.ts index 63d0b8f..403b1a6 100644 --- a/src/interfaces/cg-select.interface.ts +++ b/src/interfaces/cg-select.interface.ts @@ -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; /**