├── .editorconfig ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── angular.json ├── docs ├── 3rdpartylicenses.txt ├── assets │ ├── icons │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192x192.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ ├── icon-72x72.png │ │ └── icon-96x96.png │ └── img │ │ ├── GitHub-Mark-32px.png │ │ ├── GitHub-Mark-64px.png │ │ ├── angular.svg │ │ ├── coffee11.png │ │ ├── cuppa-logo-coffee11.png │ │ ├── cuppa_logo_128X128.png │ │ ├── loading.gif │ │ ├── multiselect-dropdown.png │ │ ├── multiselect.jpeg │ │ └── sand-background.jpg ├── favicon.ico ├── index.html ├── main.js ├── manifest.webmanifest ├── polyfills.js ├── scripts.js └── styles.css ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── karma.conf.js ├── ngsw-config.json ├── package-lock.json ├── package.json ├── projects └── angular2-multiselect-dropdown-lib │ ├── LICENSE │ ├── README.md │ ├── karma.conf.js │ ├── ng-package.json │ ├── package.json │ ├── src │ ├── lib │ │ ├── angular2-multiselect-dropdown.ts │ │ ├── clickOutside.ts │ │ ├── index.ts │ │ ├── list-filter.ts │ │ ├── menu-item.ts │ │ ├── multiselect.component.html │ │ ├── multiselect.component.scss │ │ ├── multiselect.component.ts │ │ ├── multiselect.interface.ts │ │ ├── multiselect.model.ts │ │ ├── multiselect.service.ts │ │ └── virtual-scroll │ │ │ ├── defaultoptions.ts │ │ │ ├── idimension.ts │ │ │ ├── ipageinfo.ts │ │ │ ├── iviewport.ts │ │ │ ├── pageinfo.ts │ │ │ ├── virtual-scroll.ts │ │ │ ├── wrapgroupdimension.ts │ │ │ └── wrapgroupdimensions.ts │ ├── public_api.ts │ └── test.ts │ ├── themes │ ├── dark.theme.scss │ ├── default.theme.css │ └── default.theme.scss │ ├── tsconfig.lib.json │ ├── tsconfig.lib.prod.json │ ├── tsconfig.spec.json │ └── tslint.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── app.prerender.module.ts │ ├── app.router.ts │ ├── app.server.module.ts │ ├── check-for-update.service.ts │ ├── components │ │ └── sourcetab │ │ │ ├── sourcetab.component.css │ │ │ ├── sourcetab.component.html │ │ │ └── sourcetab.component.ts │ ├── examples │ │ ├── basic.ts │ │ ├── customSearch.ts │ │ ├── customplaceholder.ts │ │ ├── disablemode.ts │ │ ├── dynamicDataSets.ts │ │ ├── events.ts │ │ ├── gist.ts │ │ ├── groupBy.ts │ │ ├── lazyLoading.ts │ │ ├── lazyLoadingRemoteData.ts │ │ ├── limitbadges.ts │ │ ├── limitselection.ts │ │ ├── mock-data.ts │ │ ├── multipleDropdowns.ts │ │ ├── remoteData.ts │ │ ├── resetdropdown.ts │ │ ├── searchByOneProperty.ts │ │ ├── searchFilter.ts │ │ ├── searchFilterAddNewItem.ts │ │ ├── singleselection.ts │ │ ├── styling.ts │ │ ├── templating.ts │ │ ├── theming.ts │ │ ├── usingInList.ts │ │ ├── usingInReactForms.ts │ │ ├── usingWithForms.ts │ │ ├── usingWithinDialog.ts │ │ └── views │ │ │ ├── customSearch.html │ │ │ ├── dialog-content-example-dialog.html │ │ │ ├── disableMode.html │ │ │ ├── dynamicData.html │ │ │ ├── events.html │ │ │ ├── groupBy.html │ │ │ ├── lazyLoading.html │ │ │ ├── lazyLoadingRemoteData.html │ │ │ ├── multipledropdowns.html │ │ │ ├── remoteData.html │ │ │ ├── resetDropdown.html │ │ │ ├── searchFilter.html │ │ │ ├── singleSelection.html │ │ │ ├── templating.html │ │ │ ├── theming.html │ │ │ ├── using-in-form.html │ │ │ ├── using-in-react-form.html │ │ │ ├── usingInList.html │ │ │ ├── usingWithinDialog.html │ │ │ └── view.html │ └── main.prerender.ts ├── assets │ ├── .gitkeep │ ├── icons │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192x192.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ ├── icon-72x72.png │ │ └── icon-96x96.png │ └── img │ │ ├── GitHub-Mark-32px.png │ │ ├── GitHub-Mark-64px.png │ │ ├── angular.svg │ │ ├── coffee11.png │ │ ├── cuppa-logo-coffee11.png │ │ ├── cuppa_logo_128X128.png │ │ ├── loading.gif │ │ ├── multiselect-dropdown.png │ │ ├── multiselect.jpeg │ │ └── sand-background.jpg ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── manifest.webmanifest ├── polyfills.ts ├── styles.scss └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | .angular 48 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at solomon.terli@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Cuppa Labs 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular2-multiselect-dropdown": { 7 | "projectType": "application", 8 | "schematics": { 9 | "@schematics/angular:component": { 10 | "style": "scss" 11 | }, 12 | "@schematics/angular:application": { 13 | "strict": true 14 | } 15 | }, 16 | "root": "", 17 | "sourceRoot": "src", 18 | "prefix": "app", 19 | "architect": { 20 | "build": { 21 | "builder": "@angular-devkit/build-angular:application", 22 | "options": { 23 | "outputPath": { 24 | "base": "docs", 25 | "browser": "" 26 | }, 27 | "index": "src/index.html", 28 | "polyfills": [ 29 | "src/polyfills.ts" 30 | ], 31 | "tsConfig": "tsconfig.app.json", 32 | "aot": true, 33 | "assets": [ 34 | "src/favicon.ico", 35 | "src/assets", 36 | "src/manifest.webmanifest" 37 | ], 38 | "styles": [ 39 | "src/styles.scss", 40 | "projects/angular2-multiselect-dropdown-lib/themes/default.theme.scss" 41 | ], 42 | "scripts": [ 43 | "node_modules/bootstrap/dist/js/bootstrap.js" 44 | ], 45 | "browser": "src/main.ts", 46 | "stylePreprocessorOptions": { 47 | "includePaths": [ 48 | "." 49 | ] 50 | } 51 | }, 52 | "configurations": { 53 | "production": { 54 | "fileReplacements": [ 55 | { 56 | "replace": "src/environments/environment.ts", 57 | "with": "src/environments/environment.prod.ts" 58 | } 59 | ], 60 | "optimization": true, 61 | "outputHashing": "all", 62 | "sourceMap": false, 63 | "namedChunks": false, 64 | "extractLicenses": true, 65 | "budgets": [ 66 | { 67 | "type": "initial", 68 | "maximumWarning": "500kb", 69 | "maximumError": "1mb" 70 | }, 71 | { 72 | "type": "anyComponentStyle", 73 | "maximumWarning": "6kb", 74 | "maximumError": "6kb" 75 | } 76 | ], 77 | "serviceWorker": "ngsw-config.json" 78 | } 79 | } 80 | }, 81 | "serve": { 82 | "builder": "@angular-devkit/build-angular:dev-server", 83 | "options": { 84 | "buildTarget": "angular2-multiselect-dropdown:build" 85 | }, 86 | "configurations": { 87 | "production": { 88 | "buildTarget": "angular2-multiselect-dropdown:build:production" 89 | } 90 | } 91 | }, 92 | "extract-i18n": { 93 | "builder": "@angular-devkit/build-angular:extract-i18n", 94 | "options": { 95 | "buildTarget": "angular2-multiselect-dropdown:build" 96 | } 97 | }, 98 | "test": { 99 | "builder": "@angular-devkit/build-angular:karma", 100 | "options": { 101 | "main": "src/test.ts", 102 | "polyfills": "src/polyfills.ts", 103 | "tsConfig": "tsconfig.spec.json", 104 | "karmaConfig": "karma.conf.js", 105 | "assets": [ 106 | "src/favicon.ico", 107 | "src/assets", 108 | "src/manifest.webmanifest" 109 | ], 110 | "styles": [ 111 | "src/styles.scss" 112 | ], 113 | "scripts": [] 114 | } 115 | }, 116 | "lint": { 117 | "builder": "@angular-devkit/build-angular:tslint", 118 | "options": { 119 | "tsConfig": [ 120 | "tsconfig.app.json", 121 | "tsconfig.spec.json", 122 | "e2e/tsconfig.json" 123 | ], 124 | "exclude": [ 125 | "**/node_modules/**" 126 | ] 127 | } 128 | }, 129 | "e2e": { 130 | "builder": "@angular-devkit/build-angular:protractor", 131 | "options": { 132 | "protractorConfig": "e2e/protractor.conf.js", 133 | "devServerTarget": "angular2-multiselect-dropdown:serve" 134 | }, 135 | "configurations": { 136 | "production": { 137 | "devServerTarget": "angular2-multiselect-dropdown:serve:production" 138 | } 139 | } 140 | } 141 | } 142 | }, 143 | "angular2-multiselect-dropdown-lib": { 144 | "projectType": "library", 145 | "root": "projects/angular2-multiselect-dropdown-lib", 146 | "sourceRoot": "projects/angular2-multiselect-dropdown-lib/src", 147 | "prefix": "lib", 148 | "architect": { 149 | "build": { 150 | "builder": "@angular-devkit/build-angular:ng-packagr", 151 | "options": { 152 | "tsConfig": "projects/angular2-multiselect-dropdown-lib/tsconfig.lib.json", 153 | "project": "projects/angular2-multiselect-dropdown-lib/ng-package.json" 154 | }, 155 | "configurations": { 156 | "production": { 157 | "tsConfig": "projects/angular2-multiselect-dropdown-lib/tsconfig.lib.prod.json" 158 | } 159 | } 160 | }, 161 | "test": { 162 | "builder": "@angular-devkit/build-angular:karma", 163 | "options": { 164 | "main": "projects/angular2-multiselect-dropdown-lib/src/test.ts", 165 | "tsConfig": "projects/angular2-multiselect-dropdown-lib/tsconfig.spec.json", 166 | "karmaConfig": "projects/angular2-multiselect-dropdown-lib/karma.conf.js" 167 | } 168 | }, 169 | "lint": { 170 | "builder": "@angular-devkit/build-angular:tslint", 171 | "options": { 172 | "tsConfig": [ 173 | "projects/angular2-multiselect-dropdown-lib/tsconfig.lib.json", 174 | "projects/angular2-multiselect-dropdown-lib/tsconfig.spec.json" 175 | ], 176 | "exclude": [ 177 | "**/node_modules/**" 178 | ] 179 | } 180 | } 181 | } 182 | } 183 | }, 184 | "cli": { 185 | "analytics": false 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /docs/assets/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-128x128.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-144x144.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-152x152.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-192x192.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-384x384.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-512x512.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-72x72.png -------------------------------------------------------------------------------- /docs/assets/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/icons/icon-96x96.png -------------------------------------------------------------------------------- /docs/assets/img/GitHub-Mark-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/GitHub-Mark-32px.png -------------------------------------------------------------------------------- /docs/assets/img/GitHub-Mark-64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/GitHub-Mark-64px.png -------------------------------------------------------------------------------- /docs/assets/img/angular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/assets/img/coffee11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/coffee11.png -------------------------------------------------------------------------------- /docs/assets/img/cuppa-logo-coffee11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/cuppa-logo-coffee11.png -------------------------------------------------------------------------------- /docs/assets/img/cuppa_logo_128X128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/cuppa_logo_128X128.png -------------------------------------------------------------------------------- /docs/assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/loading.gif -------------------------------------------------------------------------------- /docs/assets/img/multiselect-dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/multiselect-dropdown.png -------------------------------------------------------------------------------- /docs/assets/img/multiselect.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/multiselect.jpeg -------------------------------------------------------------------------------- /docs/assets/img/sand-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/assets/img/sand-background.jpg -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/docs/favicon.ico -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular Multiselect Dropdown | Cuppa Labs 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 48 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-multiselect-dropdown", 3 | "short_name": "angular2-multiselect-dropdown", 4 | "theme_color": "#1976d2", 5 | "background_color": "#fafafa", 6 | "display": "standalone", 7 | "scope": "./", 8 | "start_url": "./", 9 | "icons": [ 10 | { 11 | "src": "assets/icons/icon-72x72.png", 12 | "sizes": "72x72", 13 | "type": "image/png", 14 | "purpose": "maskable any" 15 | }, 16 | { 17 | "src": "assets/icons/icon-96x96.png", 18 | "sizes": "96x96", 19 | "type": "image/png", 20 | "purpose": "maskable any" 21 | }, 22 | { 23 | "src": "assets/icons/icon-128x128.png", 24 | "sizes": "128x128", 25 | "type": "image/png", 26 | "purpose": "maskable any" 27 | }, 28 | { 29 | "src": "assets/icons/icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image/png", 32 | "purpose": "maskable any" 33 | }, 34 | { 35 | "src": "assets/icons/icon-152x152.png", 36 | "sizes": "152x152", 37 | "type": "image/png", 38 | "purpose": "maskable any" 39 | }, 40 | { 41 | "src": "assets/icons/icon-192x192.png", 42 | "sizes": "192x192", 43 | "type": "image/png", 44 | "purpose": "maskable any" 45 | }, 46 | { 47 | "src": "assets/icons/icon-384x384.png", 48 | "sizes": "384x384", 49 | "type": "image/png", 50 | "purpose": "maskable any" 51 | }, 52 | { 53 | "src": "assets/icons/icon-512x512.png", 54 | "sizes": "512x512", 55 | "type": "image/png", 56 | "purpose": "maskable any" 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', async () => { 12 | await page.navigateTo(); 13 | expect(await page.getTitleText()).toEqual('angular2-multiselect-dropdown app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | jasmineHtmlReporter: { 19 | suppressAll: true // removes the duplicated traces 20 | }, 21 | coverageReporter: { 22 | dir: require('path').join(__dirname, './coverage/angular2-multiselect-dropdown'), 23 | subdir: '.', 24 | reporters: [ 25 | { type: 'html' }, 26 | { type: 'text-summary' } 27 | ] 28 | }, 29 | reporters: ['progress', 'kjhtml'], 30 | port: 9876, 31 | colors: true, 32 | logLevel: config.LOG_INFO, 33 | autoWatch: true, 34 | browsers: ['Chrome'], 35 | singleRun: false, 36 | restartOnFileChange: true 37 | }); 38 | }; 39 | -------------------------------------------------------------------------------- /ngsw-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/service-worker/config/schema.json", 3 | "index": "/index.html", 4 | "assetGroups": [ 5 | { 6 | "name": "app", 7 | "installMode": "prefetch", 8 | "resources": { 9 | "files": [ 10 | "/favicon.ico", 11 | "/index.html", 12 | "/manifest.webmanifest", 13 | "/*.css", 14 | "/*.js" 15 | ] 16 | } 17 | }, 18 | { 19 | "name": "assets", 20 | "installMode": "lazy", 21 | "updateMode": "prefetch", 22 | "resources": { 23 | "files": [ 24 | "/assets/**", 25 | "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)" 26 | ] 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-multiselect-dropdown", 3 | "version": "10.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e", 11 | "build-sass": "node-sass --include-path scss projects/angular2-multiselect-dropdown-lib/themes/default.theme.scss projects/angular2-multiselect-dropdown-lib/themes/default.theme.css", 12 | "build-package": "npm run build-sass && ng-packagr -p projects/angular2-multiselect-dropdown-lib/ng-package.json", 13 | "github-pages": "ng build --base-href /angular2-multiselect-dropdown/" 14 | }, 15 | "private": true, 16 | "dependencies": { 17 | "@angular/animations": "^18.1.0", 18 | "@angular/common": "^18.1.0", 19 | "@angular/compiler": "^18.1.0", 20 | "@angular/core": "^18.1.0", 21 | "@angular/forms": "^18.1.0", 22 | "@angular/localize": "^18.1.0", 23 | "@angular/platform-browser": "^18.1.0", 24 | "@angular/platform-browser-dynamic": "^18.1.0", 25 | "@angular/router": "^18.1.0", 26 | "@angular/service-worker": "^18.1.0", 27 | "@ng-bootstrap/ng-bootstrap": "^11.0.1", 28 | "@tweenjs/tween.js": "^18.6.4", 29 | "angular2-multiselect-dropdown": "^10.0.0", 30 | "bootstrap": "^5.2.3", 31 | "highlight.js": "^10.7.2", 32 | "i": "^0.3.6", 33 | "ng2-adsense": "^13.0.0", 34 | "ngx-highlightjs": "^9.0.0", 35 | "npm": "^7.9.0", 36 | "rxjs": "~6.6.0", 37 | "tslib": "^2.5.0", 38 | "zone.js": "~0.14.7" 39 | }, 40 | "devDependencies": { 41 | "@angular-devkit/build-angular": "^18.1.0", 42 | "@angular/cli": "^18.1.0", 43 | "@angular/compiler-cli": "^18.1.0", 44 | "@types/highlight.js": "^10.1.0", 45 | "@types/jasmine": "~3.6.0", 46 | "@types/node": "^12.11.1", 47 | "codelyzer": "^6.0.2", 48 | "jasmine-core": "~3.6.0", 49 | "jasmine-spec-reporter": "~5.0.0", 50 | "karma": "~6.4.1", 51 | "karma-chrome-launcher": "~3.1.1", 52 | "karma-coverage": "~2.2.0", 53 | "karma-jasmine": "~4.0.0", 54 | "karma-jasmine-html-reporter": "^1.5.0", 55 | "ng-packagr": "^18.1.0", 56 | "protractor": "~7.0.0", 57 | "ts-node": "~8.3.0", 58 | "tslint": "~6.1.0", 59 | "typescript": "~5.4.5" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Cuppa Labs 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, '../../coverage/angular2-multiselect-dropdown-lib'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "lib": { 4 | "entryFile": "src/public_api.ts" 5 | }, 6 | "allowedNonPeerDependencies": ["@tweenjs/tween.js"], 7 | "assets": [ 8 | "README.md", 9 | "LICENSE", 10 | "./themes/*.theme.scss", 11 | "./themes/*.theme.css" 12 | ], 13 | "dest": "../../dist" 14 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/package.schema.json", 3 | "name":"angular2-multiselect-dropdown", 4 | "version":"10.0.0", 5 | "license": "MIT", 6 | "author": "Pradeep Terli", 7 | "description": "Angular Multiselct dropdown component library for Angular version 11, 10, 9,8,6,4 ", 8 | "keywords": [ 9 | "angular 15 multiselect dropdown" 10 | ], 11 | "peerDependencies": { 12 | }, 13 | "dependencies": { 14 | "@tweenjs/tween.js": "^17.4.0" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/CuppaLabs/angular2-multiselect-dropdown" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/CuppaLabs/angular2-multiselect-dropdown/issues" 22 | } 23 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/angular2-multiselect-dropdown.ts: -------------------------------------------------------------------------------- 1 | export { AngularMultiSelect } from './multiselect.component'; 2 | export { ClickOutsideDirective } from './clickOutside'; 3 | export { ListFilterPipe } from './list-filter'; 4 | export { Item } from './menu-item'; 5 | export { TemplateRenderer } from './menu-item'; 6 | export { AngularMultiSelectModule } from './multiselect.component'; 7 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/clickOutside.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef, Output, EventEmitter, HostListener, Input, OnInit, OnChanges } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[clickOutside]' 5 | }) 6 | export class ClickOutsideDirective { 7 | constructor(private _elementRef: ElementRef) { 8 | } 9 | 10 | @Output() 11 | public clickOutside = new EventEmitter(); 12 | 13 | @HostListener('document:pointerdown', ['$event', '$event.target']) 14 | @HostListener('document:touchstart', ['$event', '$event.target']) 15 | public onClick(event: MouseEvent, targetElement: HTMLElement): void { 16 | if (!targetElement) { 17 | return; 18 | } 19 | 20 | const clickedInside = this._elementRef.nativeElement.contains(targetElement); 21 | if (!clickedInside) { 22 | this.clickOutside.emit(event); 23 | } 24 | } 25 | } 26 | 27 | @Directive({ 28 | selector: '[scroll]' 29 | }) 30 | export class ScrollDirective { 31 | constructor(private _elementRef: ElementRef) { 32 | } 33 | 34 | @Output() 35 | public scroll = new EventEmitter(); 36 | 37 | @HostListener('scroll', ['$event']) 38 | public onClick(event: MouseEvent, targetElement: HTMLElement): void { 39 | this.scroll.emit(event); 40 | } 41 | } 42 | @Directive({ 43 | selector: '[styleProp]' 44 | }) 45 | export class styleDirective { 46 | 47 | constructor(private el: ElementRef) { 48 | 49 | } 50 | 51 | @Input('styleProp') styleVal: number; 52 | 53 | ngOnInit() { 54 | 55 | this.el.nativeElement.style.top = this.styleVal; 56 | } 57 | ngOnChanges(): void { 58 | this.el.nativeElement.style.top = this.styleVal; 59 | } 60 | } 61 | 62 | 63 | @Directive({ 64 | selector: '[setPosition]' 65 | }) 66 | export class setPosition implements OnInit, OnChanges { 67 | 68 | @Input('setPosition') height: number; 69 | 70 | constructor(public el: ElementRef) { 71 | 72 | } 73 | ngOnInit() { 74 | if (this.height) { 75 | this.el.nativeElement.style.bottom = parseInt(this.height + 15 + "") + 'px'; 76 | } 77 | } 78 | ngOnChanges(): void { 79 | if (this.height) { 80 | this.el.nativeElement.style.bottom = parseInt(this.height + 15 + "") + 'px'; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularMultiSelect } from './multiselect.component'; 2 | export { ClickOutsideDirective } from './clickOutside'; 3 | export { ListFilterPipe } from './list-filter'; 4 | export { Item } from './menu-item'; 5 | export { TemplateRenderer } from './menu-item'; 6 | export { VirtualScrollerComponent } from './virtual-scroll/virtual-scroll'; 7 | export { AngularMultiSelectModule } from './multiselect.component'; 8 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/list-filter.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | import { DataService } from './multiselect.service'; 3 | 4 | 5 | @Pipe({ 6 | name: 'listFilter', 7 | pure: true 8 | }) 9 | export class ListFilterPipe implements PipeTransform { 10 | 11 | public filteredList: any = []; 12 | constructor(private ds: DataService) { 13 | 14 | } 15 | 16 | transform(items: any[], filter: any, searchBy: any): any[] { 17 | if (!items || !filter || filter == "") { 18 | return items; 19 | } 20 | this.filteredList = items.filter((item: any) => this.applyFilter(item, filter, searchBy)); 21 | return this.filteredList; 22 | } 23 | applyFilter(item: any, filter: any, searchBy: any): boolean { 24 | let found = false; 25 | if (searchBy.length > 0) { 26 | if (item.grpTitle) { 27 | found = true; 28 | } 29 | else { 30 | for (var t = 0; t < searchBy.length; t++) { 31 | if (filter && item[searchBy[t]] && item[searchBy[t]] != "") { 32 | if (item[searchBy[t]].toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { 33 | found = true; 34 | } 35 | } 36 | } 37 | } 38 | 39 | } else { 40 | if (item.grpTitle) { 41 | found = true; 42 | } 43 | else { 44 | for (var prop in item) { 45 | if (filter && item[prop]) { 46 | if (item[prop].toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { 47 | found = true; 48 | } 49 | } 50 | } 51 | } 52 | } 53 | 54 | return found; 55 | } 56 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/menu-item.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy, NgModule, TemplateRef, AfterContentInit, ContentChild, EmbeddedViewRef, OnChanges, ViewContainerRef, ViewEncapsulation, Input, Output, EventEmitter, ElementRef, AfterViewInit, Pipe, PipeTransform, Directive } from '@angular/core'; 2 | import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'; 3 | import { CommonModule } from '@angular/common'; 4 | 5 | @Component({ 6 | selector: 'c-item', 7 | template: `` 8 | }) 9 | 10 | export class Item { 11 | 12 | @ContentChild(TemplateRef, {static: true}) template: TemplateRef 13 | constructor() { 14 | } 15 | 16 | } 17 | 18 | @Component({ 19 | selector: 'c-badge', 20 | template: `` 21 | }) 22 | 23 | export class Badge { 24 | 25 | @ContentChild(TemplateRef, {static: true}) template: TemplateRef 26 | constructor() { 27 | } 28 | 29 | } 30 | 31 | @Component({ 32 | selector: 'c-search', 33 | template: `` 34 | }) 35 | 36 | export class Search { 37 | 38 | @ContentChild(TemplateRef, {static: true}) template: TemplateRef 39 | constructor() { 40 | } 41 | 42 | } 43 | @Component({ 44 | selector: 'c-templateRenderer', 45 | template: `` 46 | }) 47 | 48 | export class TemplateRenderer implements OnInit, OnDestroy { 49 | 50 | @Input() data: any 51 | @Input() item: any 52 | view: EmbeddedViewRef; 53 | 54 | constructor(public viewContainer: ViewContainerRef) { 55 | } 56 | ngOnInit() { 57 | this.view = this.viewContainer.createEmbeddedView(this.data.template, { 58 | '\$implicit': this.data, 59 | 'item':this.item 60 | }); 61 | } 62 | 63 | ngOnDestroy() { 64 | this.view.destroy(); 65 | } 66 | 67 | } 68 | 69 | @Component({ 70 | selector: 'c-icon', 71 | template: ` 73 | 74 | 78 | 79 | 80 | 82 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 94 | 95 | 96 | 97 | 100 | 101 | 102 | 103 | 104 | 105 | 108 | 109 | 110 | 111 | 112 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 126 | 127 | 132 | 133 | `, 134 | encapsulation: ViewEncapsulation.None, 135 | 136 | }) 137 | 138 | export class CIcon { 139 | 140 | @Input() name:any; 141 | 142 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.component.scss: -------------------------------------------------------------------------------- 1 | virtual-scroll { 2 | display: block; 3 | width: 100%; 4 | } 5 | 6 | .cuppa-dropdown { 7 | position: relative; 8 | } 9 | 10 | .c-btn { 11 | display: inline-block; 12 | border-width: 1px; 13 | line-height: 1.25; 14 | border-radius: 3px; 15 | font-size: 0.85rem; 16 | padding: 5px 10px; 17 | cursor: pointer; 18 | align-items: center; 19 | min-height: 38px; 20 | } 21 | 22 | .c-btn.disabled { 23 | background: #ccc; 24 | } 25 | 26 | .selected-list { 27 | .c-list { 28 | float: left; 29 | padding: 0px; 30 | margin: 0px; 31 | width: calc(100% - 20px); 32 | 33 | .c-token { 34 | list-style: none; 35 | padding: 4px 8px; 36 | /*background: $base-color; */ 37 | /*color: $token-color;*/ 38 | border-radius: 2px; 39 | margin-right: 4px; 40 | margin-top: 2px; 41 | float: left; 42 | position: relative; 43 | padding-right: 22px; 44 | 45 | .c-label { 46 | display: block; 47 | float: left; 48 | } 49 | 50 | .c-remove { 51 | position: absolute; 52 | right: 8px; 53 | top: 50%; 54 | transform: translateY(-50%); 55 | width: 8px; 56 | 57 | svg { 58 | fill: #fff; 59 | } 60 | } 61 | } 62 | } 63 | 64 | .fa-angle-down, 65 | .fa-angle-up { 66 | font-size: 15pt; 67 | position: absolute; 68 | right: 10px; 69 | top: 50%; 70 | transform: translateY(-50%); 71 | } 72 | 73 | .c-angle-down, 74 | .c-angle-up { 75 | width: 12px; 76 | height: 12px; 77 | position: absolute; 78 | right: 10px; 79 | top: 50%; 80 | transform: translateY(-50%); 81 | pointer-events: none; 82 | 83 | svg { 84 | fill: #333; 85 | } 86 | } 87 | 88 | .countplaceholder { 89 | position: absolute; 90 | right: 45px; 91 | top: 50%; 92 | transform: translateY(-50%); 93 | } 94 | 95 | .c-btn { 96 | width: 100%; 97 | /* box-shadow: 0px 1px 5px $box-shadow-color; 98 | */ 99 | padding: 5px 10px; 100 | cursor: pointer; 101 | display: flex; 102 | position: relative; 103 | 104 | .c-icon { 105 | position: absolute; 106 | right: 5px; 107 | top: 50%; 108 | transform: translateY(-50%); 109 | } 110 | } 111 | } 112 | .dropdown-list.tagToBody { 113 | position: fixed; 114 | } 115 | .dropdown-list { 116 | position: absolute; 117 | padding-top: 14px; 118 | width: 100%; 119 | z-index: 99999; 120 | 121 | ul { 122 | padding: 0px; 123 | list-style: none; 124 | overflow: auto; 125 | margin: 0px; 126 | 127 | li { 128 | padding: 10px 10px; 129 | cursor: pointer; 130 | text-align: left; 131 | } 132 | 133 | li:first-child { 134 | padding-top: 10px; 135 | } 136 | 137 | li:last-child { 138 | padding-bottom: 10px; 139 | } 140 | 141 | li:hover { 142 | /*background: $list-hover-background;*/ 143 | } 144 | } 145 | 146 | ::-webkit-scrollbar { 147 | width: 8px; 148 | } 149 | 150 | ::-webkit-scrollbar-thumb { 151 | background: #cccccc; 152 | border-radius: 5px; 153 | } 154 | 155 | ::-webkit-scrollbar-track { 156 | background: #f2f2f2; 157 | } 158 | } 159 | 160 | .arrow-up, 161 | .arrow-down { 162 | width: 0; 163 | height: 0; 164 | border-left: 13px solid transparent; 165 | border-right: 13px solid transparent; 166 | border-bottom: 15px solid #fff; 167 | margin-left: 15px; 168 | position: absolute; 169 | top: 0; 170 | } 171 | 172 | .arrow-down { 173 | bottom: -14px; 174 | top: unset; 175 | transform: rotate(180deg); 176 | } 177 | 178 | .arrow-2 { 179 | border-bottom: 15px solid #ccc; 180 | top: -1px; 181 | } 182 | 183 | .arrow-down.arrow-2 { 184 | top: unset; 185 | bottom: -16px; 186 | } 187 | 188 | .list-area { 189 | border: 1px solid #ccc; 190 | border-radius: 3px; 191 | background: #fff; 192 | margin: 0px; 193 | /*box-shadow: 0px 1px 5px $box-shadow-color;*/ 194 | } 195 | 196 | .select-all { 197 | padding: 10px; 198 | border-bottom: 1px solid #ccc; 199 | text-align: left; 200 | } 201 | 202 | .list-filter { 203 | border-bottom: 1px solid #ccc; 204 | position: relative; 205 | padding-left: 35px; 206 | height: 35px; 207 | 208 | input { 209 | border: 0px; 210 | width: 100%; 211 | height: 100%; 212 | padding: 0px; 213 | } 214 | 215 | input:focus { 216 | outline: none; 217 | } 218 | 219 | .c-search { 220 | position: absolute; 221 | top: 4px; 222 | left: 10px; 223 | width: 15px; 224 | height: 15px; 225 | 226 | svg { 227 | fill: #888; 228 | } 229 | } 230 | 231 | .c-clear { 232 | position: absolute; 233 | top: 4px; 234 | right: 10px; 235 | width: 15px; 236 | height: 15px; 237 | 238 | svg { 239 | fill: #888; 240 | } 241 | } 242 | } 243 | 244 | .pure-checkbox input[type="checkbox"] { 245 | border: 0; 246 | clip: rect(0 0 0 0); 247 | height: 1px; 248 | margin: -1px; 249 | overflow: hidden; 250 | padding: 0; 251 | position: absolute; 252 | width: 1px; 253 | } 254 | 255 | .pure-checkbox input[type="checkbox"]:focus + label:before, 256 | .pure-checkbox input[type="checkbox"]:hover + label:before { 257 | /*border-color: $base-color;*/ 258 | background-color: none; 259 | } 260 | 261 | .pure-checkbox input[type="checkbox"]:active + label:before { 262 | transition-duration: 0s; 263 | } 264 | 265 | .pure-checkbox input[type="checkbox"]:disabled + label { 266 | color: #cccccc; 267 | } 268 | 269 | .pure-checkbox input[type="checkbox"] + label { 270 | position: relative; 271 | padding-left: 2em; 272 | vertical-align: middle; 273 | user-select: none; 274 | cursor: pointer; 275 | margin: 0px; 276 | /*color: $label-color;*/ 277 | font-weight: 300; 278 | } 279 | 280 | .pure-checkbox input[type="checkbox"] + label:before { 281 | box-sizing: content-box; 282 | content: ''; 283 | /*color: $base-color;*/ 284 | position: absolute; 285 | top: 50%; 286 | left: 0; 287 | width: 15px; 288 | height: 15px; 289 | margin-top: -9px; 290 | /*border: 2px solid $base-color;*/ 291 | text-align: center; 292 | transition: all 0.4s ease; 293 | border-radius: 3px; 294 | } 295 | 296 | .pure-checkbox input[type="checkbox"] + label:after { 297 | box-sizing: content-box; 298 | content: ''; 299 | /*background-color: $base-color;*/ 300 | position: absolute; 301 | top: 50%; 302 | left: 0; 303 | width: 15px; 304 | height: 15px; 305 | margin-top: -9px; 306 | transform: scale(0); 307 | transform-origin: 50%; 308 | transition: transform 200ms ease-out; 309 | } 310 | 311 | .pure-checkbox input[type="checkbox"]:disabled + label:before { 312 | border-color: #cccccc; 313 | } 314 | 315 | .pure-checkbox input[type="checkbox"]:disabled:focus + label:before 316 | .pure-checkbox input[type="checkbox"]:disabled:hover + label:before { 317 | background-color: inherit; 318 | } 319 | 320 | .pure-checkbox input[type="checkbox"]:disabled:checked + label:before { 321 | background-color: #cccccc; 322 | } 323 | 324 | .pure-checkbox input[type="checkbox"] + label:after { 325 | background-color: transparent; 326 | top: 50%; 327 | left: 3px; 328 | width: 9px; 329 | height: 4px; 330 | margin-top: -5px; 331 | border-style: solid; 332 | border-width: 0 0 2px 2px; 333 | border-image: none; 334 | transform: rotate(-45deg) scale(0); 335 | } 336 | 337 | .pure-checkbox input[type="checkbox"]:checked + label:after { 338 | content: ''; 339 | transform: rotate(-45deg) scale(1); 340 | transition: transform 200ms ease-out; 341 | } 342 | 343 | .pure-checkbox input[type="radio"]:checked + label:before { 344 | background-color: white; 345 | } 346 | 347 | .pure-checkbox input[type="radio"]:checked + label:after { 348 | transform: scale(1); 349 | } 350 | 351 | .pure-checkbox input[type="radio"] + label:before { 352 | border-radius: 50%; 353 | } 354 | 355 | .pure-checkbox input[type="checkbox"]:checked + label:before { 356 | /*background: $base-color;*/ 357 | } 358 | 359 | .pure-checkbox input[type="checkbox"]:checked + label:after { 360 | transform: rotate(-45deg) scale(1); 361 | } 362 | 363 | .list-message { 364 | text-align: center; 365 | margin: 0px; 366 | padding: 15px 0px; 367 | font-size: initial; 368 | } 369 | 370 | .list-grp { 371 | padding: 0 15px !important; 372 | } 373 | 374 | .list-grp h4 { 375 | text-transform: capitalize; 376 | margin: 15px 0px 0px 0px; 377 | font-size: 14px; 378 | font-weight: 700; 379 | } 380 | 381 | .list-grp > li { 382 | padding-left: 15px !important; 383 | } 384 | 385 | .selected-item { 386 | /*background: $selected-background;*/ 387 | } 388 | 389 | .grp-item { 390 | padding-left: 30px !important; 391 | } 392 | 393 | .grp-title { 394 | padding-bottom: 0px !important; 395 | } 396 | 397 | .grp-title label { 398 | margin-bottom: 0px !important; 399 | font-weight: 800; 400 | text-transform: capitalize; 401 | } 402 | 403 | .grp-title:hover { 404 | background: none !important; 405 | } 406 | 407 | .loading-icon { 408 | width: 20px; 409 | position: absolute; 410 | right: 10px; 411 | top: 23px; 412 | z-index: 1; 413 | } 414 | 415 | .nodata-label { 416 | width: 100%; 417 | text-align: center; 418 | padding: 10px 0px 0px; 419 | } 420 | 421 | .btn-container { 422 | text-align: center; 423 | padding: 5px 5px 5px; 424 | } 425 | 426 | .btn-iceblue { 427 | } 428 | 429 | .clear-all { 430 | width: 8px; 431 | position: absolute; 432 | top: 50%; 433 | right: 30px; 434 | transform: translateY(-50%); 435 | } 436 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.interface.ts: -------------------------------------------------------------------------------- 1 | export interface DropdownSettings{ 2 | singleSelection?: boolean; 3 | text?: string; 4 | enableCheckAll? : boolean; 5 | selectAllText?: string; 6 | unSelectAllText?: string; 7 | filterSelectAllText?: string; 8 | filterUnSelectAllText?: string; 9 | enableFilterSelectAll?: boolean; 10 | enableSearchFilter?: boolean; 11 | searchBy?: string[]; 12 | maxHeight?: number; 13 | badgeShowLimit?: number; 14 | classes?: string; 15 | limitSelection?: number; 16 | disabled?: boolean; 17 | searchPlaceholderText?: string; 18 | groupBy?: string; 19 | showCheckbox?: boolean; 20 | noDataLabel?: string; 21 | searchAutofocus?: boolean; 22 | lazyLoading?: boolean; 23 | labelKey?: string; 24 | primaryKey?: string; 25 | position?:string; 26 | loading?: boolean; 27 | selectGroup?: boolean; 28 | addNewItemOnFilter?: boolean; 29 | addNewButtonText?: string; 30 | escapeToClose?: boolean; 31 | autoPosition?: boolean; 32 | clearAll?: boolean; 33 | tagToBody?: boolean; 34 | } 35 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.model.ts: -------------------------------------------------------------------------------- 1 | export class MyException { 2 | status : number; 3 | body : any; 4 | constructor(status : number, body : any) { 5 | this.status = status; 6 | this.body = body; 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable, Subject } from 'rxjs'; 3 | 4 | 5 | @Injectable() 6 | export class DataService { 7 | 8 | filteredData: any = []; 9 | private subject = new Subject(); 10 | 11 | setData(data: any) { 12 | 13 | this.filteredData = data; 14 | this.subject.next(data); 15 | } 16 | getData(): Observable { 17 | return this.subject.asObservable(); 18 | } 19 | getFilteredData() { 20 | if (this.filteredData && this.filteredData.length > 0) { 21 | return this.filteredData; 22 | } 23 | else { 24 | return []; 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/defaultoptions.ts: -------------------------------------------------------------------------------- 1 | export interface VirtualScrollerDefaultOptions { 2 | scrollThrottlingTime: number; 3 | scrollDebounceTime: number; 4 | scrollAnimationTime: number; 5 | scrollbarWidth?: number; 6 | scrollbarHeight?: number; 7 | checkResizeInterval: number 8 | resizeBypassRefreshThreshold: number, 9 | modifyOverflowStyleOfParentScroll: boolean, 10 | stripedTable: boolean 11 | } 12 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/idimension.ts: -------------------------------------------------------------------------------- 1 | export interface IDimensions { 2 | itemCount: number; 3 | itemsPerWrapGroup: number; 4 | wrapGroupsPerPage: number; 5 | itemsPerPage: number; 6 | pageCount_fractional: number; 7 | childWidth: number; 8 | childHeight: number; 9 | scrollLength: number; 10 | viewportLength: number; 11 | maxScrollPosition: number; 12 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/ipageinfo.ts: -------------------------------------------------------------------------------- 1 | export interface IPageInfo { 2 | startIndex: number; 3 | endIndex: number; 4 | scrollStartPosition: number; 5 | scrollEndPosition: number; 6 | startIndexWithBuffer: number; 7 | endIndexWithBuffer: number; 8 | maxScrollPosition: number; 9 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/iviewport.ts: -------------------------------------------------------------------------------- 1 | 2 | import { IPageInfo } from './ipageinfo'; 3 | 4 | export interface IViewport extends IPageInfo { 5 | padding: number; 6 | scrollLength: number; 7 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/pageinfo.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/pageinfo.ts -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/wrapgroupdimension.ts: -------------------------------------------------------------------------------- 1 | export interface WrapGroupDimension { 2 | childWidth: number; 3 | childHeight: number; 4 | items: any[]; 5 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/lib/virtual-scroll/wrapgroupdimensions.ts: -------------------------------------------------------------------------------- 1 | 2 | import { WrapGroupDimension } from './wrapgroupdimension'; 3 | 4 | export interface WrapGroupDimensions { 5 | numberOfKnownWrapGroupChildSizes: number; 6 | sumOfKnownWrapGroupChildWidths: number; 7 | sumOfKnownWrapGroupChildHeights: number; 8 | maxChildSizePerWrapGroup: WrapGroupDimension[]; 9 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/public_api.ts: -------------------------------------------------------------------------------- 1 | export { AngularMultiSelect } from './lib/multiselect.component'; 2 | export { ClickOutsideDirective,ScrollDirective,styleDirective,setPosition } from './lib/clickOutside'; 3 | export { ListFilterPipe } from './lib/list-filter'; 4 | export { Item } from './lib/menu-item'; 5 | export { TemplateRenderer,Badge,Search,CIcon } from './lib/menu-item'; 6 | export { AngularMultiSelectModule } from './lib/multiselect.component'; -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone'; 4 | import 'zone.js/dist/zone-testing'; 5 | import { getTestBed } from '@angular/core/testing'; 6 | import { 7 | BrowserDynamicTestingModule, 8 | platformBrowserDynamicTesting 9 | } from '@angular/platform-browser-dynamic/testing'; 10 | 11 | // First, initialize the Angular testing environment. 12 | getTestBed().initTestEnvironment( 13 | BrowserDynamicTestingModule, 14 | platformBrowserDynamicTesting() 15 | ); 16 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/themes/dark.theme.scss: -------------------------------------------------------------------------------- 1 | 2 | $base-color: #000000; 3 | $btn-background: #fff; 4 | $btn-border: #ccc; 5 | $btn-text-color: #333; 6 | $btn-arrow: #333; 7 | 8 | 9 | $token-background: $base-color; 10 | $token-text-color: #fff; 11 | $token-remove-color: #fff; 12 | 13 | $box-shadow-color: #959595; 14 | $list-hover-background: #f5f5f5; 15 | $label-color: #000; 16 | $selected-background: #e9f4ff; 17 | 18 | .c-btn{ 19 | background: $btn-background; 20 | border: 1px solid $btn-border; 21 | color: $btn-text-color; 22 | } 23 | .selected-list{ 24 | .c-list{ 25 | .c-token{ 26 | background: $token-background; 27 | .c-label{ 28 | color: $token-text-color; 29 | } 30 | .c-remove { 31 | svg { 32 | fill: $token-remove-color; 33 | } 34 | } 35 | 36 | } 37 | } 38 | .c-angle-down, .c-angle-up{ 39 | svg { 40 | fill: $btn-arrow; 41 | } 42 | } 43 | } 44 | .dropdown-list{ 45 | ul{ 46 | li:hover{ 47 | background: $list-hover-background; 48 | } 49 | } 50 | } 51 | .arrow-up, .arrow-down { 52 | border-bottom: 15px solid #fff; 53 | } 54 | 55 | .arrow-2{ 56 | border-bottom: 15px solid #ccc; 57 | } 58 | .list-area{ 59 | border: 1px solid #ccc; 60 | background: #fff; 61 | box-shadow: 0px 1px 5px $box-shadow-color; 62 | } 63 | .select-all{ 64 | border-bottom: 1px solid #ccc; 65 | } 66 | .list-filter{ 67 | border-bottom: 1px solid #ccc; 68 | .c-search{ 69 | svg { 70 | fill: #888; 71 | } 72 | } 73 | .c-clear { 74 | svg { 75 | fill: #888; 76 | } 77 | } 78 | } 79 | 80 | .pure-checkbox { 81 | input[type="checkbox"]:focus + label:before, input[type="checkbox"]:hover + label:before{ 82 | border-color: $base-color; 83 | background-color: #f2f2f2; 84 | } 85 | input[type="checkbox"] + label{ 86 | color: $label-color; 87 | } 88 | input[type="checkbox"] + label:before{ 89 | color: $base-color; 90 | border: 2px solid $base-color; 91 | } 92 | input[type="checkbox"] + label:after{ 93 | background-color: $base-color; 94 | } 95 | input[type="checkbox"]:disabled + label:before{ 96 | border-color: #cccccc; 97 | } 98 | input[type="checkbox"]:disabled:checked + label:before{ 99 | background-color: #cccccc; 100 | } 101 | input[type="checkbox"] + label:after{ 102 | border-color: #ffffff; 103 | } 104 | input[type="radio"]:checked + label:before{ 105 | background-color: white; 106 | } 107 | input[type="checkbox"]:checked + label:before{ 108 | background: $base-color; 109 | } 110 | } 111 | .selected-item{ 112 | background: $selected-background; 113 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/themes/default.theme.css: -------------------------------------------------------------------------------- 1 | .mat-toolbar { 2 | background: #ffffff; } 3 | 4 | .c-btn { 5 | background: #fff; 6 | border: 1px solid #ccc; 7 | color: #333; } 8 | 9 | .selected-list .c-list .c-token { 10 | background: #0079FE; } 11 | .selected-list .c-list .c-token .c-label { 12 | color: #fff; } 13 | .selected-list .c-list .c-token .c-remove svg { 14 | fill: #fff; } 15 | 16 | .selected-list .c-angle-down svg, .selected-list .c-angle-up svg { 17 | fill: #333; } 18 | 19 | .dropdown-list ul li:hover { 20 | background: #f5f5f5; } 21 | 22 | .arrow-up, .arrow-down { 23 | border-bottom: 15px solid #fff; } 24 | 25 | .arrow-2 { 26 | border-bottom: 15px solid #ccc; } 27 | 28 | .list-area { 29 | border: 1px solid #ccc; 30 | background: #fff; 31 | box-shadow: 0px 1px 5px #959595; } 32 | 33 | .select-all { 34 | border-bottom: 1px solid #ccc; } 35 | 36 | .list-filter { 37 | border-bottom: 1px solid #ccc; } 38 | .list-filter .c-search svg { 39 | fill: #888; } 40 | .list-filter .c-clear svg { 41 | fill: #888; } 42 | 43 | .pure-checkbox input[type="checkbox"]:focus + label:before, .pure-checkbox input[type="checkbox"]:hover + label:before { 44 | border-color: #0079FE; 45 | background-color: #f2f2f2; } 46 | 47 | .pure-checkbox input[type="checkbox"] + label { 48 | color: #000; } 49 | 50 | .pure-checkbox input[type="checkbox"] + label:before { 51 | color: #0079FE; 52 | border: 1px solid #0079FE; } 53 | 54 | .pure-checkbox input[type="checkbox"] + label:after { 55 | background-color: #0079FE; } 56 | 57 | .pure-checkbox input[type="checkbox"]:disabled + label:before { 58 | border-color: #cccccc; } 59 | 60 | .pure-checkbox input[type="checkbox"]:disabled:checked + label:before { 61 | background-color: #cccccc; } 62 | 63 | .pure-checkbox input[type="checkbox"] + label:after { 64 | border-color: #ffffff; } 65 | 66 | .pure-checkbox input[type="radio"]:checked + label:before { 67 | background-color: white; } 68 | 69 | .pure-checkbox input[type="checkbox"]:checked + label:before { 70 | background: #0079FE; } 71 | 72 | .single-select-mode .pure-checkbox input[type="checkbox"]:focus + label:before, .single-select-mode .pure-checkbox input[type="checkbox"]:hover + label:before { 73 | border-color: #0079FE; 74 | background-color: #f2f2f2; } 75 | 76 | .single-select-mode .pure-checkbox input[type="checkbox"] + label { 77 | color: #000; } 78 | 79 | .single-select-mode .pure-checkbox input[type="checkbox"] + label:before { 80 | color: transparent !important; 81 | border: 0px solid #0079FE; } 82 | 83 | .single-select-mode .pure-checkbox input[type="checkbox"] + label:after { 84 | background-color: transparent !important; } 85 | 86 | .single-select-mode .pure-checkbox input[type="checkbox"]:disabled + label:before { 87 | border-color: #cccccc; } 88 | 89 | .single-select-mode .pure-checkbox input[type="checkbox"]:disabled:checked + label:before { 90 | background-color: #cccccc; } 91 | 92 | .single-select-mode .pure-checkbox input[type="checkbox"] + label:after { 93 | border-color: #0079FE; } 94 | 95 | .single-select-mode .pure-checkbox input[type="radio"]:checked + label:before { 96 | background-color: white; } 97 | 98 | .single-select-mode .pure-checkbox input[type="checkbox"]:checked + label:before { 99 | background: none !important; } 100 | 101 | .selected-item { 102 | background: #e9f4ff; } 103 | 104 | .btn-iceblue { 105 | background: #0079FE; 106 | border: 1px solid #ccc; 107 | color: #fff; } 108 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/themes/default.theme.scss: -------------------------------------------------------------------------------- 1 | 2 | $default-color: #ffffff; 3 | $base-color: #0079FE; 4 | $btn-background: #fff; 5 | $btn-border: #ccc; 6 | $btn-text-color: #333; 7 | $btn-arrow: #333; 8 | 9 | 10 | $token-background: $base-color; 11 | $token-text-color: #fff; 12 | $token-remove-color: #fff; 13 | 14 | $box-shadow-color: #959595; 15 | $list-hover-background: #f5f5f5; 16 | $label-color: #000; 17 | $selected-background: #e9f4ff; 18 | 19 | 20 | 21 | .mat-toolbar { 22 | background: $default-color; 23 | } 24 | .c-btn{ 25 | background: $btn-background; 26 | border: 1px solid $btn-border; 27 | color: $btn-text-color; 28 | } 29 | .selected-list{ 30 | .c-list{ 31 | .c-token{ 32 | background: $token-background; 33 | .c-label{ 34 | color: $token-text-color; 35 | } 36 | .c-remove { 37 | svg { 38 | fill: $token-remove-color; 39 | } 40 | } 41 | 42 | } 43 | } 44 | .c-angle-down, .c-angle-up{ 45 | svg { 46 | fill: $btn-arrow; 47 | } 48 | } 49 | } 50 | .dropdown-list{ 51 | ul{ 52 | li:hover{ 53 | background: $list-hover-background; 54 | } 55 | } 56 | } 57 | .arrow-up, .arrow-down { 58 | border-bottom: 15px solid #fff; 59 | } 60 | 61 | .arrow-2{ 62 | border-bottom: 15px solid #ccc; 63 | } 64 | .list-area{ 65 | border: 1px solid #ccc; 66 | background: #fff; 67 | box-shadow: 0px 1px 5px $box-shadow-color; 68 | } 69 | .select-all{ 70 | border-bottom: 1px solid #ccc; 71 | } 72 | .list-filter{ 73 | border-bottom: 1px solid #ccc; 74 | .c-search{ 75 | svg { 76 | fill: #888; 77 | } 78 | } 79 | .c-clear { 80 | svg { 81 | fill: #888; 82 | } 83 | } 84 | } 85 | 86 | .pure-checkbox { 87 | input[type="checkbox"]:focus + label:before, input[type="checkbox"]:hover + label:before{ 88 | border-color: $base-color; 89 | background-color: #f2f2f2; 90 | } 91 | input[type="checkbox"] + label{ 92 | color: $label-color; 93 | } 94 | input[type="checkbox"] + label:before{ 95 | color: $base-color; 96 | border: 1px solid $base-color; 97 | } 98 | input[type="checkbox"] + label:after{ 99 | background-color: $base-color; 100 | } 101 | input[type="checkbox"]:disabled + label:before{ 102 | border-color: #cccccc; 103 | } 104 | input[type="checkbox"]:disabled:checked + label:before{ 105 | background-color: #cccccc; 106 | } 107 | input[type="checkbox"] + label:after{ 108 | border-color: #ffffff; 109 | } 110 | input[type="radio"]:checked + label:before{ 111 | background-color: white; 112 | } 113 | input[type="checkbox"]:checked + label:before{ 114 | background: $base-color; 115 | } 116 | } 117 | .single-select-mode .pure-checkbox { 118 | input[type="checkbox"]:focus + label:before, input[type="checkbox"]:hover + label:before{ 119 | border-color: $base-color; 120 | background-color: #f2f2f2; 121 | } 122 | input[type="checkbox"] + label{ 123 | color: $label-color; 124 | } 125 | input[type="checkbox"] + label:before{ 126 | color: transparent !important; 127 | border: 0px solid $base-color; 128 | } 129 | input[type="checkbox"] + label:after{ 130 | background-color: transparent !important; 131 | } 132 | input[type="checkbox"]:disabled + label:before{ 133 | border-color: #cccccc; 134 | } 135 | input[type="checkbox"]:disabled:checked + label:before{ 136 | background-color: #cccccc; 137 | } 138 | input[type="checkbox"] + label:after{ 139 | border-color: $base-color; 140 | } 141 | input[type="radio"]:checked + label:before{ 142 | background-color: white; 143 | } 144 | input[type="checkbox"]:checked + label:before{ 145 | background: none !important; 146 | } 147 | } 148 | .selected-item{ 149 | background: $selected-background; 150 | } 151 | .btn-iceblue { 152 | background: $base-color; 153 | border: 1px solid $btn-border; 154 | color: #fff; 155 | } -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/lib", 6 | "declaration": true, 7 | "declarationMap": true, 8 | "inlineSources": true, 9 | "types": [], 10 | "lib": [ 11 | "dom", 12 | "es2018" 13 | ] 14 | }, 15 | "angularCompilerOptions": { 16 | "skipTemplateCodegen": true, 17 | "strictMetadataEmit": true, 18 | "enableResourceInlining": true 19 | }, 20 | "exclude": [ 21 | "src/test.ts", 22 | "**/*.spec.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.lib.json", 4 | "compilerOptions": { 5 | "declarationMap": false 6 | }, 7 | "angularCompilerOptions": { 8 | "enableIvy": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /projects/angular2-multiselect-dropdown-lib/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 48 | 49 |
50 |
51 | 65 |
66 |

{{ currentComponent.label }}

67 | 85 |
86 |
87 |
88 | 90 | 92 |
93 |
94 |
-------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | @import "node_modules/bootstrap/scss/functions"; 2 | 3 | @import "node_modules/bootstrap/scss/variables"; 4 | 5 | .example-spacer { 6 | flex: 1 1 auto; 7 | } 8 | .mat-toolbar { 9 | position: sticky; 10 | position: -webkit-sticky; /* For macOS/iOS Safari */ 11 | top: 0; /* Sets the sticky toolbar to be on top */ 12 | z-index: 1000; /* Ensure that your app's content doesn't overlap the toolbar */ 13 | } 14 | .left-section { 15 | max-width: 250px !important; 16 | width: 250px !important; 17 | position: fixed; 18 | display: flex; 19 | height: calc(100vh - 64px); 20 | overflow: auto; 21 | border-right: 1px solid #ccc; 22 | } 23 | .center-section { 24 | max-width: initial !important; 25 | margin-left: 250px; 26 | padding-top: 10px; 27 | } 28 | .right-section { 29 | max-width: 300px !important; 30 | } 31 | .mat-grid-list { 32 | height: calc(100vh - 64px) !important; 33 | } 34 | .left-sidebar { 35 | position: fixed; 36 | top: 65px; 37 | height: calc(100vh - 75px); 38 | padding-right: 0px; 39 | overflow: hidden; 40 | } 41 | .left-sidebar, .right-sidebar { 42 | width: 260px; 43 | } 44 | .left-sidebar:hover { 45 | overflow: auto; 46 | 47 | } 48 | 49 | .outer-wrapper { 50 | padding: 30px; 51 | } 52 | .center-content{ 53 | border-right: $border-width solid $gray-300; 54 | } 55 | @media (min-width: 768px) { 56 | .center-content { 57 | margin-left: 265px; 58 | } 59 | } 60 | .nav-sub{ 61 | width: 100%; 62 | box-shadow: none; 63 | margin-bottom: 6px; 64 | padding: 0px; 65 | margin-top: 50px; 66 | } 67 | .nav-wrapper { 68 | padding: 0px 10px; 69 | } 70 | .list-group-item { 71 | padding-top: 0.5rem; 72 | padding-bottom: 0.5rem; 73 | } 74 | 75 | 76 | 77 | .sidebar { 78 | position: fixed; 79 | top: 0; 80 | /* rtl:raw: 81 | right: 0; 82 | */ 83 | bottom: 0; 84 | /* rtl:remove */ 85 | left: 0; 86 | z-index: 100; /* Behind the navbar */ 87 | padding: 60px 0 0; /* Height of navbar */ 88 | overflow: auto; 89 | width: 250px; 90 | border-right: $border-width solid $gray-300; 91 | } 92 | 93 | @media (max-width: 767.98px) { 94 | .sidebar { 95 | top: 5rem; 96 | } 97 | } 98 | 99 | .sidebar-sticky { 100 | position: relative; 101 | top: 0; 102 | height: calc(100vh - 48px); 103 | padding-top: .5rem; 104 | overflow-x: hidden; 105 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 106 | } 107 | 108 | .sidebar .nav-link .feather { 109 | margin-right: 4px; 110 | color: #727272; 111 | } 112 | 113 | .sidebar .nav-link.active { 114 | color: #007bff; 115 | } 116 | 117 | .sidebar .nav-link:hover .feather, 118 | .sidebar .nav-link.active .feather { 119 | color: inherit; 120 | } 121 | 122 | .sidebar-heading { 123 | font-size: .75rem; 124 | text-transform: uppercase; 125 | } 126 | .center-content { 127 | margin-left: 250px !important; 128 | } 129 | .ad-container { 130 | flex: 0 0 300px; 131 | } -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { AppComponent } from './app.component'; 5 | 6 | describe('AppComponent', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | }); 13 | TestBed.compileComponents(); 14 | }); 15 | 16 | it('should create the app', async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app).toBeTruthy(); 20 | })); 21 | 22 | it(`should have as title 'app works!'`, async(() => { 23 | const fixture = TestBed.createComponent(AppComponent); 24 | const app = fixture.debugElement.componentInstance; 25 | expect(app.title).toEqual('app works!'); 26 | })); 27 | 28 | it('should render title in a h1 tag', async(() => { 29 | const fixture = TestBed.createComponent(AppComponent); 30 | fixture.detectChanges(); 31 | const compiled = fixture.debugElement.nativeElement; 32 | expect(compiled.querySelector('h1').textContent).toContain('app works!'); 33 | })); 34 | }); 35 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; 5 | import { MockService } from './examples/mock-data'; 6 | import { AppComponent } from './app.component'; 7 | import { AngularMultiSelectModule } from '../../projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.component'; 8 | import { AppRouterModule } from './app.router'; 9 | import { BasicExample } from './examples/basic'; 10 | import { SingleSelectionExample } from './examples/singleselection'; 11 | import { GroupByExample } from './examples/groupBy'; 12 | import { SearchFilterExample } from './examples/searchFilter'; 13 | import { TemplatingExample } from './examples/templating'; 14 | import { ResetDropdownExample } from './examples/resetdropdown'; 15 | import { DisableModeExample } from './examples/disablemode'; 16 | import {LimitSelectionExample } from './examples/limitselection'; 17 | import {LimitBadgesExample } from './examples/limitbadges'; 18 | import { CustomPlaceholderExample } from './examples/customplaceholder'; 19 | import { StylingExample } from './examples/styling'; 20 | import { ng2Gist } from './examples/gist'; 21 | import { UsingWithFormExample } from './examples/usingWithForms'; 22 | import { UsingWithReactiveFormExample } from './examples/usingInReactForms'; 23 | import { LazyLoadingExample } from './examples/lazyLoading'; 24 | import { MultipleDropdownsExample } from './examples/multipleDropdowns'; 25 | import { DynamicDataSetsExample } from './examples/dynamicDataSets'; 26 | import { ThemingExample } from './examples/theming'; 27 | import { RemoteDataExample } from './examples/remoteData'; 28 | import { CustomSearchExample } from './examples/customSearch'; 29 | import { SearchFilterByOnePropertyExample } from './examples/searchByOneProperty'; 30 | import {LazyLoadingRemoteDataExample } from './examples/lazyLoadingRemoteData'; 31 | import {SearchFilterAddItemExample } from './examples/searchFilterAddNewItem'; 32 | import { EventsExample } from './examples/events'; 33 | import { HighlightModule } from 'ngx-highlightjs'; 34 | import { UsingInListExample } from './examples/usingInList'; 35 | import {SourceTab} from './components/sourcetab/sourcetab.component'; 36 | import { ServiceWorkerModule } from '@angular/service-worker'; 37 | import { environment } from '../environments/environment'; 38 | import { CheckForUpdateService } from './check-for-update.service'; 39 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 40 | import { DialogContentExampleDialog, UsingWithinDialog } from './examples/usingWithinDialog'; 41 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 42 | import { AdsenseModule } from 'ng2-adsense'; 43 | 44 | @NgModule({ declarations: [ 45 | AppComponent, 46 | ng2Gist, 47 | BasicExample, 48 | SingleSelectionExample, 49 | GroupByExample, 50 | SearchFilterExample, 51 | TemplatingExample, 52 | ResetDropdownExample, 53 | DisableModeExample, 54 | LimitSelectionExample, 55 | LimitBadgesExample, 56 | CustomPlaceholderExample, 57 | StylingExample, 58 | UsingWithFormExample, 59 | UsingWithReactiveFormExample, 60 | LazyLoadingExample, 61 | MultipleDropdownsExample, 62 | DynamicDataSetsExample, 63 | ThemingExample, 64 | RemoteDataExample, 65 | CustomSearchExample, 66 | SearchFilterByOnePropertyExample, 67 | LazyLoadingRemoteDataExample, 68 | SearchFilterAddItemExample, 69 | EventsExample, 70 | UsingInListExample, 71 | SourceTab, 72 | DialogContentExampleDialog, 73 | UsingWithinDialog 74 | ], 75 | bootstrap: [AppComponent], imports: [BrowserModule.withServerTransition({ appId: 'serverApp' }), 76 | ReactiveFormsModule, 77 | FormsModule, 78 | AppRouterModule, 79 | AngularMultiSelectModule, 80 | AdsenseModule.forRoot(), 81 | NgbModule, 82 | HighlightModule, 83 | ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), 84 | BrowserAnimationsModule], providers: [MockService, CheckForUpdateService, provideHttpClient(withInterceptorsFromDi())] }) 85 | export class AppModule { } 86 | -------------------------------------------------------------------------------- /src/app/app.prerender.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ServerModule, ServerTransferStateModule } from '@angular/platform-server'; 3 | 4 | import { AppModule } from './app.module'; 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | AppModule, 10 | ServerModule, 11 | ServerTransferStateModule 12 | ], 13 | bootstrap: [AppComponent] 14 | }) 15 | export class AppPrerenderModule { 16 | } -------------------------------------------------------------------------------- /src/app/app.server.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ServerModule } from '@angular/platform-server'; 3 | 4 | import { AppModule } from './app.module'; 5 | import { AppComponent } from './app.component'; 6 | import { ModuleMapLoaderModule } from '@nguniversal/module-map-ngfactory-loader'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | AppModule, 11 | ServerModule, 12 | ModuleMapLoaderModule, 13 | ], 14 | bootstrap: [AppComponent], 15 | }) 16 | export class AppServerModule {} 17 | -------------------------------------------------------------------------------- /src/app/check-for-update.service.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationRef, Injectable } from '@angular/core'; 2 | import { SwUpdate } from '@angular/service-worker'; 3 | import { concat, interval } from 'rxjs'; 4 | import { first } from 'rxjs/operators'; 5 | 6 | @Injectable() 7 | export class CheckForUpdateService { 8 | 9 | constructor(appRef: ApplicationRef, updates: SwUpdate) { 10 | // Allow the app to stabilize first, before starting polling for updates with `interval()`. 11 | const appIsStable$ = appRef.isStable.pipe(first(isStable => isStable === true)); 12 | const everySixHours$ = interval(24* 60 * 60 * 1000); 13 | const everySixHoursOnceAppIsStable$ = concat(appIsStable$, everySixHours$); 14 | 15 | everySixHoursOnceAppIsStable$.subscribe(() => { 16 | console.log("checking for update"); 17 | updates.checkForUpdate(); 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /src/app/components/sourcetab/sourcetab.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/app/components/sourcetab/sourcetab.component.css -------------------------------------------------------------------------------- /src/app/components/sourcetab/sourcetab.component.html: -------------------------------------------------------------------------------- 1 | 21 |
-------------------------------------------------------------------------------- /src/app/components/sourcetab/sourcetab.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, OnInit} from '@angular/core' 2 | 3 | 4 | @Component({ 5 | selector: 'cuppa-source', 6 | templateUrl: './sourcetab.component.html', 7 | styleUrls: ['./sourcetab.component.css'] 8 | 9 | }) 10 | export class SourceTab implements OnInit { 11 | @Input() 12 | tstitle: string 13 | 14 | @Input() 15 | htmltitle: string 16 | 17 | @Input() 18 | csstitle: string 19 | 20 | @Input() 21 | tsgist: string 22 | 23 | @Input() 24 | htmlgist: string 25 | 26 | @Input() 27 | cssgist: string 28 | 29 | active = 1; 30 | constructor(){} 31 | ngOnInit(){ 32 | 33 | } 34 | } -------------------------------------------------------------------------------- /src/app/examples/basic.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Title, Meta } from '@angular/platform-browser'; 3 | import { DropdownSettings } from 'projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.interface'; 4 | @Component({ 5 | templateUrl: './views/view.html' 6 | }) 7 | export class BasicExample implements OnInit { 8 | 9 | itemList = []; 10 | selectedItems = []; 11 | settings: DropdownSettings = {}; 12 | 13 | constructor(public seotitle: Title, public meta: Meta) { 14 | this.seotitle.setTitle('Basic example'); 15 | this.meta.addTags([ 16 | {name: 'description', content:'Basic example of angular multiselect drodown.'} 17 | ]); 18 | } 19 | ngOnInit() { 20 | 21 | this.itemList = [ 22 | { "countryId": 1, "itemName": "India" }, 23 | { "countryId": 2, "itemName": "Singapore" }, 24 | { "countryId": 3, "itemName": "Australia" }, 25 | { "countryId": 4, "itemName": "Canada" }, 26 | { "countryId": 5, "itemName": "South Korea" }, 27 | { "countryId": 6, "itemName": "Brazil" } 28 | ]; 29 | 30 | this.selectedItems = [ 31 | { "countryId": 1, "itemName": "India" }, 32 | { "countryId": 2, "itemName": "Singapore" }, 33 | { "countryId": 3, "itemName": "Australia" }, 34 | { "countryId": 4, "itemName": "Canada" }, 35 | { "countryId": 5, "itemName": "South Korea" }]; 36 | 37 | this.settings = { 38 | text: "Select Countries", 39 | selectAllText: 'Select All', 40 | unSelectAllText: 'UnSelect All', 41 | classes: "myclass custom-class", 42 | primaryKey: "countryId", 43 | enableSearchFilter: true, 44 | tagToBody: true, 45 | }; 46 | } 47 | onItemSelect(item: any) { 48 | console.log(item); 49 | console.log(this.selectedItems); 50 | } 51 | OnItemDeSelect(item: any) { 52 | console.log(item); 53 | console.log(this.selectedItems); 54 | } 55 | onSelectAll(items: any) { 56 | console.log(items); 57 | } 58 | onDeSelectAll(items: any) { 59 | console.log(items); 60 | } 61 | cssgist: boolean = false; 62 | title: string = "Basic example"; 63 | tsgist: string = "CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235"; 64 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 65 | tstitle: string = "basic.ts" 66 | htmltitle: string = "basic.html"; 67 | } 68 | -------------------------------------------------------------------------------- /src/app/examples/customSearch.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | @Component({ 5 | templateUrl: './views/customSearch.html' 6 | }) 7 | export class CustomSearchExample implements OnInit { 8 | 9 | itemList: any = []; 10 | selectedItems = []; 11 | settings = {}; 12 | filter = ""; 13 | constructor(private http: HttpClient) { } 14 | ngOnInit() { 15 | 16 | this.settings = { 17 | text: "Select Countries", 18 | selectAllText: 'Select All', 19 | unSelectAllText: 'UnSelect All', 20 | classes: "myclass custom-class", 21 | primaryKey: "alpha3Code", 22 | labelKey: "name", 23 | noDataLabel: "Search Countries...", 24 | enableSearchFilter: true, 25 | searchBy: ['name', 'capital'], 26 | tagToBody: true, 27 | }; 28 | } 29 | onItemSelect(item: any) { 30 | console.log(item); 31 | console.log(this.selectedItems); 32 | } 33 | OnItemDeSelect(item: any) { 34 | console.log(item); 35 | console.log(this.selectedItems); 36 | } 37 | onSelectAll(items: any) { 38 | console.log(items); 39 | } 40 | onDeSelectAll(items: any) { 41 | console.log(items); 42 | } 43 | onSearch(evt: any) { 44 | console.log(evt.target.value); 45 | this.itemList = []; 46 | this.http.get('https://restcountries.eu/rest/v2/name/'+evt.target.value+'?fulltext=true') 47 | .subscribe(res => { 48 | console.log(res); 49 | this.itemList = res; 50 | }, error => { 51 | 52 | }); 53 | } 54 | onClose(){ 55 | this.itemList = []; 56 | this.filter = ""; 57 | } 58 | cssgist: boolean = false; 59 | title: string = "Custom Search / Search from API"; 60 | tsgist: string = "CuppaLabs/1bab5ecbbb22727eb0afe49848a454f0"; 61 | htmlgist: string = "CuppaLabs/7f0d8ea9f9cfe9eec2cc1699affd2c14"; 62 | tstitle: string = "customSearch.ts" 63 | htmltitle: string = "customSearch.html"; 64 | } 65 | -------------------------------------------------------------------------------- /src/app/examples/customplaceholder.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class CustomPlaceholderExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India" }, 20 | { "id": 2, "itemName": "Singapore" }, 21 | { "id": 3, "itemName": "Australia" }, 22 | { "id": 4, "itemName": "Canada" }, 23 | { "id": 5, "itemName": "South Korea" }, 24 | { "id": 6, "itemName": "Brazil" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India" }, 29 | { "id": 2, "itemName": "Singapore" }, 30 | { "id": 3, "itemName": "Australia" }, 31 | { "id": 4, "itemName": "Canada" }]; 32 | this.settings = { 33 | text: "Select Countries", 34 | selectAllText: 'Select All', 35 | unSelectAllText: 'UnSelect All', 36 | enableSearchFilter: true, 37 | classes: "myclass custom-class", 38 | searchPlaceholderText: "Custom Placeholder text", 39 | tagToBody: true, 40 | }; 41 | } 42 | onItemSelect(item: any) { 43 | console.log(item); 44 | console.log(this.selectedItems); 45 | } 46 | OnItemDeSelect(item: any) { 47 | console.log(item); 48 | console.log(this.selectedItems); 49 | } 50 | onSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onDeSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | cssgist: boolean = false; 57 | title: string = "Custom search placeholder"; 58 | tsgist: string = "CuppaLabs/48c087b6c0b4381d5bae1c689cc0ee3e"; 59 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 60 | tstitle: string = "customPlaceholder.ts" 61 | htmltitle: string = "customPlaceholder.html"; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/examples/disablemode.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/disableMode.html' 5 | }) 6 | export class DisableModeExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings: any = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India" }, 20 | { "id": 2, "itemName": "Singapore" }, 21 | { "id": 3, "itemName": "Australia" }, 22 | { "id": 4, "itemName": "Canada" }, 23 | { "id": 5, "itemName": "South Korea" }, 24 | { "id": 6, "itemName": "Brazil" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India" }, 29 | { "id": 2, "itemName": "Singapore" }, 30 | { "id": 3, "itemName": "Australia" }, 31 | { "id": 4, "itemName": "Canada" }]; 32 | this.settings = { 33 | text: "Select Countries", 34 | selectAllText: 'Select All', 35 | unSelectAllText: 'UnSelect All', 36 | enableSearchFilter: false, 37 | classes: "myclass custom-class", 38 | disabled: true, 39 | tagToBody: true 40 | }; 41 | } 42 | onItemSelect(item: any) { 43 | console.log(item); 44 | console.log(this.selectedItems); 45 | } 46 | OnItemDeSelect(item: any) { 47 | console.log(item); 48 | console.log(this.selectedItems); 49 | } 50 | onSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onDeSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | showModel() { 57 | console.log(this.selectedItems); 58 | } 59 | changeData() { 60 | this.selectedItems = []; 61 | } 62 | disable() { 63 | this.settings = { 64 | text: "Select Countries", 65 | selectAllText: 'Select All', 66 | unSelectAllText: 'UnSelect All', 67 | enableSearchFilter: false, 68 | classes: "myclass custom-class", 69 | disabled: true 70 | }; 71 | } 72 | enable() { 73 | this.settings = { 74 | text: "Select Countries", 75 | selectAllText: 'Select All', 76 | unSelectAllText: 'UnSelect All', 77 | enableSearchFilter: false, 78 | classes: "myclass custom-class", 79 | disabled: false 80 | }; 81 | } 82 | toggleDisable() { 83 | console.log(this.settings); 84 | this.settings = { 85 | text: "Select Countries", 86 | selectAllText: 'Select All', 87 | unSelectAllText: 'UnSelect All', 88 | enableSearchFilter: false, 89 | classes: "myclass custom-class", 90 | limitSelection: 2, 91 | disabled: false 92 | }; 93 | } 94 | cssgist: boolean = false; 95 | title: string = "Disable mode"; 96 | tsgist: string = "CuppaLabs/96f799302bdfa08e11b4420c86c1d720"; 97 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 98 | tstitle: string = "disableMode.ts" 99 | htmltitle: string = "disableMode.html"; 100 | } 101 | -------------------------------------------------------------------------------- /src/app/examples/dynamicDataSets.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MockService } from './mock-data'; 3 | 4 | @Component({ 5 | templateUrl: './views/dynamicData.html' 6 | }) 7 | export class DynamicDataSetsExample implements OnInit { 8 | 9 | itemList = []; 10 | selectedItems = []; 11 | settings = {}; 12 | 13 | constructor(private mockService: MockService) { } 14 | ngOnInit() { 15 | 16 | this.settings = { 17 | text: "Select Countries", 18 | selectAllText: 'Select All', 19 | unSelectAllText: 'UnSelect All', 20 | classes: "myclass custom-class", 21 | tagToBody: true 22 | }; 23 | this.loadDataSet2(); 24 | } 25 | onItemSelect(item: any) { 26 | console.log(item); 27 | console.log(this.selectedItems); 28 | } 29 | OnItemDeSelect(item: any) { 30 | console.log(item); 31 | console.log(this.selectedItems); 32 | } 33 | onSelectAll(items: any) { 34 | console.log(items); 35 | } 36 | onDeSelectAll(items: any) { 37 | console.log(items); 38 | } 39 | loadDataSet1() { 40 | this.settings = { 41 | text: "Select Fruits", 42 | selectAllText: 'Select All', 43 | unSelectAllText: 'UnSelect All', 44 | classes: "myclass custom-class" 45 | }; 46 | this.selectedItems = []; 47 | this.itemList = []; 48 | const tempArr = this.mockService.getFruits(); 49 | for (let i = 0; i < tempArr.length; ++i) { 50 | this.itemList.push(tempArr[i]); 51 | } 52 | } 53 | loadDataSet2() { 54 | this.settings = { 55 | text: "Select Countries", 56 | selectAllText: 'Select All', 57 | unSelectAllText: 'UnSelect All', 58 | classes: "myclass custom-class" 59 | }; 60 | this.selectedItems = []; 61 | this.itemList = []; 62 | const tempArr = this.mockService.getCountries(); 63 | for (let i = 0; i < tempArr.length; ++i) { 64 | this.itemList.push(tempArr[i]); 65 | } 66 | } 67 | cssgist: boolean = false; 68 | title: string = "Dynamic datasets loading"; 69 | tsgist: string = "CuppaLabs/302d580f91bc40611b2474558d98fbf2"; 70 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 71 | mockgist: string = "CuppaLabs/b3e947ec83710307a3b8680a2ff89693"; 72 | tstitle: string = "dynamicData.ts" 73 | htmltitle: string = "dynamicData.html"; 74 | mocktitle: string = "mock-data.ts"; 75 | } 76 | -------------------------------------------------------------------------------- /src/app/examples/events.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/events.html' 5 | }) 6 | export class EventsExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | selectedItemString: string = ''; 12 | unSelectedItemString: string = ''; 13 | openString: string = ''; 14 | closeString: string = ''; 15 | selectAllString: string = ''; 16 | unSelectAllString: string = ''; 17 | 18 | constructor() { } 19 | ngOnInit() { 20 | 21 | this.itemList = [ 22 | { "countryId": 1, "itemName": "India" }, 23 | { "countryId": 2, "itemName": "Singapore" }, 24 | { "countryId": 3, "itemName": "Australia" }, 25 | { "countryId": 4, "itemName": "Canada" }, 26 | { "countryId": 5, "itemName": "South Korea" }, 27 | { "countryId": 6, "itemName": "Brazil" } 28 | ]; 29 | 30 | this.selectedItems = [ 31 | { "countryId": 1, "itemName": "India" }, 32 | { "countryId": 2, "itemName": "Singapore" }, 33 | { "countryId": 3, "itemName": "Australia" }, 34 | { "countryId": 4, "itemName": "Canada" }]; 35 | 36 | this.settings = { 37 | text: "Select Countries", 38 | selectAllText: 'Select All', 39 | unSelectAllText: 'UnSelect All', 40 | classes: "myclass custom-class", 41 | primaryKey: "countryId", 42 | tagToBody: true 43 | }; 44 | } 45 | onItemSelect(item: any) { 46 | console.log(item); 47 | this.selectedItemString = JSON.stringify(item); 48 | console.log(this.selectedItems); 49 | } 50 | OnItemDeSelect(item: any) { 51 | console.log(item); 52 | this.unSelectedItemString = JSON.stringify(item); 53 | console.log(this.selectedItems); 54 | } 55 | onOpen(evt: any){ 56 | this.openString = "Dropdown opened: "+evt; 57 | } 58 | onClose(evt: any){ 59 | this.closeString = "Dropdown opened: "+evt; 60 | } 61 | onSelectAll(items: any) { 62 | console.log(items); 63 | this.selectAllString = JSON.stringify(items); 64 | this.unSelectAllString = ""; 65 | } 66 | onDeSelectAll(items: any) { 67 | console.log(items); 68 | this.selectAllString = ''; 69 | this.unSelectAllString = "all items un-selected"; 70 | } 71 | cssgist: boolean = false; 72 | title: string = "Events"; 73 | tsgist: string = "CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235"; 74 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 75 | tstitle: string = "basic.ts" 76 | htmltitle: string = "basic.html"; 77 | } 78 | -------------------------------------------------------------------------------- /src/app/examples/gist.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, ViewChild, ElementRef, AfterViewInit} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'ng2-gist', 5 | template:` 6 | 7 | `, 8 | styleUrls: [] 9 | }) 10 | 11 | export class ng2Gist implements AfterViewInit { 12 | @ViewChild('iframe', {static: true}) iframe:ElementRef; 13 | @Input() gistId; 14 | 15 | constructor() { } 16 | 17 | ngAfterViewInit() { 18 | this.iframe.nativeElement.id = 'gist-' + this.gistId; 19 | let doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentElement.contentWindow; 20 | let content = ` 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | `; 31 | doc.open(); 32 | doc.write(content); 33 | doc.close(); 34 | } 35 | } -------------------------------------------------------------------------------- /src/app/examples/groupBy.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/groupBy.html' 5 | }) 6 | export class GroupByExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India", "category": "asia" }, 20 | { "id": 2, "itemName": "Singapore", "category": "asia pacific" }, 21 | { "id": 3, "itemName": "Germany", "category": "Europe" }, 22 | { "id": 4, "itemName": "France", "category": "Europe" }, 23 | { "id": 5, "itemName": "South Korea", "category": "asia" }, 24 | { "id": 6, "itemName": "Sweden", "category": "Europe" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India", "category": "asia" }, 29 | { "id": 5, "itemName": "South Korea", "category": "asia" } 30 | ] 31 | this.settings = { 32 | singleSelection: false, 33 | text: "Select Fields", 34 | selectAllText: 'Select All', 35 | unSelectAllText: 'UnSelect All', 36 | searchPlaceholderText: 'Search Fields', 37 | enableSearchFilter: true, 38 | groupBy: "category", 39 | selectGroup: true, 40 | searchBy: ["itemName"], 41 | tagToBody: true 42 | }; 43 | } 44 | onItemSelect(item: any) { 45 | console.log(item); 46 | console.log(this.selectedItems); 47 | } 48 | OnItemDeSelect(item: any) { 49 | console.log(item); 50 | console.log(this.selectedItems); 51 | } 52 | onSelectAll(items: any) { 53 | console.log(items); 54 | } 55 | onDeSelectAll(items: any) { 56 | console.log(items); 57 | } 58 | onGroupSelect(selectedGroupItem){ 59 | console.log(selectedGroupItem); 60 | } 61 | onGroupDeSelect(deselectedGroupItem){ 62 | console.log(deselectedGroupItem); 63 | } 64 | onChange(e:any){ 65 | console.log(e) 66 | } 67 | loadDataSet1(){ 68 | this.selectedItems = []; 69 | this.itemList = [ { "id": 1, "itemName": "Apple", "category": "fruits" }, 70 | { "id": 2, "itemName": "Banana", "category": "fruits" }, 71 | { "id": 5, "itemName": "Tomatoe", "category": "vegetables" }, 72 | { "id": 6, "itemName": "Potatoe", "category": "vegetables" }]; 73 | } 74 | loadDataSet2(){ 75 | this.selectedItems = []; 76 | this.itemList = [ 77 | { "id": 1, "itemName": "India", "category": "asia" }, 78 | { "id": 2, "itemName": "Singapore", "category": "asia pacific" }, 79 | { "id": 3, "itemName": "Germany", "category": "Europe" }, 80 | { "id": 4, "itemName": "France", "category": "Europe" }, 81 | { "id": 5, "itemName": "South Korea", "category": "asia" }, 82 | { "id": 6, "itemName": "Sweden", "category": "Europe" } 83 | ]; 84 | } 85 | cssgist: boolean = false; 86 | title: string = "Group By"; 87 | tsgist: string = "CuppaLabs/f6c1328ade3201042a4b4d268a30ad8c"; 88 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 89 | tstitle: string = "groupBy.ts" 90 | htmltitle: string = "groupBy.html"; 91 | } 92 | -------------------------------------------------------------------------------- /src/app/examples/lazyLoading.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/lazyLoading.html' 5 | }) 6 | export class LazyLoadingExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | public categories: any = ["Indian", "American", "Canadian", "Chinese"]; 12 | public namesList:any[] = ["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher","Henderson","Coleman","Simmons","Patterson","Jordan","Reynolds","Hamilton","Graham","Kim","Gonzales","Alexander","Ramos","Wallace","Griffin","West","Cole","Hayes","Chavez","Gibson","Bryant","Ellis","Stevens","Murray","Ford","Marshall","Owens","Mcdonald","Harrison","Ruiz","Kennedy","Wells","Alvarez","Woods","Mendoza","Castillo","Olson","Webb","Washington","Tucker","Freeman","Burns","Henry","Vasquez","Snyder","Simpson","Crawford","Jimenez","Porter","Mason","Shaw","Gordon","Wagner","Hunter","Romero","Hicks","Dixon","Hunt","Palmer","Robertson","Black","Holmes","Stone","Meyer","Boyd","Mills","Warren","Fox","Rose","Rice","Moreno","Schmidt","Patel","Ferguson","Nichols","Herrera","Medina","Ryan","Fernandez","Weaver","Daniels","Stephens","Gardner","Payne","Kelley","Dunn","Pierce","Arnold","Tran","Spencer","Peters","Hawkins","Grant","Hansen","Castro","Hoffman","Hart","Elliott","Cunningham","Knight","Bradley","Carroll","Hudson","Duncan","Armstrong","Berry","Andrews","Johnston","Ray","Lane","Riley","Carpenter","Perkins","Aguilar","Silva","Richards","Willis","Matthews","Chapman","Lawrence","Garza","Vargas","Watkins","Wheeler","Larson","Carlson","Harper","George","Greene","Burke","Guzman","Morrison","Munoz","Jacobs","Obrien","Lawson","Franklin","Lynch","Bishop","Carr","Salazar","Austin","Mendez","Gilbert","Jensen","Williamson","Montgomery","Harvey","Oliver","Howell","Dean","Hanson","Weber","Garrett","Sims","Burton","Fuller","Soto","Mccoy","Welch","Chen","Schultz","Walters","Reid","Fields","Walsh","Little","Fowler","Bowman","Davidson","May","Day","Schneider","Newman","Brewer","Lucas","Holland","Wong","Banks","Santos","Curtis","Pearson","Delgado","Valdez","Pena","Rios","Douglas","Sandoval","Barrett","Hopkins","Keller","Guerrero","Stanley","Bates","Alvarado","Beck","Ortega","Wade","Estrada","Contreras","Barnett","Caldwell","Santiago","Lambert","Powers","Chambers","Nunez","Craig","Leonard","Lowe","Rhodes","Byrd","Gregory","Shelton","Frazier","Becker","Maldonado","Fleming","Vega","Sutton","Cohen","Jennings","Parks","Mcdaniel","Watts","Barker","Norris","Vaughn","Vazquez","Holt","Schwartz","Steele","Benson","Neal","Dominguez","Horton","Terry","Wolfe","Hale","Lyons","Graves","Haynes","Miles","Park","Warner","Padilla","Bush","Thornton","Mccarthy","Mann","Zimmerman","Erickson","Fletcher","Mckinney","Page","Dawson","Joseph","Marquez","Reeves","Klein","Espinoza","Baldwin","Moran","Love","Robbins","Higgins","Ball","Cortez","Le","Griffith","Bowen","Sharp","Cummings","Ramsey","Hardy","Swanson","Barber","Acosta","Luna","Chandler","Blair","Daniel","Cross","Simon","Dennis","Oconnor","Quinn","Gross","Navarro","Moss","Fitzgerald","Doyle","Mclaughlin","Rojas","Rodgers","Stevenson","Singh","Yang","Figueroa","Harmon","Newton","Paul","Manning","Garner","Mcgee","Reese","Francis","Burgess","Adkins","Goodman","Curry","Brady","Christensen","Potter","Walton","Goodwin","Mullins","Molina","Webster","Fischer","Campos","Avila","Sherman","Todd","Chang","Blake","Malone","Wolf","Hodges","Juarez","Gill","Farmer","Hines","Gallagher","Duran","Hubbard","Cannon","Miranda","Wang","Saunders","Tate","Mack","Hammond","Carrillo","Townsend","Wise","Ingram","Barton","Mejia","Ayala","Schroeder","Hampton","Rowe","Parsons","Frank","Waters","Strickland","Osborne","Maxwell","Chan","Deleon","Norman","Harrington","Casey","Patton","Logan","Bowers","Mueller","Glover","Floyd","Hartman","Buchanan","Cobb","French","Kramer","Mccormick","Clarke","Tyler","Gibbs","Moody","Conner","Sparks","Mcguire","Leon","Bauer","Norton","Pope","Flynn","Hogan","Robles","Salinas","Yates","Lindsey","Lloyd","Marsh","Mcbride","Owen","Solis","Pham","Lang","Pratt","Lara","Brock","Ballard","Trujillo","Shaffer","Drake","Roman","Aguirre","Morton","Stokes","Lamb","Pacheco","Patrick","Cochran","Shepherd","Cain","Burnett","Hess","Li","Cervantes","Olsen","Briggs","Ochoa","Cabrera","Velasquez","Montoya","Roth","Meyers","Cardenas","Fuentes","Weiss","Hoover","Wilkins","Nicholson","Underwood","Short","Carson","Morrow","Colon","Holloway","Summers","Bryan","Petersen","Mckenzie","Serrano","Wilcox","Carey","Clayton","Poole","Calderon","Gallegos","Greer","Rivas","Guerra","Decker","Collier","Wall","Whitaker","Bass","Flowers","Davenport","Conley","Houston","Huff","Copeland","Hood","Monroe","Massey","Roberson","Combs","Franco","Larsen","Pittman","Randall","Skinner","Wilkinson","Kirby","Cameron","Bridges","Anthony","Richard","Kirk","Bruce","Singleton","Mathis","Bradford","Boone","Abbott","Charles","Allison","Sweeney","Atkinson","Horn","Jefferson","Rosales","York","Christian","Phelps","Farrell","Castaneda","Nash","Dickerson","Bond","Wyatt","Foley","Chase","Gates","Vincent","Mathews","Hodge","Garrison","Trevino","Villarreal","Heath","Dalton","Valencia","Callahan","Hensley","Atkins","Huffman","Roy","Boyer","Shields","Lin","Hancock","Grimes","Glenn","Cline","Delacruz","Camacho","Dillon","Parrish","Oneill","Melton","Booth","Kane","Berg","Harrell","Pitts","Savage","Wiggins","Brennan","Salas","Marks","Russo","Sawyer","Baxter","Golden","Hutchinson","Liu","Walter","Mcdowell","Wiley","Rich","Humphrey","Johns","Koch","Suarez","Hobbs","Beard","Gilmore","Ibarra","Keith","Macias","Khan","Andrade","Ware","Stephenson","Henson","Wilkerson","Dyer","Mcclure","Blackwell","Mercado","Tanner","Eaton","Clay","Barron","Beasley","Oneal","Preston","Small","Wu","Zamora","Macdonald","Vance","Snow","Mcclain","Stafford","Orozco","Barry","English","Shannon","Kline","Jacobson","Woodard","Huang","Kemp","Mosley","Prince","Merritt","Hurst","Villanueva","Roach","Nolan","Lam","Yoder","Mccullough","Lester","Santana","Valenzuela","Winters","Barrera","Leach","Orr","Berger","Mckee","Strong","Conway","Stein","Whitehead","Bullock","Escobar","Knox","Meadows","Solomon","Velez","Odonnell","Kerr","Stout","Blankenship","Browning","Kent","Lozano","Bartlett","Pruitt","Buck","Barr","Gaines","Durham","Gentry","Mcintyre","Sloan","Melendez","Rocha","Herman","Sexton","Moon","Hendricks","Rangel","Stark","Lowery","Hardin","Hull","Sellers","Ellison","Calhoun","Gillespie","Mora","Knapp","Mccall","Morse","Dorsey","Weeks","Nielsen","Livingston","Leblanc","Mclean","Bradshaw","Glass","Middleton","Buckley","Schaefer","Frost","Howe","House","Mcintosh","Ho","Pennington","Reilly","Hebert","Mcfarland","Hickman","Noble","Spears","Conrad","Arias","Galvan","Velazquez","Huynh","Frederick","Randolph","Cantu","Fitzpatrick","Mahoney","Peck","Villa","Michael","Donovan","Mcconnell","Walls","Boyle","Mayer","Zuniga","Giles","Pineda","Pace","Hurley","Mays","Mcmillan","Crosby","Ayers","Case","Bentley","Shepard","Everett","Pugh","David","Mcmahon","Dunlap","Bender","Hahn","Harding","Acevedo","Raymond","Blackburn","Duffy","Landry","Dougherty","Bautista","Shah","Potts","Arroyo","Valentine","Meza","Gould","Vaughan","Fry","Rush","Avery","Herring","Dodson","Clements","Sampson","Tapia","Bean","Lynn","Crane","Farley","Cisneros","Benton","Ashley","Mckay","Finley","Best","Blevins","Friedman","Moses","Sosa","Blanchard","Huber","Frye","Krueger","Bernard","Rosario","Rubio","Mullen","Benjamin","Haley","Chung","Moyer","Choi","Horne","Yu","Woodward","Ali","Nixon","Hayden","Rivers","Estes","Mccarty","Richmond","Stuart","Maynard","Brandt","Oconnell","Hanna","Sanford","Sheppard","Church","Burch","Levy","Rasmussen","Coffey","Ponce","Faulkner","Donaldson","Schmitt","Novak","Costa","Montes","Booker","Cordova","Waller","Arellano","Maddox","Mata","Bonilla","Stanton","Compton","Kaufman","Dudley","Mcpherson","Beltran","Dickson","Mccann","Villegas","Proctor","Hester","Cantrell","Daugherty","Cherry","Bray","Davila","Rowland","Levine","Madden","Spence","Good","Irwin","Werner","Krause","Petty","Whitney","Baird","Hooper","Pollard","Zavala","Jarvis","Holden","Haas","Hendrix","Mcgrath","Bird","Lucero","Terrell","Riggs","Joyce","Mercer","Rollins","Galloway","Duke","Odom","Andersen","Downs","Hatfield","Benitez","Archer","Huerta","Travis","Mcneil","Hinton","Zhang","Hays","Mayo","Fritz","Branch","Mooney","Ewing","Ritter","Esparza","Frey","Braun","Gay","Riddle","Haney","Kaiser","Holder","Chaney","Mcknight","Gamble","Vang","Cooley","Carney","Cowan","Forbes","Ferrell","Davies","Barajas","Shea","Osborn","Bright","Cuevas","Bolton","Murillo","Lutz","Duarte","Kidd","Key","Cooke"]; 13 | constructor() { } 14 | ngOnInit() { 15 | 16 | this.itemList = []; 17 | for(var t=1;t<=1000;t++){ 18 | var tempObj = {"id":0,"itemName":"","category":""}; 19 | tempObj.id = t; 20 | tempObj.itemName= this.namesList[Math.floor(Math.random()*this.namesList.length)]; 21 | tempObj.category= this.categories[Math.floor(Math.random()*this.categories.length)]; 22 | this.itemList.push(tempObj); 23 | } 24 | 25 | this.selectedItems = []; 26 | 27 | this.settings = { 28 | text: "Select Items", 29 | selectAllText: 'Select All', 30 | unSelectAllText: 'UnSelect All', 31 | classes: "myclass custom-class", 32 | enableSearchFilter: true, 33 | lazyLoading: true, 34 | badgeShowLimit: 4, 35 | tagToBody: true 36 | 37 | }; 38 | } 39 | onItemSelect(item: any) { 40 | console.log(item); 41 | console.log(this.selectedItems); 42 | } 43 | OnItemDeSelect(item: any) { 44 | console.log(item); 45 | console.log(this.selectedItems); 46 | } 47 | onSelectAll(items: any) { 48 | console.log(items); 49 | } 50 | onDeSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onScroll(e:any){ 54 | console.log(e); 55 | } 56 | onScrollToEnd(e:any){ 57 | console.log(e); 58 | } 59 | changeData() { 60 | this.selectedItems = []; 61 | } 62 | cssgist: boolean = false; 63 | title: string = "Virtual scrolling - Lazy load large data sets"; 64 | tsgist: string = "CuppaLabs/aab6c8b30a6901af01249c474f3f0cbd"; 65 | htmlgist: string = "CuppaLabs/c77fea947ef053aa22973fcd9c7c612a"; 66 | tstitle: string = "lazyLoading.ts" 67 | htmltitle: string = "lazyLoading.html"; 68 | } 69 | -------------------------------------------------------------------------------- /src/app/examples/lazyLoadingRemoteData.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MockService } from './mock-data'; 3 | 4 | @Component({ 5 | templateUrl: './views/lazyLoadingRemoteData.html' 6 | }) 7 | export class LazyLoadingRemoteDataExample implements OnInit { 8 | 9 | itemList = []; 10 | selectedItems = []; 11 | settings = {}; 12 | loading = false; 13 | indices: any; 14 | readonly bufferSize: number = 10; 15 | 16 | constructor(private appService: MockService) { } 17 | ngOnInit() { 18 | this.itemList = []; 19 | this.selectedItems = []; 20 | 21 | this.settings = { 22 | text: "Select Items", 23 | selectAllText: 'Select All', 24 | unSelectAllText: 'UnSelect All', 25 | classes: "myclass custom-class", 26 | enableSearchFilter: true, 27 | lazyLoading: true, 28 | labelKey: 'name', 29 | limitSelection: 3, 30 | tagToBody: true 31 | 32 | }; 33 | } 34 | onItemSelect(item: any) { 35 | console.log(item); 36 | console.log(this.selectedItems); 37 | } 38 | OnItemDeSelect(item: any) { 39 | console.log(item); 40 | console.log(this.selectedItems); 41 | } 42 | onSelectAll(items: any) { 43 | console.log(items); 44 | } 45 | onDeSelectAll(items: any) { 46 | console.log(items); 47 | } 48 | onScroll(e: any) { 49 | console.log(e); 50 | } 51 | onOpen(e:any){ 52 | console.log(this.itemList); 53 | } 54 | fetchMore(event: any) { 55 | if (event.endIndex === this.itemList.length - 1) { 56 | this.loading = true; 57 | this.appService.getChunkData(this.itemList.length, this.bufferSize).then(chunk => { 58 | this.itemList = this.itemList.concat(chunk); 59 | this.loading = false; 60 | }, () => this.loading = false); 61 | } 62 | } 63 | changeData() { 64 | this.selectedItems = []; 65 | } 66 | cssgist: boolean = false; 67 | title: string = "Lazy loading - Remote Data API"; 68 | tsgist: string = "CuppaLabs/3833720c12e23f6c8ee5fd870e38ad5b"; 69 | htmlgist: string = "CuppaLabs/72ebd8cfa40a23a74ccbeda6de98a1e8"; 70 | tstitle: string = "lazyLoadingRemoteData.ts" 71 | htmltitle: string = "lazyLoadingRemoteData.html"; 72 | } 73 | -------------------------------------------------------------------------------- /src/app/examples/limitbadges.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class LimitBadgesExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India" }, 20 | { "id": 2, "itemName": "Singapore" }, 21 | { "id": 3, "itemName": "Australia" }, 22 | { "id": 4, "itemName": "Canada" }, 23 | { "id": 5, "itemName": "South Korea" }, 24 | { "id": 6, "itemName": "Brazil" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India" }, 29 | { "id": 2, "itemName": "Singapore" }, 30 | { "id": 3, "itemName": "Australia" }, 31 | { "id": 4, "itemName": "Canada" }]; 32 | this.settings = { 33 | singleSelection: false, 34 | text: "Select Countries", 35 | selectAllText: 'Select All', 36 | unSelectAllText: 'UnSelect All', 37 | enableSearchFilter: true, 38 | badgeShowLimit: 3, 39 | tagToBody: true 40 | }; 41 | } 42 | onItemSelect(item: any) { 43 | console.log(item); 44 | console.log(this.selectedItems); 45 | } 46 | OnItemDeSelect(item: any) { 47 | console.log(item); 48 | console.log(this.selectedItems); 49 | } 50 | onSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onDeSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | cssgist: boolean = false; 57 | title: string = "Limit badges length"; 58 | tsgist: string = "CuppaLabs/00a25e7f8f70199f6571ac9fccbb94c2"; 59 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 60 | tstitle: string = "limitBadges.ts" 61 | htmltitle: string = "limitBadges.html"; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/examples/limitselection.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class LimitSelectionExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India" }, 20 | { "id": 2, "itemName": "Singapore" }, 21 | { "id": 3, "itemName": "Australia" }, 22 | { "id": 4, "itemName": "Canada" }, 23 | { "id": 5, "itemName": "South Korea" }, 24 | { "id": 6, "itemName": "Brazil" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India" }, 29 | { "id": 2, "itemName": "Singapore" }, 30 | { "id": 3, "itemName": "Australia" }, 31 | { "id": 4, "itemName": "Canada" }]; 32 | this.settings = { 33 | text: "Select Countries", 34 | selectAllText: 'Select All', 35 | unSelectAllText: 'UnSelect All', 36 | enableSearchFilter: true, 37 | classes: "myclass custom-class", 38 | limitSelection: 2, 39 | tagToBody: true 40 | }; 41 | } 42 | onItemSelect(item: any) { 43 | console.log(item); 44 | console.log(this.selectedItems); 45 | } 46 | OnItemDeSelect(item: any) { 47 | console.log(item); 48 | console.log(this.selectedItems); 49 | } 50 | onSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onDeSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | cssgist: boolean = false; 57 | title: string = "Limit Selection"; 58 | tsgist: string = "CuppaLabs/70667b7d4dd4270bb290685e036a379a"; 59 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 60 | tstitle: string = "limitSelection.ts" 61 | htmltitle: string = "limitSelection.html"; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/examples/multipleDropdowns.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MockService } from './mock-data'; 3 | import { tap, map } from 'rxjs/operators'; 4 | 5 | @Component({ 6 | templateUrl: './views/multipledropdowns.html' 7 | }) 8 | export class MultipleDropdownsExample implements OnInit { 9 | 10 | itemList = []; 11 | selectedItems = []; 12 | settings = {}; 13 | directorySpecialties = [{ "id": "PBMMedAdhr", "name": "PBM Medication Adherence" }, { "id": "GapsInCare", "name": "Gaps In Care" }, { "id": "UCTest1", "name": "Use Case Test1" }, { "id": "BASICSAVE", "name": "A generic alternative or 30-90 day dispense opport" }, { "id": "ADVSAVE", "name": "An advnaced generic alternative or 30-90 day dispe" }, { "id": "AttAlert", "name": "Attachment Alert" }, { "id": "PatSave", "name": "Patient savings" }, { "id": "UCTest2", "name": "Use Case Test 2" }, { "id": "UCTest3", "name": "Use Case Test 3" }, { "id": "UCTest4", "name": "Use Case Test 4" }, { "id": "UCTest5", "name": "Use Case Test 5" }, { "id": "UCTest6", "name": "Use Case Test 6" }, { "id": "UCTest7", "name": "Use Case Test 7" }, { "id": "UCTest9", "name": "Use Case Test 9" }, { "id": "UCTest#Ten", "name": "Use Case Test 10" }, { "id": "UCTest8", "name": "Use Case Test 8" }, { "id": "UCTest11", "name": "Test Use Case 11" }, { "id": "UCTest12", "name": "Test Use Case 12" }, { "id": "UCTest13", "name": "Test Use Case 13" }, { "id": "PNLIMMUN", "name": "PNL Immunization" }, { "id": "TrustBrkr", "name": "Identity Services" }, { "id": "RTBC", "name": "real time benefit check for 90 day at retail" }]; 14 | useCases = [{"id":1,"itemName":"India","name":"IN"}, 15 | {"id":2,"itemName":"Singapore","name":"SN"}, 16 | {"id":3,"itemName":"Australia","name":"AU"}, 17 | {"id":4,"itemName":"Canada","name":"CA"}, 18 | {"id":5,"itemName":"South Korea","name":"SK"}, 19 | {"id":6,"itemName":"Brazil","name":"BR"}]; 20 | dropdownSettings = {}; 21 | dropdownSettings2 = {}; 22 | 23 | selectedDirectorySpecialties = [{ "id": "PBMMedAdhr", "name": "PBM Medication Adherence" }, { "id": "GapsInCare", "name": "Gaps In Care" }] 24 | selectedUseCases = [] 25 | directoriesDropdownStatus: string = 'closed'; 26 | casesDropdownStatus: string = 'closed'; 27 | constructor(public mockService: MockService) { } 28 | ngOnInit() { 29 | 30 | this.dropdownSettings = { 31 | text: "Select", 32 | enableSearchFilter: true, 33 | labelKey: "name", 34 | tagToBody: true 35 | }; 36 | this.dropdownSettings2 = { 37 | text: "Select", 38 | enableSearchFilter: true, 39 | tagToBody: true 40 | }; 41 | 42 | 43 | 44 | } 45 | onItemSelect(item: any) { 46 | console.log(item); 47 | console.log(this.selectedItems); 48 | } 49 | OnItemDeSelect(item: any) { 50 | console.log(item); 51 | console.log(this.selectedItems); 52 | } 53 | onSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | onSelectAll2(items: any) { 57 | console.log(items); 58 | } 59 | onDeSelectAll(items: any) { 60 | console.log(items); 61 | } 62 | onDeSelectAll2(items: any) { 63 | console.log(items); 64 | } 65 | onDirectoriesOpen(e:any){ 66 | this.directoriesDropdownStatus = 'open'; 67 | } 68 | onDirectoriesClose(e:any){ 69 | this.directoriesDropdownStatus = 'close'; 70 | } 71 | onCasesOpen(e:any){ 72 | this.casesDropdownStatus = 'open'; 73 | } 74 | onCasesClose(e:any){ 75 | this.casesDropdownStatus = 'close'; 76 | } 77 | cssgist: boolean = false; 78 | title: string = "Multiple Dropdowns in a page"; 79 | tsgist: string = "CuppaLabs/12225540c23c8a171a81f996fc8d9ca6"; 80 | htmlgist: string = "CuppaLabs/3788fb5437925b9d7d8edafec567639c"; 81 | mockgist: string = "CuppaLabs/b3e947ec83710307a3b8680a2ff89693"; 82 | tstitle: string = "multiple-dropdowns.ts" 83 | htmltitle: string = "multiple-dropdowns.html"; 84 | mocktitle: string = "mock-data.ts" 85 | } 86 | -------------------------------------------------------------------------------- /src/app/examples/remoteData.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | @Component({ 5 | templateUrl: './views/remoteData.html' 6 | }) 7 | export class RemoteDataExample implements OnInit { 8 | 9 | itemList:any = []; 10 | selectedItems = []; 11 | settings = {}; 12 | 13 | constructor(private http: HttpClient) { } 14 | ngOnInit() { 15 | this.http.get('https://restcountries.eu/rest/v2/all') 16 | .subscribe(res => { 17 | console.log(res); 18 | this.itemList = res; 19 | },error => { 20 | 21 | }); 22 | this.settings = { 23 | text: "Select Countries", 24 | selectAllText: 'Select All', 25 | unSelectAllText: 'UnSelect All', 26 | classes: "myclass custom-class", 27 | primaryKey: "alpha3Code", 28 | labelKey: "name", 29 | groupBy:'region', 30 | enableSearchFilter: true, 31 | searchBy: ['name','capital'], 32 | tagToBody: true 33 | }; 34 | } 35 | onItemSelect(item: any) { 36 | console.log(item); 37 | console.log(this.selectedItems); 38 | } 39 | OnItemDeSelect(item: any) { 40 | console.log(item); 41 | console.log(this.selectedItems); 42 | } 43 | onSelectAll(items: any) { 44 | console.log(items); 45 | } 46 | onDeSelectAll(items: any) { 47 | console.log(items); 48 | } 49 | onSearch(evt: any){ 50 | console.log(evt.target.value); 51 | } 52 | cssgist: boolean = false; 53 | title: string = "Data from remote API example"; 54 | tsgist: string = "CuppaLabs/ffb168ae28c36a9130ad5ce74b720c5d"; 55 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 56 | tstitle: string = "remoteData.ts" 57 | htmltitle: string = "remoteData.html"; 58 | } 59 | -------------------------------------------------------------------------------- /src/app/examples/resetdropdown.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; 2 | import { AngularMultiSelect } from '../../../projects/angular2-multiselect-dropdown-lib/src/lib/multiselect.component'; 3 | 4 | @Component({ 5 | templateUrl: './views/resetDropdown.html' 6 | }) 7 | export class ResetDropdownExample implements OnInit { 8 | 9 | itemList = []; 10 | selectedItems = []; 11 | settings = {}; 12 | @ViewChild('dropdownElem', {static: true}) dropdownElem: AngularMultiSelect; 13 | constructor() { 14 | 15 | } 16 | ngOnInit() { 17 | 18 | 19 | this.itemList = [ 20 | { "id": 1, "itemName": "India" }, 21 | { "id": 2, "itemName": "Singapore" }, 22 | { "id": 3, "itemName": "Australia" }, 23 | { "id": 4, "itemName": "Canada" }, 24 | { "id": 5, "itemName": "South Korea" }, 25 | { "id": 6, "itemName": "Brazil" } 26 | ]; 27 | 28 | this.selectedItems = [ 29 | { "id": 1, "itemName": "India" }, 30 | { "id": 2, "itemName": "Singapore" }, 31 | { "id": 3, "itemName": "Australia" }, 32 | { "id": 4, "itemName": "Canada" }]; 33 | this.settings = { 34 | text: "Select Countries", 35 | selectAllText: 'Select All', 36 | unSelectAllText: 'UnSelect All', 37 | classes: "myclass custom-class", 38 | tagToBody: true 39 | }; 40 | } 41 | onItemSelect(item: any) { 42 | console.log(item); 43 | console.log(this.selectedItems); 44 | } 45 | OnItemDeSelect(item: any) { 46 | console.log(item); 47 | console.log(this.selectedItems); 48 | } 49 | onSelectAll(items: any) { 50 | console.log(items); 51 | } 52 | onDeSelectAll(items: any) { 53 | console.log(items); 54 | } 55 | showModel() { 56 | console.log(this.selectedItems); 57 | } 58 | changeData() { 59 | this.selectedItems = []; 60 | } 61 | open(evt: any){ 62 | this.dropdownElem.openDropdown(); 63 | evt.stopPropagation(); 64 | } 65 | close(evt: any){ 66 | this.dropdownElem.closeDropdown(); 67 | } 68 | cssgist: boolean = false; 69 | title: string = "Methods - Reset, Open, Close dropdown"; 70 | tsgist: string = "CuppaLabs/96d3ca7681f1a7a38b8c76b2f1552458"; 71 | htmlgist: string = "CuppaLabs/bbd73b9f9864effb69f361c9fc65a6e5"; 72 | tstitle: string = "resetDropdown.ts" 73 | htmltitle: string = "resetDropdown.html"; 74 | } 75 | -------------------------------------------------------------------------------- /src/app/examples/searchByOneProperty.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class SearchFilterByOnePropertyExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | {"id":1,"itemName":"India","name":"IN"}, 20 | {"id":2,"itemName":"Singapore","name":"SN"}, 21 | {"id":3,"itemName":"Australia","name":"AU"}, 22 | {"id":4,"itemName":"Canada","name":"CA"}, 23 | {"id":5,"itemName":"South Korea","name":"SK"}, 24 | {"id":6,"itemName":"Brazil","name":"BR"} 25 | ]; 26 | 27 | this.selectedItems = [ 28 | {"id":1,"itemName":"India","name":"IN"}, 29 | {"id":2,"itemName":"Singapore","name":"SN"}, 30 | {"id":3,"itemName":"Australia","name":"AU"}, 31 | {"id":4,"itemName":"Canada","name":"CA"}]; 32 | this.settings = { 33 | singleSelection: false, 34 | text: "Select Countries", 35 | selectAllText: 'Select All', 36 | unSelectAllText: 'UnSelect All', 37 | enableSearchFilter: true, 38 | badgeShowLimit: 3, 39 | searchBy: ['itemName'], 40 | searchPlaceholderText: 'Search by name', 41 | tagToBody: true 42 | }; 43 | } 44 | onItemSelect(item: any) { 45 | console.log(item); 46 | console.log(this.selectedItems); 47 | } 48 | OnItemDeSelect(item: any) { 49 | console.log(item); 50 | console.log(this.selectedItems); 51 | } 52 | onSelectAll(items: any) { 53 | console.log(items); 54 | } 55 | onDeSelectAll(items: any) { 56 | console.log(items); 57 | } 58 | cssgist: boolean = false; 59 | title: string = "Search filter by one property / key"; 60 | tsgist: string = "CuppaLabs/f6acd1eb94c95df32f689260b1f38b4c"; 61 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 62 | tstitle: string = "searchFilterByProperty.ts" 63 | htmltitle: string = "searchFilterByProperty.html"; 64 | } 65 | -------------------------------------------------------------------------------- /src/app/examples/searchFilter.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class SearchFilterExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | {"id":1,"itemName":"India","name":"IN"}, 20 | {"id":2,"itemName":"Singapore","name":"SN"}, 21 | {"id":3,"itemName":"Australia","name":"AU"}, 22 | {"id":4,"itemName":"Canada","name":"CA"}, 23 | {"id":5,"itemName":"South Korea","name":"SK"}, 24 | {"id":6,"itemName":"Brazil","name":"BR"} 25 | ]; 26 | 27 | this.selectedItems = [ 28 | {"id":1,"itemName":"India","name":"IN"}, 29 | {"id":2,"itemName":"Singapore","name":"SN"}, 30 | {"id":3,"itemName":"Australia","name":"AU"}, 31 | {"id":4,"itemName":"Canada","name":"CA"}]; 32 | this.settings = { 33 | singleSelection: false, 34 | text: "Select Countries", 35 | selectAllText: 'Select All', 36 | unSelectAllText: 'UnSelect All', 37 | enableSearchFilter: true, 38 | badgeShowLimit: 3, 39 | tagToBody: true 40 | }; 41 | } 42 | onItemSelect(item: any) { 43 | console.log(item); 44 | console.log(this.selectedItems); 45 | } 46 | OnItemDeSelect(item: any) { 47 | console.log(item); 48 | console.log(this.selectedItems); 49 | } 50 | onSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | onDeSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | cssgist: boolean = false; 57 | title: string = "Search filter"; 58 | tsgist: string = "CuppaLabs/447bd5fce6dfc2832f5f4a8c36726a9b"; 59 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 60 | tstitle: string = "searchFilter.ts" 61 | htmltitle: string = "searchFilter.html"; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/examples/searchFilterAddNewItem.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/searchFilter.html' 5 | }) 6 | export class SearchFilterAddItemExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | count = 6; 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | {"id":1,"itemName":"India","name":"IN"}, 20 | {"id":2,"itemName":"Singapore","name":"SN"}, 21 | {"id":3,"itemName":"Australia","name":"AU"}, 22 | {"id":4,"itemName":"Canada","name":"CA"}, 23 | {"id":5,"itemName":"South Korea","name":"SK"}, 24 | {"id":6,"itemName":"Brazil","name":"BR"} 25 | ]; 26 | 27 | this.selectedItems = [ 28 | {"id":1,"itemName":"India","name":"IN"}, 29 | {"id":2,"itemName":"Singapore","name":"SN"}, 30 | {"id":3,"itemName":"Australia","name":"AU"}, 31 | {"id":4,"itemName":"Canada","name":"CA"}]; 32 | this.settings = { 33 | singleSelection: false, 34 | text: "Select Countries", 35 | selectAllText: 'Select All', 36 | unSelectAllText: 'UnSelect All', 37 | enableSearchFilter: true, 38 | addNewItemOnFilter: true, 39 | enableFilterSelectAll: true, 40 | tagToBody: true 41 | }; 42 | } 43 | onAddItem(data:string){ 44 | this.count++; 45 | const list = [...this.itemList, ... [{"id": this.count,"itemName":data,"name":data}]] 46 | this.itemList = list; 47 | this.selectedItems.push({"id": this.count,"itemName":data,"name":data}); 48 | } 49 | onItemSelect(item: any) { 50 | console.log(item); 51 | console.log(this.selectedItems); 52 | } 53 | OnItemDeSelect(item: any) { 54 | console.log(item); 55 | console.log(this.selectedItems); 56 | } 57 | onSelectAll(items: any) { 58 | console.log(items); 59 | } 60 | onDeSelectAll(items: any) { 61 | console.log(items); 62 | } 63 | cssgist: boolean = false; 64 | title: string = "Search and Add New Item, if not found"; 65 | tsgist: string = "CuppaLabs/c1e00c870c3e3b9213e69e0a93518cc6"; 66 | htmlgist: string = "CuppaLabs/0583ba4be8b7c192d14f04375f96c074"; 67 | tstitle: string = "searchFilterAddNewItem.ts" 68 | htmltitle: string = "searchFilter.html"; 69 | } 70 | -------------------------------------------------------------------------------- /src/app/examples/singleselection.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/singleSelection.html' 5 | }) 6 | export class SingleSelectionExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | count = 6; 12 | 13 | constructor() { 14 | 15 | } 16 | ngOnInit() { 17 | 18 | 19 | this.itemList = [ 20 | { "id": 1, "itemName": "India", "name": "IN" }, 21 | { "id": 2, "itemName": "Singapore", "name": "SN" }, 22 | { "id": 3, "itemName": "Australia", "name": "AU" }, 23 | { "id": 4, "itemName": "Canada", "name": "CA" }, 24 | { "id": 5, "itemName": "South Korea", "name": "SK" }, 25 | { "id": 6, "itemName": "Brazil", "name": "BR" } 26 | ]; 27 | 28 | this.selectedItems = [ 29 | { "id": 1, "itemName": "India", "name": "IN" }]; 30 | this.settings = { 31 | enableSearchFilter: true, 32 | addNewItemOnFilter: true, singleSelection: true, text: "Select Country", 33 | tagToBody: true 34 | }; 35 | } 36 | onItemSelect(item: any) { 37 | console.log(item); 38 | console.log(this.selectedItems); 39 | } 40 | OnItemDeSelect(item: any) { 41 | console.log(item); 42 | console.log(this.selectedItems); 43 | } 44 | onSelectAll(items: any) { 45 | console.log(items); 46 | } 47 | onDeSelectAll(items: any) { 48 | console.log(items); 49 | } 50 | onAddItem(data: string) { 51 | this.count++; 52 | this.itemList.push({ "id": this.count, "itemName": data, "name": data }); 53 | this.selectedItems = []; 54 | this.selectedItems.push({ "id": this.count, "itemName": data, "name": data }); 55 | } 56 | cssgist: boolean = false; 57 | title: string = "Single Selection"; 58 | tsgist: string = "CuppaLabs/6ef578ce507dfd548eec39e008b4de14"; 59 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 60 | tstitle: string = "singleSelection.ts" 61 | htmltitle: string = "singleSelection.html"; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/examples/styling.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/view.html' 5 | }) 6 | export class StylingExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | 18 | this.itemList = [ 19 | { "id": 1, "itemName": "India" }, 20 | { "id": 2, "itemName": "Singapore" }, 21 | { "id": 3, "itemName": "Australia" }, 22 | { "id": 4, "itemName": "Canada" }, 23 | { "id": 5, "itemName": "South Korea" }, 24 | { "id": 6, "itemName": "Brazil" } 25 | ]; 26 | 27 | this.selectedItems = [ 28 | { "id": 1, "itemName": "India" }, 29 | { "id": 2, "itemName": "Singapore" }, 30 | { "id": 3, "itemName": "Australia" }, 31 | { "id": 4, "itemName": "Canada" }]; 32 | this.settings = { 33 | text: "Select Countries", 34 | selectAllText: 'Select All', 35 | unSelectAllText: 'UnSelect All', 36 | classes: "myclass custom-class-example", 37 | tagToBody: true 38 | }; 39 | } 40 | onItemSelect(item: any) { 41 | console.log(item); 42 | console.log(this.selectedItems); 43 | } 44 | OnItemDeSelect(item: any) { 45 | console.log(item); 46 | console.log(this.selectedItems); 47 | } 48 | onSelectAll(items: any) { 49 | console.log(items); 50 | } 51 | onDeSelectAll(items: any) { 52 | console.log(items); 53 | } 54 | title: string = "Custom styling"; 55 | tsgist: string = "CuppaLabs/67fb11cbb67a62888ca0a3adb44ee440"; 56 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 57 | cssgist: string = "CuppaLabs/e6efeedade8f737df03107625df165e7"; 58 | tstitle: string = "customStyling.ts"; 59 | htmltitle: string = "customStyling.html"; 60 | csstitle: string = "app.css"; 61 | } 62 | -------------------------------------------------------------------------------- /src/app/examples/templating.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/templating.html' 5 | }) 6 | export class TemplatingExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor(){ 13 | 14 | } 15 | ngOnInit(){ 16 | 17 | 18 | this.itemList = [ 19 | {"category":"asia","id":1,"itemName":"India","capital":"Delhi","image":"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"}, 20 | {"category":"asia","id":2,"itemName":"Singapore", "capital":"Singapore","image":"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"}, 21 | {"category":"europe","id":3,"itemName":"United Kingdom", "capital":"London","image":"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"}, 22 | {"category":"northamerica","id":4,"itemName":"Canada","capital":"Ottawa","image":"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"}, 23 | {"category":"asia","id":5,"itemName":"South Korea","capital":"Seoul","image":"http://www.sciencekids.co.nz/images/pictures/flags96/South_Korea.jpg"}, 24 | {"category":"latinamerica","id":6,"itemName":"Brazil","capital":"Brasilia","image":"http://www.sciencekids.co.nz/images/pictures/flags96/Brazil.jpg"} 25 | ]; 26 | 27 | this.selectedItems = [ 28 | {"category":"asia","id":1,"itemName":"India","capital":"Delhi","image":"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"}, 29 | {"category":"asia","id":2,"itemName":"Singapore", "capital":"Singapore","image":"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"}, 30 | {"category":"europe","id":3,"itemName":"United Kingdom", "capital":"London","image":"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"}, 31 | {"category":"northamerica","id":4,"itemName":"Canada","capital":"Ottawa","image":"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"}] 32 | this.settings = { 33 | text:"Select Countries", 34 | selectAllText:'Select All', 35 | unSelectAllText:'UnSelect All', 36 | enableSearchFilter: true, 37 | classes:"myclass custom-class", 38 | showCheckbox: true, 39 | groupBy: "category", 40 | tagToBody: true, 41 | }; 42 | 43 | } 44 | onItemSelect(item:any){ 45 | console.log(item); 46 | console.log(this.selectedItems); 47 | } 48 | OnItemDeSelect(item:any){ 49 | console.log(item); 50 | console.log(this.selectedItems); 51 | } 52 | onSelectAll(items: any){ 53 | console.log(items); 54 | } 55 | onDeSelectAll(items: any){ 56 | console.log(items); 57 | } 58 | onGroupSelect(selectedGroupItem){ 59 | console.log(selectedGroupItem); 60 | } 61 | onGroupDeSelect(deselectedGroupItem){ 62 | console.log(deselectedGroupItem); 63 | } 64 | cssgist: boolean = false; 65 | title: string = "Templating menu option"; 66 | tsgist: string = "CuppaLabs/cc0ac5976bf26b89119180ff82115fe4"; 67 | htmlgist: string = "CuppaLabs/6399258d93fd5580be1736aba2539519"; 68 | tstitle: string = "templating.ts" 69 | htmltitle: string = "templating.html"; 70 | } 71 | -------------------------------------------------------------------------------- /src/app/examples/theming.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/theming.html' 5 | }) 6 | export class ThemingExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | constructor() { } 13 | ngOnInit() { 14 | 15 | this.itemList = [ 16 | { "countryId": 1, "itemName": "India" }, 17 | { "countryId": 2, "itemName": "Singapore" }, 18 | { "countryId": 3, "itemName": "Australia" }, 19 | { "countryId": 4, "itemName": "Canada" }, 20 | { "countryId": 5, "itemName": "South Korea" }, 21 | { "countryId": 6, "itemName": "Brazil" } 22 | ]; 23 | 24 | this.selectedItems = [ 25 | { "countryId": 1, "itemName": "India" }, 26 | { "countryId": 2, "itemName": "Singapore" }, 27 | { "countryId": 3, "itemName": "Australia" }, 28 | { "countryId": 4, "itemName": "Canada" }]; 29 | 30 | this.settings = { 31 | text: "Select Countries", 32 | selectAllText: 'Select All', 33 | unSelectAllText: 'UnSelect All', 34 | classes: "myclass custom-class", 35 | primaryKey: "countryId", 36 | tagToBody: true 37 | }; 38 | } 39 | onItemSelect(item: any) { 40 | console.log(item); 41 | console.log(this.selectedItems); 42 | } 43 | OnItemDeSelect(item: any) { 44 | console.log(item); 45 | console.log(this.selectedItems); 46 | } 47 | onSelectAll(items: any) { 48 | console.log(items); 49 | } 50 | onDeSelectAll(items: any) { 51 | console.log(items); 52 | } 53 | cssgist: boolean = false; 54 | title: string = "Basic example"; 55 | tsgist: string = "CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235"; 56 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 57 | tstitle: string = "basic.ts" 58 | htmltitle: string = "basic.html"; 59 | } 60 | -------------------------------------------------------------------------------- /src/app/examples/usingInList.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/usingInList.html' 5 | }) 6 | export class UsingInListExample implements OnInit { 7 | 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | customers = []; 12 | constructor() { 13 | 14 | } 15 | ngOnInit() { 16 | 17 | this.customers = [ 18 | { 19 | name: "Toshiba", countries: [{ "category": "asia", "id": 1, "itemName": "India", "capital": "Delhi", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg" }, 20 | { "category": "asia", "id": 2, "itemName": "Singapore", "capital": "Singapore", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg" }, 21 | ] 22 | }, 23 | { name: "Apple", countries: [] }, 24 | { name: "Samsung", countries: [] }, 25 | { 26 | name: "MI", countries: [{ "category": "asia", "id": 1, "itemName": "India", "capital": "Delhi", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg" }, 27 | { "category": "asia", "id": 2, "itemName": "Singapore", "capital": "Singapore", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg" }, 28 | ] 29 | }, 30 | { name: "Google", countries: [] } 31 | ]; 32 | this.itemList = [ 33 | { "category": "asia", "id": 1, "itemName": "India", "capital": "Delhi", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg" }, 34 | { "category": "asia", "id": 2, "itemName": "Singapore", "capital": "Singapore", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg" }, 35 | { "category": "europe", "id": 3, "itemName": "United Kingdom", "capital": "London", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg" }, 36 | { "category": "northamerica", "id": 4, "itemName": "Canada", "capital": "Ottawa", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg" }, 37 | { "category": "asia", "id": 5, "itemName": "South Korea", "capital": "Seoul", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/South_Korea.jpg" }, 38 | { "category": "latinamerica", "id": 6, "itemName": "Brazil", "capital": "Brasilia", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Brazil.jpg" } 39 | ]; 40 | 41 | this.selectedItems = [ 42 | { "category": "asia", "id": 1, "itemName": "India", "capital": "Delhi", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg" }, 43 | { "category": "asia", "id": 2, "itemName": "Singapore", "capital": "Singapore", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg" }, 44 | { "category": "europe", "id": 3, "itemName": "United Kingdom", "capital": "London", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg" }, 45 | { "category": "northamerica", "id": 4, "itemName": "Canada", "capital": "Ottawa", "image": "http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg" }] 46 | this.settings = { 47 | text: "Select Countries", 48 | selectAllText: 'Select All', 49 | unSelectAllText: 'UnSelect All', 50 | enableSearchFilter: true, 51 | classes: "myclass custom-class", 52 | showCheckbox: true, 53 | tagToBody: true 54 | }; 55 | 56 | } 57 | onItemSelect(item: any) { 58 | console.log(this.customers); 59 | } 60 | OnItemDeSelect(item: any) { 61 | console.log(item); 62 | console.log(this.selectedItems); 63 | } 64 | onSelectAll(items: any) { 65 | console.log(items); 66 | } 67 | onDeSelectAll(items: any) { 68 | console.log(items); 69 | } 70 | onGroupSelect(selectedGroupItem) { 71 | console.log(selectedGroupItem); 72 | } 73 | onGroupDeSelect(deselectedGroupItem) { 74 | console.log(deselectedGroupItem); 75 | } 76 | cssgist: boolean = false; 77 | title: string = "Using in List - Inside `for loop`"; 78 | tsgist: string = "CuppaLabs/0d2dc802967cca16ffc5053d0b873aba"; 79 | htmlgist: string = "CuppaLabs/85fb2b925a56c2e533e321ae09de0e2f"; 80 | tstitle: string = "usingInList.ts" 81 | htmltitle: string = "usingInList.html"; 82 | } 83 | -------------------------------------------------------------------------------- /src/app/examples/usingInReactForms.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; 3 | 4 | @Component({ 5 | templateUrl: './views/using-in-react-form.html' 6 | }) 7 | export class UsingWithReactiveFormExample implements OnInit { 8 | itemList = []; 9 | selectedItems = []; 10 | settings = {}; 11 | 12 | userForm: UntypedFormGroup; 13 | 14 | constructor(private fb: UntypedFormBuilder) { 15 | this.createForm(); 16 | } 17 | createForm() { 18 | this.userForm = this.fb.group({ 19 | name: 'xbvxncvx', 20 | email: ['absd@gmail.com', Validators.required], 21 | skills: [[], Validators.required] 22 | }); 23 | } 24 | submitForm() { 25 | console.log(this.userForm); 26 | } 27 | ngOnInit() { 28 | 29 | this.itemList = [ 30 | { "id": 1, "itemName": "Angular" }, 31 | { "id": 2, "itemName": "JavaScript" }, 32 | { "id": 3, "itemName": "HTML" }, 33 | { "id": 4, "itemName": "CSS" }, 34 | { "id": 5, "itemName": "ReactJS" }, 35 | { "id": 6, "itemName": "HTML5" } 36 | ]; 37 | this.selectedItems = []; 38 | this.settings = { 39 | text: "Select Skills", 40 | selectAllText: 'Select All', 41 | unSelectAllText: 'UnSelect All', 42 | classes: "myclass custom-class" 43 | }; 44 | } 45 | onItemSelect(item: any) { 46 | console.log(item); 47 | console.log(this.selectedItems); 48 | } 49 | OnItemDeSelect(item: any) { 50 | console.log(item); 51 | console.log(this.selectedItems); 52 | } 53 | onSelectAll(items: any) { 54 | console.log(items); 55 | } 56 | onDeSelectAll(items: any) { 57 | console.log(items); 58 | } 59 | cssgist: boolean = false; 60 | title: string = "Using with Reactive Forms"; 61 | tsgist: string = "CuppaLabs/f0dfe353c6378cee7f55547395a80fc4"; 62 | htmlgist: string = "CuppaLabs/0a32c3d76110468b84bac01fd64488bc"; 63 | tstitle: string = "using-in-reactive-forms.ts" 64 | htmltitle: string = "using-with-reactive-forms.html"; 65 | } 66 | -------------------------------------------------------------------------------- /src/app/examples/usingWithForms.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './views/using-in-form.html' 5 | }) 6 | export class UsingWithFormExample implements OnInit { 7 | itemList = []; 8 | selectedItems = []; 9 | settings = {}; 10 | formModel = { 11 | name: '', 12 | email: 'ascasc@aa.com', 13 | skills: [{ "id": 1, "itemName": "Angular" }] 14 | }; 15 | submitted = false; 16 | onSubmit() { this.submitted = true; } 17 | constructor() { } 18 | ngOnInit() { 19 | 20 | this.itemList = [ 21 | { "id": 1, "itemName": "Angular" }, 22 | { "id": 2, "itemName": "JavaScript" }, 23 | { "id": 3, "itemName": "HTML" }, 24 | { "id": 4, "itemName": "CSS" }, 25 | { "id": 5, "itemName": "ReactJS" }, 26 | { "id": 6, "itemName": "HTML5" } 27 | ]; 28 | 29 | this.settings = { 30 | text: "Select Skills", 31 | selectAllText: 'Select All', 32 | unSelectAllText: 'UnSelect All', 33 | classes: "myclass custom-class", 34 | tagToBody: true 35 | }; 36 | } 37 | onItemSelect(item: any) { 38 | console.log(item); 39 | console.log(this.selectedItems); 40 | } 41 | OnItemDeSelect(item: any) { 42 | console.log(item); 43 | console.log(this.selectedItems); 44 | } 45 | onSelectAll(items: any) { 46 | console.log(items); 47 | } 48 | onDeSelectAll(items: any) { 49 | console.log(items); 50 | } 51 | cssgist: boolean = false; 52 | title: string = "Using with Template driven Forms"; 53 | tsgist: string = "CuppaLabs/6cd9396b8f5589b792b27dd10efe9140"; 54 | htmlgist: string = "CuppaLabs/8148509a46a59e3aba513808daa40ca1"; 55 | tstitle: string = "using-in-forms.ts" 56 | htmltitle: string = "using-with-forms.html"; 57 | } 58 | -------------------------------------------------------------------------------- /src/app/examples/usingWithinDialog.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Title, Meta } from '@angular/platform-browser'; 3 | 4 | @Component({ 5 | templateUrl: './views/usingWithinDialog.html' 6 | }) 7 | export class UsingWithinDialog implements OnInit { 8 | 9 | itemList = []; 10 | selectedItems = []; 11 | settings = {}; 12 | 13 | constructor(public seotitle: Title, public meta: Meta) { 14 | this.seotitle.setTitle('Basic example'); 15 | this.meta.addTags([ 16 | {name: 'description', content:'Basic example of angular multiselect drodown.'} 17 | ]); 18 | } 19 | ngOnInit() { 20 | 21 | this.itemList = [ 22 | { "countryId": 1, "itemName": "India" }, 23 | { "countryId": 2, "itemName": "Singapore" }, 24 | { "countryId": 3, "itemName": "Australia" }, 25 | { "countryId": 4, "itemName": "Canada" }, 26 | { "countryId": 5, "itemName": "South Korea" }, 27 | { "countryId": 6, "itemName": "Brazil" } 28 | ]; 29 | 30 | this.selectedItems = [ 31 | { "countryId": 1, "itemName": "India" }, 32 | { "countryId": 2, "itemName": "Singapore" }, 33 | { "countryId": 3, "itemName": "Australia" }, 34 | { "countryId": 4, "itemName": "Canada" }, 35 | { "countryId": 5, "itemName": "South Korea" }, 36 | { "countryId": 6, "itemName": "Brazil" }]; 37 | 38 | this.settings = { 39 | text: "Select Countries", 40 | selectAllText: 'Select All', 41 | unSelectAllText: 'UnSelect All', 42 | classes: "myclass custom-class", 43 | primaryKey: "countryId", 44 | enableSearchFilter: true, 45 | tagToBody: true, 46 | }; 47 | } 48 | onItemSelect(item: any) { 49 | console.log(item); 50 | console.log(this.selectedItems); 51 | } 52 | OnItemDeSelect(item: any) { 53 | console.log(item); 54 | console.log(this.selectedItems); 55 | } 56 | onSelectAll(items: any) { 57 | console.log(items); 58 | } 59 | onDeSelectAll(items: any) { 60 | console.log(items); 61 | } 62 | cssgist: boolean = false; 63 | title: string = "Basic example"; 64 | tsgist: string = "CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235"; 65 | htmlgist: string = "CuppaLabs/eb78d42ab7971fda6493586e329bfdb8"; 66 | tstitle: string = "basic.ts" 67 | htmltitle: string = "basic.html"; 68 | } 69 | 70 | @Component({ 71 | selector: 'dialog-content-example-dialog', 72 | templateUrl: './views/dialog-content-example-dialog.html', 73 | }) 74 | export class DialogContentExampleDialog implements OnInit { 75 | itemList = []; 76 | selectedItems = []; 77 | settings = {}; 78 | ngOnInit() { 79 | 80 | this.itemList = [ 81 | { "countryId": 1, "itemName": "India" }, 82 | { "countryId": 2, "itemName": "Singapore" }, 83 | { "countryId": 3, "itemName": "Australia" }, 84 | { "countryId": 4, "itemName": "Canada" }, 85 | { "countryId": 5, "itemName": "South Korea" }, 86 | { "countryId": 6, "itemName": "Brazil" } 87 | ]; 88 | 89 | this.selectedItems = [ 90 | { "countryId": 1, "itemName": "India" }, 91 | { "countryId": 2, "itemName": "Singapore" }, 92 | { "countryId": 3, "itemName": "Australia" }, 93 | { "countryId": 4, "itemName": "Canada" }, 94 | { "countryId": 5, "itemName": "South Korea" }, 95 | { "countryId": 6, "itemName": "Brazil" }]; 96 | 97 | this.settings = { 98 | text: "Select Countries", 99 | selectAllText: 'Select All', 100 | unSelectAllText: 'UnSelect All', 101 | classes: "myclass custom-class", 102 | primaryKey: "countryId", 103 | enableSearchFilter: true, 104 | tagToBody: true, 105 | }; 106 | } 107 | onItemSelect(item: any) { 108 | console.log(item); 109 | console.log(this.selectedItems); 110 | } 111 | OnItemDeSelect(item: any) { 112 | console.log(item); 113 | console.log(this.selectedItems); 114 | } 115 | onSelectAll(items: any) { 116 | console.log(items); 117 | } 118 | onDeSelectAll(items: any) { 119 | console.log(items); 120 | } 121 | } -------------------------------------------------------------------------------- /src/app/examples/views/customSearch.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/app/examples/views/dialog-content-example-dialog.html: -------------------------------------------------------------------------------- 1 | 3 | 4 |

Develop across all platforms

5 |

Learn one way to build applications with Angular and reuse your code and abilities to build 6 | apps for any deployment target. For web, mobile web, native mobile and native desktop.

7 | 8 |

Speed & Performance

9 |

Achieve the maximum speed possible on the Web Platform today, and take it further, via Web 10 | Workers and server-side rendering. Angular puts you in control over scalability. Meet huge 11 | data requirements by building data models on RxJS, Immutable.js or another push-model.

12 | 13 |

Incredible tooling

14 |

Build features quickly with simple, declarative templates. Extend the template language with 15 | your own components and use a wide array of existing components. Get immediate Angular-specific 16 | help and feedback with nearly every IDE and editor. All this comes together so you can focus 17 | on building amazing apps rather than trying to make the code work.

18 | 19 |

Loved by millions

20 |

From prototype through global deployment, Angular delivers the productivity and scalable 21 | infrastructure that supports Google's largest applications.

22 | 23 |

What is Angular?

24 | 25 |

Angular is a platform that makes it easy to build applications with the web. Angular 26 | combines declarative templates, dependency injection, end to end tooling, and integrated 27 | best practices to solve development challenges. Angular empowers developers to build 28 | applications that live on the web, mobile, or the desktop

29 | 30 |

Architecture overview

31 | 32 |

Angular is a platform and framework for building client applications in HTML and TypeScript. 33 | Angular is itself written in TypeScript. It implements core and optional functionality as a 34 | set of TypeScript libraries that you import into your apps.

35 | 36 |

The basic building blocks of an Angular application are NgModules, which provide a compilation 37 | context for components. NgModules collect related code into functional sets; an Angular app is 38 | defined by a set of NgModules. An app always has at least a root module that enables 39 | bootstrapping, and typically has many more feature modules.

40 | 41 |

Components define views, which are sets of screen elements that Angular can choose among and 42 | modify according to your program logic and data. Every app has at least a root component.

43 | 44 |

Components use services, which provide specific functionality not directly related to views. 45 | Service providers can be injected into components as dependencies, making your code modular, 46 | reusable, and efficient.

47 | 48 |

Both components and services are simply classes, with decorators that mark their type and 49 | provide metadata that tells Angular how to use them.

50 | 51 |

The metadata for a component class associates it with a template that defines a view. A 52 | template combines ordinary HTML with Angular directives and binding markup that allow Angular 53 | to modify the HTML before rendering it for display.

54 | 55 |

The metadata for a service class provides the information Angular needs to make it available 56 | to components through Dependency Injection (DI).

57 | 58 |

An app's components typically define many views, arranged hierarchically. Angular provides 59 | the Router service to help you define navigation paths among views. The router provides 60 | sophisticated in-browser navigational capabilities.

-------------------------------------------------------------------------------- /src/app/examples/views/disableMode.html: -------------------------------------------------------------------------------- 1 | 3 |
4 |
5 |
6 | 7 | 8 |
-------------------------------------------------------------------------------- /src/app/examples/views/dynamicData.html: -------------------------------------------------------------------------------- 1 | 3 |
4 |
5 |
6 | 7 | 8 |
-------------------------------------------------------------------------------- /src/app/examples/views/events.html: -------------------------------------------------------------------------------- 1 | 8 | 9 |
10 |
11 |
12 |
13 |
On Select
14 | 16 |
17 |
18 |
On Un-select
19 | 21 |
22 |
23 |
On Open
24 | 26 |
27 |
28 |
On Close
29 | 31 |
32 |
33 |
On Select All
34 | 36 |
37 |
38 |
On Un-Select All
39 | 41 |
42 |
-------------------------------------------------------------------------------- /src/app/examples/views/groupBy.html: -------------------------------------------------------------------------------- 1 | 13 |
14 |
15 |
16 | 19 | 22 |
-------------------------------------------------------------------------------- /src/app/examples/views/lazyLoading.html: -------------------------------------------------------------------------------- 1 | 10 |
11 | Total Records : {{itemList.length}} 12 |
13 |
14 |
15 | 23 |
-------------------------------------------------------------------------------- /src/app/examples/views/lazyLoadingRemoteData.html: -------------------------------------------------------------------------------- 1 | 11 |
12 | Total Records : {{itemList.length}} 13 |
14 |
15 |
16 | 24 |
-------------------------------------------------------------------------------- /src/app/examples/views/multipledropdowns.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 7 |
8 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 28 |
29 | 40 | 41 |
-------------------------------------------------------------------------------- /src/app/examples/views/remoteData.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/app/examples/views/resetDropdown.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 8 | 11 |
12 | 22 |
23 | -------------------------------------------------------------------------------- /src/app/examples/views/searchFilter.html: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /src/app/examples/views/singleSelection.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /src/app/examples/views/templating.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/app/examples/views/theming.html: -------------------------------------------------------------------------------- 1 | 5 |

Code

6 | 7 | -------------------------------------------------------------------------------- /src/app/examples/views/using-in-form.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 7 |
8 |
Name is required
9 |
Only alphabetsallowed
10 | 11 |
12 |
13 |
14 |
15 | 16 | * required 17 | 19 |
20 |
Email is required
21 |
Email format should be joe@abc.com
22 |
23 |
24 |
25 |
26 | 27 | * required 28 | 34 | 35 |
36 |
Atleast one Skill is required
37 |
38 |
39 |
40 |
41 | 42 |
43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 |
{{formModel.name}}
{{formModel.email}}
57 |
{{obj.itemName}}
58 |
61 | {{formModel | json}} 62 |

Form status: {{ loginForm.form.status | json }}

63 | -------------------------------------------------------------------------------- /src/app/examples/views/using-in-react-form.html: -------------------------------------------------------------------------------- 1 |
6 |
7 | 8 | 9 |
10 |
11 |
12 | 13 | * required 14 | 15 |
16 |
17 |
18 | 19 | * required 20 | 30 | 31 |
32 |
33 |
34 | 41 |
42 | 43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 58 | 59 |
{{userForm.value.name}}
{{userForm.value.email}}
56 |
{{obj.itemName}}
57 |
60 | {{userForm.value | json}} 61 |

Form status: {{ userForm.status | json }}

62 | -------------------------------------------------------------------------------- /src/app/examples/views/usingInList.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/examples/views/usingWithinDialog.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 |
7 | -------------------------------------------------------------------------------- /src/app/examples/views/view.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /src/app/main.prerender.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | export { AppPrerenderModule } from './app.prerender.module'; 3 | 4 | enableProdMode(); -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-128x128.png -------------------------------------------------------------------------------- /src/assets/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-144x144.png -------------------------------------------------------------------------------- /src/assets/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-152x152.png -------------------------------------------------------------------------------- /src/assets/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-192x192.png -------------------------------------------------------------------------------- /src/assets/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-384x384.png -------------------------------------------------------------------------------- /src/assets/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-512x512.png -------------------------------------------------------------------------------- /src/assets/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-72x72.png -------------------------------------------------------------------------------- /src/assets/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/icons/icon-96x96.png -------------------------------------------------------------------------------- /src/assets/img/GitHub-Mark-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/GitHub-Mark-32px.png -------------------------------------------------------------------------------- /src/assets/img/GitHub-Mark-64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/GitHub-Mark-64px.png -------------------------------------------------------------------------------- /src/assets/img/angular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/assets/img/coffee11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/coffee11.png -------------------------------------------------------------------------------- /src/assets/img/cuppa-logo-coffee11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/cuppa-logo-coffee11.png -------------------------------------------------------------------------------- /src/assets/img/cuppa_logo_128X128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/cuppa_logo_128X128.png -------------------------------------------------------------------------------- /src/assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/loading.gif -------------------------------------------------------------------------------- /src/assets/img/multiselect-dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/multiselect-dropdown.png -------------------------------------------------------------------------------- /src/assets/img/multiselect.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/multiselect.jpeg -------------------------------------------------------------------------------- /src/assets/img/sand-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/assets/img/sand-background.jpg -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CuppaLabs/angular2-multiselect-dropdown/ec5c610ad65bf3d75f9fee8d000faecf026a0cd0/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular Multiselect Dropdown | Cuppa Labs 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 40 | 48 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-multiselect-dropdown", 3 | "short_name": "angular2-multiselect-dropdown", 4 | "theme_color": "#1976d2", 5 | "background_color": "#fafafa", 6 | "display": "standalone", 7 | "scope": "./", 8 | "start_url": "./", 9 | "icons": [ 10 | { 11 | "src": "assets/icons/icon-72x72.png", 12 | "sizes": "72x72", 13 | "type": "image/png", 14 | "purpose": "maskable any" 15 | }, 16 | { 17 | "src": "assets/icons/icon-96x96.png", 18 | "sizes": "96x96", 19 | "type": "image/png", 20 | "purpose": "maskable any" 21 | }, 22 | { 23 | "src": "assets/icons/icon-128x128.png", 24 | "sizes": "128x128", 25 | "type": "image/png", 26 | "purpose": "maskable any" 27 | }, 28 | { 29 | "src": "assets/icons/icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image/png", 32 | "purpose": "maskable any" 33 | }, 34 | { 35 | "src": "assets/icons/icon-152x152.png", 36 | "sizes": "152x152", 37 | "type": "image/png", 38 | "purpose": "maskable any" 39 | }, 40 | { 41 | "src": "assets/icons/icon-192x192.png", 42 | "sizes": "192x192", 43 | "type": "image/png", 44 | "purpose": "maskable any" 45 | }, 46 | { 47 | "src": "assets/icons/icon-384x384.png", 48 | "sizes": "384x384", 49 | "type": "image/png", 50 | "purpose": "maskable any" 51 | }, 52 | { 53 | "src": "assets/icons/icon-512x512.png", 54 | "sizes": "512x512", 55 | "type": "image/png", 56 | "purpose": "maskable any" 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /*************************************************************************************************** 2 | * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. 3 | */ 4 | import '@angular/localize/init'; 5 | /** 6 | * This file includes polyfills needed by Angular and is loaded before the app. 7 | * You can add your own extra polyfills to this file. 8 | * 9 | * This file is divided into 2 sections: 10 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 11 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 12 | * file. 13 | * 14 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 15 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 16 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 17 | * 18 | * Learn more in https://angular.io/guide/browser-support 19 | */ 20 | 21 | /*************************************************************************************************** 22 | * BROWSER POLYFILLS 23 | */ 24 | 25 | /** IE11 requires the following for NgClass support on SVG elements */ 26 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 27 | 28 | /** 29 | * Web Animations `@angular/platform-browser/animations` 30 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 31 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 32 | */ 33 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 34 | 35 | /** 36 | * By default, zone.js will patch all possible macroTask and DomEvents 37 | * user can disable parts of macroTask/DomEvents patch by setting following flags 38 | * because those flags need to be set before `zone.js` being loaded, and webpack 39 | * will put import in the top of bundle, so user need to create a separate file 40 | * in this directory (for example: zone-flags.ts), and put the following flags 41 | * into that file, and then add the following code before importing zone.js. 42 | * import './zone-flags'; 43 | * 44 | * The flags allowed in zone-flags.ts are listed here. 45 | * 46 | * The following flags will work for all browsers. 47 | * 48 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 49 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 50 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 51 | * 52 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 53 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 54 | * 55 | * (window as any).__Zone_enable_cross_context_check = true; 56 | * 57 | */ 58 | 59 | /*************************************************************************************************** 60 | * Zone JS is required by default for Angular itself. 61 | */ 62 | import 'zone.js'; // Included with Angular CLI. 63 | 64 | 65 | /*************************************************************************************************** 66 | * APPLICATION IMPORTS 67 | */ 68 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | $nav-link-font-size: 0.875rem !default; 2 | $navbar-nav-link-padding-x: 1rem !default; 3 | $nav-link-padding-y: 1rem !default; 4 | $nav-link-color: #5f6368 !default; 5 | $nav-tabs-link-active-color: #0d6efd !default; 6 | $nav-tabs-link-active-border-color: #0d6efd !default; 7 | $nav-tabs-border-width: .0625rem; 8 | 9 | @import "node_modules/bootstrap/scss/bootstrap"; 10 | 11 | body { 12 | min-height: 75rem; 13 | padding-top: 60px; 14 | } 15 | 16 | .cuppa-navbar { 17 | background: $white; 18 | box-shadow: 0 0 0px rgb(0 0 0 / 14%), 0 1px 5px rgb(0 0 0 / 28%); 19 | padding: 0 !important; 20 | } 21 | .cuppa-brand { 22 | max-width: 230px; 23 | margin: 0; 24 | padding: 0px; 25 | } 26 | .cuppa-brand img{ 27 | 28 | } 29 | .cuppa-brand span:nth-child(2){ 30 | font-size: 1.4rem; 31 | color: $gray-900 32 | } 33 | .cuppa-brand span:nth-child(3){ 34 | color: $gray-800 35 | } 36 | .sidebar .nav-link { 37 | color: $gray-800; 38 | font-weight: 400; 39 | } 40 | .sidebar .nav-link.active { 41 | background-color: $gray-100; 42 | } 43 | .navbar .nav-item { 44 | padding: 0px 10px; 45 | } 46 | .navbar .nav-item.active { 47 | border-bottom: 2px solid $primary; 48 | } 49 | .nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover{ 50 | border-color: transparent; 51 | } 52 | .nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active { 53 | color: $primary; 54 | background-color: transparent; 55 | border-color: transparent transparent $primary; 56 | border-bottom-width: .2rem; 57 | } 58 | .example-button-row .btn { 59 | margin: 5px; 60 | } 61 | iframe { 62 | height: 1300px !important; 63 | } -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting() 14 | ); 15 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "esModuleInterop": true, 8 | "strict": false, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "sourceMap": true, 12 | "declaration": false, 13 | "experimentalDecorators": true, 14 | "moduleResolution": "node", 15 | "importHelpers": true, 16 | "target": "ES2022", 17 | "module": "es2020", 18 | "lib": [ 19 | "es2020", 20 | "dom" 21 | ], 22 | "paths": { 23 | "angular2-multiselect-dropdown-lib": [ 24 | "dist/angular2-multiselect-dropdown-lib/angular2-multiselect-dropdown-lib", 25 | "dist/angular2-multiselect-dropdown-lib" 26 | ] 27 | }, 28 | "useDefineForClassFields": false 29 | }, 30 | "angularCompilerOptions": { 31 | "strictInjectionParameters": true, 32 | "strictInputAccessModifiers": true, 33 | "strictTemplates": true 34 | } 35 | } -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "align": { 8 | "options": [ 9 | "parameters", 10 | "statements" 11 | ] 12 | }, 13 | "array-type": false, 14 | "arrow-return-shorthand": true, 15 | "curly": true, 16 | "deprecation": { 17 | "severity": "warning" 18 | }, 19 | "eofline": true, 20 | "import-blacklist": [ 21 | true, 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": { 26 | "options": [ 27 | "spaces" 28 | ] 29 | }, 30 | "max-classes-per-file": false, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-empty": false, 55 | "no-inferrable-types": [ 56 | true, 57 | "ignore-params" 58 | ], 59 | "no-non-null-assertion": true, 60 | "no-redundant-jsdoc": true, 61 | "no-switch-case-fall-through": true, 62 | "no-var-requires": false, 63 | "object-literal-key-quotes": [ 64 | true, 65 | "as-needed" 66 | ], 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "semicolon": { 72 | "options": [ 73 | "always" 74 | ] 75 | }, 76 | "space-before-function-paren": { 77 | "options": { 78 | "anonymous": "never", 79 | "asyncArrow": "always", 80 | "constructor": "never", 81 | "method": "never", 82 | "named": "never" 83 | } 84 | }, 85 | "typedef": [ 86 | true, 87 | "call-signature" 88 | ], 89 | "typedef-whitespace": { 90 | "options": [ 91 | { 92 | "call-signature": "nospace", 93 | "index-signature": "nospace", 94 | "parameter": "nospace", 95 | "property-declaration": "nospace", 96 | "variable-declaration": "nospace" 97 | }, 98 | { 99 | "call-signature": "onespace", 100 | "index-signature": "onespace", 101 | "parameter": "onespace", 102 | "property-declaration": "onespace", 103 | "variable-declaration": "onespace" 104 | } 105 | ] 106 | }, 107 | "variable-name": { 108 | "options": [ 109 | "ban-keywords", 110 | "check-format", 111 | "allow-pascal-case" 112 | ] 113 | }, 114 | "whitespace": { 115 | "options": [ 116 | "check-branch", 117 | "check-decl", 118 | "check-operator", 119 | "check-separator", 120 | "check-type", 121 | "check-typecast" 122 | ] 123 | }, 124 | "component-class-suffix": true, 125 | "contextual-lifecycle": true, 126 | "directive-class-suffix": true, 127 | "no-conflicting-lifecycle": true, 128 | "no-host-metadata-property": true, 129 | "no-input-rename": true, 130 | "no-inputs-metadata-property": true, 131 | "no-output-native": true, 132 | "no-output-on-prefix": true, 133 | "no-output-rename": true, 134 | "no-outputs-metadata-property": true, 135 | "template-banana-in-box": true, 136 | "template-no-negated-async": true, 137 | "use-lifecycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "directive-selector": [ 140 | true, 141 | "attribute", 142 | "app", 143 | "camelCase" 144 | ], 145 | "component-selector": [ 146 | true, 147 | "element", 148 | "app", 149 | "kebab-case" 150 | ] 151 | } 152 | } 153 | --------------------------------------------------------------------------------