vnSearchbar - General search reflected in a new field in the panel
This commit is contained in:
parent
5a52035dac
commit
f02f3938dd
|
@ -3,11 +3,18 @@
|
|||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Name"
|
||||
model="filter.name"
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Name"
|
||||
model="filter.name">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
|
|
|
@ -3,11 +3,18 @@
|
|||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Client"
|
||||
model="filter.client"
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Client"
|
||||
model="filter.client">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
|
|
|
@ -1,22 +1,61 @@
|
|||
<div pad-large style="min-width: 30em">
|
||||
<form ng-submit="$ctrl.onSearch()">
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Client id" model="filter.id" vn-focus></vn-textfield>
|
||||
<vn-textfield vn-one label="Tax number" model="filter.fi"></vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Name" model="filter.name"></vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Client id"
|
||||
model="filter.id">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Tax number"
|
||||
model="filter.fi">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Social name" model="filter.socialName"></vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one label="Name"
|
||||
model="filter.name">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Town/City" model="filter.city"></vn-textfield>
|
||||
<vn-textfield vn-one label="Postcode" model="filter.postcode"></vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Social name"
|
||||
model="filter.socialName">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Email" model="filter.email"></vn-textfield>
|
||||
<vn-textfield vn-one label="Phone" model="filter.phone"></vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Town/City"
|
||||
model="filter.city">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Postcode"
|
||||
model="filter.postcode">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Email"
|
||||
model="filter.email">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Phone"
|
||||
model="filter.phone">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal margin-large-top>
|
||||
<vn-submit label="Search"></vn-submit>
|
||||
|
|
|
@ -159,14 +159,13 @@ export default class Controller extends Component {
|
|||
let regex = /((([\w_]+):([\w_]+))|([\w_]+):\(([\w_ ]+)\))/gi;
|
||||
let findPattern = searchString.match(regex);
|
||||
let remnantString = searchString.replace(regex, '').trim();
|
||||
if (findPattern) {
|
||||
if (findPattern)
|
||||
for (let i = 0; i < findPattern.length; i++) {
|
||||
let aux = findPattern[i].split(':');
|
||||
let property = aux[0];
|
||||
let value = aux[1].replace(/\(|\)/g, '');
|
||||
result[property] = value.trim();
|
||||
}
|
||||
}
|
||||
if (remnantString)
|
||||
result.search = remnantString;
|
||||
}
|
||||
|
|
|
@ -13,3 +13,4 @@ Finalize: Finalize
|
|||
Previous: Back
|
||||
Load more: Load more
|
||||
Auto-scroll interrupted, please adjust the search: Auto-scroll interrupted, please adjust the search
|
||||
General search: General search
|
|
@ -24,3 +24,4 @@ Value should be %s characters long: El valor debe ser de %s carácteres de longi
|
|||
Value should have a length between %s and %s: El valor debe tener una longitud de entre %s y %s
|
||||
Value should have at least %s characters: El valor debe tener al menos %s carácteres
|
||||
Value should have at most %s characters: El valor debe tener un máximo de %s carácteres
|
||||
General search: Busqueda general
|
|
@ -4,10 +4,17 @@
|
|||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Id"
|
||||
model="filter.id"
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Id"
|
||||
model="filter.id">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Name"
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
<div pad-large style="min-width: 30em">
|
||||
<form ng-submit="$ctrl.onSearch()">
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
|
|
|
@ -3,11 +3,18 @@
|
|||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Nickname"
|
||||
model="filter.nickname"
|
||||
label="General search"
|
||||
model="filter.search"
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Nickname"
|
||||
model="filter.nickname">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
|
|
Loading…
Reference in New Issue