2017-12-22 15:13:54 +00:00
|
|
|
<!--
|
|
|
|
@license
|
|
|
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
|
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
|
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
|
|
Code distributed by Google as part of the polymer project is also
|
|
|
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
|
|
-->
|
|
|
|
|
|
|
|
<link rel="import" href="../bower_components/polymer/polymer-element.html">
|
|
|
|
<link rel="import" href="shared-styles.html">
|
2018-01-10 18:35:17 +00:00
|
|
|
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
|
|
|
|
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
|
|
|
<link rel="import" href="../bower_components/paper-checkbox/paper-checkbox.html">
|
|
|
|
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
|
|
|
<link rel="import" href="../bower_components/iron-input/iron-input.html">
|
|
|
|
<link rel="import" href="../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
|
|
|
|
<link rel="import" href="../bower_components/vaadin-grid/vaadin-grid.html">
|
2017-12-22 15:13:54 +00:00
|
|
|
|
|
|
|
<dom-module id="colors-view">
|
|
|
|
<template>
|
|
|
|
<style include="shared-styles">
|
|
|
|
:host {
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
padding: 10px;
|
|
|
|
}
|
2018-01-10 18:35:17 +00:00
|
|
|
input[readonly] {
|
|
|
|
border: 2px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
input {
|
|
|
|
font: inherit;
|
|
|
|
}
|
|
|
|
paper-checkbox {
|
|
|
|
--primary-color: #ff5722;
|
|
|
|
}
|
2017-12-22 15:13:54 +00:00
|
|
|
</style>
|
|
|
|
|
2018-01-10 18:35:17 +00:00
|
|
|
<!--<iron-ajax auto url="https://demo.vaadin.com/demo-data/1.0/people?count=200" handle-as="json" last-response="{{users}}"></iron-ajax>
|
|
|
|
-->
|
2017-12-22 15:13:54 +00:00
|
|
|
<div class="card">
|
2018-01-10 18:35:17 +00:00
|
|
|
<div class="circle">3</div>
|
|
|
|
<h1>Edit Color Definition</h1>
|
|
|
|
<p>
|
|
|
|
<paper-checkbox checked="{{editing}}">Enable Editing</paper-checkbox>
|
|
|
|
<vaadin-grid aria-label="Color Definitions" items="[[colors]]">
|
|
|
|
<vaadin-grid-column width="50px" flex-grow="0">
|
|
|
|
<template class="header">#</template>
|
|
|
|
<template>
|
|
|
|
[[index]]
|
|
|
|
</template>
|
|
|
|
</vaadin-grid-column>
|
|
|
|
|
|
|
|
<vaadin-grid-column>
|
|
|
|
<template class="header">Color Name</template>
|
|
|
|
<template>
|
|
|
|
<input type="text" maxLength="40" placeholder="Enter color name" value="{{item.name::input}}" readonly$="[[!editing]]">
|
|
|
|
</template>
|
|
|
|
</vaadin-grid-column>
|
|
|
|
|
|
|
|
<vaadin-grid-column>
|
|
|
|
<template class="header">Color Definition</template>
|
|
|
|
<template>
|
|
|
|
<input type="color" value="{{item.color::input}}" readonly$="[[!editing]]">
|
|
|
|
</template>
|
|
|
|
</vaadin-grid-column>
|
|
|
|
</vaadin-grid>
|
|
|
|
<br />
|
|
|
|
<paper-button raised on-click="addColorsRow">Add Row</paper-button>
|
|
|
|
</p>
|
2017-12-22 15:13:54 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-01-10 18:35:17 +00:00
|
|
|
class ColorsView extends Polymer.Element {
|
2017-12-22 15:13:54 +00:00
|
|
|
static get is() { return 'colors-view'; }
|
|
|
|
ready() {
|
|
|
|
super.ready();
|
2018-01-10 18:35:17 +00:00
|
|
|
}
|
|
|
|
static get properties() {
|
|
|
|
return {
|
|
|
|
editing: { type: Boolean, value: false },
|
|
|
|
colors: { type: Array, value: [{name: "", color: "#000000"}] }
|
2017-12-22 15:13:54 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-10 18:35:17 +00:00
|
|
|
addColorsRow() {
|
|
|
|
this.push('colors', {name: "", color: "#000000"});
|
|
|
|
}
|
2017-12-22 15:13:54 +00:00
|
|
|
}
|
|
|
|
|
2018-01-10 18:35:17 +00:00
|
|
|
window.customElements.define(ColorsView.is, ColorsView);
|
2017-12-22 15:13:54 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</dom-module>
|