New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ng-bootstrap-nested-select

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-bootstrap-nested-select

To install this library, run:

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

ng-bootstrap-nested-select

Installation

To install this library, run:

$ npm install ng-bootstrap-nested-select --save

Dependencies to install

$ npm install bootstrap --save

Then you'll need to add the bootstrap.min.css file if you haven't already to you angular config file

"styles": [
  "node_modules/bootstrap/dist/css/bootstrap.min.css",
  "src/styles.css"
],

Consuming your library

Once you have published your library to npm, you can import your library in any Angular application by running:

$ npm install ng-bootstrap-nested-select

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { NgBootstrapNestedSelectModule } from 'ng-bootstrap-nested-select';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgBootstrapNestedSelectModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Inputs

OptionTypeDescription
optionsArrayAn array of object where each must have a "name" and "options" fields
settingsNgBootstrapNestedSelectSettingsAn object of settings to control the select box
defaultObjectThe default object to show, from the "options" list
actionsNgBootstrapNestedSelectActionsAn array of action (links or buttons) that will be displayed within the select box
disabledBooleanDisable the select box

Outputs

OptionTypeDescription
selectedobjectPasses back selected object
actionSelectobjectPasses back the action object when one is selected

NgBootstrapNestedSelectActions [actions] Input

OptionTypeDescription
idNumberUnique ID for this action
labelStringLabel that is displayed to the user

NgBootstrapNestedSelectSettings [settings] Input

OptionTypeDescriptionDefault
fieldStringThe name of the field that you want to iterate over, which contains the array of options'options'
topBooleanDisplay select options above input fieldfalse
scrollBooleanUse min-height and overflow-y scroll css to limit height of select boxtrue
selectAllBooleanAllows user to select multi optionsfalse
collapsedBooleanCollapse all child options and only display top most parentfalse
labelStringName of the field in the option object to display as label in drop down.'name'
clearString or BooleanSet text of clear button. Setting to false will hide clear button.'Clear'
strictBooleanDisabled search. Only list options.false
filter{fields: [...array of fields as strings]}Fields in each option to search for when filtering.
actionsStringThe style of the action options. 'link' = plain text, 'buttons' = bootstrap button'link'
requiredBooleanField is required. Adds "required" class.false
indexedOptionsBoolean
numberInputBoolean type is "number"false
matchRatingFloatUsing the "string-similarity" package, a rating number between 0-1. See https://www.npmjs.com/package/string-similarity0.4
emptyTextStringText to display when no options are available
popoverTitleString or BooleanWhen disabled, select box will have a popover of option selected. This is title to that popover. false = hide popover
<!--
myOptions = [
    { 
        name: 'Parent Item', 
        options: [
            { 
                name: 'Child Item', 
                options [
                    ...
                ]
            }
        ]
    }
];
-->
<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

MIT © Scot Schroeder

Keywords

angular

FAQs

Package last updated on 03 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts