This repository has been archived by the owner on May 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ud-pf-filter-fields.html
67 lines (59 loc) · 1.92 KB
/
ud-pf-filter-fields.html
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
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="styles/ud-pf-base-styles.html">
<link rel="import" href="styles/ud-pf-shared-styles.html">
<link rel="import" href="styles/ud-pf-filter-styles.html">
<link rel="import" href="styles/ud-pf-toolbar-styles.html">
<link rel="import" href="ud-pf-dropdown.html">
<dom-module id="ud-pf-filter-fields">
<template>
<style include="ud-pf-base-styles ud-pf-shared-styles ud-pf-forms-styles ud-pf-filter-styles ud-pf-toolbar-styles">
:host {
display: block;
background-color: transparent;
}
:host(.toolbar-pf-filter) .form-group{
margin-bottom: 0px;
}
</style>
<div class="input-group">
<ud-pf-dropdown items="[[fields]]" class="input-group-btn" selected-item="{{_selectedField}}"></ud-pf-dropdown>
<input id="input" type="text" class="form-control" placeholder="[[_placeholderText]]" autocomplete="off">
</div>
</template>
<script>
/**
* `ud-pf-filter-fields`
*
*
* @customElement
* @polymer
* @demo demo/index.html
*/
class UdPfFilterFieldsElement extends Polymer.Element {
static get is() { return 'ud-pf-filter-fields'; }
static get properties() {
return {
fields: {
type: Array
},
_placeholderText: {
type: String,
computed: '_computePlacehoderText(_selectedField)',
observer: '_selectedFieldChanged'
},
_selectedField: {
type: Object
}
};
}
_computePlacehoderText(selectedField) {
if (selectedField) {
return selectedField.filterText || ('Filter By ' + selectedField.name + ' ...');
}
}
_selectedFieldChanged(selectedField) {
}
}
window.customElements.define(UdPfFilterFieldsElement.is, UdPfFilterFieldsElement);
</script>
</dom-module>