1 <div layout="column" class="advanced-search-container" flex>
4 ng-model="vm.options.matchType"
8 <md-radio-button value="$and" class="md-primary"
9 >{{ 'DASHBOARDS.MEET_ALL_CONDITIONS' | translate }}
11 <md-radio-button value="$or"
12 >{{ 'DASHBOARDS.MEET_ANY_CONDITIONS' | translate }}</md-radio-button
17 <!-- ACTIVE CONDITIONS -->
20 ng-if="vm.options.conditions.length > 0"
21 class="advanced-search-conditions"
26 ng-model="vm.options.conditions"
27 class="advanced-search-chips"
30 md-on-remove="vm.removeCondition()"
32 <md-chip-template ms-chip-color="{{ $chip.style }}">
35 ng-class="{'no-click': vm.pendingCondition}"
38 <p class="filter-text">{{ $chip.name }}</p>
39 <em ng-show="$chip.operator" class="text-lowercase"
40 >{{ $chip.operator }}</em
42 <strong>{{ $chip.displayValue }}</strong>
43 <em ng-show="$chip.displayEndValue" class="text-lowercase"
44 >{{ 'DASHBOARDS.AND' | translate }}</em
46 <strong>{{ $chip.displayEndValue }}</strong>
48 <md-menu-content width="2" class="md-dense">
49 <md-menu-item ng-hide="$chip.disabled">
50 <md-button ng-click="vm.editCondition($chip)"
55 <md-button ng-click="vm.setConditionStatus($chip)">
56 {{ $chip.disabled ? 'Enable' : 'Disable' }}
62 <button type="button" md-chip-remove class="md-primary remove-filter">
64 md-font-icon="icon-cancel"
65 aria-label="Remove Filter"
75 <div layout="row" class="advanced-search-bar" layout-margin flex>
77 <md-input-container flex="35">
78 <md-icon md-font-icon="icon-filter-variant"></md-icon>
81 ng-model="vm.selectedField"
82 ng-change="vm.onFieldChange()"
83 placeholder="{{ 'DASHBOARDS.SELECT_FIELD' | translate }}"
86 <md-option ng-value="field" ng-repeat="field in vm.options.fields"
87 >{{ field.name }}</md-option
93 <md-input-container flex="30">
94 <md-icon md-font-icon="icon-format-text"></md-icon>
97 ng-model="vm.selectedOperator"
98 ng-change="vm.onOperatorChange(oldValue)"
99 ng-focus="oldValue=vm.selectedOperator"
100 md-selected-text="vm.selectedOperator ? ('DASHBOARDS.' + vm.selectedOperator.translate | translate) : ('DASHBOARDS.SELECT_OPERATOR' | translate)"
101 ng-disabled="!vm.selectedField"
102 aria-label="Operator"
106 ng-repeat="operator in vm.availableOperators"
107 ng-selected="vm.autoSelectOperator"
109 <div layout="row" class="operators-list">
110 <span class="operator-symbol"> {{ operator.symbol }} </span>
112 {{ 'DASHBOARDS.' + operator.translate | translate }}
117 </md-input-container>
121 ng-if="!vm.selectedField.type || vm.selectedField.type === 'text'"
125 <md-icon md-font-icon="icon-format-text"></md-icon>
130 ng-change="vm.onValueChange()"
131 ng-disabled="!vm.selectedField"
132 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
133 placeholder="{{ 'DASHBOARDS.VALUE' | translate }}"
135 </md-input-container>
136 <!-- NUMERIC INPUT -->
138 ng-if="vm.selectedField.type === 'number'"
144 <md-input-container class="no-errors" flex>
145 <md-icon md-font-icon="icon-numeric"></md-icon>
150 ng-change="vm.onValueChange()"
151 ng-disabled="!vm.selectedField"
153 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
154 placeholder="{{ vm.selectedOperator.type === '$between' ? 'DASHBOARDS.STARTING_VALUE' : 'DASHBOARDS.VALUE' | translate }}"
156 </md-input-container>
159 ng-if="vm.selectedOperator.type === '$between'"
160 ng-class="{'md-input-invalid': !vm.isValidRange}"
163 <md-icon md-font-icon=" icon-numeric"> </md-icon>
168 ng-model="vm.endRangeValue"
169 ng-change="vm.checkRange()"
170 ng-disabled="!vm.value"
172 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
173 placeholder="{{ 'DASHBOARDS.ENDING_VALUE' | translate }}"
176 ng-if="!vm.isValidRange"
177 class="md-input-message-animation md-input-messages-animation"
179 {{ ('DASHBOARDS.VALUE_RANGE_CHECK' | translate) + ' ' + vm.value }}
181 </md-input-container>
184 <md-input-container ng-if="vm.selectedField.type === 'select'" flex>
185 <md-icon md-font-icon="icon-format-text"></md-icon>
189 md-on-open="vm.getValues()"
190 ng-change="vm.onValueChange()"
191 ng-model-vm.options="{trackBy: '$value.id'}"
192 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
193 placeholder="{{ 'DASHBOARDS.VALUE' | translate }}"
196 <md-option ng-value="item" ng-repeat="item in vm.selectedField.values"
200 </md-input-container>
202 <md-input-container ng-if="vm.selectedField.type === 'multiselect'" flex>
203 <md-icon md-font-icon="icon-format-text"></md-icon>
208 md-on-open="vm.getValues()"
209 ng-change="vm.onValueChange()"
210 ng-model-vm.options="{trackBy: '$value.id'}"
211 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
212 placeholder="{{ 'DASHBOARDS.VALUE' | translate }}"
215 <md-option ng-value="item" ng-repeat="item in vm.selectedField.values"
219 </md-input-container>
221 <div ng-if="vm.selectedField.type === 'date'" flex layout="row">
225 ng-change="vm.onValueChange()"
226 mdp-max-date="vm.maxDateRange"
227 mdp-placeholder="{{ vm.selectedOperator.type === '$between' ? 'DASHBOARDS.STARTING_DATE' : 'DASHBOARDS.VALUE' | translate }}"
228 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
234 ng-if="vm.selectedOperator.type === '$between'"
235 ng-change="vm.checkRange()"
236 ng-model="vm.endRangeValue"
237 mdp-min-date="vm.minDateRange"
238 mdp-disabled="!vm.value"
239 mdp-placeholder="{{ 'DASHBOARDS.ENDING_DATE' | translate }}"
240 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
245 <!-- AUTOCOMPLETE -->
248 layout-align="start start"
249 ng-if="vm.selectedField.type === 'autocomplete' && vm.selectedOperator.type != '$substring'"
250 class="autocomplete-input"
253 <md-icon md-font-icon="icon-format-text"></md-icon>
255 md-selected-item="vm.value"
256 md-selected-item-change="vm.onValueChange()"
257 md-items="item in vm.getValues()"
258 md-search-text="vm.searchText"
259 md-item-text="item.displayValue"
262 md-floating-label="{{ 'DASHBOARDS.VALUE' | translate }}"
263 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
267 <span md-highlight-text="vm.searchText" md-highlight-flags="i"
268 >{{item.displayValue}}</span
274 ng-if="vm.selectedField.type === 'autocomplete' && vm.selectedOperator.type === '$substring'"
278 <md-icon md-font-icon="icon-format-text"></md-icon>
283 ng-change="vm.onValueChange()"
284 ng-disabled="!vm.selectedField"
285 ng-keydown="$event.keyCode == 13 && vm.isValidCondition && vm.handleKeyboardAction()"
286 placeholder="{{ 'DASHBOARDS.VALUE' | translate }}"
288 </md-input-container>
291 class="md-fab md-mini md-primary mt-20"
292 ng-if="!vm.pendingCondition"
293 ng-disabled="!vm.isValidCondition"
294 aria-label="Add filter"
295 ng-click="vm.addCondition()"
296 translate-attr-aria-label="DASHBOARDS.ADD"
298 <md-icon md-font-icon="icon-plus"></md-icon>
301 class="md-fab md-mini mt-20"
302 ng-if="vm.pendingCondition"
303 ng-disabled="!vm.isValidCondition"
304 aria-label="Update filter"
305 ng-click="vm.updateCondition()"
306 translate-attr-aria-label="DASHBOARDS.UPDATE"
308 <md-icon md-font-icon="icon-check"></md-icon>
311 class="md-fab md-mini md-primary mt-20"
312 ng-if="vm.pendingCondition"
313 aria-label="Cancel filter update"
314 ng-click="vm.cancelUpdateCondition()"
315 translate-attr-aria-label="DASHBOARDS.CANCEL"
317 <md-icon md-font-icon="icon-close"></md-icon>