Skip to content

Commit

Permalink
Adding sifter's respect-word-boundary option. initial default is true
Browse files Browse the repository at this point in the history
  • Loading branch information
risadams committed Nov 9, 2022
1 parent b98e6d6 commit ca965de
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 75 deletions.
149 changes: 75 additions & 74 deletions src/defaults.js
Original file line number Diff line number Diff line change
@@ -1,93 +1,94 @@
Selectize.count = 0;
Selectize.defaults = {
options: [],
optgroups: [],
options: [],
optgroups: [],

plugins: [],
delimiter: ',',
splitOn: null, // regexp or string for splitting up values from a paste command
persist: true,
diacritics: true,
create: false,
showAddOptionOnCreate: true,
createOnBlur: false,
createFilter: null,
highlight: true,
openOnFocus: true,
maxOptions: 1000,
maxItems: null,
hideSelected: null,
addPrecedence: false,
selectOnTab: true,
preload: false,
allowEmptyOption: false,
showEmptyOptionInDropdown: false,
emptyOptionLabel: '--',
plugins: [],
delimiter: ',',
splitOn: null, // regexp or string for splitting up values from a paste command
persist: true,
diacritics: true,
create: false,
showAddOptionOnCreate: true,
createOnBlur: false,
createFilter: null,
highlight: true,
openOnFocus: true,
maxOptions: 1000,
maxItems: null,
hideSelected: null,
addPrecedence: false,
selectOnTab: true,
preload: false,
allowEmptyOption: false,
showEmptyOptionInDropdown: false,
emptyOptionLabel: '--',
setFirstOptionActive: false,
closeAfterSelect: false,
closeAfterSelect: false,
closeDropdownThreshold: 250, // number of ms to prevent reopening of dropdown after mousedown

scrollDuration: 60,
deselectBehavior: 'previous', //top, previous
loadThrottle: 300,
loadingClass: 'loading',
scrollDuration: 60,
deselectBehavior: 'previous', //top, previous
loadThrottle: 300,
loadingClass: 'loading',

dataAttr: 'data-data',
optgroupField: 'optgroup',
valueField: 'value',
labelField: 'text',
disabledField: 'disabled',
optgroupLabelField: 'label',
optgroupValueField: 'value',
lockOptgroupOrder: false,
dataAttr: 'data-data',
optgroupField: 'optgroup',
valueField: 'value',
labelField: 'text',
disabledField: 'disabled',
optgroupLabelField: 'label',
optgroupValueField: 'value',
lockOptgroupOrder: false,

sortField: '$order',
searchField: ['text'],
searchConjunction: 'and',
sortField: '$order',
searchField: ['text'],
searchConjunction: 'and',
respect_word_boundaries: true,

mode: null,
wrapperClass: '',
inputClass: '',
dropdownClass: '',
dropdownContentClass: '',
mode: null,
wrapperClass: '',
inputClass: '',
dropdownClass: '',
dropdownContentClass: '',

dropdownParent: null,
dropdownParent: null,

copyClassesToDropdown: true,
copyClassesToDropdown: true,
dropdownSize: {
sizeType: 'auto', // 'numberItems' or 'fixedHeight'
sizeValue: 'auto', // number of items or height value (px is default) or CSS height (px, rem, em, vh)
},
normalize: false,
ignoreOnDropwdownHeight: 'img, i',
/*
load : null, // function(query, callback) { ... }
score : null, // function(search) { ... }
formatValueToKey : null, // function(key) { ... }
onInitialize : null, // function() { ... }
onChange : null, // function(value) { ... }
onItemAdd : null, // function(value, $item) { ... }
onItemRemove : null, // function(value, $item) { ... }
onClear : null, // function() { ... }
onOptionAdd : null, // function(value, data) { ... }
onOptionRemove : null, // function(value) { ... }
onOptionClear : null, // function() { ... }
onOptionGroupAdd : null, // function(id, data) { ... }
onOptionGroupRemove : null, // function(id) { ... }
onOptionGroupClear : null, // function() { ... }
onDropdownOpen : null, // function($dropdown) { ... }
onDropdownClose : null, // function($dropdown) { ... }
onType : null, // function(str) { ... }
onDelete : null, // function(values) { ... }
*/
/*
load : null, // function(query, callback) { ... }
score : null, // function(search) { ... }
formatValueToKey : null, // function(key) { ... }
onInitialize : null, // function() { ... }
onChange : null, // function(value) { ... }
onItemAdd : null, // function(value, $item) { ... }
onItemRemove : null, // function(value, $item) { ... }
onClear : null, // function() { ... }
onOptionAdd : null, // function(value, data) { ... }
onOptionRemove : null, // function(value) { ... }
onOptionClear : null, // function() { ... }
onOptionGroupAdd : null, // function(id, data) { ... }
onOptionGroupRemove : null, // function(id) { ... }
onOptionGroupClear : null, // function() { ... }
onDropdownOpen : null, // function($dropdown) { ... }
onDropdownClose : null, // function($dropdown) { ... }
onType : null, // function(str) { ... }
onDelete : null, // function(values) { ... }
*/

render: {
/*
item: null,
optgroup: null,
optgroup_header: null,
option: null,
option_create: null
*/
}
render: {
/*
item: null,
optgroup: null,
optgroup_header: null,
option: null,
option_create: null
*/
}
};
3 changes: 2 additions & 1 deletion src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,8 @@ $.extend(Selectize.prototype, {
conjunction : settings.searchConjunction,
sort : sort,
nesting : settings.nesting,
filter : settings.filter
filter : settings.filter,
respect_word_boundaries : settings.respect_word_boundaries
};
},

Expand Down

0 comments on commit ca965de

Please sign in to comment.