Skip to content

Commit 7aef8d2

Browse files
committed
add size filter option for text inputs
1 parent 19c9779 commit 7aef8d2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

examples/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ <h3>Output</h3>
7676
id: 'name',
7777
label: 'Name',
7878
type: 'string',
79-
optgroup: 'core'
79+
optgroup: 'core',
80+
size: 30
8081
},
8182
/*
8283
* select
@@ -119,6 +120,7 @@ <h3>Output</h3>
119120
id: 'price',
120121
label: 'Price',
121122
type: 'double',
123+
size: 5,
122124
validation: {
123125
min: 0,
124126
step: 0.01
@@ -156,6 +158,7 @@ <h3>Output</h3>
156158
type: 'string',
157159
optgroup: 'plugin',
158160
placeholder: '____-____-____',
161+
size: 14,
159162
operators: ['equal', 'not_equal'],
160163
validation: {
161164
format: /^.{4}-.{4}-.{4}$/

src/query-builder.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,13 +1548,15 @@
15481548
if (validation.min !== undefined) h+= ' min="'+ validation.min +'"';
15491549
if (validation.max !== undefined) h+= ' max="'+ validation.max +'"';
15501550
if (filter.placeholder) h+= ' placeholder="'+ filter.placeholder +'"';
1551+
if (filter.size) h+= ' size="'+ filter.size +'"';
15511552
h+= '>';
15521553
break;
15531554

15541555
/* falls through */
15551556
case 'datetime': case 'text': default:
15561557
h+= '<input type="text" name="'+ name +'"';
15571558
if (filter.placeholder) h+= ' placeholder="'+ filter.placeholder +'"';
1559+
if (filter.size) h+= ' size="'+ filter.size +'"';
15581560
h+= '>';
15591561
}
15601562
}

0 commit comments

Comments
 (0)