Finished update

This commit is contained in:
MaxOvs19 2023-02-08 15:03:36 +03:00
parent c5d41550b1
commit d9e6fc72c9
7 changed files with 23 additions and 11 deletions

View File

@ -26,13 +26,23 @@ Tested in JS and React. Errors in work in React applications are revealed.
- All select rewritten to ts.
- Fixed bugs and shortcomings.
24.01.2023 - fix 0.2.2 - Fixed documentation etc.
27.01.2023 - fix 0.2.3
##### 24.01.2023 - fix 0.2.2 - Fixed documentation etc.
### 27.01.2023 - update 0.2.3
- Changed the theme selection function.
- Fixed documentation.
31.01.2023 - fix 0.2.31
##### 31.01.2023 - fix 0.2.31
- Adding a new method to track select actions.
- Fixed documentation.
##### 08.02.2023 - fix 0.2.32
- Fixing Methods and Variables.
- Updating how themes work.
- Fixed documentation.
- Fixing bugs related to the cleanup of the select.
- Documentation navigation update.
- Added icon for example page and documentation.

View File

@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="assets/style.css" />
<link rel="stylesheet" href="assets/highlight.css" />
<link rel="shortcut icon" href="../src/images/logoCG2.ico" type="image/x-icon" />
<script async src="assets/search.js" id="search-script"></script>
</head>
<body>

View File

@ -14,6 +14,7 @@
<meta property="og:image" content="/src/images/logoCG.jpg" />
<title>Cg-Select</title>
<link rel="shortcut icon" href="../src/images/logoCG2.ico" type="image/x-icon" />
<link href="example.scss" rel="stylesheet" />
</head>
<body class="body-example">
@ -351,6 +352,7 @@
maxWidth: <span class="code__string">'500px ',</span>
},
},
multiselect: <span class="code__keyword">true,</span>
});
</pre>
</code>

View File

@ -57,6 +57,7 @@ const dropdownNativeSelect = new CGSelect({
width: '824px',
},
},
theme: 'dark',
});
// ------------------------------listDisplayMode--------------------
@ -88,7 +89,7 @@ const dropdownlistDisplayMode = new CGSelect({
// --------------------------------Категории--------------------------
const dropdown4 = new CGSelect({
selector: '.cg-dropdown_categories',
placeholder: 'Выберите регион',
placeholder: 'Choose region',
searchMode: true,
items: [
{

View File

@ -32,7 +32,6 @@ import { changeTheme } from './components/theme/theme';
* @author Ovsyanikov Maxim
*/
export class CGSelect implements ICgSelect {
// Select settings
selector?: string;
selected?: string;
placeholder?: string;
@ -466,10 +465,6 @@ export class CGSelect implements ICgSelect {
* @method initEvent
*/
private initEvent() {
if (!this.event) {
return;
}
if (this.event) {
if (this.event === 'mouseenter') {
this.element!.addEventListener(this.event, () => {
@ -771,7 +766,7 @@ export class CGSelect implements ICgSelect {
* @returns {HTMLElement} returns a reference to the selected HTML element.
* @method getElement
*/
public getElement(numberItem: number): IItems[] | string[] | any {
public getElement(numberItem: number): IItems[] | any {
if (numberItem > this.items.length) {
return;
}

View File

@ -4,6 +4,7 @@ export function changeTheme(element: Element, theme: string) {
const list = element!.querySelector('ul.list');
const search = element!.querySelector('.inputSearch');
const path = element.querySelectorAll('.pathWhite');
const nativeSelect = element.querySelector('.nativeSelect');
select!.classList.remove('classicSelect');
list!.classList.remove('classicList');
@ -12,10 +13,11 @@ export function changeTheme(element: Element, theme: string) {
elem.classList.remove('pathWhite');
});
switch (theme) {
switch (theme.toLowerCase()) {
case 'dark':
select!.classList.add('selectDark');
list!.classList.add('listDark');
nativeSelect?.classList.add('listDark');
path.forEach((elem) => {
elem.classList.add('pathWhite');
});
@ -24,6 +26,7 @@ export function changeTheme(element: Element, theme: string) {
select!.classList.add('selectWhite');
caret!.classList.add('caretWhite');
list!.classList.add('listWhite');
nativeSelect?.classList.add('listWhite');
path.forEach((elem) => {
elem.classList.add('pathBlack');
});

BIN
src/images/logoCG2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB