Skip to content

Commit

Permalink
Updating to version 1.0.2. Major changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sscots committed Oct 3, 2019
1 parent 88e0311 commit a9506b0
Show file tree
Hide file tree
Showing 29 changed files with 10,981 additions and 6,081 deletions.
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .yo-rc.json

This file was deleted.

64 changes: 50 additions & 14 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,66 @@ export class AppModule { }
### Inputs
| Option | Type | Description
| ------------- |:-------------:| ---------|
| options | array | An array of object where each must have a "name" and "options" fields
| default | object | The default object to show, from the "options" list
| options | Array | An array of object where each must have a "name" and "options" fields
| settings | NgBootstrapNestedSelectSettings | An object of settings to control the select box
| default | Object | The default object to show, from the "options" list
| actions | NgBootstrapNestedSelectActions | An array of action (links or buttons) that will be displayed within the select box
| disabled | Boolean | Disable the select box
### Outputs
| Option | Type | Description
| ------------- |:-------------:| ---------|
| selected | object | Passes back selected object
### Settings [settings] options
| Option | Type | Default | Description
| actionSelect | object | Passes back the action object when one is selected
### NgBootstrapNestedSelectActions [actions] Input
| Option | Type | Description
| ------------- |:-------------:| ---------|
| id | Number | Unique ID for this action
| label | String | Label that is displayed to the user
### NgBootstrapNestedSelectSettings [settings] Input
| Option | Type | Description | Default
| ------------- |:-------------:| :-----:| ---------|
| field | string | 'options' | The name of the field that you want to iterate over
| top | boolean | false | Display select options above input field
| scroll | boolean | true | Use min-height and overflow-y scroll css to limit height of select box
| field | String | The name of the field that you want to iterate over, which contains the array of options | 'options'
| top | Boolean | Display select options above input field | false
| scroll | Boolean | Use min-height and overflow-y scroll css to limit height of select box | true
| selectAll | Boolean | Allows user to select multi options | false
| collapsed | Boolean | Collapse all child options and only display top most parent | false
| label | String | Name of the field in the option object to display as label in drop down. | 'name'
| clear | String or Boolean | Set text of clear button. Setting to false will hide clear button. | 'Clear'
| strict | Boolean | Disabled search. Only list options. | false
| filter | {fields: [...array of fields as strings]} | Fields in each option to search for when filtering.
| actions | String | The style of the action options. 'link' = plain text, 'buttons' = bootstrap button | 'link'
| required | Boolean | Field is required. Adds "required" class. | false
| indexedOptions | Boolean
| numberInput | Boolean | <input> type is "number" | false
| matchRating | Float | Using the "string-similarity" package, a rating number between 0-1. See https://www.npmjs.com/package/string-similarity | 0.4
| emptyText | String | Text to display when no options are available
| popoverTitle | String or Boolean | When disabled, select box will have a popover of option selected. This is title to that popover. false = hide popover

```html
<!--
list = [
{ name: 'Parent Item', options: [
{ name: 'Child Item', options [
...
]}
]}
myOptions = [
{
name: 'Parent Item',
options: [
{
name: 'Child Item',
options [
...
]
}
]
}
];
-->
<nested-select [items]="list" [default]="list[0][0]" [settings]="{field: 'options', top: false, scroll: true}" (selected)="onSelect($event)" ></nested-select>
<nested-select
[options]="myOptions"
[default]="myOptions[0].options[0]"
[settings]="{collapsed: true, strict: false}"
[actions]="{id: 1, label: 'Add Option'}"
(selected)="triggerSelected($event)"
(actionSelected)="triggerAction($event)">

</nested-select>
```

## License
Expand Down
11 changes: 0 additions & 11 deletions bs-config.json

This file was deleted.

32 changes: 32 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/ng-bootstrap-nested-select'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
15 changes: 15 additions & 0 deletions ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/ng-bootstrap-nested-select",
"lib": {
"entryFile": "src/public-api.ts",
"umdModuleIds": {
"string-similarity": "string-similarity",
"@ng-bootstrap/ng-bootstrap": "@ng-bootstrap/ng-bootstrap"
}
},
"whitelistedNonPeerDependencies": [
"string-similarity",
"@ng-bootstrap/ng-bootstrap"
]
}
Loading

0 comments on commit a9506b0

Please sign in to comment.