README
<variables-manager>
A manager for environments and variables.
Non UI element that manages variables state and handle storage. It works with other elements consuming variables:
- variables-editor
- environment-selector
- variables-evaluator
- variables-consumer-mixin (used by variables consumers)
API components
This components is a part of API components ecosystem
Usage
Installation
npm install --save @advanced-rest-client/variables-manager
In an html file
<html>
<head>
<script type="module">
import './node_modules/@advanced-rest-client/variables-manager/variables-manager.js';
import './node_modules/@advanced-rest-client/arc-models/variables-model.js';
</script>
</head>
<body>
<variables-manager></variables-manager>
</body>
</html>
In a LitElement template
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/variables-manager/variables-manager.js';
class SampleElement extends LitElement {
render() {
return html`
<variables-manager
@environment-changed="${this._environmentHandler}"
@variables-changed="${this._variablesHandler}"></variables-manager>
`;
}
_environmentHandler(e) {
this.currentEnvironment = e.target.environment; // or e.detail.value;
}
_environmentHandler(e) {
this.currentVariables = e.target.variables; // or e.detail.value;
}
}
customElements.define('sample-element', SampleElement);
In a Polymer 3 element
import {PolymerElement, html} from '@polymer/polymer';
import '@advanced-rest-client/variables-manager/variables-manager.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
<variables-manager environment="{{environment}}" variables="{{currentVariables}}"></variables-manager>
`;
}
}
customElements.define('sample-element', SampleElement);
Installation
git clone https://github.com/advanced-rest-client/variables-manager
cd variables-manager
npm install
Running the demo locally
npm start
Running the tests
npm test