fomantic-ui-sass 2.8.1 → 2.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/app/assets/fonts/semantic-ui/brand-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.svg +175 -82
- data/app/assets/fonts/semantic-ui/brand-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +177 -126
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.svg +11 -11
- data/app/assets/fonts/semantic-ui/outline-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
- data/app/assets/javascripts/semantic-ui/calendar.js +103 -45
- data/app/assets/javascripts/semantic-ui/checkbox.js +1 -1
- data/app/assets/javascripts/semantic-ui/dropdown.js +45 -45
- data/app/assets/javascripts/semantic-ui/form.js +63 -27
- data/app/assets/javascripts/semantic-ui/modal.js +9 -1
- data/app/assets/javascripts/semantic-ui/popup.js +8 -7
- data/app/assets/javascripts/semantic-ui/search.js +29 -2
- data/app/assets/javascripts/semantic-ui/slider.js +6 -6
- data/app/assets/javascripts/semantic-ui/tab.js +3 -2
- data/app/assets/javascripts/semantic-ui/toast.js +11 -9
- data/app/assets/javascripts/semantic-ui/visibility.js +1 -1
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +63 -24
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +28 -28
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +36 -20
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +9 -3
- data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +6130 -6133
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +147 -18
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +44 -44
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +7 -0
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +1 -0
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +9 -9
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +8 -8
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +10 -3
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +34 -7
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +32 -3
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +90 -0
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -0
- data/fomantic-ui-sass.gemspec +2 -2
- data/lib/fomantic-ui-sass.rb +2 -2
- data/lib/fomantic/ui/sass/version.rb +2 -2
- data/spec/dummy/app/assets/config/manifest.js +0 -0
- metadata +11 -9
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<?xml version="1.0" standalone="no"?>
|
2
2
|
<!--
|
3
|
-
Font Awesome Free 5.
|
3
|
+
Font Awesome Free 5.12.0 by @fontawesome - https://fontawesome.com
|
4
4
|
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
5
5
|
-->
|
6
6
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
7
7
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
|
8
8
|
<metadata>
|
9
|
-
Created by FontForge
|
9
|
+
Created by FontForge 20190801 at Tue Dec 10 16:09:21 2019
|
10
10
|
By Robert Madole
|
11
11
|
Copyright (c) Font Awesome
|
12
12
|
</metadata>
|
@@ -22,7 +22,7 @@ Copyright (c) Font Awesome
|
|
22
22
|
descent="-64"
|
23
23
|
bbox="-0.0663408 -64.0662 640.01 448.1"
|
24
24
|
underline-thickness="25"
|
25
|
-
underline-position="-
|
25
|
+
underline-position="-50"
|
26
26
|
unicode-range="U+0020-F5C8"
|
27
27
|
/>
|
28
28
|
<missing-glyph />
|
@@ -435,14 +435,14 @@ c-44.1123 0 -80 35.8877 -80 80v8c0 30.8779 25.1211 56 56 56h293.917c24.5 0 47.08
|
|
435
435
|
c-4.41113 0 -8 -3.58887 -8 -8v-8c0 -17.6445 14.3555 -32 32 -32h213.471c25.2021 0 42.626 -25.293 33.6299 -48.8457l-24.5518 -64.2812c-7.05371 -18.4658 -25.0732 -30.873 -44.8398 -30.873h-113.709c-22.0557 0 -40 -17.9443 -40 -40c0 -4.41113 3.58887 -8 8 -8
|
436
436
|
h131.552h0.0517578c7.44141 0 19.1074 -2.19238 26.041 -4.89355l99.752 -38.7881c18.5898 -7.22852 30.6035 -24.7881 30.6035 -44.7363v-23.582h128z" />
|
437
437
|
<glyph glyph-name="hand-spock" unicode=""
|
438
|
-
d="
|
439
|
-
|
440
|
-
c-
|
441
|
-
|
442
|
-
|
443
|
-
c-
|
444
|
-
|
445
|
-
|
438
|
+
d="M501.03 331.824c6.05762 -9.77832 10.9746 -27.0498 10.9746 -38.5518c0 -4.80664 -0.915039 -12.499 -2.04297 -17.1709l-57.623 -241.963c-12.748 -54.1729 -68.2627 -98.1387 -123.915 -98.1387h-0.345703h-107.455h-0.224609
|
439
|
+
c-33.8135 0 -81.2148 18.834 -105.807 42.041l-91.3652 85.9766c-12.8213 12.0469 -23.2266 36.1016 -23.2266 53.6943c0 16.1299 8.97266 38.7529 20.0273 50.499c5.31836 5.66406 29.875 29.3926 68.1152 21.8477l-24.3594 82.1973
|
440
|
+
c-1.68164 5.66406 -3.0459 15.0576 -3.0459 20.9668c0 37.5938 30.417 70.502 67.8955 73.4551c-0.204102 2.03125 -0.369141 5.33691 -0.369141 7.37891c0 31.627 24.8594 63.6895 55.4902 71.5684c43.248 10.9785 80.5645 -17.7012 89.6602 -53.0723l13.6836 -53.207
|
441
|
+
l4.64648 22.6602c6.76074 32.417 39.123 58.8115 72.2373 58.916c8.73438 0 56.625 -3.26953 70.7383 -54.0801c15.0664 0.710938 46.9199 -3.50977 66.3105 -35.0176zM463.271 287.219c7.86914 32.9844 -42.1211 45.2695 -50.0859 11.9219l-24.8008 -104.146
|
442
|
+
c-4.38867 -18.4141 -31.7783 -11.8926 -28.0557 6.2168l28.5479 139.166c7.39844 36.0703 -43.3076 45.0703 -50.1182 11.9629l-31.791 -154.971c-3.54883 -17.3086 -28.2832 -18.0469 -32.7109 -0.804688l-47.3262 184.035
|
443
|
+
c-8.43359 32.8105 -58.3691 20.2676 -49.8652 -12.8359l42.4414 -165.039c4.81641 -18.7207 -23.3711 -26.9121 -28.9648 -8.00781l-31.3438 105.779c-9.6875 32.6465 -59.1191 18.2578 -49.3867 -14.625l36.0137 -121.539
|
444
|
+
c5.61816 -18.9521 10.1777 -50.377 10.1777 -70.1436v-0.00878906c0 -6.54297 -8.05664 -10.9355 -13.4824 -5.82617l-51.123 48.1074c-24.7852 23.4082 -60.0527 -14.1875 -35.2793 -37.4902l91.3691 -85.9805c16.9629 -16.0068 49.6592 -28.998 72.9824 -28.998h0.154297
|
445
|
+
h107.455h0.216797c34.7402 0 69.3936 27.4443 77.3525 61.2598z" />
|
446
446
|
<glyph glyph-name="hand-pointer" unicode="" horiz-adv-x="448"
|
447
447
|
d="M358.182 268.639c43.1934 16.6348 89.8184 -15.7949 89.8184 -62.6387v-84c-0.000976562 -4.25 -0.775391 -11.0615 -1.72754 -15.2041l-27.4297 -118.999c-6.98242 -30.2969 -33.7549 -51.7969 -64.5566 -51.7969h-178.286c-21.2588 0 -41.3682 10.4102 -53.791 27.8457
|
448
448
|
l-109.699 154.001c-21.2432 29.8193 -14.8047 71.3574 14.5498 93.1523c18.8115 13.9658 42.1748 16.2822 62.083 8.87207v161.129c0 36.9443 29.7363 67 66.2861 67s66.2861 -30.0557 66.2861 -67v-73.6338c20.4131 2.85742 41.4678 -3.94238 56.5947 -19.6289
|
Binary file
|
Binary file
|
Binary file
|
@@ -116,6 +116,7 @@ $.fn.calendar = function(parameters) {
|
|
116
116
|
module.set.maxDate($module.data(metadata.maxDate));
|
117
117
|
}
|
118
118
|
module.setting('type', module.get.type());
|
119
|
+
module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
|
119
120
|
},
|
120
121
|
popup: function () {
|
121
122
|
if (settings.inline) {
|
@@ -159,7 +160,7 @@ $.fn.calendar = function(parameters) {
|
|
159
160
|
module.set.mode(settings.startMode);
|
160
161
|
return settings.onShow.apply($container, arguments);
|
161
162
|
};
|
162
|
-
var on =
|
163
|
+
var on = module.setting('on');
|
163
164
|
var options = $.extend({}, settings.popupOptions, {
|
164
165
|
popup: $container,
|
165
166
|
on: on,
|
@@ -202,33 +203,38 @@ $.fn.calendar = function(parameters) {
|
|
202
203
|
calendar: function () {
|
203
204
|
var i, r, c, p, row, cell, pageGrid;
|
204
205
|
|
205
|
-
var
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
206
|
+
var
|
207
|
+
mode = module.get.mode(),
|
208
|
+
today = new Date(),
|
209
|
+
date = module.get.date(),
|
210
|
+
focusDate = module.get.focusDate(),
|
211
|
+
display = module.helper.dateInRange(focusDate || date || settings.initialDate || today)
|
212
|
+
;
|
211
213
|
|
212
214
|
if (!focusDate) {
|
213
215
|
focusDate = display;
|
214
216
|
module.set.focusDate(focusDate, false, false);
|
215
217
|
}
|
216
218
|
|
217
|
-
var
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
219
|
+
var
|
220
|
+
isYear = mode === 'year',
|
221
|
+
isMonth = mode === 'month',
|
222
|
+
isDay = mode === 'day',
|
223
|
+
isHour = mode === 'hour',
|
224
|
+
isMinute = mode === 'minute',
|
225
|
+
isTimeOnly = settings.type === 'time'
|
226
|
+
;
|
223
227
|
|
224
228
|
var multiMonth = Math.max(settings.multiMonth, 1);
|
225
229
|
var monthOffset = !isDay ? 0 : module.get.monthOffset();
|
226
230
|
|
227
|
-
var
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
231
|
+
var
|
232
|
+
minute = display.getMinutes(),
|
233
|
+
hour = display.getHours(),
|
234
|
+
day = display.getDate(),
|
235
|
+
startMonth = display.getMonth() + monthOffset,
|
236
|
+
year = display.getFullYear()
|
237
|
+
;
|
232
238
|
|
233
239
|
var columns = isDay ? settings.showWeekNumbers ? 8 : 7 : isHour ? 4 : timeGap['column'];
|
234
240
|
var rows = isDay || isHour ? 6 : timeGap['row'];
|
@@ -254,17 +260,18 @@ $.fn.calendar = function(parameters) {
|
|
254
260
|
rows = Math.ceil(requiredCells / 7);
|
255
261
|
}
|
256
262
|
|
257
|
-
var
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
263
|
+
var
|
264
|
+
yearChange = isYear ? 10 : isMonth ? 1 : 0,
|
265
|
+
monthChange = isDay ? 1 : 0,
|
266
|
+
dayChange = isHour || isMinute ? 1 : 0,
|
267
|
+
prevNextDay = isHour || isMinute ? day : 1,
|
268
|
+
prevDate = new Date(year - yearChange, month - monthChange, prevNextDay - dayChange, hour),
|
269
|
+
nextDate = new Date(year + yearChange, month + monthChange, prevNextDay + dayChange, hour),
|
270
|
+
prevLast = isYear ? new Date(Math.ceil(year / 10) * 10 - 9, 0, 0) :
|
271
|
+
isMonth ? new Date(year, 0, 0) : isDay ? new Date(year, month, 0) : new Date(year, month, day, -1),
|
272
|
+
nextFirst = isYear ? new Date(Math.ceil(year / 10) * 10 + 1, 0, 1) :
|
273
|
+
isMonth ? new Date(year + 1, 0, 1) : isDay ? new Date(year, month + 1, 1) : new Date(year, month, day + 1)
|
274
|
+
;
|
268
275
|
|
269
276
|
var tempMode = mode;
|
270
277
|
if (isDay && settings.showWeekNumbers){
|
@@ -440,7 +447,6 @@ $.fn.calendar = function(parameters) {
|
|
440
447
|
$input.on('input' + eventNamespace, module.event.inputChange);
|
441
448
|
$input.on('focus' + eventNamespace, module.event.inputFocus);
|
442
449
|
$input.on('blur' + eventNamespace, module.event.inputBlur);
|
443
|
-
$input.on('click' + eventNamespace, module.event.inputClick);
|
444
450
|
$input.on('keydown' + eventNamespace, module.event.keydown);
|
445
451
|
} else {
|
446
452
|
$container.on('keydown' + eventNamespace, module.event.keydown);
|
@@ -569,9 +575,6 @@ $.fn.calendar = function(parameters) {
|
|
569
575
|
var text = formatter.datetime(date, settings);
|
570
576
|
$input.val(text);
|
571
577
|
}
|
572
|
-
},
|
573
|
-
inputClick: function () {
|
574
|
-
module.popup('show');
|
575
578
|
}
|
576
579
|
},
|
577
580
|
|
@@ -796,10 +799,12 @@ $.fn.calendar = function(parameters) {
|
|
796
799
|
var canceled = module.set.date(date) === false;
|
797
800
|
if (!canceled && settings.closable) {
|
798
801
|
module.popup('hide');
|
799
|
-
//if this is a range calendar,
|
802
|
+
//if this is a range calendar, focus the container or input. This will open the popup from its event listeners.
|
800
803
|
var endModule = module.get.calendarModule(settings.endCalendar);
|
801
804
|
if (endModule) {
|
802
|
-
endModule.
|
805
|
+
if (endModule.setting('on') !== 'focus') {
|
806
|
+
endModule.popup('show');
|
807
|
+
}
|
803
808
|
endModule.focus();
|
804
809
|
}
|
805
810
|
}
|
@@ -809,7 +814,7 @@ $.fn.calendar = function(parameters) {
|
|
809
814
|
module.set.mode(newMode);
|
810
815
|
if (mode === 'hour' || (mode === 'day' && module.get.date())) {
|
811
816
|
//the user has chosen enough to consider a valid date/time has been chosen
|
812
|
-
module.set.date(date);
|
817
|
+
module.set.date(date, true, false);
|
813
818
|
} else {
|
814
819
|
module.set.focusDate(date);
|
815
820
|
}
|
@@ -845,15 +850,38 @@ $.fn.calendar = function(parameters) {
|
|
845
850
|
|
846
851
|
helper: {
|
847
852
|
isDisabled: function(date, mode) {
|
848
|
-
return mode === 'day' && ((settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
|
853
|
+
return (mode === 'day' || mode === 'month' || mode === 'year') && ((settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
|
849
854
|
if(typeof d === 'string') {
|
850
855
|
d = module.helper.sanitiseDate(d);
|
851
856
|
}
|
852
857
|
if (d instanceof Date) {
|
853
858
|
return module.helper.dateEqual(date, d, mode);
|
854
859
|
}
|
855
|
-
if (d !== null && typeof d === 'object'
|
856
|
-
|
860
|
+
if (d !== null && typeof d === 'object') {
|
861
|
+
if (d[metadata.year]) {
|
862
|
+
if (typeof d[metadata.year] === 'number') {
|
863
|
+
return date.getFullYear() == d[metadata.year];
|
864
|
+
} else if (Array.isArray(d[metadata.year])) {
|
865
|
+
return d[metadata.year].indexOf(date.getFullYear()) > -1;
|
866
|
+
}
|
867
|
+
} else if (d[metadata.month]) {
|
868
|
+
if (typeof d[metadata.month] === 'number') {
|
869
|
+
return date.getMonth() == d[metadata.month];
|
870
|
+
} else if (Array.isArray(d[metadata.month])) {
|
871
|
+
return d[metadata.month].indexOf(date.getMonth()) > -1;
|
872
|
+
} else if (d[metadata.month] instanceof Date) {
|
873
|
+
var sdate = module.helper.sanitiseDate(d[metadata.month]);
|
874
|
+
return (date.getMonth() == sdate.getMonth()) && (date.getFullYear() == sdate.getFullYear())
|
875
|
+
}
|
876
|
+
} else if (d[metadata.date] && mode === 'day') {
|
877
|
+
if (d[metadata.date] instanceof Date) {
|
878
|
+
return module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode);
|
879
|
+
} else if (Array.isArray(d[metadata.date])) {
|
880
|
+
return d[metadata.date].some(function(idate) {
|
881
|
+
return module.helper.dateEqual(date, idate, mode);
|
882
|
+
});
|
883
|
+
}
|
884
|
+
}
|
857
885
|
}
|
858
886
|
}));
|
859
887
|
},
|
@@ -875,10 +903,9 @@ $.fn.calendar = function(parameters) {
|
|
875
903
|
}
|
876
904
|
},
|
877
905
|
findDayAsObject: function(date, mode, dates) {
|
878
|
-
if (mode === 'day') {
|
879
|
-
var i = 0, il = dates.length;
|
906
|
+
if (mode === 'day' || mode === 'month' || mode === 'year') {
|
880
907
|
var d;
|
881
|
-
for (; i <
|
908
|
+
for (var i = 0; i < dates.length; i++) {
|
882
909
|
d = dates[i];
|
883
910
|
if(typeof d === 'string') {
|
884
911
|
d = module.helper.sanitiseDate(d);
|
@@ -888,8 +915,37 @@ $.fn.calendar = function(parameters) {
|
|
888
915
|
dateObject[metadata.date] = d;
|
889
916
|
return dateObject;
|
890
917
|
}
|
891
|
-
else if (d !== null && typeof d === 'object'
|
892
|
-
|
918
|
+
else if (d !== null && typeof d === 'object') {
|
919
|
+
if (d[metadata.year]) {
|
920
|
+
if (typeof d[metadata.year] === 'number' && date.getFullYear() == d[metadata.year]) {
|
921
|
+
return d;
|
922
|
+
} else if (Array.isArray(d[metadata.year])) {
|
923
|
+
if (d[metadata.year].indexOf(date.getFullYear()) > -1) {
|
924
|
+
return d;
|
925
|
+
}
|
926
|
+
}
|
927
|
+
} else if (d[metadata.month]) {
|
928
|
+
if (typeof d[metadata.month] === 'number' && date.getMonth() == d[metadata.month]) {
|
929
|
+
return d;
|
930
|
+
} else if (Array.isArray(d[metadata.month])) {
|
931
|
+
if (d[metadata.month].indexOf(date.getMonth()) > -1) {
|
932
|
+
return d;
|
933
|
+
}
|
934
|
+
} else if (d[metadata.month] instanceof Date) {
|
935
|
+
var sdate = module.helper.sanitiseDate(d[metadata.month]);
|
936
|
+
if ((date.getMonth() == sdate.getMonth()) && (date.getFullYear() == sdate.getFullYear())) {
|
937
|
+
return d;
|
938
|
+
}
|
939
|
+
}
|
940
|
+
} else if (d[metadata.date] && mode === 'day') {
|
941
|
+
if (d[metadata.date] instanceof Date && module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]), mode)) {
|
942
|
+
return d;
|
943
|
+
} else if (Array.isArray(d[metadata.date])) {
|
944
|
+
if(d[metadata.date].some(function(idate) { return module.helper.dateEqual(date, idate, mode); })) {
|
945
|
+
return d;
|
946
|
+
}
|
947
|
+
}
|
948
|
+
}
|
893
949
|
}
|
894
950
|
}
|
895
951
|
}
|
@@ -1576,7 +1632,9 @@ $.fn.calendar.settings = {
|
|
1576
1632
|
type: 'type',
|
1577
1633
|
monthOffset: 'monthOffset',
|
1578
1634
|
message: 'message',
|
1579
|
-
class: 'class'
|
1635
|
+
class: 'class',
|
1636
|
+
month: 'month',
|
1637
|
+
year: 'year'
|
1580
1638
|
},
|
1581
1639
|
|
1582
1640
|
eventClass: 'blue'
|
@@ -175,7 +175,7 @@ $.fn.checkbox = function(parameters) {
|
|
175
175
|
},
|
176
176
|
|
177
177
|
preventDefaultOnInputTarget: function() {
|
178
|
-
if(typeof event !== 'undefined' && $(event.target).is(selector.input)) {
|
178
|
+
if(typeof event !== 'undefined' && event !== null && $(event.target).is(selector.input)) {
|
179
179
|
module.verbose('Preventing default check action after manual check action');
|
180
180
|
event.preventDefault();
|
181
181
|
}
|
@@ -31,6 +31,10 @@ $.fn.dropdown = function(parameters) {
|
|
31
31
|
moduleSelector = $allModules.selector || '',
|
32
32
|
|
33
33
|
hasTouch = ('ontouchstart' in document.documentElement),
|
34
|
+
clickEvent = hasTouch
|
35
|
+
? 'touchstart'
|
36
|
+
: 'click',
|
37
|
+
|
34
38
|
time = new Date().getTime(),
|
35
39
|
performance = [],
|
36
40
|
|
@@ -113,7 +117,9 @@ $.fn.dropdown = function(parameters) {
|
|
113
117
|
module.setup.layout();
|
114
118
|
|
115
119
|
if(settings.values) {
|
120
|
+
module.set.initialLoad();
|
116
121
|
module.change.values(settings.values);
|
122
|
+
module.remove.initialLoad();
|
117
123
|
}
|
118
124
|
|
119
125
|
module.refreshData();
|
@@ -537,6 +543,7 @@ $.fn.dropdown = function(parameters) {
|
|
537
543
|
} else if( module.can.click() ) {
|
538
544
|
module.unbind.intent();
|
539
545
|
}
|
546
|
+
iconClicked = false;
|
540
547
|
},
|
541
548
|
|
542
549
|
hideOthers: function() {
|
@@ -565,27 +572,10 @@ $.fn.dropdown = function(parameters) {
|
|
565
572
|
|
566
573
|
bind: {
|
567
574
|
events: function() {
|
568
|
-
if(hasTouch) {
|
569
|
-
module.bind.touchEvents();
|
570
|
-
}
|
571
575
|
module.bind.keyboardEvents();
|
572
576
|
module.bind.inputEvents();
|
573
577
|
module.bind.mouseEvents();
|
574
578
|
},
|
575
|
-
touchEvents: function() {
|
576
|
-
module.debug('Touch device detected binding additional touch events');
|
577
|
-
if( module.is.searchSelection() ) {
|
578
|
-
// do nothing special yet
|
579
|
-
}
|
580
|
-
else if( module.is.single() ) {
|
581
|
-
$module
|
582
|
-
.on('touchstart' + eventNamespace, module.event.test.toggle)
|
583
|
-
;
|
584
|
-
}
|
585
|
-
$menu
|
586
|
-
.on('touchstart' + eventNamespace, selector.item, module.event.item.mouseenter)
|
587
|
-
;
|
588
|
-
},
|
589
579
|
keyboardEvents: function() {
|
590
580
|
module.verbose('Binding keyboard events');
|
591
581
|
$module
|
@@ -612,8 +602,8 @@ $.fn.dropdown = function(parameters) {
|
|
612
602
|
module.verbose('Binding mouse events');
|
613
603
|
if(module.is.multiple()) {
|
614
604
|
$module
|
615
|
-
.on(
|
616
|
-
.on(
|
605
|
+
.on(clickEvent + eventNamespace, selector.label, module.event.label.click)
|
606
|
+
.on(clickEvent + eventNamespace, selector.remove, module.event.remove.click)
|
617
607
|
;
|
618
608
|
}
|
619
609
|
if( module.is.searchSelection() ) {
|
@@ -622,24 +612,24 @@ $.fn.dropdown = function(parameters) {
|
|
622
612
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
623
613
|
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
|
624
614
|
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
|
625
|
-
.on(
|
626
|
-
.on(
|
615
|
+
.on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
|
616
|
+
.on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
627
617
|
.on('focus' + eventNamespace, selector.search, module.event.search.focus)
|
628
|
-
.on(
|
618
|
+
.on(clickEvent + eventNamespace, selector.search, module.event.search.focus)
|
629
619
|
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
|
630
|
-
.on(
|
620
|
+
.on(clickEvent + eventNamespace, selector.text, module.event.text.focus)
|
631
621
|
;
|
632
622
|
if(module.is.multiple()) {
|
633
623
|
$module
|
634
|
-
.on(
|
624
|
+
.on(clickEvent + eventNamespace, module.event.click)
|
635
625
|
;
|
636
626
|
}
|
637
627
|
}
|
638
628
|
else {
|
639
629
|
if(settings.on == 'click') {
|
640
630
|
$module
|
641
|
-
.on(
|
642
|
-
.on(
|
631
|
+
.on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
|
632
|
+
.on(clickEvent + eventNamespace, module.event.test.toggle)
|
643
633
|
;
|
644
634
|
}
|
645
635
|
else if(settings.on == 'hover') {
|
@@ -657,7 +647,7 @@ $.fn.dropdown = function(parameters) {
|
|
657
647
|
.on('mousedown' + eventNamespace, module.event.mousedown)
|
658
648
|
.on('mouseup' + eventNamespace, module.event.mouseup)
|
659
649
|
.on('focus' + eventNamespace, module.event.focus)
|
660
|
-
.on(
|
650
|
+
.on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
|
661
651
|
;
|
662
652
|
if(module.has.menuSearch() ) {
|
663
653
|
$module
|
@@ -671,7 +661,7 @@ $.fn.dropdown = function(parameters) {
|
|
671
661
|
}
|
672
662
|
}
|
673
663
|
$menu
|
674
|
-
.on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)
|
664
|
+
.on((hasTouch ? 'touchstart' : 'mouseenter') + eventNamespace, selector.item, module.event.item.mouseenter)
|
675
665
|
.on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
|
676
666
|
.on('click' + eventNamespace, selector.item, module.event.item.click)
|
677
667
|
;
|
@@ -685,7 +675,7 @@ $.fn.dropdown = function(parameters) {
|
|
685
675
|
;
|
686
676
|
}
|
687
677
|
$document
|
688
|
-
.on(
|
678
|
+
.on(clickEvent + elementNamespace, module.event.test.hide)
|
689
679
|
;
|
690
680
|
}
|
691
681
|
},
|
@@ -700,7 +690,7 @@ $.fn.dropdown = function(parameters) {
|
|
700
690
|
;
|
701
691
|
}
|
702
692
|
$document
|
703
|
-
.off(
|
693
|
+
.off(clickEvent + elementNamespace)
|
704
694
|
;
|
705
695
|
}
|
706
696
|
},
|
@@ -848,6 +838,10 @@ $.fn.dropdown = function(parameters) {
|
|
848
838
|
text,
|
849
839
|
value
|
850
840
|
;
|
841
|
+
if($choice.hasClass(className.unfilterable)) {
|
842
|
+
results.push(this);
|
843
|
+
return true;
|
844
|
+
}
|
851
845
|
if(settings.match === 'both' || settings.match === 'text') {
|
852
846
|
text = module.remove.diacritics(String(module.get.choiceText($choice, false)));
|
853
847
|
if(text.search(beginsWithRegExp) !== -1) {
|
@@ -1017,7 +1011,7 @@ $.fn.dropdown = function(parameters) {
|
|
1017
1011
|
var
|
1018
1012
|
value = settings.templates.deQuote(item[fields.value]),
|
1019
1013
|
name = settings.templates.escape(
|
1020
|
-
item[fields.name] ||
|
1014
|
+
item[fields.name] || '',
|
1021
1015
|
settings.preserveHTML
|
1022
1016
|
)
|
1023
1017
|
;
|
@@ -1781,7 +1775,7 @@ $.fn.dropdown = function(parameters) {
|
|
1781
1775
|
return $text.text();
|
1782
1776
|
},
|
1783
1777
|
query: function() {
|
1784
|
-
return
|
1778
|
+
return String($search.val()).trim();
|
1785
1779
|
},
|
1786
1780
|
searchWidth: function(value) {
|
1787
1781
|
value = (value !== undefined)
|
@@ -1924,8 +1918,8 @@ $.fn.dropdown = function(parameters) {
|
|
1924
1918
|
return ($choice.data(metadata.text) !== undefined)
|
1925
1919
|
? $choice.data(metadata.text)
|
1926
1920
|
: (preserveHTML)
|
1927
|
-
?
|
1928
|
-
:
|
1921
|
+
? $choice.html().trim()
|
1922
|
+
: $choice.text().trim()
|
1929
1923
|
;
|
1930
1924
|
}
|
1931
1925
|
},
|
@@ -1937,11 +1931,11 @@ $.fn.dropdown = function(parameters) {
|
|
1937
1931
|
return ($choice.data(metadata.value) !== undefined)
|
1938
1932
|
? String( $choice.data(metadata.value) )
|
1939
1933
|
: (typeof choiceText === 'string')
|
1940
|
-
?
|
1934
|
+
? String(
|
1941
1935
|
settings.ignoreSearchCase
|
1942
1936
|
? choiceText.toLowerCase()
|
1943
1937
|
: choiceText
|
1944
|
-
)
|
1938
|
+
).trim()
|
1945
1939
|
: String(choiceText)
|
1946
1940
|
;
|
1947
1941
|
},
|
@@ -1975,6 +1969,9 @@ $.fn.dropdown = function(parameters) {
|
|
1975
1969
|
value = ( $option.attr('value') !== undefined )
|
1976
1970
|
? $option.attr('value')
|
1977
1971
|
: name,
|
1972
|
+
text = ( $option.data(metadata.text) !== undefined )
|
1973
|
+
? $option.data(metadata.text)
|
1974
|
+
: name,
|
1978
1975
|
group = $option.parent('optgroup')
|
1979
1976
|
;
|
1980
1977
|
if(settings.placeholder === 'auto' && value === '') {
|
@@ -1992,6 +1989,7 @@ $.fn.dropdown = function(parameters) {
|
|
1992
1989
|
select.values.push({
|
1993
1990
|
name : name,
|
1994
1991
|
value : value,
|
1992
|
+
text : text,
|
1995
1993
|
disabled : disabled
|
1996
1994
|
});
|
1997
1995
|
}
|
@@ -2080,7 +2078,7 @@ $.fn.dropdown = function(parameters) {
|
|
2080
2078
|
return;
|
2081
2079
|
}
|
2082
2080
|
if(isMultiple) {
|
2083
|
-
if($.inArray(
|
2081
|
+
if($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(function(v){return String(v);})) !== -1) {
|
2084
2082
|
$selectedItem = ($selectedItem)
|
2085
2083
|
? $selectedItem.add($choice)
|
2086
2084
|
: $choice
|
@@ -2099,7 +2097,7 @@ $.fn.dropdown = function(parameters) {
|
|
2099
2097
|
optionValue = optionValue.toLowerCase();
|
2100
2098
|
value = value.toLowerCase();
|
2101
2099
|
}
|
2102
|
-
if(
|
2100
|
+
if(module.escape.htmlEntities(String(optionValue)) === module.escape.htmlEntities(String(value))) {
|
2103
2101
|
module.verbose('Found select item by value', optionValue, value);
|
2104
2102
|
$selectedItem = $choice;
|
2105
2103
|
return true;
|
@@ -3072,6 +3070,7 @@ $.fn.dropdown = function(parameters) {
|
|
3072
3070
|
values = module.get.values(),
|
3073
3071
|
newValue
|
3074
3072
|
;
|
3073
|
+
removedValue = module.escape.htmlEntities(removedValue);
|
3075
3074
|
if( module.has.selectInput() ) {
|
3076
3075
|
module.verbose('Input is <select> removing selected option', removedValue);
|
3077
3076
|
newValue = module.remove.arrayValue(removedValue, values);
|
@@ -3661,10 +3660,9 @@ $.fn.dropdown = function(parameters) {
|
|
3661
3660
|
},
|
3662
3661
|
htmlEntities: function(string) {
|
3663
3662
|
var
|
3664
|
-
badChars = /[
|
3663
|
+
badChars = /[<>"'`]/g,
|
3665
3664
|
shouldEscape = /[&<>"'`]/,
|
3666
3665
|
escape = {
|
3667
|
-
"&": "&",
|
3668
3666
|
"<": "<",
|
3669
3667
|
">": ">",
|
3670
3668
|
'"': """,
|
@@ -3676,6 +3674,7 @@ $.fn.dropdown = function(parameters) {
|
|
3676
3674
|
}
|
3677
3675
|
;
|
3678
3676
|
if(shouldEscape.test(string)) {
|
3677
|
+
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
|
3679
3678
|
return string.replace(badChars, escapedChar);
|
3680
3679
|
}
|
3681
3680
|
return string;
|
@@ -4072,7 +4071,8 @@ $.fn.dropdown.settings = {
|
|
4072
4071
|
delete : 'delete',
|
4073
4072
|
header : 'header',
|
4074
4073
|
divider : 'divider',
|
4075
|
-
groupIcon : ''
|
4074
|
+
groupIcon : '',
|
4075
|
+
unfilterable : 'unfilterable'
|
4076
4076
|
}
|
4077
4077
|
|
4078
4078
|
};
|
@@ -4087,10 +4087,9 @@ $.fn.dropdown.settings.templates = {
|
|
4087
4087
|
return string;
|
4088
4088
|
}
|
4089
4089
|
var
|
4090
|
-
badChars = /[
|
4090
|
+
badChars = /[<>"'`]/g,
|
4091
4091
|
shouldEscape = /[&<>"'`]/,
|
4092
4092
|
escape = {
|
4093
|
-
"&": "&",
|
4094
4093
|
"<": "<",
|
4095
4094
|
">": ">",
|
4096
4095
|
'"': """,
|
@@ -4102,6 +4101,7 @@ $.fn.dropdown.settings.templates = {
|
|
4102
4101
|
}
|
4103
4102
|
;
|
4104
4103
|
if(shouldEscape.test(string)) {
|
4104
|
+
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
|
4105
4105
|
return string.replace(badChars, escapedChar);
|
4106
4106
|
}
|
4107
4107
|
return string;
|
@@ -4157,10 +4157,10 @@ $.fn.dropdown.settings.templates = {
|
|
4157
4157
|
if(option[fields.icon]) {
|
4158
4158
|
html += '<i class="'+deQuote(option[fields.icon])+' '+(option[fields.iconClass] ? deQuote(option[fields.iconClass]) : className.icon)+'"></i>';
|
4159
4159
|
}
|
4160
|
-
html += escape(option[fields.name] ||
|
4160
|
+
html += escape(option[fields.name] || '', preserveHTML);
|
4161
4161
|
html += '</div>';
|
4162
4162
|
} else if (itemType === 'header') {
|
4163
|
-
var groupName = escape(option[fields.name],preserveHTML),
|
4163
|
+
var groupName = escape(option[fields.name] || '', preserveHTML),
|
4164
4164
|
groupIcon = option[fields.icon] ? deQuote(option[fields.icon]) : className.groupIcon
|
4165
4165
|
;
|
4166
4166
|
if(groupName !== '' || groupIcon !== '') {
|