diff --git a/docs/classes/cg_select.CGSelect.html b/docs/classes/cg_select.CGSelect.html index 615195d..adfb032 100644 --- a/docs/classes/cg_select.CGSelect.html +++ b/docs/classes/cg_select.CGSelect.html @@ -33,7 +33,8 @@
Generated using TypeDoc
+Creating an Item Selector Button.
-instantiated class CgSelect.
-Optional
content: stringplaceholer passed from select settings.
-Optional
styles: IStyleoptional parameter. The object in which the settings for customizing parts of the select are located.
-Generated using TypeDoc
Creating an Item Selector Button.
instantiated class CgSelect.
+Optional
content:
+ string
+ placeholer passed from select settings.
+Optional
styles:
+ IStyle
+ + optional parameter. The object in which the settings for customizing parts + of the select are located. +
+Generated using TypeDoc
+Finding and styling elements derived from the styles instance CgSelect
-instantiated class CgSelect.
-object in which there are settings for customizing parts of the select.
-Generated using TypeDoc
Finding and styling elements derived from the styles instance CgSelect
+instantiated class CgSelect.
+object in which there are settings for customizing parts of the select.
+Generated using TypeDoc
+Generated using TypeDoc
Generic Method for Styling a Select.
++ an object obtained from the styles object from which we get the styles + key-value. +
+HTMLElement subject to customization.
+Generated using TypeDoc
+Converting each item obtained from the Items field;
+ + + + + +Generated using TypeDoc
returns the formed object
+received element passed when creating the select.
+index of this element.
Generated using TypeDoc
+Insert initial select text (before selection)
+ + + + + +Insert initial select text (before selection)
-returns the generated select element.
-the object in which the title of the select is located.
-select element where title will be inserted.
-Generated using TypeDoc
returns the generated select element.
+the object in which the title of the select is located.
+select element where title will be inserted.
+Generated using TypeDoc
+The behavior of the native (Multiple) select when choosing in a custom one.
-NodeList of native select.
-selected element in custom select.
-a special flag that adds / removes attributes from the native select.
-Generated using TypeDoc
The behavior of the native (Multiple) select when choosing in a custom one.
+NodeList of native select.
selected element in custom select.
+a special flag that adds / removes attributes from the native select.
+Generated using TypeDoc
+The method that creates and is responsible for the behavior of the chips.
+ + + + + +The method that creates and is responsible for the behavior of the chips.
-returns the generated HTMLElement chips item.
-an object that contains settings and select elements.
-the name of the selected element to draw chips.
-index of the selected item to draw chips.
-unique id of the selected element.
-Generated using TypeDoc
returns the generated HTMLElement chips item.
+an object that contains settings and select elements.
+the name of the selected element to draw chips.
+index of the selected item to draw chips.
+unique id of the selected element.
+Generated using TypeDoc
+The method that creates a search for elements in the select.
+ + + + + +The method that creates a search for elements in the select.
-Returns the rendered input element.
-unique value for input element.
-text in specific language passed from language.ts file
-Generated using TypeDoc
Returns the rendered input element.
+unique value for input element.
+text in specific language passed from language.ts file
+Generated using TypeDoc
+The method that creates the native select.
+ + + + + +Generated using TypeDoc
Returns the created native select.
+Generated using TypeDoc
+The method that creates Options for the native select.
+ + + + + +Generated using TypeDoc
Returns the generated Options of the native select.
+Generated using TypeDoc
+This component allows you to create a custom select. It offers more flexible customization and use of select. -Customization, multi-selection and live search by elements are available.
+ ++ This component allows you to create a custom select. It offers more flexible + customization and use of select. Customization, multi-selection and live search by + elements are available. +
- -npm i cg-select
+
+ Installation
+
+ npm i cg-select
-
- Usage
-
+
+ Usage
+
-
- To create a component, you need:
-
-
-- Create a regular button element.
-- Give it the cg-dropdown class.
-
-<button class="cg-dropdown"></button>
+
+ To create a component, you need:
+
+
+ - Create a regular button element.
+ - Give it the cg-dropdown class.
+
+ <button class="cg-dropdown"></button>
-
-- Give it a unique class, e.g. (cg-dropdown_categories).
-
-<button class="cg-dropdown cg-dropdown_categories"></button>
+
+ - Give it a unique class, e.g. (cg-dropdown_categories).
+
+ <button class="cg-dropdown cg-dropdown_categories"></button>
-
-- Create a new instance of the class (new CGSelect)
-- Pass all desired settings as an object
-
+
+ - Create a new instance of the class (new CGSelect)
+ - Pass all desired settings as an object
+
-
- All options for creating and managing are in the documentation, section "CGSelect class constructor".
-
+
+
+ All options for creating and managing are in the documentation, section "CGSelect
+ class constructor".
+
+
-
- An example of creating a regular select.
-
-import CGSelect from 'cg-select';
const dropdown = new CGSelect({
selector: '.cg-dropdown_selector',
placeholder: 'Выберите авто',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 1,
},
'Mersedes',
'MAN',
'Ferari',
],
});
+
+ An example of creating a regular select.
+
+ import CGSelect from 'cg-select';
const dropdown = new CGSelect({
selector: '.cg-dropdown_selector',
placeholder: 'Выберите авто',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 1,
},
'Mersedes',
'MAN',
'Ferari',
],
});
-
- Example of different selects
-
-Same working example -- https://cg-select.itguild.info/
-
-
-
-
-All documentation on CG-SELECT is located in the folder of the same name. The documentation describes all methods and variables, there are also examples of passing settings to select. You can also open it on the page with an example, or follow the link below.
-To view it, follow the link - https://cg-select.itguild.info/up_/documentation/index.html
+
+ Example of different selects
+
+
+ Same working example --
+ https://cg-select.itguild.info/
+
+
+
+
+
+
+
+
+ All documentation on CG-SELECT is located in the folder of the same name. The
+ documentation describes all methods and variables, there are also examples of passing
+ settings to select. You can also open it on the page with an example, or follow the link
+ below.
+
-
- Contributing
-
-
-- Fork it!
-- Create your feature branch:
git checkout -b my-new-feature
-- Commit your changes:
git commit -am 'Add some feature'
-- Push to the branch:
git push origin my-new-feature
-- Submit a pull request :D
-
+
+ Contributing
+
+
+ - Fork it!
+ - Create your feature branch:
git checkout -b my-new-feature
+ - Commit your changes:
git commit -am 'Add some feature'
+ - Push to the branch:
git push origin my-new-feature
+ - Submit a pull request :D
+
-
- Compatibility
-
-
-
-
-Application Compatibility
-JS
-React
-Angular
-Vue
-
-
-
-CG-SELECT
-
-

