Skip to content

Commit

Permalink
Update options list (fixes #258)
Browse files Browse the repository at this point in the history
  • Loading branch information
VanTanev committed Feb 10, 2019
1 parent 90ca00c commit 08f662a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/angular-chosen.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
'chosen', '$timeout', '$parse', function(config, $timeout, $parse) {
var CHOSEN_OPTION_WHITELIST, NG_OPTIONS_REGEXP, isEmpty, snakeCase;
NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
CHOSEN_OPTION_WHITELIST = ['persistentCreateOption', 'createOptionText', 'createOption', 'skipNoResults', 'noResultsText', 'allowSingleDeselect', 'disableSearchThreshold', 'disableSearch', 'enableSplitWordSearch', 'inheritSelectClasses', 'maxSelectedOptions', 'placeholderTextMultiple', 'placeholderTextSingle', 'searchContains', 'singleBackstrokeDelete', 'displayDisabledOptions', 'displaySelectedOptions', 'width', 'includeGroupLabelInSelected', 'maxShownResults'];
CHOSEN_OPTION_WHITELIST = ['allowSingleDeselect', 'disableSearch', 'disableSearchThreshold', 'enableSplitWordSearch', 'inheritSelectClasses', 'maxSelectedOptions', 'noResultsText', 'placeholderTextMultiple', 'placeholderTextSingle', 'searchContains', 'groupSearch', 'singleBackstrokeDelete', 'width', 'displayDisabledOptions', 'displaySelectedOptions', 'includeGroupLabelInSelected', 'maxShownResults', 'caseSensitiveSearch', 'hideResultsOnSelect', 'rtl'];
snakeCase = function(input) {
return input.replace(/[A-Z]/g, function($1) {
return "_" + ($1.toLowerCase());
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-chosen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 17 additions & 7 deletions src/chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,37 @@ chosenModule.directive 'chosen', ['chosen', '$timeout', '$parse', (config, $time
# coffeelint: enable=max_line_length

# Whitelist of options that will be parsed from the element's attributes and passed into Chosen
#
# Can be updated by running the following script on the options page
# https://harvesthq.github.io/chosen/options.html
#
# Array.from(
# document.querySelectorAll('table:first-of-type tr td:first-of-type')
# )
# .map(node => node.textContent)
# .map(option => option.replace(/_(\w)/g, (_, letter) => letter.toUpperCase()))
#
CHOSEN_OPTION_WHITELIST = [
'persistentCreateOption'
'createOptionText'
'createOption'
'skipNoResults'
'noResultsText'
'allowSingleDeselect'
'disableSearchThreshold'
'disableSearch'
'disableSearchThreshold'
'enableSplitWordSearch'
'inheritSelectClasses'
'maxSelectedOptions'
'noResultsText'
'placeholderTextMultiple'
'placeholderTextSingle'
'searchContains'
'groupSearch'
'singleBackstrokeDelete'
'width'
'displayDisabledOptions'
'displaySelectedOptions'
'width'
'includeGroupLabelInSelected'
'maxShownResults'
'caseSensitiveSearch'
'hideResultsOnSelect'
'rtl'
]

snakeCase = (input) -> input.replace /[A-Z]/g, ($1) -> "_#{$1.toLowerCase()}"
Expand Down

0 comments on commit 08f662a

Please sign in to comment.