Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add clear all text Input #155

Merged
merged 5 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ addons:
packages:
- google-chrome-stable
before_install:
- echo "$TRAVIS_BRANCH"
- echo "$TRAVIS_PULL_REQUEST"
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then openssl aes-256-cbc -K $encrypted_100b62b33cf9_key -iv $encrypted_100b62b33cf9_iv -in travis_rsa.enc -out travis_rsa -d; fi
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- export CHROME_BIN=chromium-browser
Expand All @@ -25,6 +28,7 @@ script:
- npm run-script coveralls
- yarn run integration
- yarn run build:demo
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == false ]; then node_modules/.bin/gh-pages-travis; fi

env:
global:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ map: {
| placeholder | string | `-` | no | Placeholder text. |
| notFoundText | string | `No items found` | no | Set custom text when filter returns empty result |
| typeToSearchText | string | `Type to search` | no | Set custom text when using Typeahead |
| clearAllText | string | `Clear all` | no | Set custom text for clear all icon title |
| addTagText | string | `Add item` | no | Set custom text when using tagging |
| [typeahead] | Subject | `-` | no | Custom autocomplete or filter. |
| [disableVirtualScroll] | boolean | false | no | Disable virtual scroll |
Expand Down
1 change: 1 addition & 0 deletions demo/app/examples/reactive-forms.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { DataService } from '../shared/data.service';
bindValue="id"
[multiple]="true"
placeholder="Select cities"
clearAllText="Clear"
formControlName="selectedCitiesIds">
</ng-select>
---
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"reflect-metadata": "^0.1.10",
"remap-istanbul": "^0.6.4",
"rimraf": "^2.6.1",
"rxjs": "^5.4.3",
"rxjs": "^5.5.3",
"sass-loader": "^6.0.1",
"standard-version": "^4.2.0",
"style-loader": "^0.13.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ng-select/ng-select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<spinner class="ng-spinner-zone" *ngIf="isLoading"></spinner>

<span *ngIf="showClear()" (click)="handleClearClick($event)" class="ng-clear-zone" title="Clear all" aria-label="Clear all">
<span *ngIf="showClear()" (click)="handleClearClick($event)" class="ng-clear-zone" title="{{clearAllText}}">
<span class="ng-clear" aria-hidden="true">×</span>
</span>

Expand Down
2 changes: 2 additions & 0 deletions src/ng-select/ng-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie
@Input() typeToSearchText;
@Input() addTagText;
@Input() loadingText;
@Input() clearAllText;
@Input() dropdownPosition: 'below' | 'above' = 'below';

@Input()
Expand Down Expand Up @@ -621,6 +622,7 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie
this.typeToSearchText = this.typeToSearchText || config.typeToSearchText;
this.addTagText = this.addTagText || config.addTagText;
this.loadingText = this.loadingText || config.loadingText;
this.clearAllText = this.clearAllText || config.clearAllText;
this.disableVirtualScroll = this.disableVirtualScroll || config.disableVirtualScroll;
}
}
1 change: 1 addition & 0 deletions src/ng-select/ng-select.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ export class NgSelectConfig {
typeToSearchText? = 'Type to search';
addTagText? = 'Add item';
loadingText? = 'Loading...';
clearAllText = 'Clear all';
disableVirtualScroll? = false;
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5639,9 +5639,9 @@ rollup@^0.50.0:
version "0.50.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.50.0.tgz#4c158f4e780e6cb33ff0dbfc184a52cc58cd5f3b"

rxjs@^5.4.3:
version "5.4.3"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.3.tgz#0758cddee6033d68e0fd53676f0f3596ce3d483f"
rxjs@^5.5.3:
version "5.5.3"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.3.tgz#b62227e74b84f4e77bdf440e50b5ee01a1bc7dcd"
dependencies:
symbol-observable "^1.0.1"

Expand Down