aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf_dashboard_common/tf-regex-group.html
blob: c1d3cf06aeadc0aa6c30d24d82ae5aa9ae65a566 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!--
@license
Copyright 2016 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../tf-storage/tf-storage.html">

<!--
`tf-regex-group` provides an input component for a group of regular expressions.

Example:
  <tf-regex-group regexes="{{regexes}}"></tf-regex-group>

It contains a series of regular expression input fields. From this, it computes
`regexes', an array in which every element is either a string representing a
valid, nonempty regular expression, or the value `null`

Public Properties:
`regexes` a readonly, notifying array of strings, where each string is a regex

It maintains an invariant that the final regex should always be an empty string,
so the user can easily add more regular expressions. It does this by adding
a new empty regex when the final one is nonempty.

Pressing "enter" moves focus to the next regex (or just blurs if there are no
more regexes).
-->
<dom-module id="tf-regex-group">
  <template>
    <div class="regex-list">
      <template is="dom-repeat" items="{{rawRegexes}}">
        <div class="regex-line">
          <paper-input
            id="text-input"
            class="regex-input"
            label="Write a regex to create a tag group"
            no-label-float
            value="{{item.regex}}"
            invalid="[[!item.valid]]"
            on-keyup="moveFocus"
          ></paper-input>
          <paper-icon-button
            icon="close"
            class="delete-button"
            aria-label="Delete Regex"
            tabindex="0"
            on-tap="deleteRegex"
          ></paper-icon-button>
        </div>
        <style>
          .regex-input {
            width: 250px;
            display: inline-block;
            margin-left: -3px;
          }

          .delete-button {
            color: var(--paper-grey-700);
            width: 40px;
            height: 40px;
            margin-right: -10px;
          }

          .regex-list {
            margin-bottom: 10px;
          }

          paper-input {
            --paper-input-container-focus-color: var(--tb-orange-strong);
            --paper-input-container-input: {
              font-size: 14px;
            };
            --paper-input-container-label: {
              font-size: 14px;
            };
          }
        </style>
      </template>
    </div>
  </template>
  <script src="tf-regex-group.js"></script>
</dom-module>