0.4.6 • Published 7 years ago

anrom-jive-osapi-picker v0.4.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

anrom-jive-osapi-picker

Requirements

  • osapi global variable have to be exported as 'jive/osapi' in webpack externals
  • webpack should be configured to proces CSS files with style-loader!css-loader rule

Installation

npm

npm install -S anrom-jive-osapi-picker

Usage

Usage example:

import React from 'react'
import JivePicker from 'anrom-jive-osapi-picker'

export default function Picker({author, setAuthor}){
    return <JivePicker
        buttonTitle="Добавить блог"
        contentType="people"
        value={author}
        onChange={person => setAuthor({author: person})}
    />
}

Example of use with array as value

import React from 'react'
import JivePicker from 'anrom-jive-osapi-picker'

export default function Picker({placesArray, setPlaces}){
    return <JivePicker
        value={placesArray}
        // function receives the whole new array, not a single item
        onChange={places => setPlaces({placesArray: places})}
    />
}

API

Component propperties

propertytypedefaultdescription
buttonTitlestring"Add place"Sets the add button title
contentTypestring"place"Possible options: "people", "content" Defines the type of content that the picker will be handling.
valueobject/array-Current place/person/content item or the array of specified type. If array given the selector will allow multiple values
onChangefunction-arguments: selected item (object). Fires when the selection of an object is performed
0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago