├── .gitignore ├── LICENSE.md ├── README.md ├── bower.json ├── dist ├── css │ ├── bootstrap-multiselect.css │ └── bootstrap-multiselect.min.css ├── js │ ├── bootstrap-multiselect.js │ └── bootstrap-multiselect.min.js └── less │ └── bootstrap-multiselect.less ├── docs ├── css │ ├── bootstrap-4.5.2.min.css │ ├── bootstrap-example.min.css │ ├── fontawesome-5.15.1-web │ │ ├── all.css │ │ └── all.min.css │ └── prettify.min.css ├── fonts │ ├── fontawesome-5.15.1-web │ │ ├── fa-brands-400.eot │ │ ├── fa-brands-400.svg │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.eot │ │ ├── fa-regular-400.svg │ │ ├── fa-regular-400.ttf │ │ ├── fa-regular-400.woff │ │ ├── fa-regular-400.woff2 │ │ ├── fa-solid-900.eot │ │ ├── fa-solid-900.svg │ │ ├── fa-solid-900.ttf │ │ ├── fa-solid-900.woff │ │ └── fa-solid-900.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── js │ ├── bootstrap.bundle-4.5.2.min.js │ ├── jquery-2.2.4.min.js │ ├── knockout-3.4.0.debug.js │ ├── prettify.min.js │ └── require-2.3.5.min.js └── less │ └── bootstrap-example.less ├── example.png ├── index.html ├── package.json ├── post.php ├── require.html ├── tests ├── SpecRunner.html ├── karma.conf.js ├── lib │ ├── MIT.LICENSE │ └── jasmine-2.4.1 │ │ ├── boot.js │ │ ├── console.js │ │ ├── jasmine-html.js │ │ ├── jasmine.css │ │ ├── jasmine.js │ │ └── jasmine_favicon.png └── spec │ └── bootstrap-multiselect.js └── types └── bootstrap-multiselect └── index.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | # Project files. 2 | *.project 3 | .idea/ 4 | *.iml 5 | nbproject/ 6 | node_modules/ 7 | .vscode -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License, Version 2.0: 2 | 3 | Copyright (c) 2012 - 2022 David Stutz 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 6 | this file except in compliance with the License. You may obtain a copy of the 7 | License at http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | 14 | BSD 3-Clause License: 15 | 16 | Copyright (c) 2012 - 2022 David Stutz 17 | All rights reserved. 18 | 19 | Redistribution and use in source and binary forms, with or without modification, 20 | are permitted provided that the following conditions are met: 21 | * Redistributions of source code must retain the above copyright notice, 22 | this list of conditions and the following disclaimer. 23 | * Redistributions in binary form must reproduce the above copyright notice, 24 | this list of conditions and the following disclaimer in the documentation and/or 25 | other materials provided with the distribution. 26 | * Neither the name of David Stutz nor the names of its contributors may be used 27 | to endorse or promote products derived from this software without specific prior 28 | written permission. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 31 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 32 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 33 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 34 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 37 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 38 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 39 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bootstrap Multiselect 2 | 3 | Bootstrap Multiselect is a JQuery based plugin to provide an intuitive user interface for using select inputs with the multiple attribute present. Instead of a select a bootstrap button will be shown w dropdown menu containing the single options as checkboxes. 4 | 5 | Documentation, Examples, FAQ and License: [https://davidstutz.github.io/bootstrap-multiselect/](https://davidstutz.github.io/bootstrap-multiselect/). 6 | 7 | **If you are interested in actively maintaining this project, please contact me (see GitHub profile for contact information).** 8 | 9 | Bootstrap Multiselect is featured in an article on [tutorialzine](https://tutorialzine.com/): [50 must-Have Plugins for Extending Twitter Bootstrap](https://tutorialzine.com/2013/07/50-must-have-plugins-for-extending-twitter-bootstrap/); on [Bootsnipp](https://bootsnipp.com/)'s [list of Twitter Bootstrap resources](https://bootsnipp.com/resources); on [Design Your Way](https://www.designyourway.net/blog/resources/jquery-bootstrap-plugins/); and available on [NuGet](https://www.nuget.org/packages/Bootstrap.Multiselect). 10 | 11 | **If you use this plugin commercially, consider supporting the development by [making a donation](https://davidstutz.de/donate/).** 12 | 13 | Also check out [Bootstrap Strength Meter](https://github.com/davidstutz/bootstrap-strength-meter) - a Twitter Bootstrap plugin to visualize password strength using [Password Score](https://github.com/davidstutz/password-score). 14 | 15 | ![Example of a multiselect.](example.png?raw=true "Example of a multiselect.") 16 | 17 | ## License 18 | 19 | **Apache License, Version 2.0** 20 | 21 | Copyright (c) 2012 - 2022 [David Stutz](https://davidstutz.de/) 22 | 23 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 24 | 25 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 26 | 27 | **BSD 3-Clause License** 28 | 29 | Copyright (c) 2012 - 2022 [David Stutz](https://davidstutz.de/) 30 | All rights reserved. 31 | 32 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 33 | 34 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 35 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 36 | * Neither the name of David Stutz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 37 | 38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-multiselect", 3 | "description": "Twitter Bootstrap plugin to make selects user friendly.", 4 | "homepage": "http://davidstutz.github.io/bootstrap-multiselect/", 5 | "version": "1.1.1", 6 | "authors": [ 7 | "David Stutz" 8 | ], 9 | "license": "Apache License, Version 2.0 OR BSD 3-Clause License", 10 | "keywords": [ 11 | "js", 12 | "css", 13 | "less", 14 | "bootstrap", 15 | "jquery", 16 | "multiselect" 17 | ], 18 | "main": [ 19 | "./dist/js/bootstrap-multiselect.js", 20 | "./dist/js/bootstrap-multiselect.min.js", 21 | "./dist/css/bootstrap-multiselect.css", 22 | "./dist/css/bootstrap-multiselect.min.css", 23 | "./dist/less/bootstrap-multiselect.less", 24 | "LICENSE.md", 25 | "READMEREADME.md" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 2.2.4", 29 | "bootstrap": "~4.5.x" 30 | }, 31 | "ignore": [ 32 | "docs/.*", 33 | "tests/.*", 34 | "*.html", 35 | "*.git*", 36 | "*.md", 37 | "*.png", 38 | "*.php" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /dist/css/bootstrap-multiselect.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/) 3 | * 4 | * Apache License, Version 2.0: 5 | * Copyright (c) 2012 - 2022 David Stutz 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | * use this file except in compliance with the License. You may obtain a 9 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | * 17 | * BSD 3-Clause License: 18 | * Copyright (c) 2012 - 2022 David Stutz 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * - Redistributions of source code must retain the above copyright notice, 24 | * this list of conditions and the following disclaimer. 25 | * - Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * - Neither the name of David Stutz nor the names of its contributors may be 29 | * used to endorse or promote products derived from this software without 30 | * specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 34 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 35 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 36 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 39 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 41 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 42 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | */ 44 | span.multiselect-native-select { 45 | position: relative; 46 | } 47 | span.multiselect-native-select select { 48 | border: 0 !important; 49 | clip: rect(0 0 0 0) !important; 50 | height: 1px !important; 51 | margin: -1px -1px -1px -3px !important; 52 | overflow: hidden !important; 53 | padding: 0 !important; 54 | position: absolute !important; 55 | width: 1px !important; 56 | left: 50%; 57 | top: 30px; 58 | } 59 | .multiselect.dropdown-toggle:after { 60 | display: none; 61 | } 62 | .multiselect { 63 | overflow: hidden; 64 | text-overflow: ellipsis; 65 | } 66 | .multiselect-container { 67 | position: absolute; 68 | list-style-type: none; 69 | margin: 0; 70 | padding: 0; 71 | } 72 | .multiselect-container .multiselect-reset .input-group { 73 | width: 93%; 74 | } 75 | .multiselect-container .multiselect-filter > .fa-search { 76 | z-index: 1; 77 | padding-left: 0.75rem; 78 | } 79 | .multiselect-container .multiselect-filter > input.multiselect-search { 80 | border: none; 81 | border-bottom: 1px solid lightgrey; 82 | padding-left: 2rem; 83 | margin-left: -1.625rem; 84 | border-bottom-right-radius: 0; 85 | border-bottom-left-radius: 0; 86 | } 87 | .multiselect-container .multiselect-filter > input.multiselect-search:focus { 88 | border-bottom-right-radius: 0.25rem; 89 | border-bottom-left-radius: 0.25rem; 90 | } 91 | .multiselect-container .multiselect-filter > .multiselect-moz-clear-filter { 92 | margin-left: -1.5rem; 93 | display: none; 94 | } 95 | .multiselect-container .multiselect-option.multiselect-group-option-indented-full { 96 | padding-left: 2.6rem; 97 | } 98 | .multiselect-container .multiselect-option.multiselect-group-option-indented { 99 | padding-left: 1.8rem; 100 | } 101 | .multiselect-container .multiselect-group { 102 | cursor: pointer; 103 | } 104 | .multiselect-container .multiselect-group.closed .dropdown-toggle::after { 105 | transform: rotate(-90deg); 106 | } 107 | .multiselect-container .multiselect-group .caret-container ~ .form-check { 108 | margin-left: 0.5rem; 109 | } 110 | .multiselect-container .multiselect-option, 111 | .multiselect-container .multiselect-group, 112 | .multiselect-container .multiselect-all { 113 | padding: 0.25rem 0.25rem 0.25rem 0.75rem; 114 | } 115 | .multiselect-container .multiselect-option.dropdown-item, 116 | .multiselect-container .multiselect-group.dropdown-item, 117 | .multiselect-container .multiselect-all.dropdown-item, 118 | .multiselect-container .multiselect-option.dropdown-toggle, 119 | .multiselect-container .multiselect-group.dropdown-toggle, 120 | .multiselect-container .multiselect-all.dropdown-toggle { 121 | cursor: pointer; 122 | } 123 | .multiselect-container .multiselect-option .form-check-label, 124 | .multiselect-container .multiselect-group .form-check-label, 125 | .multiselect-container .multiselect-all .form-check-label { 126 | cursor: pointer; 127 | } 128 | .multiselect-container .multiselect-option.active:not(.multiselect-active-item-fallback), 129 | .multiselect-container .multiselect-group.active:not(.multiselect-active-item-fallback), 130 | .multiselect-container .multiselect-all.active:not(.multiselect-active-item-fallback), 131 | .multiselect-container .multiselect-option:not(.multiselect-active-item-fallback):active, 132 | .multiselect-container .multiselect-group:not(.multiselect-active-item-fallback):active, 133 | .multiselect-container .multiselect-all:not(.multiselect-active-item-fallback):active { 134 | background-color: lightgrey; 135 | color: black; 136 | } 137 | .multiselect-container .multiselect-option:hover, 138 | .multiselect-container .multiselect-group:hover, 139 | .multiselect-container .multiselect-all:hover, 140 | .multiselect-container .multiselect-option:focus, 141 | .multiselect-container .multiselect-group:focus, 142 | .multiselect-container .multiselect-all:focus { 143 | background-color: darkgray !important; 144 | } 145 | .multiselect-container .multiselect-option .form-check, 146 | .multiselect-container .multiselect-group .form-check, 147 | .multiselect-container .multiselect-all .form-check { 148 | padding: 0 5px 0 20px; 149 | } 150 | .multiselect-container .multiselect-option:focus, 151 | .multiselect-container .multiselect-group:focus, 152 | .multiselect-container .multiselect-all:focus { 153 | outline: none; 154 | } 155 | .form-inline .multiselect-container span.form-check { 156 | padding: 3px 20px 3px 40px; 157 | } 158 | .input-group.input-group-sm > .multiselect-native-select .multiselect { 159 | padding: 0.25rem 0.5rem; 160 | font-size: 0.875rem; 161 | line-height: 1.5; 162 | padding-right: 1.75rem; 163 | height: calc(1.5em + 0.5rem + 2px); 164 | } 165 | .input-group > .multiselect-native-select { 166 | flex: 1 1 auto; 167 | width: 1%; 168 | } 169 | .input-group > .multiselect-native-select > div.btn-group { 170 | width: 100%; 171 | } 172 | .input-group > .multiselect-native-select:not(:first-child) .multiselect { 173 | border-top-left-radius: 0; 174 | border-bottom-left-radius: 0; 175 | } 176 | .input-group > .multiselect-native-select:not(:last-child) .multiselect { 177 | border-top-right-radius: 0; 178 | border-bottom-right-radius: 0; 179 | } 180 | -------------------------------------------------------------------------------- /dist/css/bootstrap-multiselect.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/) 3 | * 4 | * Apache License, Version 2.0: 5 | * Copyright (c) 2012 - 2022 David Stutz 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | * use this file except in compliance with the License. You may obtain a 9 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | * 17 | * BSD 3-Clause License: 18 | * Copyright (c) 2012 - 2022 David Stutz 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * - Redistributions of source code must retain the above copyright notice, 24 | * this list of conditions and the following disclaimer. 25 | * - Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * - Neither the name of David Stutz nor the names of its contributors may be 29 | * used to endorse or promote products derived from this software without 30 | * specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 34 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 35 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 36 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 39 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 41 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 42 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | */ 44 | span.multiselect-native-select{position:relative}span.multiselect-native-select select{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px -1px -1px -3px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;left:50%;top:30px}.multiselect.dropdown-toggle:after{display:none}.multiselect{overflow:hidden;text-overflow:ellipsis}.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .multiselect-reset .input-group{width:93%}.multiselect-container .multiselect-filter>.fa-search{z-index:1;padding-left:.75rem}.multiselect-container .multiselect-filter>input.multiselect-search{border:none;border-bottom:1px solid #d3d3d3;padding-left:2rem;margin-left:-1.625rem;border-bottom-right-radius:0;border-bottom-left-radius:0}.multiselect-container .multiselect-filter>input.multiselect-search:focus{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.multiselect-container .multiselect-filter>.multiselect-moz-clear-filter{margin-left:-1.5rem;display:none}.multiselect-container .multiselect-option.multiselect-group-option-indented-full{padding-left:2.6rem}.multiselect-container .multiselect-option.multiselect-group-option-indented{padding-left:1.8rem}.multiselect-container .multiselect-group{cursor:pointer}.multiselect-container .multiselect-group.closed .dropdown-toggle::after{transform:rotate(-90deg)}.multiselect-container .multiselect-group .caret-container~.form-check{margin-left:.5rem}.multiselect-container .multiselect-all,.multiselect-container .multiselect-group,.multiselect-container .multiselect-option{padding:.25rem .25rem .25rem .75rem}.multiselect-container .multiselect-all.dropdown-item,.multiselect-container .multiselect-all.dropdown-toggle,.multiselect-container .multiselect-group.dropdown-item,.multiselect-container .multiselect-group.dropdown-toggle,.multiselect-container .multiselect-option.dropdown-item,.multiselect-container .multiselect-option.dropdown-toggle{cursor:pointer}.multiselect-container .multiselect-all .form-check-label,.multiselect-container .multiselect-group .form-check-label,.multiselect-container .multiselect-option .form-check-label{cursor:pointer}.multiselect-container .multiselect-all.active:not(.multiselect-active-item-fallback),.multiselect-container .multiselect-all:not(.multiselect-active-item-fallback):active,.multiselect-container .multiselect-group.active:not(.multiselect-active-item-fallback),.multiselect-container .multiselect-group:not(.multiselect-active-item-fallback):active,.multiselect-container .multiselect-option.active:not(.multiselect-active-item-fallback),.multiselect-container .multiselect-option:not(.multiselect-active-item-fallback):active{background-color:#d3d3d3;color:#000}.multiselect-container .multiselect-all:focus,.multiselect-container .multiselect-all:hover,.multiselect-container .multiselect-group:focus,.multiselect-container .multiselect-group:hover,.multiselect-container .multiselect-option:focus,.multiselect-container .multiselect-option:hover{background-color:#a9a9a9!important}.multiselect-container .multiselect-all .form-check,.multiselect-container .multiselect-group .form-check,.multiselect-container .multiselect-option .form-check{padding:0 5px 0 20px}.multiselect-container .multiselect-all:focus,.multiselect-container .multiselect-group:focus,.multiselect-container .multiselect-option:focus{outline:0}.form-inline .multiselect-container span.form-check{padding:3px 20px 3px 40px}.input-group.input-group-sm>.multiselect-native-select .multiselect{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;padding-right:1.75rem;height:calc(1.5em + .5rem + 2px)}.input-group>.multiselect-native-select{flex:1 1 auto;width:1%}.input-group>.multiselect-native-select>div.btn-group{width:100%}.input-group>.multiselect-native-select:not(:first-child) .multiselect{border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.multiselect-native-select:not(:last-child) .multiselect{border-top-right-radius:0;border-bottom-right-radius:0} -------------------------------------------------------------------------------- /dist/js/bootstrap-multiselect.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/) 3 | * 4 | * Apache License, Version 2.0: 5 | * Copyright (c) 2012 - 2022 David Stutz 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | * use this file except in compliance with the License. You may obtain a 9 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | * 17 | * BSD 3-Clause License: 18 | * Copyright (c) 2012 - 2022 David Stutz 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * - Redistributions of source code must retain the above copyright notice, 24 | * this list of conditions and the following disclaimer. 25 | * - Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * - Neither the name of David Stutz nor the names of its contributors may be 29 | * used to endorse or promote products derived from this software without 30 | * specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 34 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 35 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 36 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 39 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 41 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 42 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | */ 44 | !function(root,factory){"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified("knockout")?define(["jquery","knockout"],factory):factory(root.jQuery,root.ko)}(this,(function($,ko){"use strict";function forEach(array,callback){for(var index=0;index').after(this.$container),this.$select.prop("tabindex","-1"),"never"!==this.options.widthSynchronizationMode&&this.synchronizeButtonAndPopupWidth(),this.$select.data("multiselect",this),this.options.onInitialized(this.$select,this.$container)}Multiselect.prototype={defaults:{buttonText:function(selectedOptions,select){if(this.disabledText.length>0&&select.prop("disabled"))return this.disabledText;if(0===selectedOptions.length)return this.nonSelectedText;if(this.allSelectedText&&selectedOptions.length===$("option",$(select)).length&&1!==$("option",$(select)).length&&this.multiple)return this.selectAllNumber?this.allSelectedText+" ("+selectedOptions.length+")":this.allSelectedText;if(0!=this.numberDisplayed&&selectedOptions.length>this.numberDisplayed)return selectedOptions.length+" "+this.nSelectedText;var selected="",delimiter=this.delimiterText;return selectedOptions.each((function(){var label=void 0!==$(this).attr("label")?$(this).attr("label"):$(this).text();selected+=label+delimiter})),selected.substr(0,selected.length-this.delimiterText.length)},buttonTitle:function(options,select){if(0===options.length)return this.nonSelectedText;var selected="",delimiter=this.delimiterText;return options.each((function(){var label=void 0!==$(this).attr("label")?$(this).attr("label"):$(this).text();selected+=label+delimiter})),selected.substr(0,selected.length-this.delimiterText.length)},checkboxName:function(option){return!1},optionLabel:function(element){return $(element).attr("label")||$(element).text()},optionClass:function(element){return $(element).attr("class")||""},onChange:function(option,checked){},onDropdownShow:function(event){},onDropdownHide:function(event){},onDropdownShown:function(event){},onDropdownHidden:function(event){},onSelectAll:function(selectedOptions){},onDeselectAll:function(deselectedOptions){},onInitialized:function($select,$container){},onFiltering:function($filter){},enableHTML:!1,buttonClass:"custom-select",inheritClass:!1,buttonWidth:"auto",buttonContainer:'
',dropRight:!1,dropUp:!1,selectedClass:"active",maxHeight:null,includeSelectAllOption:!1,includeSelectAllIfMoreThan:0,selectAllText:" Select all",selectAllValue:"multiselect-all",selectAllName:!1,selectAllNumber:!0,selectAllJustVisible:!0,enableFiltering:!1,enableCaseInsensitiveFiltering:!1,enableFullValueFiltering:!1,enableClickableOptGroups:!1,enableCollapsibleOptGroups:!1,collapseOptGroupsByDefault:!1,filterPlaceholder:"Search",filterBehavior:"text",includeFilterClearBtn:!0,preventInputChangeEvent:!1,nonSelectedText:"None selected",nSelectedText:"selected",allSelectedText:"All selected",resetButtonText:"Reset",numberDisplayed:3,disableIfEmpty:!1,disabledText:"",delimiterText:", ",includeResetOption:!1,includeResetDivider:!1,resetText:"Reset",indentGroupOptions:!0,widthSynchronizationMode:"never",buttonTextAlignment:"center",enableResetButton:!1,templates:{button:'',popupContainer:'',filter:'
',buttonGroup:'
',buttonGroupReset:'',option:'',divider:'',optionGroup:'',resetButton:'
'}},constructor:Multiselect,buildContainer:function(){this.$container=$(this.options.buttonContainer),"never"!==this.options.widthSynchronizationMode?this.$container.on("show.bs.dropdown",$.proxy((function(){this.synchronizeButtonAndPopupWidth(),this.options.onDropdownShow()}),this)):this.$container.on("show.bs.dropdown",this.options.onDropdownShow),this.$container.on("hide.bs.dropdown",this.options.onDropdownHide),this.$container.on("shown.bs.dropdown",this.options.onDropdownShown),this.$container.on("hidden.bs.dropdown",this.options.onDropdownHidden)},buildButton:function(){if(this.$button=$(this.options.templates.button).addClass(this.options.buttonClass),this.$select.attr("class")&&this.options.inheritClass&&this.$button.addClass(this.$select.attr("class")),this.$select.prop("disabled")?this.disable():this.enable(),this.options.buttonWidth&&"auto"!==this.options.buttonWidth&&(this.$button.css({width:"100%"}),this.$container.css({width:this.options.buttonWidth})),this.options.buttonTextAlignment)switch(this.options.buttonTextAlignment){case"left":this.$button.addClass("text-left");break;case"center":this.$button.addClass("text-center");break;case"right":this.$button.addClass("text-right")}var tabindex=this.$select.attr("tabindex");tabindex&&this.$button.attr("tabindex",tabindex),this.$container.prepend(this.$button)},buildDropdown:function(){this.$popupContainer=$(this.options.templates.popupContainer),this.options.dropRight?this.$container.addClass("dropright"):this.options.dropUp&&this.$container.addClass("dropup"),this.options.maxHeight&&this.$popupContainer.css({"max-height":this.options.maxHeight+"px","overflow-y":"auto","overflow-x":"hidden"}),"never"!==this.options.widthSynchronizationMode&&this.$popupContainer.css("overflow-x","hidden"),this.$popupContainer.on("touchstart click",(function(e){e.stopPropagation()})),this.$container.append(this.$popupContainer)},synchronizeButtonAndPopupWidth:function(){if(this.$popupContainer&&"never"!==this.options.widthSynchronizationMode){var buttonWidth=this.$button.outerWidth();switch(this.options.widthSynchronizationMode){case"always":this.$popupContainer.css("min-width",buttonWidth),this.$popupContainer.css("max-width",buttonWidth);break;case"ifPopupIsSmaller":this.$popupContainer.css("min-width",buttonWidth);break;case"ifPopupIsWider":this.$popupContainer.css("max-width",buttonWidth)}}},buildDropdownOptions:function(){if(this.$select.children().each($.proxy((function(index,element){var $element=$(element),tag=$element.prop("tagName").toLowerCase();$element.prop("value")!==this.options.selectAllValue&&("optgroup"===tag?this.createOptgroup(element):"option"===tag&&("divider"===$element.data("role")?this.createDivider():this.createOptionValue(element,!1)))}),this)),$(this.$popupContainer).off("change",'> *:not(.multiselect-group) input[type="checkbox"], > *:not(.multiselect-group) input[type="radio"]'),$(this.$popupContainer).on("change",'> *:not(.multiselect-group) input[type="checkbox"], > *:not(.multiselect-group) input[type="radio"]',$.proxy((function(event){var $target=$(event.target),checked=$target.prop("checked")||!1,isSelectAllOption=$target.val()===this.options.selectAllValue;this.options.selectedClass&&(checked?$target.closest(".multiselect-option").addClass(this.options.selectedClass):$target.closest(".multiselect-option").removeClass(this.options.selectedClass));var id=$target.attr("id"),$option=this.getOptionById(id),$optionsNotThis=$("option",this.$select).not($option),$checkboxesNotThis=$("input",this.$container).not($target);if(isSelectAllOption?checked?this.selectAll(this.options.selectAllJustVisible,!0):this.deselectAll(this.options.selectAllJustVisible,!0):(checked?($option.prop("selected",!0),this.options.multiple?$option.prop("selected",!0):(this.options.selectedClass&&$($checkboxesNotThis).closest(".dropdown-item").removeClass(this.options.selectedClass),$($checkboxesNotThis).prop("checked",!1),$optionsNotThis.prop("selected",!1),this.$button.click()),"active"===this.options.selectedClass&&$optionsNotThis.closest(".dropdown-item").css("outline","")):$option.prop("selected",!1),this.options.onChange($option,checked),this.updateSelectAll(),this.options.enableClickableOptGroups&&this.options.multiple&&this.updateOptGroups()),this.$select.change(),this.updateButtonText(),this.options.preventInputChangeEvent)return!1}),this)),$(".multiselect-option",this.$popupContainer).off("mousedown"),$(".multiselect-option",this.$popupContainer).on("mousedown",(function(e){if(e.shiftKey)return!1})),$(this.$popupContainer).off("touchstart click",".multiselect-option, .multiselect-all, .multiselect-group"),$(this.$popupContainer).on("touchstart click",".multiselect-option, .multiselect-all, .multiselect-group",$.proxy((function(event){event.stopPropagation();var $target=$(event.target),$input;if(event.shiftKey&&this.options.multiple){$target.is("input")||(event.preventDefault(),($target=$target.closest(".multiselect-option").find("input")).prop("checked",!$target.prop("checked")));var checked=$target.prop("checked")||!1;if(null!==this.lastToggledInput&&this.lastToggledInput!==$target){var from=this.$popupContainer.find(".multiselect-option:visible").index($target.closest(".multiselect-option")),to=this.$popupContainer.find(".multiselect-option:visible").index(this.lastToggledInput.closest(".multiselect-option"));if(from>to){var tmp=to;to=from,from=tmp}++to;var range=this.$popupContainer.find(".multiselect-option:not(.multiselect-filter-hidden)").slice(from,to).find("input");range.prop("checked",checked),this.options.selectedClass&&range.closest(".multiselect-option").toggleClass(this.options.selectedClass,checked);for(var i=0,j=range.length;i0)!this.options.multiple&&$checkbox.prop("checked")||($checkbox.prop("checked",!$checkbox.prop("checked")),$checkbox.change());else if(this.options.enableClickableOptGroups&&this.options.multiple&&!$target.hasClass("caret-container")){var groupItem=$target;groupItem.hasClass("multiselect-group")||(groupItem=$target.closest(".multiselect-group")),($checkbox=groupItem.find(".form-check-input")).length>0&&($checkbox.prop("checked",!$checkbox.prop("checked")),$checkbox.change())}event.preventDefault()}$target.closest(".multiselect-option").find("input[type='checkbox'], input[type='radio']").length>0?this.lastToggledInput=$target:this.lastToggledInput=null,$target.blur()}),this)),this.$container.off("keydown.multiselect").on("keydown.multiselect",$.proxy((function(event){var $items=$(this.$container).find(".multiselect-option:not(.disabled), .multiselect-group:not(.disabled), .multiselect-all").filter(":visible"),index=$items.index($items.filter(":focus")),$search=$(".multiselect-search",this.$container);if(9===event.keyCode&&this.$container.hasClass("show"))this.$button.click();else if(13==event.keyCode){var $current=$items.eq(index);setTimeout((function(){$current.focus()}),1)}else if(38==event.keyCode)0!=index||$search.is(":focus")||setTimeout((function(){$search.focus()}),1);else if(40==event.keyCode)if($search.is(":focus")){var $first=$items.eq(0);setTimeout((function(){$search.blur(),$first.focus()}),1)}else-1==index&&setTimeout((function(){$search.focus()}),1)}),this)),this.options.enableClickableOptGroups&&this.options.multiple&&($(".multiselect-group input",this.$popupContainer).off("change"),$(".multiselect-group input",this.$popupContainer).on("change",$.proxy((function(event){event.stopPropagation();var $target,checked=$(event.target).prop("checked")||!1,$item=$(event.target).closest(".dropdown-item"),$group,$inputs=$item.nextUntil(".multiselect-group").not(".multiselect-filter-hidden").not(".disabled").find("input"),$options=[];this.options.selectedClass&&(checked?$item.addClass(this.options.selectedClass):$item.removeClass(this.options.selectedClass)),$.each($inputs,$.proxy((function(index,input){var $input=$(input),id=$input.attr("id"),$option=this.getOptionById(id);checked?($input.prop("checked",!0),$input.closest(".dropdown-item").addClass(this.options.selectedClass),$option.prop("selected",!0)):($input.prop("checked",!1),$input.closest(".dropdown-item").removeClass(this.options.selectedClass),$option.prop("selected",!1)),$options.push($option)}),this)),this.options.onChange($options,checked),this.$select.change(),this.updateButtonText(),this.updateSelectAll()}),this))),this.options.enableCollapsibleOptGroups){let clickableSelector=this.options.enableClickableOptGroups?".multiselect-group .caret-container":".multiselect-group";$(clickableSelector,this.$popupContainer).off("click"),$(clickableSelector,this.$popupContainer).on("click",$.proxy((function(event){var $group=$(event.target).closest(".multiselect-group"),$inputs=$group.nextUntil(".multiselect-group").not(".multiselect-filter-hidden"),visible=!0;$inputs.each((function(){visible=visible&&!$(this).hasClass("multiselect-collapsible-hidden")})),visible?($inputs.hide().addClass("multiselect-collapsible-hidden"),$group.get(0).classList.add("closed")):($inputs.show().removeClass("multiselect-collapsible-hidden"),$group.get(0).classList.remove("closed"))}),this))}},createCheckbox:function($item,labelContent,name,value,title,inputType,internalId){var $wrapper=$("");$wrapper.addClass("form-check");var $checkboxLabel=$('