-
-
-
-
-Comment
-Tested in Js applications and it worksуспешно.
-Works only with a crutch in the form setTimeout()
-not yet available
-not yet available
-
-
+
+ Compatibility
+
+
+
+
+ Application Compatibility
+ JS
+ React
+ Angular
+ Vue
+
+
+
+
+ CG-SELECT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Comment
+ Tested in Js applications and it worksуспешно.
+
+ Works only with a crutch in the form setTimeout()
+
+ not yet available
+ not yet available
+
+
+
-
- History
-
-16.12.2022 - release version 0.1.0!
-20.01.2023 - upgrade to version 0.2.1
-
Generated using TypeDoc
16.12.2022 - release version 0.1.0!
+20.01.2023 - upgrade to version 0.2.1
+Generated using TypeDoc
+cSettings for creating chips.
-A specific instance of a class.
-Array of indexes of selected elements.
-Select settings.
-Array with selected elements.
-Generated using TypeDoc
cSettings for creating chips.
+A specific instance of a class.
Array of indexes of selected elements.
+Select settings.
Array with selected elements.
Generated using TypeDoc
+Receive Item Settings.
-The value of the passed element.
-Optional
categoryOptional parameter. Item group category.
-Optional
categoryOptional parameter. Array with elements.
-Generated using TypeDoc
Receive Item Settings.
+The value of the passed element.
Optional
category
+ Optional parameter. Item group category.
+Optional
categoryOptional parameter. Array with elements.
+Generated using TypeDoc
+Settings for select text, etc.
-Optional
indexesArray of indexes of selected elements.
-Optional
multiselectAn optional parameter that is responsible for the behavior of the select, -for him, *** works only in a place with a multiselect connection.
-Optional
placeholderPlaceholder optional parameter to which the text of the select placeholder is passed.
-Optional
selectedAn optional parameter, which is passed the element that will be selected initially in the select.
-Optional
selectedArray of selected items from the list.
-Optional
themeAn optional parameter that is responsible for enabling a light/dark theme by default, the dark theme is set.
-Generated using TypeDoc
Settings for select text, etc.
+Optional
indexes
+ Array of indexes of selected elements.
+Optional
+ multiselect+ An optional parameter that is responsible for the behavior of the select, for him, + *** works only in a place with a multiselect connection. +
+Optional
placeholder
+ + Placeholder optional parameter to which the text of the select placeholder is + passed. +
+Optional
selected
+ + An optional parameter, which is passed the element that will be selected initially + in the select. +
+Optional
selectedArray of selected items from the list.
+Optional
theme
+ + An optional parameter that is responsible for enabling a light/dark theme by + default, the dark theme is set. +
+Generated using TypeDoc
+Generated using TypeDoc
Element structure.
+Unique item ID.
Element text value.
Sequence number, or other information.
+Generated using TypeDoc
+Settings for adding languages.
-Search text.
-Default Select Text if no placeholder or selected element is specified.
-Text if no match.
-Generated using TypeDoc
Settings for adding languages.
+Search text.
Default Select Text if no placeholder or selected element is specified.
+Text if no match.
Generated using TypeDoc
+Utils module
-Generated using TypeDoc
Utils module
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Generated using TypeDoc
Generated using TypeDoc
+Const
Generated using TypeDoc
Const
Generated using TypeDoc
+- This class implements the functionality of a custom select, with customization - capabilities. -
- -Ovsyanikov Maxim
-The constructor takes an object and renders the select.
- -options = {
selector: 'Unique selector',
selected: 'Selected item',
placeholder: '...',
lable: '...'
items: [string|number|object],
theme: string,
searchMode: true/false,
closeOnSelect: true/false,
nativeSelectMode: true/false,
listDisplayMode: true/false,
language: 'ru/en',
styles: {
head: {
background: '...',
},
list: {...},
chips: {...},
caret: {...},
placeholder: {...},
lable: {..},
},
event: '...',
url: 'http/...',
multiselect: true/false,
multiselectTag: true/false,
}
-
- Object accepting select settings.
-Private
- Optional
btnButton, to control the select.
Private
caret
- Variable for carriage control.
Private
- Optional
category
- Transferred categories.
Optional
- close- An optional parameter that is responsible for the behavior of the select when - opening, if closeOnSelect: false, then when an element is selected in the selector, - closing does not occur, and you can select another element by default, - closeOnSelect:true. -
-Optional
theme
- - An optional parameter responsible for switching between different themes, the - classic theme is set by default. -
-Private
element
- Created HTML element.
Optional
event
- - An optional parameter that is responsible for the behavior of the select, passing to - this parameter an event of the 'mouseenter' type, select will open on hover. -
-Private
indexes
- Array of indexes of selected elements.
-Optional
items
- - *Required parameter (if no other way to get data (url) is specified), this is an - array of elements, which will be displayed in the select when selected. -
-Optional
lable
- An optional parameter that adds a lable before the select.
-Optional
language
- Optional parameter responsible for the localization of some text elements.
-Private
list
- Created list(ul), with class list.
Optional
- list- An optional parameter that is responsible for the behavior of the select when - opening. -
-Optional
multiselect
- - An optional parameter, which is responsible for the behavior of the select, adds the - ability to select multiple elements. Selected elements are rendered as plain text, - separated by commas. -
-Optional
- multiselect- An optional parameter that is responsible for the behavior of the select, for him, - *** works only in a place with a multiselect connection. -
-Optional
- native- An optional parameter that is responsible for the behavior of the select when opened - on mobile devices. -
-Private
options
- Select settings passed when creating an instance of the class.
-Optional
placeholder
- - Placeholder optional parameter to which the text of the select placeholder is - passed. -
-Private
randomUnique Id for elements.
Optional
searchAn optional parameter that adds a live search on the select elements.
-Optional
selected
- - An optional parameter, which is passed the element that will be selected initially - in the select. -
-Private
selectedSelected or an array of selected items from a list.
-Optional
selector
- - Unique selector - *mandatory parameter (indicator) that is set when creating a - select. -
-Optional
styles
- - An optional parameter that is responsible for customizing the select elements, - objects with CSS properties for customizable elements are passed to it. -
-Optional
url
- - Required parameter (if no other way to get data (items) is specified), data that - comes from the backend in the format { id: "", title: "", value: - ""}. -
-Returns the indices of the selected element(s) as an array / empty array.
- -A getter that returns the indexes of the selected element(s) of the select.
-Returns the selected element(s) as an array / element / null.
- -Getter returning the selected element(s) of the select.
-- adds the given element to the end of the list and redraws the list. Cannot be - used when passing elements with categories. -
- -addItem
-added element.
- a method that allows you to change the placeholder in the search and the text - that is displayed if there is no result. -
- -addLanguage
-- the object in which the fields for connecting the language are located has - two mandatory fields placeholder, textInListSearch, selectPlaceholder. -
-Private
- addPrivate
checkPrivate
close
- Private
- close- removes the element by index from the list and redraws it. Cannot be used when - passing elements with categories. -
- -deleteItem
-the index of the element to be removed.
-Private
displayPrivate
- Changes the display of a sheet with a selection as a modal window.
- -displayMode
-- parameter responsible for displaying the selection in the form of a modal - window. -
-Private
init
- Private
- Private method for initializing an instance of the ICgSelect class.
- -init
- -- Private method. General initialization of the select. Obtaining tinctures and - converting select elements. -
- -{
selector: '.cg-dropdown_one',
placeholder: 'Choose a car',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 1,
},
'Mersedes',
'MAN',
'max',
],
theme: true,
multiselect: true,
multiselectTag: true,
}
-
- passed select settings.
Private
initPrivate
initPrivate
open
- Private
render
- Private
renderPrivate
- searchPrivate
selectGenerated using TypeDoc
-Generated using TypeDoc
Creating a clear select button, with a single selection.
-place in the select that will be reassigned to ''.
-class instance CgSelect.
-the text that is rendered in the select.
-Generated using TypeDoc
Creating an Item Selector Button.
-instantiated class CgSelect.
-Optional
content: stringplaceholer passed from select settings.
-Optional
styles: IStyleoptional parameter. The object in which the settings for customizing parts of the select are located.
-Generated using TypeDoc
Finding and styling elements derived from the styles instance CgSelect
-instantiated class CgSelect.
-object in which there are settings for customizing parts of the select.
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Insert initial select text (before selection)
- -returns the generated select element.
-the object in which the title of the select is located.
-select element where title will be inserted.
-Generated using TypeDoc
The behavior of the native (Multiple) select when choosing in a custom one.
-NodeList of native select.
-selected element in custom select.
-a special flag that adds / removes attributes from the native select.
-Generated using TypeDoc
Behavior of a native (single) select when choosing a custom one.
-NodeList native select.
-selected element in custom select.
-Generated using TypeDoc
The method that creates and is responsible for the behavior of the chips.
- -returns the generated HTMLElement chips item.
-an object that contains settings and select elements.
-the name of the selected element to draw chips.
-index of the selected item to draw chips.
-unique id of the selected element.
-Generated using TypeDoc
The method that creates a search for elements in the select.
- -Returns the rendered input element.
-unique value for input element.
-text in specific language passed from language.ts file
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
- This component allows you to create a custom select. It offers more flexible - customization and use of select. Customization, multi-selection and live search by - elements are available. -
- - -npm i cg-select
-
-
-
- <button class="cg-dropdown"></button>
-
- <button class="cg-dropdown cg-dropdown_categories"></button>
-
- import CGSelect from 'cg-select';
const dropdown = new CGSelect({
selector: '.cg-dropdown_selector',
placeholder: 'Выберите авто',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 1,
},
'Mersedes',
'MAN',
'Ferari',
],
});
-
-
-
- - Same working example -- - https://cg-select.itguild.info/ -
-
-
-
-
-
-
- All documentation on CG-SELECT is located in the folder of the same name. The - documentation describes all methods and variables, there are also examples of passing - settings to select. You can also open it on the page with an example, or follow the link - below. -
- - -git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Application Compatibility | -JS | -React | -Angular | -Vue | -
---|---|---|---|---|
CG-SELECT | -
- ![]() |
-
- ![]() ![]() |
-
- ![]() |
-
- ![]() |
-
Comment | -Tested in Js applications and it worksуспешно. | -
- Works only with a crutch in the form setTimeout()
- |
- not yet available | -not yet available | -
- 16.12.2022 - release version 0.1.0!
- 20.01.2023 - upgrade to version 0.2.1
-
Generated using TypeDoc
-cSettings for creating chips.
-A specific instance of a class.
-Array of indexes of selected elements.
-Select settings.
-Array with selected elements.
-Generated using TypeDoc
Receive Item Settings.
-The value of the passed element.
-Optional
categoryOptional parameter. Item group category.
-Optional
categoryOptional parameter. Array with elements.
-Generated using TypeDoc
Settings for select text, etc.
-Optional
theme
- - An optional parameter that is responsible for enabling a light/dark theme by - default, the dark theme is set. -
-Optional
indexes
- Array of indexes of selected elements.
-Optional
- multiselect- An optional parameter that is responsible for the behavior of the select, for him, - *** works only in a place with a multiselect connection. -
-Optional
placeholder
- - Placeholder optional parameter to which the text of the select placeholder is - passed. -
-Optional
selected
- - An optional parameter, which is passed the element that will be selected initially - in the select. -
-Optional
selectedArray of selected items from the list.
-Generated using TypeDoc
-Select settings.
-Optional
- close- An optional parameter that is responsible for the behavior of the select when - opening, if closeOnSelect: false, then when an element is selected in the selector, - closing does not occur, and you can select another element by default, - closeOnSelect:true. -
-Optional
theme
- - An optional parameter responsible for switching between different themes, the - classic theme is set by default. -
-Optional
event
- - An optional parameter that is responsible for the behavior of the select, passing to - this parameter an event of the 'mouseenter' type, select will open on hover. -
-Optional
items
- - *Required parameter (if no other way to get data (url) is specified), this is an - array of elements, which will be displayed in the select when selected. -
-Optional
lable
- An optional parameter that adds a lable before the select.
-Optional
language
- Optional parameter responsible for the localization of some text elements.
-Optional
- list- An optional parameter that is responsible for the behavior of the select when - opening. -
-Optional
multiselect
- - An optional parameter, which is responsible for the behavior of the select, adds the - ability to select multiple elements. Selected elements are rendered as plain text, - separated by commas. -
-Optional
- multiselect- An optional parameter that is responsible for the behavior of the select, for him, - *** works only in a place with a multiselect connection. -
-Optional
- native- An optional parameter that is responsible for the behavior of the select when opened - on mobile devices. -
-Optional
placeholder
- - Placeholder optional parameter to which the text of the select placeholder is - passed. -
-Optional
searchAn optional parameter that adds a live search on the select elements.
-Optional
selected
- - An optional parameter, which is passed the element that will be selected initially - in the select. -
-Optional
selector
- - Unique selector - *mandatory parameter (indicator) that is set when creating a - select. -
-Optional
styles
- - An optional parameter that is responsible for customizing the select elements, - objects with CSS properties for customizable elements are passed to it. -
-Optional
url
- - Required parameter (if no other way to get data (items) is specified), data that - comes from the backend in the format { id: "", title: "", value: - ""}. -
-Generated using TypeDoc
-Style Settings.
-Optional
caretCarriage customization.
-Optional
chipsChips customization with selected elements.
-Optional
headSelect button customization.
-Optional
lableLable select customization.
-Optional
listSheet customization with a selection of elements.
-Optional
placeholderCustomization placeholder.
-Optional
searchSearch customization.
-Generated using TypeDoc
Generated using TypeDoc
Settings for adding languages.
-Search text.
-Default Select Text if no placeholder or selected element is specified.
-Text if no match.
-Generated using TypeDoc
Generated using TypeDoc
Utils module
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Const
Generated using TypeDoc
Const
Generated using TypeDoc
Checking if item contains the specified properties.
+ + + + + ++- Preparing search index...
+ - The search index is not available
+
+ Home + Go to CGSelect ++- cg-select
+ - Utils
+ - checkItemStruct
+
+Function checkItemStruct
++-
+ check
Item Struct(item: object): boolean
+
+ -
+
+
-
-
-
Checking if item contains the specified properties.
-Returns
returns true/false if item contains the specified properties.
-Parameters
---
-
item: object
-element to be checked against a certain structure.
-Returns boolean
-
-Settings
Member Visibility
Theme
Generated using TypeDoc
Returns
+returns true/false if item contains the specified properties.
+