mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-03 06:22:25 +02:00
Update read me + minor tweak
This commit is contained in:
parent
76df544677
commit
57586c0e3d
|
@ -60,6 +60,7 @@ A vanilla, lightweight (~15kb gzipped 🎉), configurable select box/text input
|
||||||
loadingText: 'Loading...',
|
loadingText: 'Loading...',
|
||||||
noResultsText: 'No results round',
|
noResultsText: 'No results round',
|
||||||
noChoicesText: 'No choices to choose from',
|
noChoicesText: 'No choices to choose from',
|
||||||
|
itemSelectText: 'Press to select',
|
||||||
classNames: {
|
classNames: {
|
||||||
containerOuter: 'choices',
|
containerOuter: 'choices',
|
||||||
containerInner: 'choices__inner',
|
containerInner: 'choices__inner',
|
||||||
|
@ -316,6 +317,13 @@ const example = new Choices(element, {
|
||||||
|
|
||||||
**Usage:** The text that is shown when a user has selected all possible choices.
|
**Usage:** The text that is shown when a user has selected all possible choices.
|
||||||
|
|
||||||
|
### itemSelectText
|
||||||
|
**Type:** `String` **Default:** `Press to select`
|
||||||
|
|
||||||
|
**Input types affected:** `select-multiple`, `select-one`
|
||||||
|
|
||||||
|
**Usage:** The text that is shown when a user hovers over a selectable choice.
|
||||||
|
|
||||||
### classNames
|
### classNames
|
||||||
**Type:** `Object` **Default:**
|
**Type:** `Object` **Default:**
|
||||||
|
|
||||||
|
|
|
@ -1703,7 +1703,6 @@ export default class Choices {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_createTemplates() {
|
_createTemplates() {
|
||||||
const config = this.config;
|
|
||||||
const classNames = this.config.classNames;
|
const classNames = this.config.classNames;
|
||||||
const templates = {
|
const templates = {
|
||||||
containerOuter: (direction) => {
|
containerOuter: (direction) => {
|
||||||
|
@ -1767,7 +1766,7 @@ export default class Choices {
|
||||||
choice: (data) => {
|
choice: (data) => {
|
||||||
return strToEl(
|
return strToEl(
|
||||||
`
|
`
|
||||||
<div class="${classNames.item} ${classNames.itemChoice} ${data.disabled ? classNames.itemDisabled : classNames.itemSelectable}" data-select-text="${config.itemSelectText}" data-choice ${data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable'} data-id="${data.id}" data-value="${data.value}" ${data.groupId > 0 ? 'role="treeitem"' : 'role="option"'}>
|
<div class="${classNames.item} ${classNames.itemChoice} ${data.disabled ? classNames.itemDisabled : classNames.itemSelectable}" data-select-text="${this.config.itemSelectText}" data-choice ${data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable'} data-id="${data.id}" data-value="${data.value}" ${data.groupId > 0 ? 'role="treeitem"' : 'role="option"'}>
|
||||||
${data.label}
|
${data.label}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in a new issue