This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
/
filter.html
94 lines (84 loc) · 2.93 KB
/
filter.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
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
<template>
<div repeat.for="filter of filters" class="filters">
<div repeat.for="field of filter">
<div class="col-md-12">
<div class="col-md-4">
<form-field
change.delegate="onChange($parent.$index, $index) & debounce:200"
value.bind="field.data.field"
element.bind="field.field">
</form-field>
</div>
<div class="col-md-4">
<form-field
change.delegate="onChange($parent.$index, $index) & debounce:200"
value.bind="field.data.operator"
element.bind="field.operator">
</form-field>
</div>
<div class="col-md-4">
<div class="input-group">
<div class="${field.data.hasError ? 'has-error' : ''}">
<form-field
keydown.delegate="onChange($parent.$index, $index, true) & debounce:50"
value.bind="field.data.value"
element.bind="field.value">
</form-field>
</div>
<div class="input-group-btn">
<button
class="btn btn-primary add-filter "
if.bind="$last"
click.delegate="create($parent.$index)"
t="${$first ? '+ And' : '+'}">+
</button>
<button
class="btn btn-danger remove-filter"
if.bind="filter.length > 1"
click.delegate="destroy($parent.$index, $index)"
t="${$first ? '- And' : '-'}">-
</button>
</div>
</div>
</div>
</div>
<div if.bind="field.data.operator === 'between'" class="col-md-12">
<div class="col-md-4">
<input type="text" class="form-control disabled" disabled>
</div>
<div class="col-md-4">
<input type="text" class="form-control disabled" disabled value="and" t="[value]and">
</div>
<div class="col-md-4" style="margin-bottom: 15px;">
<form-field
keypress.delegate="onChange($parent.$index, $index, true) & debounce:500"
value.bind="field.data.between"
element.bind="field.value">
</form-field>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-offset-4 col-md-4">
<div class="btn-group btn-group btn-group-justified">
<a
class="btn btn-primary add-block btn-sm"
if.bind="$last"
click.delegate="create()"
t="+ Or">+
</a>
<a
class="btn btn-danger remove-block btn-sm"
if.bind="filters.length > 1"
click.delegate="destroy($index)"
t="- Or">-;
</a>
</div>
</div>
</div>
<div class="col-md-12" if.bind="!$last">
<hr>
</div>
<div class="clearfix"></div>
</div>
</template>