1.6.6 • Published 9 months ago
@grafana/labels v1.6.6
@grafana/labels
Getting Started
The following guide is for consuming the library imports
- Import core component
import { ServiceLabels } from '@grafana/labels'
- Render
ServiceLabels
<ServiceLabels
value={options}
errors={{}}
loadById
onLoadKeys={() => Promise.resolve(keys)}
onLoadValuesForKey={() => Promise.resolve(values)}
onCreateKey={() => Promise.resolve(undefined)}
onUpdateKey={() => Promise.resolve(undefined)}
onCreateValue={() => Promise.resolve(undefined)}
onUpdateValue={() => Promise.resolve(undefined)}
onRowItemRemoval={() => {}}
onDataUpdate={(result) => console.info(result)}
/>
Props you may want to pass to the component
valueField
- (optional) Field name for the id field (defaults toid
)labelField
- (optional) Field name for the value field (defaults toname
)loadById
- (optional - defaults totrue
) If true this will pas the id to some callbacks that fetch that, otherwise it will pass the valueonLoadKeys
- Callback for fetching the keysonLoadValuesForKey
- Callback for fetching the values for a keyonCreateKey
- Callback for requesting data whenever a new key is addedonUpdateKey
- Callback for requesting data whenever a key is updated (edited)onCreateValue
- Callback for requesting data whenever a new value is addedonUpdateValue
- Callback for requesting data whenever a value is updated (edited)onRowItemRemoval
- (optional) Callback for when a row is being removed (clicked X)onDataUpdate
- Callback for whenever the data changes (add/edit/add new row/remove row)
valueField
and labelField
allow customizing the data type you pass to the component in case you don't want to follow id
/name
convention
The following guide is for running the development version
To bootstrap both the webpack server and the library build:
- Open terminal and run
yarn watch
in thefrontend
directory - this will watch for any changes in library - Run
yarn link
to allow creating a symlink to this directory - In your grafana plugin directory, run
yarn add '@grafana/labels'
Available commands
yarn build // triggers webpack to build the library
yarn watch // triggers webpack to watch for library changes
NPM library publishing
- Update version
in package.json
- Run
npm publish
, authenticate and voila!
1.6.6
9 months ago
1.6.4
9 months ago
1.6.3
9 months ago
1.6.2
9 months ago
1.6.1
9 months ago
1.6.5
9 months ago
1.6.0
10 months ago
1.5.1
1 year ago
1.4.5
1 year ago
1.5.0
1 year ago
1.4.4
2 years ago
1.4.3
2 years ago
1.4.2
2 years ago
1.4.1
2 years ago
1.4.0
2 years ago
1.3.5
2 years ago
1.3.4
2 years ago
1.3.3
2 years ago
1.3.2
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.1
2 years ago
0.0.1-beta.12
2 years ago
0.0.1-beta.11
2 years ago
0.0.1-beta.10
2 years ago
0.0.1-beta.9
2 years ago
0.0.1-beta.8
2 years ago
0.0.1-beta.7
2 years ago
0.0.1-beta.6
2 years ago
0.0.1-beta.5
2 years ago
0.0.1-beta.4
2 years ago
0.0.1-beta.2
2 years ago
0.0.1-beta.1
2 years ago
0.0.1-beta.0
2 years ago