66    < link  rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css "> 
77    < script  src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js "> </ script > 
88    < script  src ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js "> </ script > 
9-     < script  src ="https://rawgit.com/jshjohnson/Choices/v4.1.3 /public/assets/scripts/choices.js "> </ script > 
9+     < script  src ="https://rawgit.com/jshjohnson/Choices/v7.0.0 /public/assets/scripts/choices.js "> </ script > 
1010    < script  src ="dist/choicesjsstencil.js "> </ script > 
1111    < style > 
1212      html  {
@@ -335,18 +335,17 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
335335              </ span > 
336336              < input  type ="text " class ="form-control " name ="searchFields " value ="["label", "value"] "> 
337337            </ div > 
338-             < div  class ="form-group type type--text  "> 
339-               < label  for ="regexFilter "> 
340-                 Regex Filter 
338+             < div  class ="form-group "> 
339+               < label  for ="addItemFilterFn "> 
340+                 addItemFilterFn(value) { 
341341              </ label > 
342-               < span  class ="description " data-toggle ="tooltip " title ="A filter  that will need to pass for a user to successfully add an item.> 
342+               < span  class ="description " data-toggle ="tooltip " title ="The function  that will need to pass for a user to successfully add an item.> 
343343                < span  class ="glyphicon glyphicon glyphicon-question-sign "> </ span > 
344344              </ span > 
345-               < div  class ="input-group "> 
346-                 < span  class ="input-group-addon "> /</ span > 
347-                 < input  type ="text " class ="form-control " name ="regexFilter "> 
348-                 < span  class ="input-group-addon "> /</ span > 
349-               </ div > 
345+               < textarea  class ="form-control textarea--vertical " name ="addItemFilterFn " rows ="2 "> 
346+ return /^[^\s]+$/.test(value);
347+               </ textarea > 
348+               < label  for ="addItemFilterFn "> }</ label > 
350349            </ div > 
351350            < div  class ="form-group type type--single type--multiple "> 
352351              < label  for ="position "> 
@@ -483,7 +482,9 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
483482              < span  class ="description " data-toggle ="tooltip " title ="Function to run once Choices initialises. "> 
484483                < span  class ="glyphicon glyphicon glyphicon-question-sign "> </ span > 
485484              </ span > 
486-               < textarea  class ="form-control textarea--vertical " name ="callbackOnInit " rows ="2 "> </ textarea > 
485+               < textarea  class ="form-control textarea--vertical " name ="callbackOnInit " rows ="2 "> 
486+ console.info('ChoicesJS Stencil Web Component ready!');
487+               </ textarea > 
487488              < label  for ="callbackOnInit "> }</ label > 
488489            </ div > 
489490            < div  class ="form-group "> 
@@ -493,10 +494,12 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
493494              < span  class ="description " data-toggle ="tooltip " title ="Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined in the reference link below. "> 
494495                < span  class ="glyphicon glyphicon glyphicon-question-sign "> </ span > 
495496              </ span > 
496-               < textarea  class ="form-control textarea--vertical " name ="callbackOnCreateTemplates " rows ="2 "> </ textarea > 
497+               < textarea  class ="form-control textarea--vertical " name ="callbackOnCreateTemplates " rows ="2 "> 
498+ return template;
499+               </ textarea > 
497500              < label  for ="callbackOnCreateTemplates "> }</ label > 
498501              < br /> 
499-               < a  href ="https://github.com/jshjohnson/Choices/blob/67f29c286aa21d88847adfcd6304dc7d068dc01f/ assets/scripts/src/ choices.js#L1993-L2067  "> 
502+               < a  href ="https://github.com/jshjohnson/Choices/blob/v7.0.0/public/ assets/scripts/choices.js#L713-L788  "  target =" _blank "> 
500503                Templates reference
501504              </ a > 
502505            </ div > 
@@ -520,7 +523,11 @@ <h2 class="col-sm-12">ChoicesJS Web Component: test page</h2>
520523      < div  class ="container "> 
521524        < div  class ="row "> 
522525          < div  class ="col-md-12 "> 
523-             < p  class ="text-center pad-top "> See full documentation in < a  href ="https://www.npmjs.com/package/choices.js "> choices.js</ a >  npm package.</ p > 
526+             < p  class ="text-center pad-top "> 
527+               See full documentation in
528+               < a  href ="https://www.npmjs.com/package/choices.js/v/7.0.0 " target ="_blank "> choices.js</ a > 
529+               npm package.
530+             </ p > 
524531          </ div > 
525532        </ div > 
526533      </ div > 
@@ -603,7 +610,9 @@ <h4 class="modal-title">Custom Styles</h4>
603610              < h4  class ="modal-title "> Search options</ h4 > 
604611          </ div > 
605612          < div  class ="modal-body "> 
606-             < h5  class ="text-center pad-bottom "> See full Fuse documentation in < a  href ="https://github.com/krisk/Fuse/tree/v2.7.4#options "> GitHub</ a > .</ h5 > 
613+             < h5  class ="text-center pad-bottom "> 
614+               See full Fuse documentation in < a  href ="https://fusejs.io/ " target ="_blank "> GitHub</ a > .
615+             </ h5 > 
607616            < form  name ="custom-search-form "> 
608617              < div  class ="form-group "> 
609618                < div  class ="row "> 
@@ -789,7 +798,9 @@ <h5 class="text-center pad-bottom">See full Fuse documentation in <a href="https
789798            choices : jsonParser , 
790799            items : jsonParser , 
791800            searchFields : jsonParser , 
792-             regexFilter : regexParser ( ) , 
801+             addItemFilterFn : function ( value )  { 
802+               return  new  Function ( 'value' ,  value . trim ( ) ) ; 
803+             } , 
793804            renderChoiceLimit : Number , 
794805            maxItemCount : Number , 
795806            searchFloor : Number , 
0 commit comments