1
1
<!DOCTYPE html>
2
- < html >
2
+ < html data-bs-theme =" light " >
3
3
< head >
4
4
< meta charset ="utf-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
7
7
< title > jQuery QueryBuilder Example</ title >
8
8
9
9
< link rel ="stylesheet " href ="/node_modules/bootstrap/dist/css/bootstrap.css " id ="bt-theme ">
10
- < link rel ="stylesheet " href ="/node_modules/bootstrap-select/dist/css/bootstrap-select.css ">
11
10
< link rel ="stylesheet " href ="/node_modules/chosenjs/chosen.css ">
12
11
< link rel ="stylesheet " href ="/node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css ">
13
12
< link rel ="stylesheet " href ="/node_modules/bootstrap-slider/dist/css/bootstrap-slider.css ">
14
- < link rel ="stylesheet " href ="/node_modules/selectize/dist/css/selectize.bootstrap3 .css ">
15
-
13
+ < link rel ="stylesheet " href ="/node_modules/@ selectize/selectize/ dist/css/selectize.bootstrap5 .css ">
14
+ < link rel =" stylesheet " href =" /node_modules/bootstrap-icons/font/bootstrap-icons.css " >
16
15
< link rel ="stylesheet " href ="/dist/css/query-builder.default.css " id ="qb-theme ">
17
- < link rel ="stylesheet " href ="http://mistic100.github.io/jQuery-QueryBuilder/assets/flags/flags.css ">
18
-
19
- < style >
20
- .flag {
21
- display : inline-block;
22
- }
23
- </ style >
24
16
</ head >
25
17
26
18
< body >
27
19
28
20
< div class ="container ">
29
- < div class ="col-md-12 col-lg-10 col -lg-offset -1 ">
21
+ < div class ="col-md-12 col-lg-10 offset -lg-1 ">
30
22
< div class ="page-header ">
31
- < a class ="pull-right " href ="https://github.com/mistic100/jQuery-QueryBuilder ">
23
+ < a class ="float-end " href ="https://github.com/mistic100/jQuery-QueryBuilder ">
32
24
< img src ="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png " style ="height:48px; ">
33
25
</ a >
34
26
< h1 > jQuery QueryBuilder
@@ -40,47 +32,47 @@ <h1>jQuery QueryBuilder
40
32
< label > Theme:</ label >
41
33
< div class ="btn-group ">
42
34
< button class ="btn btn-primary btn-sm change-theme " data-qb ="/dist/css/query-builder.default.css "
43
- data-bt ="/node_modules/bootstrap/dist/css/bootstrap.css "> Default
35
+ data-bt ="default "> Default
44
36
</ button >
45
37
< button class ="btn btn-primary btn-sm change-theme " data-qb ="/dist/css/query-builder.dark.css "
46
- data-bt ="/node_modules/bootswatch-dist/css/bootstrap.css "> Dark
38
+ data-bt ="dark "> Dark
47
39
</ button >
48
40
</ div >
49
41
50
42
< label > Language:</ label >
51
- < select name ="language " class ="selectpicker show-tick show-menu-arrow " data-width ="auto ">
52
- < option value ="sq " data-icon =" flag flag-al " > Albanian</ option >
53
- < option value ="ar " data-icon =" flag flag-ar " > Arabic</ option >
54
- < option value ="az " data-icon =" flag flag-az " > Azerbaijani</ option >
55
- < option value ="bg " data-icon =" flag flag-bg " > Bulgarian</ option >
56
- < option value ="zh-CN " data-icon =" flag flag-zh-CN " > Simplified Chinese</ option >
57
- < option value ="cs " data-icon =" flag flag-cs " > Czech</ option >
58
- < option value ="de " data-icon =" flag flag-de " > German</ option >
59
- < option value ="da " data-icon =" flag flag-dk " > Danish</ option >
60
- < option value ="nl " data-icon =" flag flag-nl " > Dutch</ option >
61
- < option value ="en " data-icon =" flag flag-gb " selected > English</ option >
62
- < option value ="fa-IR " data-icon =" flag flag-ir " > Farsi</ option >
63
- < option value ="fr " data-icon =" flag flag-fr " > French</ option >
64
- < option value ="el " data-icon =" flag flag-el " > Greek</ option >
65
- < option value ="he " data-icon =" flag flag-he " > Hebrew</ option >
66
- < option value ="it " data-icon =" flag flag-it " > Italian</ option >
67
- < option value ="no " data-icon =" flag flag-no " > Norwegian</ option >
68
- < option value ="pl " data-icon =" flag flag-pl " > Polish</ option >
69
- < option value ="pt-PT " data-icon =" flag flag-pt-PT " > Portuguese</ option >
70
- < option value ="pt-BR " data-icon =" flag flag-pt-BR " > Brazilian Portuguese</ option >
71
- < option value ="ro " data-icon =" flag flag-ro " > Romanian</ option >
72
- < option value ="ru " data-icon =" flag flag-ru " > Russian</ option >
73
- < option value ="es " data-icon =" flag flag-es " > Spanish</ option >
74
- < option value ="tr " data-icon =" flag flag-tr " > Turkish</ option >
75
- < option value ="ua " data-icon =" flag flag-ua " > Ukrainian</ option >
43
+ < select name ="language " class ="show-tick show-menu-arrow " data-width ="auto ">
44
+ < option value ="sq "> Albanian</ option >
45
+ < option value ="ar "> Arabic</ option >
46
+ < option value ="az "> Azerbaijani</ option >
47
+ < option value ="bg "> Bulgarian</ option >
48
+ < option value ="zh-CN "> Simplified Chinese</ option >
49
+ < option value ="cs "> Czech</ option >
50
+ < option value ="de "> German</ option >
51
+ < option value ="da "> Danish</ option >
52
+ < option value ="nl "> Dutch</ option >
53
+ < option value ="en " selected > English</ option >
54
+ < option value ="fa-IR "> Farsi</ option >
55
+ < option value ="fr "> French</ option >
56
+ < option value ="el "> Greek</ option >
57
+ < option value ="he "> Hebrew</ option >
58
+ < option value ="it "> Italian</ option >
59
+ < option value ="no "> Norwegian</ option >
60
+ < option value ="pl "> Polish</ option >
61
+ < option value ="pt-PT "> Portuguese</ option >
62
+ < option value ="pt-BR "> Brazilian Portuguese</ option >
63
+ < option value ="ro "> Romanian</ option >
64
+ < option value ="ru "> Russian</ option >
65
+ < option value ="es "> Spanish</ option >
66
+ < option value ="tr "> Turkish</ option >
67
+ < option value ="ua "> Ukrainian</ option >
76
68
</ select >
77
69
</ div >
78
70
79
71
< div id ="builder "> </ div >
80
72
81
73
< div class ="btn-group ">
82
74
< button class ="btn btn-danger reset "> Reset</ button >
83
- < button class ="btn btn-warning set-filters " data-toggle ="tooltip " data-container ="body " data-placement ="bottom "
75
+ < button class ="btn btn-warning set-filters " data-bs- toggle ="tooltip " data-container ="body " data-placement ="bottom "
84
76
title ="Adds a filter 'New filter' and removes 'Coordinates', 'State', 'BSON' "> Set filters
85
77
</ button >
86
78
</ div >
@@ -106,22 +98,23 @@ <h3>Output</h3>
106
98
</ div >
107
99
</ div >
108
100
</ div >
109
-
110
101
< script src ="/node_modules/jquery/dist/jquery.js "> </ script >
102
+ < script src ="/node_modules/@popperjs/core/dist/umd/popper.js "> </ script >
111
103
< script src ="/node_modules/bootstrap/dist/js/bootstrap.js "> </ script >
112
- < script src ="/node_modules/bootstrap-select/dist/js/bootstrap-select.js "> </ script >
113
104
< script src ="/node_modules/chosenjs/chosen.jquery.js "> </ script >
114
- < script src ="/node_modules/bootbox/bootbox.js "> </ script >
115
105
< script src ="/node_modules/bootstrap-slider/dist/bootstrap-slider.js "> </ script >
116
- < script src ="/node_modules/selectize/dist/js/standalone /selectize.js "> </ script >
106
+ < script src ="/node_modules/@ selectize/selectize/ dist/js/selectize.js "> </ script >
117
107
< script src ="/node_modules/jquery-extendext/jquery-extendext.js "> </ script >
118
108
< script src ="/node_modules/sql-parser-mistic/browser/sql-parser.js "> </ script >
119
109
< script src ="/node_modules/interactjs/dist/interact.js "> </ script >
110
+ < script src ="/node_modules/bootbox/dist/bootbox.all.js "> </ script >
120
111
121
112
< script src ="/dist/js/query-builder.js "> </ script >
122
113
123
114
< script >
124
- $ ( '[data-toggle="tooltip"]' ) . tooltip ( ) ;
115
+ document . querySelectorAll ( '[data-bs-toggle="tooltip"]' ) . forEach ( function ( element ) {
116
+ new bootstrap . Tooltip ( element ) ;
117
+ } ) ;
125
118
126
119
var $b = $ ( '#builder' ) ;
127
120
@@ -142,7 +135,6 @@ <h3>Output</h3>
142
135
'bt-tooltip-errors' : { delay : 100 } ,
143
136
'sortable' : null ,
144
137
'filter-description' : { mode : 'bootbox' } ,
145
- 'bt-selectpicker' : null ,
146
138
// 'chosen-selectpicker': null,
147
139
'unique-filter' : null ,
148
140
'bt-checkbox' : { color : 'primary' } ,
@@ -185,7 +177,7 @@ <h3>Output</h3>
185
177
en : 'Name' ,
186
178
fr : 'Nom'
187
179
} ,
188
- icon : 'glyphicon glyphicon-user ' ,
180
+ icon : 'bi-person-fill ' ,
189
181
value_separator : ',' ,
190
182
type : 'string' ,
191
183
optgroup : 'core' ,
@@ -202,7 +194,7 @@ <h3>Output</h3>
202
194
{
203
195
id : 'age' ,
204
196
label : 'Age' ,
205
- icon : 'glyphicon glyphicon-calendar ' ,
197
+ icon : 'bi-calendar3 ' ,
206
198
type : 'integer' ,
207
199
input : 'text' ,
208
200
value_separator : '|' ,
@@ -219,7 +211,7 @@ <h3>Output</h3>
219
211
{
220
212
id : 'bson' ,
221
213
label : 'BSON' ,
222
- icon : 'glyphicon glyphicon-qrcode ' ,
214
+ icon : 'bi-qr-code ' ,
223
215
type : 'string' ,
224
216
input : 'textarea' ,
225
217
operators : [ 'equal' ] ,
@@ -232,7 +224,7 @@ <h3>Output</h3>
232
224
{
233
225
id : 'category' ,
234
226
label : 'Category' ,
235
- icon : 'glyphicon glyphicon-th- list' ,
227
+ icon : 'bi- list-task ' ,
236
228
type : 'integer' ,
237
229
input : 'checkbox' ,
238
230
optgroup : 'core' ,
@@ -258,7 +250,7 @@ <h3>Output</h3>
258
250
{
259
251
id : 'continent' ,
260
252
label : 'Continent' ,
261
- icon : 'glyphicon glyphicon -globe' ,
253
+ icon : 'bi -globe-americas ' ,
262
254
type : 'string' ,
263
255
input : 'select' ,
264
256
optgroup : 'core' ,
@@ -307,7 +299,7 @@ <h3>Output</h3>
307
299
{
308
300
id : 'state' ,
309
301
label : 'State' ,
310
- icon : 'glyphicon glyphicon -globe' ,
302
+ icon : 'bi -globe-americas ' ,
311
303
type : 'string' ,
312
304
input : 'select' ,
313
305
multiple : true ,
@@ -343,7 +335,7 @@ <h3>Output</h3>
343
335
{
344
336
id : 'in_stock' ,
345
337
label : 'In stock' ,
346
- icon : 'glyphicon glyphicon-log-in ' ,
338
+ icon : 'bi-box-arrow-in-right ' ,
347
339
type : 'integer' ,
348
340
input : 'radio' ,
349
341
optgroup : 'plugin' ,
@@ -359,7 +351,7 @@ <h3>Output</h3>
359
351
{
360
352
id : 'price' ,
361
353
label : 'Price' ,
362
- icon : 'glyphicon glyphicon-usd ' ,
354
+ icon : 'bi-currency-dollar ' ,
363
355
type : 'double' ,
364
356
size : 5 ,
365
357
validation : {
@@ -376,7 +368,7 @@ <h3>Output</h3>
376
368
{
377
369
id : 'rate' ,
378
370
label : 'Rate' ,
379
- icon : 'glyphicon glyphicon-flash ' ,
371
+ icon : 'bi-box-arrow-lightning-charge-fill ' ,
380
372
type : 'integer' ,
381
373
validation : {
382
374
min : 0 ,
@@ -400,7 +392,7 @@ <h3>Output</h3>
400
392
{
401
393
id : 'id' ,
402
394
label : 'Identifier' ,
403
- icon : 'glyphicon glyphicon -sunglasses' ,
395
+ icon : 'bi -sunglasses' ,
404
396
type : 'string' ,
405
397
optgroup : 'plugin' ,
406
398
placeholder : '____-____-____' ,
@@ -419,7 +411,7 @@ <h3>Output</h3>
419
411
{
420
412
id : 'coord' ,
421
413
label : 'Coordinates' ,
422
- icon : 'glyphicon glyphicon -star-empty ' ,
414
+ icon : 'bi -star' ,
423
415
type : 'string' ,
424
416
default_value : 'C.5' ,
425
417
description : 'The letter is the cadran identifier:\
@@ -489,7 +481,7 @@ <h3>Output</h3>
489
481
} ) ;
490
482
491
483
// change language
492
- $ ( '[name=language]' ) . selectpicker ( ) . on ( 'change' , function ( ) {
484
+ $ ( '[name=language]' ) . on ( 'change' , function ( ) {
493
485
var lang = $ ( this ) . val ( ) ;
494
486
495
487
var done = function ( ) {
@@ -516,7 +508,7 @@ <h3>Output</h3>
516
508
// change theme
517
509
$ ( '.change-theme' ) . on ( 'click' , function ( ) {
518
510
$ ( '#qb-theme' ) . replaceWith ( '<link rel="stylesheet" href="' + $ ( this ) . data ( 'qb' ) + '" id="qb-theme">' ) ;
519
- $ ( '#bt- theme' ) . replaceWith ( '<link rel="stylesheet" href="' + $ ( this ) . data ( 'bt' ) + '" id="bt-theme">' ) ;
511
+ $ ( '[data-bs- theme] ' ) . attr ( 'data-bs-theme' , $ ( this ) . data ( 'bt' ) ) ;
520
512
} ) ;
521
513
522
514
// set rules
@@ -604,12 +596,12 @@ <h3>Output</h3>
604
596
// reset builder
605
597
$ ( '.reset' ) . on ( 'click' , function ( ) {
606
598
$ ( '#builder' ) . queryBuilder ( 'reset' ) ;
607
- $ ( '#result' ) . addClass ( 'hide ' ) . find ( 'pre' ) . empty ( ) ;
599
+ $ ( '#result' ) . addClass ( 'd-none ' ) . find ( 'pre' ) . empty ( ) ;
608
600
} ) ;
609
601
610
602
// get rules
611
603
$ ( '.parse-json' ) . on ( 'click' , function ( ) {
612
- $ ( '#result' ) . removeClass ( 'hide ' )
604
+ $ ( '#result' ) . removeClass ( 'd-none ' )
613
605
. find ( 'pre' ) . html ( JSON . stringify (
614
606
$ ( '#builder' ) . queryBuilder ( 'getRules' , {
615
607
get_flags : true ,
@@ -621,14 +613,14 @@ <h3>Output</h3>
621
613
622
614
$ ( '.parse-sql' ) . on ( 'click' , function ( ) {
623
615
var res = $ ( '#builder' ) . queryBuilder ( 'getSQL' , $ ( this ) . data ( 'stmt' ) , false ) ;
624
- $ ( '#result' ) . removeClass ( 'hide ' )
616
+ $ ( '#result' ) . removeClass ( 'd-none ' )
625
617
. find ( 'pre' ) . html (
626
618
res . sql + ( res . params ? '\n\n' + JSON . stringify ( res . params , undefined , 2 ) : '' )
627
619
) ;
628
620
} ) ;
629
621
630
622
$ ( '.parse-mongo' ) . on ( 'click' , function ( ) {
631
- $ ( '#result' ) . removeClass ( 'hide ' )
623
+ $ ( '#result' ) . removeClass ( 'd-none ' )
632
624
. find ( 'pre' ) . html ( JSON . stringify (
633
625
$ ( '#builder' ) . queryBuilder ( 'getMongo' ) ,
634
626
undefined , 2
@@ -638,7 +630,7 @@ <h3>Output</h3>
638
630
// set filters
639
631
$ ( '.set-filters' ) . on ( 'click' , function ( ) {
640
632
$ ( this ) . prop ( 'disabled' , true ) ;
641
- $ ( this ) . tooltip ( ' hide' ) ;
633
+ bootstrap . Tooltip . getInstance ( $ ( this ) ) . hide ( ) ;
642
634
643
635
// add a new filter after 'state'
644
636
$ ( '#builder' ) . queryBuilder ( 'addFilter' ,
0 commit comments