This package has been deprecated

Author message:

This component is deprecated

@advanced-rest-client/variables-manager
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Published on NPM

Build Status

Published on webcomponents.org

<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

Package Sidebar

Install

npm i @advanced-rest-client/variables-manager

Weekly Downloads

2

Version

3.0.1

License

Apache-2.0

Unpacked Size

71.9 kB

Total Files

6

Last publish

Collaborators

  • carowright
  • jarrodek
  • twoplustwoone
  • lbauret