refine-rails 2.11.0 → 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/refine-stimulus.esm.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.modern.js.map +1 -1
- data/app/assets/javascripts/refine-stimulus.umd.js.map +1 -1
- data/app/assets/stylesheets/index.css +82 -53
- data/app/assets/stylesheets/index.tailwind.css +82 -53
- data/app/controllers/refine/inline/criteria_controller.rb +17 -4
- data/app/models/refine/filter.rb +4 -0
- data/app/views/refine/inline/filters/_add_first_condition_button.html.erb +1 -1
- data/app/views/refine/inline/filters/_and_button.html.erb +8 -4
- data/app/views/refine/inline/filters/_clear_button.html.erb +13 -0
- data/app/views/refine/inline/filters/_criterion.html.erb +8 -8
- data/app/views/refine/inline/filters/_group.html.erb +4 -13
- data/app/views/refine/inline/filters/_or_button.html.erb +10 -8
- data/app/views/refine/inline/filters/_show.html.erb +17 -17
- data/config/locales/en/refine.en.yml +2 -1
- data/config/routes.rb +3 -1
- data/lib/refine/rails/version.rb +1 -1
- metadata +3 -2
@@ -1203,20 +1203,23 @@
|
|
1203
1203
|
.refine--filter-wrapper {
|
1204
1204
|
font-size: 14px;
|
1205
1205
|
display: flex;
|
1206
|
-
flex-direction: column;
|
1206
|
+
/* flex-direction: column; */
|
1207
1207
|
gap: 12px;
|
1208
1208
|
margin-top: 12px;
|
1209
1209
|
}
|
1210
1210
|
|
1211
1211
|
.refine--filter-row {
|
1212
1212
|
display: flex;
|
1213
|
+
width: 100%;
|
1213
1214
|
gap: 10px;
|
1214
1215
|
row-gap: 15px;
|
1215
1216
|
align-items: center;
|
1216
|
-
|
1217
|
+
align-items: start;
|
1218
|
+
justify-content: space-between;
|
1217
1219
|
}
|
1218
1220
|
|
1219
1221
|
.refine--groups-wrapper {
|
1222
|
+
flex-grow: 1;
|
1220
1223
|
display: flex;
|
1221
1224
|
gap: 10px;
|
1222
1225
|
row-gap: 15px;
|
@@ -1224,6 +1227,13 @@
|
|
1224
1227
|
flex-wrap: wrap;
|
1225
1228
|
}
|
1226
1229
|
|
1230
|
+
.refine--filter-control-group {
|
1231
|
+
text-wrap: nowrap;
|
1232
|
+
flex-wrap: wrap;
|
1233
|
+
display: flex;
|
1234
|
+
align-items: center;
|
1235
|
+
}
|
1236
|
+
|
1227
1237
|
.refine--group-join, .refine--condition-join {
|
1228
1238
|
position: relative;
|
1229
1239
|
padding: 5px 0;
|
@@ -1250,6 +1260,7 @@
|
|
1250
1260
|
position: relative;
|
1251
1261
|
padding: 0 10px;
|
1252
1262
|
align-items: center;
|
1263
|
+
flex-wrap: wrap;
|
1253
1264
|
&:before , &:after {
|
1254
1265
|
content: "";
|
1255
1266
|
position: absolute;
|
@@ -1304,7 +1315,7 @@
|
|
1304
1315
|
text-decoration: none;
|
1305
1316
|
}
|
1306
1317
|
|
1307
|
-
.refine--condition-pill-wrapper
|
1318
|
+
.refine--condition-pill-wrapper {
|
1308
1319
|
display: flex;
|
1309
1320
|
align-items: center;
|
1310
1321
|
gap: 5px;
|
@@ -1312,21 +1323,26 @@
|
|
1312
1323
|
}
|
1313
1324
|
|
1314
1325
|
.refine--condition-pill {
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1326
|
+
display: flex;
|
1327
|
+
align-items: center;
|
1328
|
+
background-color: #F2F4F7;
|
1329
|
+
border: 1px solid #EBEBEB;
|
1319
1330
|
border-radius: 6px;
|
1320
1331
|
font-size: 14px;
|
1321
1332
|
cursor: pointer;
|
1322
1333
|
position: relative;
|
1323
1334
|
white-space: nowrap;
|
1335
|
+
padding: 4px 8px;
|
1324
1336
|
&:hover {
|
1325
|
-
border-color: #
|
1337
|
+
border-color: #D1D5DB;
|
1338
|
+
background-color: #E5E7EB;
|
1326
1339
|
.refine--remove-condition {
|
1327
1340
|
display: block;
|
1328
1341
|
}
|
1329
1342
|
}
|
1343
|
+
&:active {
|
1344
|
+
border-color: #E5E7EB;
|
1345
|
+
}
|
1330
1346
|
&:not(:hover){
|
1331
1347
|
.refine--condition-value-wrapper {
|
1332
1348
|
display: none;
|
@@ -1334,6 +1350,10 @@
|
|
1334
1350
|
}
|
1335
1351
|
}
|
1336
1352
|
|
1353
|
+
.refine--condition-pill-button {
|
1354
|
+
display: flex;
|
1355
|
+
}
|
1356
|
+
|
1337
1357
|
.refine--filter-condition {
|
1338
1358
|
display: flex;
|
1339
1359
|
align-items: center;
|
@@ -1344,30 +1364,22 @@
|
|
1344
1364
|
padding: 4px;
|
1345
1365
|
}
|
1346
1366
|
|
1347
|
-
.refine--condition-pill-name {
|
1348
|
-
padding: 4px 8px;
|
1349
|
-
display: block;
|
1350
|
-
}
|
1351
|
-
|
1352
1367
|
.refine--remove-condition {
|
1353
1368
|
display: none;
|
1354
|
-
|
1355
|
-
padding:
|
1369
|
+
color: #fff;
|
1370
|
+
padding: 0px 2px 0px 2px;
|
1356
1371
|
border-radius: 50%;
|
1357
1372
|
position: absolute;
|
1358
1373
|
top: -8px;
|
1359
1374
|
right:-8px;
|
1360
|
-
background-color: #
|
1375
|
+
background-color: #ee3f3f;
|
1361
1376
|
z-index: 999;
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
width: 6px;
|
1369
|
-
height: 2px;
|
1370
|
-
background-color: #fff;
|
1377
|
+
line-height: 1;
|
1378
|
+
border: 1.5px solid #fff;
|
1379
|
+
.material-icons-outlined.refine--icon-sm,
|
1380
|
+
.material-icons.refine--icon-sm,
|
1381
|
+
.icon.refine--icon-sm {
|
1382
|
+
padding: 2px 0 ;
|
1371
1383
|
}
|
1372
1384
|
}
|
1373
1385
|
|
@@ -1398,8 +1410,18 @@
|
|
1398
1410
|
animation-fill-mode: both;
|
1399
1411
|
}
|
1400
1412
|
|
1401
|
-
.refine--condition-value-clause {
|
1402
|
-
|
1413
|
+
.refine--condition-value-clause, .refine--condition-value-self {
|
1414
|
+
padding-left: 4px;
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
.refine--condition-pill-name, .refine--condition-value-self {
|
1418
|
+
font-weight: 600;
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
.refine--condition-value-self {
|
1422
|
+
max-width: 150px;
|
1423
|
+
text-overflow: ellipsis;
|
1424
|
+
overflow: hidden;
|
1403
1425
|
}
|
1404
1426
|
|
1405
1427
|
/* Form widgets */
|
@@ -1634,10 +1656,6 @@ input.refine--text-condition-input:focus {
|
|
1634
1656
|
text-decoration: none;
|
1635
1657
|
}
|
1636
1658
|
|
1637
|
-
.refine--save-filter-link-label {
|
1638
|
-
border-bottom: 1px dotted #111;
|
1639
|
-
}
|
1640
|
-
|
1641
1659
|
/*
|
1642
1660
|
*********************************************
|
1643
1661
|
Inline Final Styles
|
@@ -1649,36 +1667,36 @@ input.refine--text-condition-input:focus {
|
|
1649
1667
|
color: #767676;
|
1650
1668
|
}
|
1651
1669
|
|
1652
|
-
.refine--add-condition-button.refine--add-first-condition-button,
|
1653
|
-
.refine--add-condition-group-button.refine--add-first-condition-button {
|
1654
|
-
border: 1px dotted #aaa;
|
1655
|
-
padding-right: 8px;
|
1656
|
-
line-height: 16px;
|
1657
|
-
&:hover {
|
1658
|
-
background-color: #fff;
|
1659
|
-
border-style: solid;
|
1660
|
-
color: #111;
|
1661
|
-
}
|
1662
|
-
}
|
1663
|
-
|
1664
1670
|
.refine--add-condition-button, .refine--add-group-button {
|
1665
1671
|
display: flex;
|
1666
1672
|
gap: 5px;
|
1667
1673
|
color: #767676;
|
1668
1674
|
font-size: 14px;
|
1669
1675
|
border-radius: 6px;
|
1670
|
-
padding: 5px;
|
1671
1676
|
align-items: center;
|
1672
|
-
background-color: #
|
1677
|
+
background-color: #F2F4F7;
|
1678
|
+
border: 1px solid #EBEBEB;
|
1679
|
+
cursor: pointer;
|
1680
|
+
position: relative;
|
1681
|
+
white-space: nowrap;
|
1682
|
+
padding: 4px 8px;
|
1683
|
+
font-weight: 600;
|
1684
|
+
&:hover {
|
1685
|
+
border-color: #D1D5DB;
|
1686
|
+
background-color: #E5E7EB;
|
1687
|
+
}
|
1688
|
+
&:active {
|
1689
|
+
border-color: #E5E7EB;
|
1690
|
+
}
|
1673
1691
|
&:disabled {
|
1674
|
-
|
1675
|
-
background-color: #f8f8f8;
|
1692
|
+
opacity: 0.5;
|
1676
1693
|
cursor: not-allowed;
|
1677
1694
|
}
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1695
|
+
}
|
1696
|
+
|
1697
|
+
.refine--add-group-wrapper {
|
1698
|
+
padding-left: 10px;
|
1699
|
+
border-left: 1px solid #E5E7EB;
|
1682
1700
|
}
|
1683
1701
|
|
1684
1702
|
.refine--has-many-groups .refine--add-button-label {
|
@@ -1791,16 +1809,22 @@ button.refine--apply-button {
|
|
1791
1809
|
}
|
1792
1810
|
}
|
1793
1811
|
|
1794
|
-
.refine--save-filter-link {
|
1812
|
+
.refine--save-filter-link, .refine--clear-filter-link {
|
1795
1813
|
display: flex;
|
1796
1814
|
align-items: center;
|
1797
1815
|
gap: 5px;
|
1798
1816
|
font-size: 14px;
|
1799
|
-
padding: 3px 0;
|
1817
|
+
padding: 3px 0 3px 10px;
|
1800
1818
|
border: 1px solid transparent;
|
1801
1819
|
border-radius: 6px;
|
1802
1820
|
}
|
1803
1821
|
|
1822
|
+
.refine--save-filter-link-label, .refine--clear-filter-link-label {
|
1823
|
+
&:hover {
|
1824
|
+
border-bottom: 1px dotted #111;
|
1825
|
+
}
|
1826
|
+
}
|
1827
|
+
|
1804
1828
|
.refine--save-filter-input-wrapper {
|
1805
1829
|
display: flex;
|
1806
1830
|
gap: 5px;
|
@@ -1836,6 +1860,10 @@ input.refine--save-filter-input {
|
|
1836
1860
|
z-index: 9999;
|
1837
1861
|
}
|
1838
1862
|
|
1863
|
+
.refine--save-filter-form {
|
1864
|
+
margin-left: 8px;
|
1865
|
+
}
|
1866
|
+
|
1839
1867
|
.refine--hotkey {
|
1840
1868
|
border-radius: 4px;
|
1841
1869
|
background-color: rgba(255,255,255,.3);
|
@@ -1855,6 +1883,7 @@ input.refine--save-filter-input {
|
|
1855
1883
|
.material-icons.refine--icon-sm,
|
1856
1884
|
.icon.refine--icon-sm {
|
1857
1885
|
font-size: 14px;
|
1886
|
+
padding: 3px 0;
|
1858
1887
|
}
|
1859
1888
|
|
1860
1889
|
.refine--search-box {
|
@@ -382,20 +382,23 @@
|
|
382
382
|
.refine--filter-wrapper {
|
383
383
|
font-size: 14px;
|
384
384
|
display: flex;
|
385
|
-
flex-direction: column;
|
385
|
+
/* flex-direction: column; */
|
386
386
|
gap: 12px;
|
387
387
|
margin-top: 12px;
|
388
388
|
}
|
389
389
|
|
390
390
|
.refine--filter-row {
|
391
391
|
display: flex;
|
392
|
+
width: 100%;
|
392
393
|
gap: 10px;
|
393
394
|
row-gap: 15px;
|
394
395
|
align-items: center;
|
395
|
-
|
396
|
+
align-items: start;
|
397
|
+
justify-content: space-between;
|
396
398
|
}
|
397
399
|
|
398
400
|
.refine--groups-wrapper {
|
401
|
+
flex-grow: 1;
|
399
402
|
display: flex;
|
400
403
|
gap: 10px;
|
401
404
|
row-gap: 15px;
|
@@ -403,6 +406,13 @@
|
|
403
406
|
flex-wrap: wrap;
|
404
407
|
}
|
405
408
|
|
409
|
+
.refine--filter-control-group {
|
410
|
+
text-wrap: nowrap;
|
411
|
+
flex-wrap: wrap;
|
412
|
+
display: flex;
|
413
|
+
align-items: center;
|
414
|
+
}
|
415
|
+
|
406
416
|
.refine--group-join, .refine--condition-join {
|
407
417
|
position: relative;
|
408
418
|
padding: 5px 0;
|
@@ -429,6 +439,7 @@
|
|
429
439
|
position: relative;
|
430
440
|
padding: 0 10px;
|
431
441
|
align-items: center;
|
442
|
+
flex-wrap: wrap;
|
432
443
|
|
433
444
|
&:before , &:after {
|
434
445
|
content: "";
|
@@ -484,7 +495,7 @@
|
|
484
495
|
text-decoration: none;
|
485
496
|
}
|
486
497
|
|
487
|
-
.refine--condition-pill-wrapper
|
498
|
+
.refine--condition-pill-wrapper {
|
488
499
|
display: flex;
|
489
500
|
align-items: center;
|
490
501
|
gap: 5px;
|
@@ -492,21 +503,26 @@
|
|
492
503
|
}
|
493
504
|
|
494
505
|
.refine--condition-pill {
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
506
|
+
display: flex;
|
507
|
+
align-items: center;
|
508
|
+
background-color: #F2F4F7;
|
509
|
+
border: 1px solid #EBEBEB;
|
499
510
|
border-radius: 6px;
|
500
511
|
font-size: 14px;
|
501
512
|
cursor: pointer;
|
502
513
|
position: relative;
|
503
514
|
white-space: nowrap;
|
515
|
+
padding: 4px 8px;
|
504
516
|
&:hover {
|
505
|
-
border-color: #
|
517
|
+
border-color: #D1D5DB;
|
518
|
+
background-color: #E5E7EB;
|
506
519
|
.refine--remove-condition {
|
507
520
|
display: block;
|
508
521
|
}
|
509
522
|
}
|
523
|
+
&:active {
|
524
|
+
border-color: #E5E7EB;
|
525
|
+
}
|
510
526
|
&:not(:hover){
|
511
527
|
.refine--condition-value-wrapper {
|
512
528
|
display: none;
|
@@ -514,6 +530,10 @@
|
|
514
530
|
}
|
515
531
|
}
|
516
532
|
|
533
|
+
.refine--condition-pill-button {
|
534
|
+
display: flex;
|
535
|
+
}
|
536
|
+
|
517
537
|
.refine--filter-condition {
|
518
538
|
display: flex;
|
519
539
|
align-items: center;
|
@@ -524,31 +544,24 @@
|
|
524
544
|
padding: 4px;
|
525
545
|
}
|
526
546
|
|
527
|
-
.refine--condition-pill-name {
|
528
|
-
padding: 4px 8px;
|
529
|
-
display: block;
|
530
|
-
}
|
531
|
-
|
532
547
|
.refine--remove-condition {
|
533
548
|
display: none;
|
534
|
-
|
535
|
-
padding:
|
549
|
+
color: #fff;
|
550
|
+
padding: 0px 2px 0px 2px;
|
536
551
|
border-radius: 50%;
|
537
552
|
position: absolute;
|
538
553
|
top: -8px;
|
539
554
|
right:-8px;
|
540
|
-
background-color: #
|
555
|
+
background-color: #ee3f3f;
|
541
556
|
z-index: 999;
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
width: 6px;
|
549
|
-
height: 2px;
|
550
|
-
background-color: #fff;
|
557
|
+
line-height: 1;
|
558
|
+
border: 1.5px solid #fff;
|
559
|
+
.material-icons-outlined.refine--icon-sm,
|
560
|
+
.material-icons.refine--icon-sm,
|
561
|
+
.icon.refine--icon-sm {
|
562
|
+
padding: 2px 0 ;
|
551
563
|
}
|
564
|
+
|
552
565
|
}
|
553
566
|
&:hover {
|
554
567
|
border-color: #999;
|
@@ -575,8 +588,18 @@
|
|
575
588
|
animation-fill-mode: both;
|
576
589
|
}
|
577
590
|
|
578
|
-
.refine--condition-value-clause {
|
579
|
-
|
591
|
+
.refine--condition-value-clause, .refine--condition-value-self {
|
592
|
+
padding-left: 4px;
|
593
|
+
}
|
594
|
+
|
595
|
+
.refine--condition-pill-name, .refine--condition-value-self {
|
596
|
+
font-weight: 600;
|
597
|
+
}
|
598
|
+
|
599
|
+
.refine--condition-value-self {
|
600
|
+
max-width: 150px;
|
601
|
+
text-overflow: ellipsis;
|
602
|
+
overflow: hidden;
|
580
603
|
}
|
581
604
|
|
582
605
|
/* Form widgets */
|
@@ -805,9 +828,6 @@ input.refine--text-condition-input:focus {
|
|
805
828
|
text-decoration: none;
|
806
829
|
}
|
807
830
|
|
808
|
-
.refine--save-filter-link-label {
|
809
|
-
border-bottom: 1px dotted #111;
|
810
|
-
}
|
811
831
|
/*
|
812
832
|
*********************************************
|
813
833
|
Inline Final Styles
|
@@ -818,37 +838,36 @@ input.refine--text-condition-input:focus {
|
|
818
838
|
color: #767676;
|
819
839
|
}
|
820
840
|
|
821
|
-
|
822
|
-
.refine--add-condition-button.refine--add-first-condition-button,
|
823
|
-
.refine--add-condition-group-button.refine--add-first-condition-button {
|
824
|
-
border: 1px dotted #aaa;
|
825
|
-
padding-right: 8px;
|
826
|
-
line-height: 16px;
|
827
|
-
&:hover {
|
828
|
-
background-color: #fff;
|
829
|
-
border-style: solid;
|
830
|
-
color: #111;
|
831
|
-
}
|
832
|
-
}
|
833
|
-
|
834
841
|
.refine--add-condition-button, .refine--add-group-button {
|
835
842
|
display: flex;
|
836
843
|
gap: 5px;
|
837
844
|
color: #767676;
|
838
845
|
font-size: 14px;
|
839
846
|
border-radius: 6px;
|
840
|
-
padding: 5px;
|
841
847
|
align-items: center;
|
842
|
-
background-color: #
|
848
|
+
background-color: #F2F4F7;
|
849
|
+
border: 1px solid #EBEBEB;
|
850
|
+
cursor: pointer;
|
851
|
+
position: relative;
|
852
|
+
white-space: nowrap;
|
853
|
+
padding: 4px 8px;
|
854
|
+
font-weight: 600;
|
855
|
+
&:hover {
|
856
|
+
border-color: #D1D5DB;
|
857
|
+
background-color: #E5E7EB;
|
858
|
+
}
|
859
|
+
&:active {
|
860
|
+
border-color: #E5E7EB;
|
861
|
+
}
|
843
862
|
&:disabled {
|
844
|
-
|
845
|
-
background-color: #f8f8f8;
|
863
|
+
opacity: 0.5;
|
846
864
|
cursor: not-allowed;
|
847
865
|
}
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
866
|
+
}
|
867
|
+
|
868
|
+
.refine--add-group-wrapper {
|
869
|
+
padding-left: 10px;
|
870
|
+
border-left: 1px solid #E5E7EB;
|
852
871
|
}
|
853
872
|
|
854
873
|
.refine--has-many-groups .refine--add-button-label {
|
@@ -955,16 +974,21 @@ button.refine--apply-button {
|
|
955
974
|
}
|
956
975
|
}
|
957
976
|
|
958
|
-
.refine--save-filter-link {
|
977
|
+
.refine--save-filter-link, .refine--clear-filter-link {
|
959
978
|
display: flex;
|
960
979
|
align-items: center;
|
961
980
|
gap: 5px;
|
962
981
|
font-size: 14px;
|
963
|
-
padding: 3px 0;
|
982
|
+
padding: 3px 0 3px 10px;
|
964
983
|
border: 1px solid transparent;
|
965
984
|
border-radius: 6px;
|
966
985
|
}
|
967
986
|
|
987
|
+
.refine--save-filter-link-label, .refine--clear-filter-link-label {
|
988
|
+
&:hover {
|
989
|
+
border-bottom: 1px dotted #111;
|
990
|
+
}
|
991
|
+
}
|
968
992
|
.refine--save-filter-input-wrapper {
|
969
993
|
display: flex;
|
970
994
|
gap: 5px;
|
@@ -1000,6 +1024,10 @@ input.refine--save-filter-input {
|
|
1000
1024
|
z-index: 9999;
|
1001
1025
|
}
|
1002
1026
|
|
1027
|
+
.refine--save-filter-form {
|
1028
|
+
margin-left: 8px;
|
1029
|
+
}
|
1030
|
+
|
1003
1031
|
.refine--hotkey {
|
1004
1032
|
border-radius: 4px;
|
1005
1033
|
background-color: rgba(255,255,255,.3);
|
@@ -1019,6 +1047,7 @@ input.refine--save-filter-input {
|
|
1019
1047
|
.material-icons.refine--icon-sm,
|
1020
1048
|
.icon.refine--icon-sm {
|
1021
1049
|
font-size: 14px;
|
1050
|
+
padding: 3px 0;
|
1022
1051
|
}
|
1023
1052
|
|
1024
1053
|
.refine--search-box {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class Refine::Inline::CriteriaController < ApplicationController
|
2
2
|
layout false
|
3
3
|
before_action :set_refine_filter
|
4
|
-
|
5
4
|
# List available conditions for new criteria
|
6
5
|
# Carries position and index forward
|
7
6
|
def index
|
@@ -88,8 +87,18 @@ class Refine::Inline::CriteriaController < ApplicationController
|
|
88
87
|
handle_filter_update(@refine_filter.to_stable_id)
|
89
88
|
end
|
90
89
|
|
90
|
+
def clear
|
91
|
+
@refine_filter.clear_blueprint!
|
92
|
+
@criterion = Refine::Inline::Criterion.new(criterion_params.merge(refine_filter: @refine_filter))
|
93
|
+
handle_filter_update()
|
94
|
+
end
|
95
|
+
|
91
96
|
private
|
92
97
|
|
98
|
+
def set_blank_filter
|
99
|
+
@refine_filter = Refine::Rails.configuration.stabilizer_classes[:url].new
|
100
|
+
end
|
101
|
+
|
93
102
|
def set_refine_filter
|
94
103
|
@refine_filter ||= Refine::Rails.configuration.stabilizer_classes[:url]
|
95
104
|
.new
|
@@ -131,12 +140,14 @@ class Refine::Inline::CriteriaController < ApplicationController
|
|
131
140
|
end
|
132
141
|
|
133
142
|
# either directly redirect or emit a `filter-submit-success` event
|
134
|
-
def handle_filter_update(stable_id)
|
143
|
+
def handle_filter_update(stable_id=nil)
|
135
144
|
# update_stable_id in url
|
136
145
|
uri = URI(request.referrer)
|
137
146
|
new_query_ar = URI.decode_www_form(String(uri.query))
|
138
147
|
new_query_ar.reject! { |(k, _v)| k == "stable_id" }
|
139
|
-
|
148
|
+
if stable_id
|
149
|
+
new_query_ar << ["stable_id", stable_id]
|
150
|
+
end
|
140
151
|
uri.query = URI.encode_www_form(new_query_ar)
|
141
152
|
|
142
153
|
respond_to do |format|
|
@@ -146,7 +157,9 @@ class Refine::Inline::CriteriaController < ApplicationController
|
|
146
157
|
@refine_client_id = @criterion.client_id
|
147
158
|
render :create
|
148
159
|
end
|
149
|
-
format.html
|
160
|
+
format.html do
|
161
|
+
redirect_to uri.to_s
|
162
|
+
end
|
150
163
|
end
|
151
164
|
end
|
152
165
|
|
data/app/models/refine/filter.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
src: refine_inline_criteria_path(criterion.to_params) do
|
14
14
|
%>
|
15
15
|
<button class="refine--add-condition-button refine--add-first-condition-button" href="#" data-action="click->refine--popup#show" type="button">
|
16
|
-
<span class="icon material-icons-outlined refine--icon-sm">add</span>
|
17
16
|
<span><%= t(".filter") %></span>
|
17
|
+
<span class="icon material-icons-outlined refine--icon-sm">add</span>
|
18
18
|
</button>
|
19
19
|
<% end %>
|
@@ -9,18 +9,22 @@
|
|
9
9
|
%>
|
10
10
|
|
11
11
|
<% if @refine_filter.criteria_limit_reached? %>
|
12
|
-
<button disabled class="refine--add-condition-button" type="button" title="<%= t(".criteria_limit", criteria_limit: @refine_filter.criteria_limit) %>">
|
12
|
+
<button disabled class="refine--add-condition-button refine--group-last-item refine--condition-pill-end" type="button" title="<%= t(".criteria_limit", criteria_limit: @refine_filter.criteria_limit) %>">
|
13
|
+
<% if show_label %>
|
14
|
+
<span class="refine--add-button-label"><%= t("refine.inline.filters.and_button.condition") %></span>
|
15
|
+
<% end %>
|
13
16
|
<span class="icon material-icons-outlined refine--icon-sm">add</span>
|
14
|
-
<span class="refine--add-button-label"><%= t("refine.inline.filters.and_button.condition") %></span>
|
15
17
|
</button>
|
16
18
|
<% else %>
|
17
19
|
<%= render "refine/inline/filters/popup",
|
18
20
|
frame_id: dom_id(criterion),
|
19
21
|
src: refine_inline_criteria_path(criterion.to_params) do
|
20
22
|
%>
|
21
|
-
<button class="refine--add-condition-button" type="button" data-action="click->refine--popup#show">
|
23
|
+
<button class="refine--add-condition-button refine--group-last-item refine--condition-pill-end" type="button" data-action="click->refine--popup#show">
|
24
|
+
<% if show_label %>
|
25
|
+
<span class="refine--add-button-label"><%= t("refine.inline.filters.and_button.condition") %></span>
|
26
|
+
<% end %>
|
22
27
|
<span class="icon material-icons-outlined refine--icon-sm">add</span>
|
23
|
-
<span class="refine--add-button-label"><%= t("refine.inline.filters.and_button.condition") %></span>
|
24
28
|
</button>
|
25
29
|
<% end %>
|
26
30
|
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%
|
2
|
+
criterion = Refine::Inline::Criterion.new(
|
3
|
+
stable_id: @refine_filter.to_stable_id,
|
4
|
+
client_id: @refine_client_id,
|
5
|
+
)
|
6
|
+
%>
|
7
|
+
|
8
|
+
<%= link_to clear_refine_inline_criteria_path(criterion.to_params), method: :post,
|
9
|
+
class: "refine--clear-filter-link", data: {turbo_stream: true, turbo_method: :post} do %>
|
10
|
+
<span class="material-icons-outlined refine--icon-sm">clear</span>
|
11
|
+
<span class="refine--clear-filter-link-label"><%= t('refine.inline.filters.clear_filter') %></span>
|
12
|
+
<% end %>
|
13
|
+
|
@@ -6,16 +6,16 @@
|
|
6
6
|
|
7
7
|
<div class="refine--condition-pill-wrapper">
|
8
8
|
<div class="refine--condition-pill">
|
9
|
-
<%= link_to criterion.condition_display, edit_refine_inline_criterion_path(criterion.position, criterion.to_params), class: "refine--condition-pill-name", data: {controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} %>
|
10
|
-
<div class="refine--remove-condition"></div>
|
11
9
|
<%= link_to refine_inline_criterion_path(criterion.position, criterion.to_params), class: "refine--remove-condition", data: {turbo_method: :delete, controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} do %>
|
10
|
+
<span class="material-icons-outlined refine--icon-sm">clear</span>
|
11
|
+
<% end %>
|
12
|
+
<%= link_to edit_refine_inline_criterion_path(criterion.position, criterion.to_params), class:"refine--condition-pill-button", data: {controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} do %>
|
13
|
+
<div class="refine--condition-pill-name"><%= criterion.condition_display %></div>
|
14
|
+
<div class="refine--condition-value-clause"><%= criterion.clause_display %></div>
|
15
|
+
<div class="refine--condition-value-self" title="<%= criterion.human_readable_value %>">
|
16
|
+
<%= criterion.human_readable_value %>
|
17
|
+
</div>
|
12
18
|
<% end %>
|
13
|
-
<div class="refine--condition-value-wrapper">
|
14
|
-
<div class="refine--condition-value-clause"><%= criterion.clause_display %></div>
|
15
|
-
<div class="refine--condition-value-self">
|
16
|
-
<div><%= criterion.human_readable_value.truncate(64) %></div>
|
17
|
-
</div>
|
18
|
-
</div>
|
19
19
|
</div>
|
20
20
|
</div>
|
21
21
|
|
@@ -1,13 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<% unless i == 0 %>
|
6
|
-
<div class="refine--condition-join"><%= t(".and") %></div>
|
7
|
-
<% end %>
|
8
|
-
<%= render "refine/inline/filters/criterion", criterion: criterion %>
|
9
|
-
<% end %>
|
10
|
-
</div>
|
11
|
-
<%= render "refine/inline/filters/and_button", position: group.last.position + 1 %>
|
12
|
-
</div>
|
13
|
-
</div>
|
1
|
+
<% group.each.with_index do |criterion, i| %>
|
2
|
+
<%= render "refine/inline/filters/criterion", criterion: criterion, placement: i, size: group.length %>
|
3
|
+
<% end %>
|
4
|
+
<%= render "refine/inline/filters/and_button", position: group.last.position + 1, show_label: (group_count < 2 && condition_count < 2) %>
|