Blame view

controllets/dataset-selection-controllet/paper-input-search.html 25.1 KB
4bf5f658   root   update tree map, ...
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
  <!--
  @license
  Copyright (c) 2015 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.html">
  <link rel="import" href="../../bower_components/paper-styles/default-theme.html">
  <link rel="import" href="../../bower_components/paper-input/paper-input.html">
  <link rel="import" href="../../bower_components/paper-menu-button/paper-menu-button.html">
  <link rel="import" href="../../bower_components/paper-ripple/paper-ripple.html">
  <link rel="import" href="../../bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
  <link rel="import" href="../../bower_components/iron-behaviors/iron-control-state.html">
  <link rel="import" href="../../bower_components/iron-behaviors/iron-button-state.html">
  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
  <link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
  <link rel="import" href="../../bower_components/iron-selector/iron-selectable.html">
  <link rel="import" href="../../bower_components/iron-form-element-behavior/iron-form-element-behavior.html">
  <link rel="import" href="../../bower_components/iron-validatable-behavior/iron-validatable-behavior.html">
  
  <!--
  Material design: [Dropdown menus](https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons)
  
  `paper-dropdown-menu` is similar to a native browser select element.
  `paper-dropdown-menu` works with selectable content. The currently selected
  item is displayed in the control. If no item is selected, the `label` is
  displayed instead.
  
  The child element with the class `dropdown-content` will be used as the dropdown
  menu. It could be a `paper-menu` or element that triggers `iron-select` when
  selecting its children.
  
  Example:
  
      <paper-dropdown-menu label="Your favourite pastry">
        <paper-menu class="dropdown-content">
          <paper-item>Croissant</paper-item>
          <paper-item>Donut</paper-item>
          <paper-item>Financier</paper-item>
          <paper-item>Madeleine</paper-item>
        </paper-menu>
      </paper-dropdown-menu>
  
  This example renders a dropdown menu with 4 options.
  
  Similarly to using `iron-select`, `iron-deselect` events will cause the
  current selection of the `paper-dropdown-menu` to be cleared.
  
  ### Styling
  
  The following custom properties and mixins are also available for styling:
  
  Custom property | Description | Default
  ----------------|-------------|----------
  `--paper-dropdown-menu` | A mixin that is applied to the element host | `{}`
  `--paper-dropdown-menu-disabled` | A mixin that is applied to the element host when disabled | `{}`
  `--paper-dropdown-menu-ripple` | A mixin that is applied to the internal ripple | `{}`
  `--paper-dropdown-menu-button` | A mixin that is applied to the internal menu button | `{}`
  `--paper-dropdown-menu-input` | A mixin that is applied to the internal paper input | `{}`
  `--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon | `{}`
  
  You can also use any of the `paper-input-container` and `paper-menu-button`
  style mixins and custom properties to style the internal input and menu button
  respectively.
  
  @group Paper Elements
  @element paper-dropdown-menu
  @hero hero.svg
  @demo demo/index.html
  -->
  
  <dom-module id="paper-input-search">
      <style>
          :host {
              display: inline-block;
              position: relative;
              text-align: left;
0f6424fe   root   update new data-s...
82
              cursor: pointer;
4bf5f658   root   update tree map, ...
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
  
              /* NOTE(cdata): Both values are needed, since some phones require the
               * value to be `transparent`.
               */
              -webkit-tap-highlight-color: rgba(0,0,0,0);
              -webkit-tap-highlight-color: transparent;
  
          --paper-input-container-input: {
               overflow: hidden;
               white-space: nowrap;
               text-overflow: ellipsis;
               max-width: 100%;
               box-sizing: border-box;
               /*cursor: pointer;*/
           };
  
          @apply(--paper-dropdown-menu);
          }
  
          :host([disabled]) {
          @apply(--paper-dropdown-menu-disabled);
          }
  
          :host([noink]) paper-ripple {
              display: none;
          }
  
          :host([no-label-float]) paper-ripple {
              top: 8px;
          }
  
          paper-ripple {
              top: 12px;
              left: 0px;
              bottom: 8px;
              right: 0px;
  
          @apply(--paper-dropdown-menu-ripple);
          }
  
          paper-menu-button {
              display: block;
              padding: 0;
          @apply(--paper-dropdown-menu-button);
          }
  
          paper-input {
          @apply(--paper-dropdown-menu-input);
          }
  
          iron-icon {
0f6424fe   root   update new data-s...
134
135
              /*color: var(--disabled-text-color);*/
              color: #2196F3;
4bf5f658   root   update tree map, ...
136
137
138
139
140
141
142
143
144
  
          @apply(--paper-dropdown-menu-icon);
          }
  
      </style>
      <template>
          <paper-menu-button
                  id="menuButton"
                  vertical-align="top"
0f6424fe   root   update new data-s...
145
                  horizontal-align="left"
4bf5f658   root   update tree map, ...
146
147
148
149
150
151
152
                  vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]"
                  disabled="[[disabled]]"
                  no-animations="[[noAnimations]]"
                  on-iron-select="_onIronSelect"
                  on-iron-deselect="_onIronDeselect"
                  opened="{{opened}}">
              <div class="dropdown-trigger">
0f6424fe   root   update new data-s...
153
                  <!--<paper-ripple></paper-ripple>-->
4bf5f658   root   update tree map, ...
154
                  <paper-input
0f6424fe   root   update new data-s...
155
                          id="inputField"
4bf5f658   root   update tree map, ...
156
                          invalid="[[invalid]]"
0f6424fe   root   update new data-s...
157
                          value="{{inputValue}}"
4bf5f658   root   update tree map, ...
158
159
160
161
                          placeholder="[[placeholder]]"
                          always-float-label="[[alwaysFloatLabel]]"
                          no-label-float="[[noLabelFloat]]"
                          label="[[label]]">
0f6424fe   root   update new data-s...
162
                      <iron-icon icon="search" prefix></iron-icon>
4bf5f658   root   update tree map, ...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
                      <iron-icon icon="arrow-drop-down" suffix></iron-icon>
                  </paper-input>
              </div>
              <content id="content" select=".dropdown-content"></content>
          </paper-menu-button>
      </template>
  </dom-module>
  <script>
      (function() {
          'use strict';
  
          Polymer({
              is: 'paper-input-search',
  
              /**
               * Fired when the dropdown opens.
               *
               * @event paper-dropdown-open
               */
  
              /**
               * Fired when the dropdown closes.
               *
               * @event paper-dropdown-close
               */
  
              behaviors: [
                  Polymer.IronControlState,
                  Polymer.IronButtonState,
                  Polymer.IronFormElementBehavior,
                  Polymer.IronValidatableBehavior
              ],
  
              properties: {
                  /**
                   * The derived "label" of the currently selected item. This value
                   * is the `label` property on the selected item if set, or else the
                   * trimmed text content of the selected item.
                   */
                  selectedItemLabel: {
                      type: String,
                      notify: true,
0f6424fe   root   update new data-s...
205
                      readOnly: true
4bf5f658   root   update tree map, ...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
                  },
  
                  /**
                   * The last selected item. An item is selected if the dropdown menu has
                   * a child with class `dropdown-content`, and that child triggers an
                   * `iron-select` event with the selected `item` in the `detail`.
                   *
                   * @type {?Object}
                   */
                  selectedItem: {
                      type: Object,
                      notify: true,
                      readOnly: true
                  },
  
                  /**
                   * The value for this element that will be used when submitting in
                   * a form. It is read only, and will always have the same value
                   * as `selectedItemLabel`.
                   */
                  value: {
                      type: String,
                      notify: true,
                      readOnly: true
                  },
  
                  /**
                   * The label for the dropdown.
                   */
                  label: {
                      type: String
                  },
  
                  /**
                   * The placeholder for the dropdown.
                   */
                  placeholder: {
                      type: String
                  },
  
                  /**
                   * True if the dropdown is open. Otherwise, false.
                   */
                  opened: {
                      type: Boolean,
                      notify: true,
                      value: false
                  },
  
                  /**
                   * Set to true to disable the floating label. Bind this to the
                   * `<paper-input-container>`'s `noLabelFloat` property.
                   */
                  noLabelFloat: {
                      type: Boolean,
                      value: false,
                      reflectToAttribute: true
                  },
  
                  /**
                   * Set to true to always float the label. Bind this to the
                   * `<paper-input-container>`'s `alwaysFloatLabel` property.
                   */
                  alwaysFloatLabel: {
                      type: Boolean,
                      value: false
                  },
  
                  /**
                   * Set to true to disable animations when opening and closing the
                   * dropdown.
                   */
                  noAnimations: {
                      type: Boolean,
                      value: false
0f6424fe   root   update new data-s...
281
282
283
284
285
286
287
288
289
290
291
                  },
  
                  inputValue: {
                      type: String,
                      value: undefined,
                      observer: '_fireInputValue'
                  },
  
                  fireInputValue: {
                      type: Boolean,
                      value: true,
4bf5f658   root   update tree map, ...
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
                  }
              },
  
              listeners: {
                  'tap': '_onTap'
              },
  
              keyBindings: {
                  'up down': 'open',
                  'esc': 'close'
              },
  
              hostAttributes: {
                  role: 'group',
                  'aria-haspopup': 'true'
              },
  
              observers: [
0f6424fe   root   update new data-s...
310
  //                '_selectedItemChanged(selectedItem)'
4bf5f658   root   update tree map, ...
311
312
313
314
315
316
317
318
319
320
321
322
323
              ],
  
              attached: function() {
                  // NOTE(cdata): Due to timing, a preselected value in a `IronSelectable`
                  // child will cause an `iron-select` event to fire while the element is
                  // still in a `DocumentFragment`. This has the effect of causing
                  // handlers not to fire. So, we double check this value on attached:
                  var contentElement = this.contentElement;
                  if (contentElement && contentElement.selectedItem) {
                      this._setSelectedItem(contentElement.selectedItem);
                  }
              },
  
0f6424fe   root   update new data-s...
324
325
326
327
328
329
330
331
332
333
334
335
336
              _fireInputValue: function() {console.log(this.inputValue);
                  if(this.fireInputValue) {//change NO DDL
                      this.fire('paper-input-search_input-value', {inputValue: this.inputValue});
                      if(this.contentElement.selectedItem){
  //                        this._setSelectedItem(null);
                          this.contentElement.select(-1);
                          console.log("deselected");
                      }
                  }
  
                  this.fireInputValue = true;
              },
  
4bf5f658   root   update tree map, ...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
              /**
               * The content element that is contained by the dropdown menu, if any.
               */
              get contentElement() {
                  return Polymer.dom(this.$.content).getDistributedNodes()[0];
              },
  
              /**
               * Show the dropdown content.
               */
              open: function() {
                  this.$.menuButton.open();
              },
  
              /**
               * Hide the dropdown content.
               */
              close: function() {
                  this.$.menuButton.close();
              },
  
              /**
               * A handler that is called when `iron-select` is fired.
               *
               * @param {CustomEvent} event An `iron-select` event.
               */
              _onIronSelect: function(event) {
0f6424fe   root   update new data-s...
364
365
  //                console.log("select");
                  this.fireInputValue = false;
4bf5f658   root   update tree map, ...
366
                  this._setSelectedItem(event.detail.item);
0f6424fe   root   update new data-s...
367
                  this.inputValue = event.detail.item.label || event.detail.item.textContent.trim();
4bf5f658   root   update tree map, ...
368
369
370
371
372
373
374
375
              },
  
              /**
               * A handler that is called when `iron-deselect` is fired.
               *
               * @param {CustomEvent} event An `iron-deselect` event.
               */
              _onIronDeselect: function(event) {
0f6424fe   root   update new data-s...
376
377
  //                console.log("deselect");
                  this.fireInputValue = false;
4bf5f658   root   update tree map, ...
378
379
380
381
382
383
384
385
386
387
388
389
                  this._setSelectedItem(null);
              },
  
              /**
               * A handler that is called when the dropdown is tapped.
               *
               * @param {CustomEvent} event A tap event.
               */
              _onTap: function(event) {
                  if (Polymer.Gestures.findOriginalTarget(event) === this) {
                      this.open();
                  }
0f6424fe   root   update new data-s...
390
391
392
393
394
                  this.async(function(){this.$.inputField.$.input.focus();},200);//to improve
  //                console.log(this.selectedItemLabel);
  //                console.log(this.value);
  //                console.log(this.$.inputField.value);
  //                console.log(this.inputValue);
4bf5f658   root   update tree map, ...
395
396
397
398
399
400
401
402
              },
  
              /**
               * Compute the label for the dropdown given a selected item.
               *
               * @param {Element} selectedItem A selected Element item, with an
               * optional `label` property.
               */
0f6424fe   root   update new data-s...
403
404
405
406
407
408
409
410
411
412
413
414
  //            _selectedItemChanged: function(selectedItem) {
  //                var value = '';
  //                if (!selectedItem) {
  //                    value = '';
  //                } else {
  //                    value = selectedItem.label || selectedItem.textContent.trim();
  //                }
  //
  //                this._setValue(value);
  //                this._setSelectedItemLabel(value);
  //                this.inputValue = selectedItem.label || selectedItem.textContent.trim();
  //            },
4bf5f658   root   update tree map, ...
415
416
417
418
419
420
421
422
423
424
425
426
427
428
  
              /**
               * Compute the vertical offset of the menu based on the value of
               * `noLabelFloat`.
               *
               * @param {boolean} noLabelFloat True if the label should not float
               * above the input, otherwise false.
               */
              _computeMenuVerticalOffset: function(noLabelFloat) {
                  // NOTE(cdata): These numbers are somewhat magical because they are
                  // derived from the metrics of elements internal to `paper-input`'s
                  // template. The metrics will change depending on whether or not the
                  // input has a floating label.
  //                return noLabelFloat ? -4 : 8;
0f6424fe   root   update new data-s...
429
430
                  return noLabelFloat ? 46-4 : 46+8;
  //                return 64;
4bf5f658   root   update tree map, ...
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
              },
  
              /**
               * Returns false if the element is required and does not have a selection,
               * and true otherwise.
               * @return {Boolean} true if `required` is false, or if `required` is true
               * and the element has a valid selection.
               */
              _getValidity: function() {
                  return this.disabled || !this.required || (this.required && this.value);
              }
          });
      })();
  </script>
  
  
  
  
  <!--<link rel="import" href="../../bower_components/polymer/polymer.html">-->
  
  <!--<link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">-->
  <!--<link rel="import" href="../../bower_components/paper-tabs/paper-tab.html">-->
  
  <!--<link rel="import" href="../../bower_components/neon-animation/neon-animation.html">-->
  <!--<link rel="import" href="../../bower_components/neon-animation/neon-animatable.html">-->
  <!--<link rel="import" href="../../bower_components/neon-animation/neon-animations.html">-->
  
  <!--<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">-->
  <!--<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">-->
  <!--<link rel="import" href="../../bower_components/paper-item/paper-item.html">-->
  
  <!--<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">-->
  
  <!--<link rel="import" href="../../bower_components/paper-material/paper-material.html" />-->
  
  <!--<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">-->
  <!--<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">-->
  <!--<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">-->
  
  <!--<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">-->
  <!--<link rel="import" href="../../bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html">-->
  
  <!--<link rel="import" href="../../datalets/datasetexplorer-datalet/datasetexplorer-datalet.html">-->
  
  <!--&lt;!&ndash;<script src="../../datalets/shared_js/d3.js"></script>&ndash;&gt;-->
  
  <!--<link rel="import" href="../../bower_components/paper-input/paper-input.html">-->
  <!--<link rel="import" href="demo/paper-autocomplete.html">-->
  
  <!--<dom-module id="paper-input-search">-->
  
      <!--<template>-->
  
          <!--&lt;!&ndash;<paper-dropdown-menu label="Available datasets">&ndash;&gt;-->
              <!--&lt;!&ndash;<paper-menu class="dropdown-content">&ndash;&gt;-->
                  <!--&lt;!&ndash;<template is="dom-repeat" items={{datasets}} as="dataset">&ndash;&gt;-->
                      <!--&lt;!&ndash;<paper-item id={{index}} on-tap="_selectDataUrl">{{dataset.name}}</paper-item>&ndash;&gt;-->
                  <!--&lt;!&ndash;</template>&ndash;&gt;-->
              <!--&lt;!&ndash;</paper-menu>&ndash;&gt;-->
          <!--&lt;!&ndash;</paper-dropdown-menu>&ndash;&gt;-->
  
          <!--&lt;!&ndash;<paper-icon-button id="info_button" disabled on-click="_showInfo" icon="info-outline" title="dataset info"></paper-icon-button>&ndash;&gt;-->
  
          <!--&lt;!&ndash;<paper-textarea id="selected_url" label="Selected url" value={{dataUrl}}></paper-textarea>&ndash;&gt;-->
  
          <!--&lt;!&ndash;<paper-dialog id="dialog_info">&ndash;&gt;-->
              <!--&lt;!&ndash;<h2 id="dialog_name"></h2>&ndash;&gt;-->
              <!--&lt;!&ndash;<p id="dialog_description"></p>&ndash;&gt;-->
          <!--&lt;!&ndash;</paper-dialog>&ndash;&gt;-->
  
          <!--<style is="custom-style">-->
              <!--paper-input {-->
                  <!--width: 200px;-->
              <!--}-->
          <!--</style>-->
  
          <!--<paper-input list="filtered_datasets" bind-value="{{filter::input}}"></paper-input>&lt;!&ndash; is="iron-input" type="search"&ndash;&gt;-->
  
          <!--<datalist id="filtered_datasets">-->
              <!--<template is="dom-repeat" items={{_filteredDatasets}}>-->
                  <!--<option value={{item.name}}></option>-->
              <!--</template>-->
          <!--</datalist>-->
  
      <!--</template>-->
  
      <!--<script>-->
  
          <!--Polymer({-->
  
              <!--is : 'paper-input-search',-->
  
              <!--properties : {-->
  
                  <!--datasets : {-->
                      <!--type : Array,-->
                      <!--value : undefined,-->
  <!--//                    observer : '_ciao'-->
                  <!--},-->
  
                  <!--_filteredDatasets : {-->
                      <!--type  : Array,-->
                      <!--value: undefined-->
                  <!--},-->
  
                  <!--filter: {-->
                      <!--type: String,-->
                      <!--value: "",-->
                      <!--observer: "_filterChanged"-->
                  <!--}-->
              <!--},-->
  
              <!--attached : function(){-->
                  <!--this._filteredDatasets = this.datasets;-->
                  <!--console.log(this._filteredDatasets);-->
              <!--},-->
  
              <!--_filterChanged : function(){-->
  <!--//                this.filteredDatalist = this.datalist;-->
                  <!--console.log(this.filter);-->
              <!--},-->
  
          <!--});-->
  
      <!--</script>-->
  
  <!--</dom-module>-->
  
  
  <!--paper-autocomplete!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
  <!--//http://stackoverflow.com/questions/31030583/polymer-paper-input-html-datalist-autocomplete-suggestions-list-->
  
  <!--<link rel="import" href="../../../bower_components/paper-input/paper-input.html">-->
  <!--<link rel="import" href="../../../bower_components/paper-input/paper-input-container.html">-->
  <!--<link rel="import" href="../../../bower_components/iron-collapse/iron-collapse.html">-->
  <!--<link rel="import" href="../../../bower_components/paper-material/paper-material.html">-->
  <!--<link rel="import" href="../../../bower_components/paper-button/paper-button.html">-->
  
  <!--&lt;!&ndash;<link rel="import" href="../../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">&ndash;&gt;-->
  <!--&lt;!&ndash;<link rel="import" href="../../../bower_components/paper-menu/paper-menu.html">&ndash;&gt;-->
  <!--&lt;!&ndash;<link rel="import" href="../../../bower_components/paper-item/paper-item.html">&ndash;&gt;-->
  
  
  <!--<dom-module id="paper-autocomplete">-->
      <!--<style>-->
          <!--iron-collapse {-->
              <!--box-shadow: 6px;-->
          <!--}-->
  
          <!--paper-button {-->
              <!--width: 100%;-->
              <!--text-transform: none;-->
          <!--}-->
  
          <!--paper-input-container {-->
              <!--width: 200px;-->
          <!--}-->
      <!--</style>-->
      <!--<template>-->
          <!--<paper-input-container>-->
              <!--<label>{{label}}</label>-->
              <!--<content select=".content"></content>-->
              <!--<input id="searchBox" class="paper-input-input" is="iron-input" bind-value="{{searchValue::input}}"></input>-->
          <!--</paper-input-container>-->
  
          <!--<iron-collapse id="collapse">-->
  
              <!--<paper-material>-->
                  <!--<div>-->
                      <!--<template id="resultList" is="dom-repeat" items="{{choices}}" filter="_listFilter">-->
                          <!--<paper-item>-->
                              <!--<paper-button on-tap="_selectItem">{{item.name}}</paper-button>-->
                          <!--</paper-item>-->
                      <!--</template>-->
                  <!--</div>-->
              <!--</paper-material>-->
          <!--</iron-collapse>-->
  
          <!--&lt;!&ndash;<iron-collapse id="collapse">&ndash;&gt;-->
          <!--&lt;!&ndash;<paper-menu>&ndash;&gt;-->
          <!--&lt;!&ndash;<template id="resultList" is="dom-repeat" items="{{choices}}" filter="_listFilter">&ndash;&gt;-->
          <!--&lt;!&ndash;<paper-item>&ndash;&gt;-->
          <!--&lt;!&ndash;&lt;!&ndash;<paper-button on-tap="_selectItem">{{item.name}}</paper-button>&ndash;&gt;&ndash;&gt;-->
          <!--&lt;!&ndash;<paper-item on-tap="_selectItem">{{item.name}}</paper-item>&ndash;&gt;-->
          <!--&lt;!&ndash;</paper-item>&ndash;&gt;-->
          <!--&lt;!&ndash;</template>&ndash;&gt;-->
          <!--&lt;!&ndash;</paper-menu>&ndash;&gt;-->
          <!--&lt;!&ndash;</iron-collapse>&ndash;&gt;-->
  
      <!--</template>-->
  <!--</dom-module>-->
  <!--<script>-->
      <!--(function() {-->
          <!--Polymer({-->
              <!--is: "paper-autocomplete",-->
              <!--properties: {-->
  <!--//                choices: Array,-->
                  <!--label: String,-->
                  <!--value: {-->
                      <!--type: Object,-->
                  <!--},-->
  
                  <!--choices: {-->
                      <!--type: Array,-->
                      <!--value: undefined-->
                  <!--},-->
  
                  <!--searchValue: {-->
                      <!--type: String,-->
                      <!--value: '',-->
                      <!--observer: "_valueChanged"-->
                  <!--}-->
              <!--},-->
              <!--ready: function() {-->
                  <!--this.$.resultList.render();-->
              <!--},-->
  
              <!--attached: function() {-->
                  <!--this.$.resultList.render();-->
                  <!--console.log(this.choices);-->
              <!--},-->
  
              <!--_valueChanged: function(e) {console.log("we");-->
                  <!--var collapse = this.$.collapse-->
                  <!--if (e != '' && !collapse.opened) {-->
                      <!--this.$.resultList.render()-->
                      <!--collapse.toggle()-->
                  <!--} else-->
                  <!--if (e == '' && collapse.opened) {-->
                      <!--collapse.toggle()-->
                  <!--}-->
              <!--},-->
              <!--_listFilter: function(item) {-->
                  <!--return item.name.toLowerCase().includes(-->
                          <!--this.searchValue.toLowerCase()-->
                  <!--)-->
              <!--},-->
              <!--_selectItem: function(event) {-->
                  <!--this.set('searchValue', event.model.item.name)-->
                  <!--this.set('value', event.model.item)-->
                  <!--collapse.toggle()-->
              <!--}-->
          <!--})-->
      <!--})()-->
  <!--</script>-->