Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'beta.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastiaan van den Berg committed Jul 5, 2017
2 parents b7c42f5 + 64e100f commit 5a5b2bb
Show file tree
Hide file tree
Showing 177 changed files with 12,737 additions and 2,506 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

npm-debug.log
yarn-error.log
.vscode

*.orig
*.swp
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tslint.json
.editorconfig
.npmignore
.travis.yml
.vscode

npm-debug.log
yarn-error.log
Expand Down
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog



<a name="1.0.0-beta.6"></a>
## [1.0.0-beta.6](https://github.com/basvandenberg/ng-select/compare/1.0.0-beta.5...1.0.0-beta.6) (2017-07-05)

### Features
- New ng-select web site.
- Blur and focus output events (#170).
- Option template for customizing option layout/styling (#92).

### Bug fixes
- Stop clearing the (single select) filter input in the drop down (#162).
- Enable/disable filter (based on noFilter) if list of options changes (#146).
- Skip disabled options when navigating option list with up/down keys (#182).
- Set value, also if there is no option with this value present yet, this
prevents having to use setTimeout when setting a value directly after
setting/updating options (#169, #130).
- Call the onChange only for user (de)select actions (#176).
- Fix missing placeholder (multiple select) if filter is hidden (#110).
- Prevent drop down to close when clicking disabled option (#156).
- Update filter input width when closing drop down (#198).
- Show pointer instead of text cursor when hovering placeholder in multiple
select (#199).
- Added change detection for placeholder property (#192).
- Fixed placeholder initially not visible in multi select (#193).



<a name="1.0.0-beta.5"></a>
## [1.0.0-beta.5](https://github.com/basvandenberg/ng-select/compare/1.0.0-beta.4...1.0.0-beta.5) (2017-03-29)

Expand Down Expand Up @@ -146,7 +174,7 @@ Fixes for use with angular4.

### Improvements

- Set ViewEncapsulation to None to enable style override ([#16] (https://github.com/basvandenberg/ng-select/issues/16)).
- Set ViewEncapsulation to None to enable style override ([#16] (https://github.com/basvandenberg/ng-select/issues/16)).



Expand Down Expand Up @@ -175,4 +203,3 @@ Fixes for use with angular4.
- Update current selection when option list is changed ([#6] (https://github.com/basvandenberg/ng-select/issues/6)).
- Prevent javascript error when list of options is empty ([#7] (https://github.com/basvandenberg/ng-select/issues/7)).
- Prevent javascript error when clicking the 'No results found' option ([#8] (https://github.com/basvandenberg/ng-select/issues/8)).

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2016, B.A. van den Berg
Copyright (c) 2017, B.A. van den Berg

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
170 changes: 18 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,165 +2,31 @@
[![npm version](https://badge.fury.io/js/ng-select.svg)](https://badge.fury.io/js/ng-select)
[![Build Status](https://travis-ci.org/basvandenberg/ng-select.svg?branch=master)](https://travis-ci.org/basvandenberg/ng-select)

A select component for angular, based on the select2 JQuery plugin. See the
[ng-select] page for example uses or try it with this [plunker].
A select component for angular, based on the [select2] JQuery plugin. See the
[ng-select] web site for documentation and examples, or try it with this [plunker].

*Disclaimer*: This is a beta version, not yet intended for production release.

-------------------------------------------------------------------------------
***IMPORTANT NOTICE***

*The angular [press kit](https://angular.io/presskit.html) states that 3rd
party projects should avoid the use of version numbers in their names. The name
of this project is therefore changed from angular2-select to ng-select (since
angular-select was not available on npm anymore).*

*The npm package `angular2-select` will be deprecated, the upcoming beta.4
version will only be available as `ng-select`. Therefore, for upgrading to
beta.4 (which is not yet released) you will need to reinstall the npm package:*
```
npm uninstall --save angular2-select
npm install --save ng-select
```
*And your module import needs to be changed to:*
```
import {SelectModule} from 'ng-select';
```
-------------------------------------------------------------------------------

- [Getting started](#getting-started)
- [Input properties](#input-properties)
- [Output events](#output-events)
- [Methods](#methods)
- [Limitations](#limitations)
- [Develop](#develop)

## Getting started

### Install

For npm users:
```
npm install --save ng-select
```
For yarn users:
```
yarn add ng-select
```

### Configuration

#### Angular cli

After installation, no additional configuration is needed. Import the
`SelectModule` and define it as one of the imports of your application module:

```typescript
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {SelectModule} from 'ng-select';
## Develop

import {AppComponent} from './app.component';
Make sure that `gulp` and `yarn` are installed.

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
SelectModule
],
bootstrap: [
AppComponent
]
})
export class AppModule {}
Clone the repository and run:
```bash
$ yarn install
$ gulp build
```

#### Systemjs

In `systemjs.config.js` add `ng-select` to map and package:

```javascript
var map = {
'ng-select': 'node_modules/ng-select'
};

var packages = {
'ng-select': {
main: 'index.js',
defaultExtension: 'js'
}
};
To install and run the ng-select web site on your local machine, run the following in the demo
folder:
```bash
$ yarn install
$ ng serve
```

## Input properties

| Name | Type | Default | Description |
| ------------------ | ----------------- | --------------------- | ------------------------------------------------------------------------------------------ |
| options | `Array<IOption>`\* | | List of select option. |
| multiple | `boolean` | `false` | If set to true, the select component is multi-select, otherwise single select. |
| allowClear | `boolean` | `false` | Only applies to single select. If set to true, a clickable clear selection cross is shown. |
| disabled | `boolean` | `false` | If set to true, the select component is disabled. |
| highlightColor | `string` | `#2196f3` | Background color of highlighted option. |
| highlightTextColor | `string` | `#fff` | Text color of highlighted option. |
| label | `string` | '' | Label above select container. |
| noFilter | `number` | `0` | Filter is hidden if the number of options is less than the given number. |
| notFoundMsg | `string` | `"No results found"` | The message shown if no options are found for the current filter input value. |
| placeholder | `string` | `""` | Placeholder text that is shown if no options are selected.
| filterPlaceholder | `string` | `""` | Placeholder text that is shown on the filter input (**single select only**).

\* Object that implements the IOption interface (`{value: string, label: string}`)

## Output events

| Name | Value | Description |
| ------------- | --------------------------- | ------------------------------------------------------------------------ |
| opened | `null` | If the select drop down is opened. |
| closed | `null` | If the select drop down is closed. |
| selected | `IOption`\* | Returns selected option object. |
| deselected | `IOption`\* or `[IOption]`\*| Returns deselected option object(s). |
| noOptionsFound| `string` | Returns search term if filter does not return any results. |

\* Object that implements the IOption interface (`{value: string, label: string}`)

## Methods

| Name | Parameters | Description |
| ------------- | --------------------- | --------------------------------------- |
| open | - | Open the select drop down. |
| close | - | Close the select drop down. |
| clear | - | Deselect all selected options. |
| select | `value: string` | Select the option with the given value. |

## Limitations

This component has limitations, which will be handled in future versions.
Currently the goal is to work towards a stable 1.0 release version.

### Scalability

The component is currently not suitable for large numbers of options. If the
dropdown is opened, all options are added to the DOM, which will cause browser
performance issues for large numbers of options. Therefore, if you have more
that a few hundred options, then you will be better of with another solution.

### Custom option view (using an option template)

In version 1.0 it will only be possible to define an option label that will be
shown in the select dropdown. Customizing the option's view (adding an icon for
example) is not possible. Also grouping of options is not supported.

## Develop

Global installations of `gulp` and `yarn` are required for development. Clone
or fork the repository and run:

For manual testing, pack and install a modified version of the ng-select component to ng-select web
site with the script:
```bash
$ ./copy_to_demo.sh
```
yarn install
gulp build
```

[ng-select]: https://basvandenberg.github.io/ng-select
[select2]: https://select2.github.io
[plunker]: https://plnkr.co/edit/vxwV6zxEwZGVUVR5V6tg?p=preview
[changelog]: https://github.com/basvandenberg/ng-select/releases
3 changes: 2 additions & 1 deletion demo/.angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
"styles.css",
"style/base.scss"
],
"scripts": [
"../lib/highlight/highlight.pack.js"
Expand Down
2 changes: 1 addition & 1 deletion demo/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
100 changes: 100 additions & 0 deletions demo/lib/highlight/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,103 @@
## Version 9.12.0

New language:

- *MikroTik* RouterOS Scripting language by [Ivan Dementev][].

New style:

- *VisualStudio 2015 Dark* by [Nicolas LLOBERA][]

Improvements:

- *Crystal* updated with new keywords and syntaxes by [Tsuyusato Kitsune][].
- *Julia* updated to the modern definitions by [Alex Arslan][].
- *julia-repl* added by [Morten Piibeleht][].
- [Stanislav Belov][] wrote a new definition for *1C*, replacing the one that
has not been updated for more than 8 years. The new version supports syntax
for versions 7.7 and 8.
- [Nicolas LLOBERA][] improved C# definition fixing edge cases with function
titles detection and added highlighting of `[Attributes]`.
- [nnnik][] provided a few correctness fixes for *Autohotkey*.
- [Martin Clausen][] made annotation collections in *Clojure* to look
consistently with other kinds.
- [Alejandro Alonso][] updated *Swift* keywords.

[Tsuyusato Kitsune]: https://github.com/MakeNowJust
[Alex Arslan]: https://github.com/ararslan
[Morten Piibeleht]: https://github.com/mortenpi
[Stanislav Belov]: https://github.com/4ppl
[Ivan Dementev]: https://github.com/DiVAN1x
[Nicolas LLOBERA]: https://github.com/Nicolas01
[nnnik]: https://github.com/nnnik
[Martin Clausen]: https://github.com/maacl
[Alejandro Alonso]: https://github.com/Azoy


## Version 9.11.0

New languages:

- *Shell* by [Tsuyusato Kitsune][]
- *jboss-cli* by [Raphaël Parrëe][]

Improvements:

- [Joël Porquet] has [greatly improved the definition of *makefile*][5b3e0e6].
- *C++* class titles are now highlighted as in other languages with classes.
- [Jordi Petit][] added rarely used `or`, `and` and `not` keywords to *C++*.
- [Pieter Vantorre][] fixed highlighting of negative floating point values.


[Tsuyusato Kitsune]: https://github.com/MakeNowJust
[Jordi Petit]: https://github.com/jordi-petit
[Raphaël Parrëe]: https://github.com/rparree
[Pieter Vantorre]: https://github.com/NuclearCookie
[5b3e0e6]: https://github.com/isagalaev/highlight.js/commit/5b3e0e68bfaae282faff6697d6a490567fa9d44b


## Version 9.10.0

Apologies for missing the previous release cycle. Some thing just can't be
automated… Anyway, we're back!

New languages:

- *Hy* by [Sergey Sobko][]
- *Leaf* by [Hale Chan][]
- *N1QL* by [Andres Täht][] and [Rene Saarsoo][]

Improvements:

- *Rust* got updated with new keywords by [Kasper Andersen][] and then
significantly modernized even more by [Eduard-Mihai Burtescu][] (yes, @eddyb,
Rust core team member!)
- *Python* updated with f-literals by [Philipp A][].
- *YAML* updated with unquoted strings support.
- *Gauss* updated with new keywords by [Matt Evans][].
- *Lua* updated with new keywords by [Joe Blow][].
- *Kotlin* updated with new keywords by [Philipp Hauer][].
- *TypeScript* got highlighting of function params and updated keywords by
[Ike Ku][].
- *Scheme* now correctly handles \`-quoted lists thanks to [Guannan Wei].
- [Sam Wu][] fixed handling of `<<` in *C++* defines.

[Philipp A]: https://github.com/flying-sheep
[Philipp Hauer]: https://github.com/phauer
[Sergey Sobko]: https://github.com/profitware
[Hale Chan]: https://github.com/halechan
[Matt Evans]: https://github.com/matthewevans
[Joe Blow]: https://github.com/mossarelli
[Kasper Andersen]: https://github.com/kasma1990
[Eduard-Mihai Burtescu]: https://github.com/eddyb
[Andres Täht]: https://github.com/andrestaht
[Rene Saarsoo]: https://github.com/nene
[Philipp Hauer]: https://github.com/phauer
[Ike Ku]: https://github.com/dempfi
[Guannan Wei]: https://github.com/Kraks
[Sam Wu]: https://github.com/samsam2310


## Version 9.9.0

New languages
Expand Down
4 changes: 2 additions & 2 deletions demo/lib/highlight/highlight.pack.js

Large diffs are not rendered by default.

Loading

0 comments on commit 5a5b2bb

Please sign in to comment.