Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Description

The package can be installed via npm:

npm i empower-inputs
import { SelectWithLinks } from 'empower-inputs';

.....................................

const sampleSelectWithLinks = {
    id: 'link',
    type: 'multi-select',
    options: [
      {
        category: "Csa",
        label: "Sample 1 Links",
        link: "/sample-1",
        value: "sample-1"
    
      },
      {
        category: "Csa",
        label: "Sample 2 Links",
        link: "/sample-2",
        value: "sample-2"
    
      },
      {
        category: "Csa",
        label: "Sample 3 Links",
        link: "/sample-3",
        value: "sample-3"
      }
    ],
    placeholder: 'Search for deals',
    label: "Sample Select With Links",
    value: [],
    disabled: false,
    required: true,
    isMultiple: false
}

..................................

const inputChangedHandler = (val, key) => {
    console.log('VAL', val)
    console.log('KEY', key)
}

 <SelectWithLinks
    config={sampleSelectWithLinks}
    onChanged={(e: any) => inputChangedHandler(e, 'sampleSelectWithLinks')}
  />

Parameter

Data Type

Constraint

Description

id

String

Required

Set the id for the select.

type

String

Required

Set the component to display if multiple select drop down will be use.

options

Array

Required

Set the data to display in the drop down selection.

It should consist of:

  • category

  • label

  • link

  • value

placeholder

String

Optional

Set the placeholder of the select.

label

String

Optional

Set the title/label of the select

value

Array

Required

Set the value that selected in drop down.

disabled

Boolean

Optional

Set if the select is disable or not.

required

Boolean

Optional

Set to display asterisk ('*') or not.

isMultiple

Boolean

Required

Set if the component is multiple-select or not.

Repository Link: https://gitlab.com/empowerteams/empower-inputs.git

NPM Package: https://www.npmjs.com/package/empower-inputs

Demo Repo: git@bitbucket.org:empowerteams/mfe-sub-application-template.git

  • No labels