fomantic-ui 2.9.1-beta.21 → 2.9.1-beta.23
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.
- package/.eslintrc.js +95 -75
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.stylelintrc.js +6 -7
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +7 -7
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +54 -53
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +3 -3
- package/dist/components/calendar.js +119 -99
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +8 -8
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +16 -18
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +87 -87
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +17 -23
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +2 -2
- package/dist/components/flyout.js +32 -30
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +2 -2
- package/dist/components/form.js +113 -89
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +22 -22
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +18 -16
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +30 -30
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +23 -21
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +8 -8
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +41 -46
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +9 -9
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +21 -19
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +11 -10
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +39 -42
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +7 -7
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +7 -7
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +36 -38
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +20 -17
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +7 -7
- package/dist/components/transition.js +27 -21
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +8 -8
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +60 -60
- package/dist/semantic.js +780 -735
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/.eslintrc.js +6 -0
- package/examples/responsive.html +1 -1
- package/gulpfile.js +1 -1
- package/package.json +5 -4
- package/scripts/nightly-version.js +3 -3
- package/src/definitions/behaviors/api.js +53 -52
- package/src/definitions/behaviors/form.js +112 -88
- package/src/definitions/behaviors/state.js +6 -6
- package/src/definitions/behaviors/visibility.js +7 -7
- package/src/definitions/collections/menu.less +2 -2
- package/src/definitions/elements/button.less +2 -2
- package/src/definitions/elements/loader.less +4 -4
- package/src/definitions/elements/step.less +1 -1
- package/src/definitions/globals/site.js +10 -9
- package/src/definitions/modules/accordion.js +6 -6
- package/src/definitions/modules/calendar.js +118 -98
- package/src/definitions/modules/calendar.less +2 -2
- package/src/definitions/modules/checkbox.js +7 -7
- package/src/definitions/modules/dimmer.js +15 -17
- package/src/definitions/modules/dimmer.less +10 -10
- package/src/definitions/modules/dropdown.js +86 -86
- package/src/definitions/modules/embed.js +16 -22
- package/src/definitions/modules/flyout.js +31 -29
- package/src/definitions/modules/flyout.less +1 -1
- package/src/definitions/modules/modal.js +21 -21
- package/src/definitions/modules/nag.js +17 -15
- package/src/definitions/modules/popup.js +29 -29
- package/src/definitions/modules/progress.js +22 -20
- package/src/definitions/modules/rating.js +7 -7
- package/src/definitions/modules/search.js +40 -45
- package/src/definitions/modules/shape.js +8 -8
- package/src/definitions/modules/sidebar.js +20 -18
- package/src/definitions/modules/slider.js +38 -41
- package/src/definitions/modules/sticky.js +6 -6
- package/src/definitions/modules/tab.js +35 -37
- package/src/definitions/modules/toast.js +19 -16
- package/src/definitions/modules/transition.js +26 -20
- package/src/themes/amazon/elements/button.overrides +7 -7
- package/src/themes/default/collections/form.variables +1 -1
- package/src/themes/default/elements/reveal.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -1
- package/src/themes/default/modules/dimmer.variables +6 -6
- package/src/themes/default/modules/modal.variables +1 -1
- package/src/themes/default/modules/slider.variables +4 -4
- package/src/themes/default/modules/toast.variables +2 -2
- package/src/themes/default/modules/transition.overrides +12 -12
- package/src/themes/flat/collections/form.overrides +2 -2
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/collections/form.overrides +2 -2
- package/src/themes/github/collections/menu.variables +1 -1
- package/src/themes/github/collections/message.overrides +3 -3
- package/src/themes/github/elements/input.overrides +2 -2
- package/src/themes/timeline/views/feed.overrides +3 -3
- package/src/themes/twitter/elements/button.overrides +2 -2
- package/tasks/.eslintrc.js +9 -0
- package/tasks/README.md +1 -3
- package/tasks/admin/components/create.js +9 -16
- package/tasks/admin/components/init.js +7 -7
- package/tasks/admin/components/update.js +7 -7
- package/tasks/admin/distributions/create.js +15 -17
- package/tasks/admin/distributions/init.js +7 -7
- package/tasks/admin/distributions/update.js +7 -7
- package/tasks/admin/publish.js +1 -1
- package/tasks/admin/register.js +2 -2
- package/tasks/admin/release.js +1 -1
- package/tasks/build/assets.js +2 -2
- package/tasks/build/css.js +8 -3
- package/tasks/build/javascript.js +3 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/README.md +3 -5
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/docs.js +1 -1
- package/tasks/collections/install.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/collections/various.js +1 -1
- package/tasks/config/admin/github.js +5 -6
- package/tasks/config/admin/templates/css-package.js +1 -1
- package/tasks/config/admin/templates/less-package.js +1 -1
- package/tasks/config/npm/gulpfile.js +7 -7
- package/tasks/config/project/config.js +9 -16
- package/tasks/config/project/install.js +26 -25
- package/tasks/config/project/release.js +12 -14
- package/tasks/config/tasks.js +17 -19
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +5 -3
- package/tasks/docs/metadata.js +7 -8
- package/tasks/docs/serve.js +5 -3
- package/tasks/install.js +38 -38
- package/tasks/rtl/build.js +1 -1
- package/tasks/rtl/watch.js +1 -1
- package/tasks/version.js +1 -1
- package/tasks/watch.js +1 -1
- package/test/.eslintrc.js +23 -0
- package/test/meteor/assets.js +1 -1
- package/test/modules/module.spec.js +15 -15
- package/test/modules/popup.spec.js +1 -1
- package/test/modules/search.spec.js +1 -1
- package/test/modules/tab.spec.js +1 -1
- package/test/modules/transition.spec.js +1 -1
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -23,11 +23,11 @@
|
|
23
23
|
var
|
24
24
|
$allModules = $(this),
|
25
25
|
|
26
|
-
time =
|
26
|
+
time = Date.now(),
|
27
27
|
performance = [],
|
28
28
|
|
29
29
|
query = arguments[0],
|
30
|
-
methodInvoked = (typeof query
|
30
|
+
methodInvoked = (typeof query === 'string'),
|
31
31
|
queryArguments = [].slice.call(arguments, 1),
|
32
32
|
|
33
33
|
returnedValue
|
@@ -70,11 +70,9 @@
|
|
70
70
|
} else {
|
71
71
|
$dimmable = $module;
|
72
72
|
if (module.has.dimmer()) {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
$dimmer = $dimmable.find(selector.dimmer);
|
77
|
-
}
|
73
|
+
$dimmer = settings.dimmerName
|
74
|
+
? $dimmable.find(selector.dimmer).filter('.' + settings.dimmerName)
|
75
|
+
: $dimmable.find(selector.dimmer);
|
78
76
|
} else {
|
79
77
|
$dimmer = module.create();
|
80
78
|
}
|
@@ -336,9 +334,9 @@
|
|
336
334
|
duration: function () {
|
337
335
|
if (module.is.active()) {
|
338
336
|
return settings.transition.hideDuration || settings.duration.hide || settings.duration;
|
339
|
-
} else {
|
340
|
-
return settings.transition.showDuration || settings.duration.show || settings.duration;
|
341
337
|
}
|
338
|
+
|
339
|
+
return settings.transition.showDuration || settings.duration.show || settings.duration;
|
342
340
|
},
|
343
341
|
},
|
344
342
|
|
@@ -346,9 +344,9 @@
|
|
346
344
|
dimmer: function () {
|
347
345
|
if (settings.dimmerName) {
|
348
346
|
return ($module.find(selector.dimmer).filter('.' + settings.dimmerName).length > 0);
|
349
|
-
} else {
|
350
|
-
return ($module.find(selector.dimmer).length > 0);
|
351
347
|
}
|
348
|
+
|
349
|
+
return ($module.find(selector.dimmer).length > 0);
|
352
350
|
},
|
353
351
|
},
|
354
352
|
|
@@ -519,7 +517,7 @@
|
|
519
517
|
previousTime
|
520
518
|
;
|
521
519
|
if (settings.performance) {
|
522
|
-
currentTime =
|
520
|
+
currentTime = Date.now();
|
523
521
|
previousTime = time || currentTime;
|
524
522
|
executionTime = currentTime - previousTime;
|
525
523
|
time = currentTime;
|
@@ -548,7 +546,7 @@
|
|
548
546
|
title += ' \'' + moduleSelector + '\'';
|
549
547
|
}
|
550
548
|
if ($allModules.length > 1) {
|
551
|
-
title += '
|
549
|
+
title += ' (' + $allModules.length + ')';
|
552
550
|
}
|
553
551
|
if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
554
552
|
console.groupCollapsed(title);
|
@@ -573,8 +571,8 @@
|
|
573
571
|
;
|
574
572
|
passedArguments = passedArguments || queryArguments;
|
575
573
|
context = context || element;
|
576
|
-
if (typeof query
|
577
|
-
query = query.split(/[
|
574
|
+
if (typeof query === 'string' && object !== undefined) {
|
575
|
+
query = query.split(/[ .]/);
|
578
576
|
maxDepth = query.length - 1;
|
579
577
|
$.each(query, function (depth, value) {
|
580
578
|
var camelCaseValue = (depth != maxDepth)
|
@@ -721,7 +719,7 @@
|
|
721
719
|
.addClass(settings.className.loader)
|
722
720
|
.addClass(settings.loaderVariation)
|
723
721
|
;
|
724
|
-
if (
|
722
|
+
if (settings.loaderText) {
|
725
723
|
l.text(settings.loaderText);
|
726
724
|
l.addClass('text');
|
727
725
|
}
|
@@ -302,7 +302,7 @@ body.dimmable > .dimmer {
|
|
302
302
|
.ui[class*="center dimmer"] {
|
303
303
|
top: 50%;
|
304
304
|
transform: translateY(-50%);
|
305
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
305
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
306
306
|
}
|
307
307
|
|
308
308
|
.ui.segment > .ui.ui[class*="top dimmer"] {
|
@@ -336,48 +336,48 @@ body.dimmable > .dimmer {
|
|
336
336
|
0% {
|
337
337
|
opacity: 0;
|
338
338
|
transform: translateY(-40%);
|
339
|
-
-webkit-transform: translateY(calc(-40% - .5px));
|
339
|
+
-webkit-transform: translateY(calc(-40% - 0.5px));
|
340
340
|
}
|
341
341
|
100% {
|
342
342
|
opacity: 1;
|
343
343
|
transform: translateY(-50%);
|
344
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
344
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
345
345
|
}
|
346
346
|
}
|
347
347
|
@keyframes fadeInDownCenter {
|
348
348
|
0% {
|
349
349
|
opacity: 0;
|
350
350
|
transform: translateY(-60%);
|
351
|
-
-webkit-transform: translateY(calc(-60% - .5px));
|
351
|
+
-webkit-transform: translateY(calc(-60% - 0.5px));
|
352
352
|
}
|
353
353
|
100% {
|
354
354
|
opacity: 1;
|
355
355
|
transform: translateY(-50%);
|
356
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
356
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
357
357
|
}
|
358
358
|
}
|
359
359
|
@keyframes fadeOutUpCenter {
|
360
360
|
0% {
|
361
361
|
opacity: 1;
|
362
362
|
transform: translateY(-50%);
|
363
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
363
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
364
364
|
}
|
365
365
|
100% {
|
366
366
|
opacity: 0;
|
367
367
|
transform: translateY(-45%);
|
368
|
-
-webkit-transform: translateY(calc(-45% - .5px));
|
368
|
+
-webkit-transform: translateY(calc(-45% - 0.5px));
|
369
369
|
}
|
370
370
|
}
|
371
371
|
@keyframes fadeOutDownCenter {
|
372
372
|
0% {
|
373
373
|
opacity: 1;
|
374
374
|
transform: translateY(-50%);
|
375
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
375
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
376
376
|
}
|
377
377
|
100% {
|
378
378
|
opacity: 0;
|
379
379
|
transform: translateY(-55%);
|
380
|
-
-webkit-transform: translateY(calc(-55% - .5px));
|
380
|
+
-webkit-transform: translateY(calc(-55% - 0.5px));
|
381
381
|
}
|
382
382
|
}
|
383
383
|
@keyframes bounceCenter {
|
@@ -387,7 +387,7 @@ body.dimmable > .dimmer {
|
|
387
387
|
80%,
|
388
388
|
100% {
|
389
389
|
transform: translateY(-50%);
|
390
|
-
-webkit-transform: translateY(calc(-50% - .5px));
|
390
|
+
-webkit-transform: translateY(calc(-50% - 0.5px));
|
391
391
|
}
|
392
392
|
40% {
|
393
393
|
transform: translateY(calc(-50% - 30px));
|
@@ -15,7 +15,7 @@
|
|
15
15
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
16
16
|
}
|
17
17
|
|
18
|
-
window = (
|
18
|
+
window = (window !== undefined && window.Math === Math)
|
19
19
|
? window
|
20
20
|
: globalThis;
|
21
21
|
|
@@ -26,11 +26,11 @@
|
|
26
26
|
|
27
27
|
moduleSelector = $allModules.selector || '',
|
28
28
|
|
29
|
-
time =
|
29
|
+
time = Date.now(),
|
30
30
|
performance = [],
|
31
31
|
|
32
32
|
query = arguments[0],
|
33
|
-
methodInvoked = (typeof query
|
33
|
+
methodInvoked = (typeof query === 'string'),
|
34
34
|
queryArguments = [].slice.call(arguments, 1),
|
35
35
|
returnedValue
|
36
36
|
;
|
@@ -361,7 +361,7 @@
|
|
361
361
|
.addClass(className.search)
|
362
362
|
.prop('autocomplete', module.is.chrome() ? 'fomantic-search' : 'off')
|
363
363
|
;
|
364
|
-
if (labelNode.length) {
|
364
|
+
if (labelNode.length > 0) {
|
365
365
|
if (!labelNode.attr('id')) {
|
366
366
|
labelNode.attr('id', '_' + module.get.id() + '_formLabel');
|
367
367
|
}
|
@@ -727,7 +727,7 @@
|
|
727
727
|
if (module.is.multiple()) {
|
728
728
|
module.filterActive();
|
729
729
|
}
|
730
|
-
if (query || (!query && module.get.activeItem().length
|
730
|
+
if (query || (!query && module.get.activeItem().length === 0)) {
|
731
731
|
module.select.firstUnfiltered();
|
732
732
|
}
|
733
733
|
if (module.has.allResultsFiltered()) {
|
@@ -942,7 +942,7 @@
|
|
942
942
|
// Dividers which are direct siblings are considered a group
|
943
943
|
var $lastDivider = $(this).nextUntil(selector.item);
|
944
944
|
|
945
|
-
return ($lastDivider.length ? $lastDivider : $(this))
|
945
|
+
return ($lastDivider.length > 0 ? $lastDivider : $(this))
|
946
946
|
// Count all non-filtered items until the next divider (or end of the dropdown)
|
947
947
|
.nextUntil(selector.divider)
|
948
948
|
.filter(selector.item + ':not(.' + className.filtered + ')')
|
@@ -967,17 +967,22 @@
|
|
967
967
|
if (queryLength === termLength) {
|
968
968
|
return (query === term);
|
969
969
|
}
|
970
|
-
|
970
|
+
for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
|
971
971
|
var
|
972
|
+
continueSearch = false,
|
972
973
|
queryCharacter = query.charCodeAt(characterIndex)
|
973
974
|
;
|
974
975
|
while (nextCharacterIndex < termLength) {
|
975
976
|
if (term.charCodeAt(nextCharacterIndex++) === queryCharacter) {
|
976
|
-
|
977
|
+
continueSearch = true;
|
978
|
+
|
979
|
+
break;
|
977
980
|
}
|
978
981
|
}
|
979
982
|
|
980
|
-
|
983
|
+
if (!continueSearch) {
|
984
|
+
return false;
|
985
|
+
}
|
981
986
|
}
|
982
987
|
|
983
988
|
return true;
|
@@ -1604,19 +1609,20 @@
|
|
1604
1609
|
event.preventDefault();
|
1605
1610
|
|
1606
1611
|
return;
|
1607
|
-
} else {
|
1608
|
-
module.verbose('Up key pressed, changing active item');
|
1609
|
-
$selectedItem
|
1610
|
-
.removeClass(className.selected)
|
1611
|
-
;
|
1612
|
-
$nextItem
|
1613
|
-
.addClass(className.selected)
|
1614
|
-
;
|
1615
|
-
module.set.scrollPosition($nextItem);
|
1616
|
-
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
1617
|
-
module.set.selectedItem($nextItem);
|
1618
|
-
}
|
1619
1612
|
}
|
1613
|
+
|
1614
|
+
module.verbose('Up key pressed, changing active item');
|
1615
|
+
$selectedItem
|
1616
|
+
.removeClass(className.selected)
|
1617
|
+
;
|
1618
|
+
$nextItem
|
1619
|
+
.addClass(className.selected)
|
1620
|
+
;
|
1621
|
+
module.set.scrollPosition($nextItem);
|
1622
|
+
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
1623
|
+
module.set.selectedItem($nextItem);
|
1624
|
+
}
|
1625
|
+
|
1620
1626
|
event.preventDefault();
|
1621
1627
|
}
|
1622
1628
|
|
@@ -1630,19 +1636,20 @@
|
|
1630
1636
|
event.preventDefault();
|
1631
1637
|
|
1632
1638
|
return;
|
1633
|
-
} else {
|
1634
|
-
module.verbose('Down key pressed, changing active item');
|
1635
|
-
$item
|
1636
|
-
.removeClass(className.selected)
|
1637
|
-
;
|
1638
|
-
$nextItem
|
1639
|
-
.addClass(className.selected)
|
1640
|
-
;
|
1641
|
-
module.set.scrollPosition($nextItem);
|
1642
|
-
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
1643
|
-
module.set.selectedItem($nextItem);
|
1644
|
-
}
|
1645
1639
|
}
|
1640
|
+
|
1641
|
+
module.verbose('Down key pressed, changing active item');
|
1642
|
+
$item
|
1643
|
+
.removeClass(className.selected)
|
1644
|
+
;
|
1645
|
+
$nextItem
|
1646
|
+
.addClass(className.selected)
|
1647
|
+
;
|
1648
|
+
module.set.scrollPosition($nextItem);
|
1649
|
+
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
|
1650
|
+
module.set.selectedItem($nextItem);
|
1651
|
+
}
|
1652
|
+
|
1646
1653
|
event.preventDefault();
|
1647
1654
|
}
|
1648
1655
|
|
@@ -1725,11 +1732,11 @@
|
|
1725
1732
|
callback();
|
1726
1733
|
|
1727
1734
|
return true;
|
1728
|
-
} else {
|
1729
|
-
module.verbose('Event occurred in dropdown, canceling callback');
|
1730
|
-
|
1731
|
-
return false;
|
1732
1735
|
}
|
1736
|
+
|
1737
|
+
module.verbose('Event occurred in dropdown, canceling callback');
|
1738
|
+
|
1739
|
+
return false;
|
1733
1740
|
},
|
1734
1741
|
eventOnElement: function (event, callback) {
|
1735
1742
|
var
|
@@ -1747,11 +1754,11 @@
|
|
1747
1754
|
callback();
|
1748
1755
|
|
1749
1756
|
return true;
|
1750
|
-
} else {
|
1751
|
-
module.verbose('Event occurred in dropdown menu, canceling callback');
|
1752
|
-
|
1753
|
-
return false;
|
1754
1757
|
}
|
1758
|
+
|
1759
|
+
module.verbose('Event occurred in dropdown menu, canceling callback');
|
1760
|
+
|
1761
|
+
return false;
|
1755
1762
|
},
|
1756
1763
|
},
|
1757
1764
|
|
@@ -1809,7 +1816,7 @@
|
|
1809
1816
|
return $module.data(metadata.defaultValue);
|
1810
1817
|
},
|
1811
1818
|
placeholderText: function () {
|
1812
|
-
if (settings.placeholder != 'auto' && typeof settings.placeholder
|
1819
|
+
if (settings.placeholder != 'auto' && typeof settings.placeholder === 'string') {
|
1813
1820
|
return settings.placeholder;
|
1814
1821
|
}
|
1815
1822
|
|
@@ -1880,7 +1887,8 @@
|
|
1880
1887
|
;
|
1881
1888
|
if (returnEndPos && 'selectionEnd' in input) {
|
1882
1889
|
return input.selectionEnd;
|
1883
|
-
}
|
1890
|
+
}
|
1891
|
+
if (!returnEndPos && 'selectionStart' in input) {
|
1884
1892
|
return input.selectionStart;
|
1885
1893
|
}
|
1886
1894
|
if (document.selection) {
|
@@ -1917,7 +1925,7 @@
|
|
1917
1925
|
}
|
1918
1926
|
|
1919
1927
|
return (!module.has.selectInput() && module.is.multiple())
|
1920
|
-
? (typeof value
|
1928
|
+
? (typeof value === 'string') // delimited string
|
1921
1929
|
? (raw ? value : module.escape.htmlEntities(value)).split(settings.delimiter)
|
1922
1930
|
: ''
|
1923
1931
|
: value;
|
@@ -1928,7 +1936,7 @@
|
|
1928
1936
|
remoteValues = false
|
1929
1937
|
;
|
1930
1938
|
if (values) {
|
1931
|
-
if (typeof values
|
1939
|
+
if (typeof values === 'string') {
|
1932
1940
|
values = [values];
|
1933
1941
|
}
|
1934
1942
|
$.each(values, function (index, value) {
|
@@ -2119,9 +2127,7 @@
|
|
2119
2127
|
return;
|
2120
2128
|
}
|
2121
2129
|
if (isMultiple) {
|
2122
|
-
if ($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(
|
2123
|
-
return String(v);
|
2124
|
-
})) !== -1) {
|
2130
|
+
if ($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(String)) !== -1) {
|
2125
2131
|
$selectedItem = ($selectedItem)
|
2126
2132
|
? $selectedItem.add($choice)
|
2127
2133
|
: $choice;
|
@@ -2170,16 +2176,16 @@
|
|
2170
2176
|
}
|
2171
2177
|
|
2172
2178
|
return true;
|
2173
|
-
}
|
2174
|
-
module.verbose('No longer at maximum selection count');
|
2175
|
-
module.remove.message();
|
2176
|
-
module.remove.filteredItem();
|
2177
|
-
if (module.is.searchSelection()) {
|
2178
|
-
module.filterItems();
|
2179
|
-
}
|
2179
|
+
}
|
2180
2180
|
|
2181
|
-
|
2181
|
+
module.verbose('No longer at maximum selection count');
|
2182
|
+
module.remove.message();
|
2183
|
+
module.remove.filteredItem();
|
2184
|
+
if (module.is.searchSelection()) {
|
2185
|
+
module.filterItems();
|
2182
2186
|
}
|
2187
|
+
|
2188
|
+
return false;
|
2183
2189
|
}
|
2184
2190
|
|
2185
2191
|
return true;
|
@@ -2878,7 +2884,7 @@
|
|
2878
2884
|
var
|
2879
2885
|
$addition = $menu.children(selector.addition),
|
2880
2886
|
$existingItem = module.get.item(value),
|
2881
|
-
alreadyHasValue = $existingItem && $existingItem.not(selector.addition).length,
|
2887
|
+
alreadyHasValue = $existingItem && $existingItem.not(selector.addition).length > 0,
|
2882
2888
|
hasUserSuggestion = $addition.length > 0,
|
2883
2889
|
html
|
2884
2890
|
;
|
@@ -3203,7 +3209,7 @@
|
|
3203
3209
|
}
|
3204
3210
|
},
|
3205
3211
|
diacritics: function (text) {
|
3206
|
-
return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\
|
3212
|
+
return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\u036F]/g, '') : text;
|
3207
3213
|
},
|
3208
3214
|
},
|
3209
3215
|
|
@@ -3262,7 +3268,7 @@
|
|
3262
3268
|
return ($currentMenu || $menu).find(selector.menu).length > 0;
|
3263
3269
|
},
|
3264
3270
|
message: function () {
|
3265
|
-
return ($menu.children(selector.message).length
|
3271
|
+
return ($menu.children(selector.message).length > 0);
|
3266
3272
|
},
|
3267
3273
|
label: function (value) {
|
3268
3274
|
var
|
@@ -3304,9 +3310,7 @@
|
|
3304
3310
|
: (values == value)
|
3305
3311
|
;
|
3306
3312
|
|
3307
|
-
return (hasValue)
|
3308
|
-
? true
|
3309
|
-
: false;
|
3313
|
+
return !!(hasValue);
|
3310
3314
|
},
|
3311
3315
|
valueIgnoringCase: function (value) {
|
3312
3316
|
var
|
@@ -3723,8 +3727,8 @@
|
|
3723
3727
|
},
|
3724
3728
|
htmlEntities: function (string) {
|
3725
3729
|
var
|
3726
|
-
badChars = /[
|
3727
|
-
shouldEscape = /[
|
3730
|
+
badChars = /["'<>`]/g,
|
3731
|
+
shouldEscape = /["&'<>`]/,
|
3728
3732
|
escape = {
|
3729
3733
|
'<': '<',
|
3730
3734
|
'>': '>',
|
@@ -3737,7 +3741,7 @@
|
|
3737
3741
|
}
|
3738
3742
|
;
|
3739
3743
|
if (shouldEscape.test(string)) {
|
3740
|
-
string = string.replace(/&(?![a-
|
3744
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
3741
3745
|
|
3742
3746
|
return string.replace(badChars, escapedChar);
|
3743
3747
|
}
|
@@ -3803,7 +3807,7 @@
|
|
3803
3807
|
previousTime
|
3804
3808
|
;
|
3805
3809
|
if (settings.performance) {
|
3806
|
-
currentTime =
|
3810
|
+
currentTime = Date.now();
|
3807
3811
|
previousTime = time || currentTime;
|
3808
3812
|
executionTime = currentTime - previousTime;
|
3809
3813
|
time = currentTime;
|
@@ -3854,8 +3858,8 @@
|
|
3854
3858
|
;
|
3855
3859
|
passedArguments = passedArguments || queryArguments;
|
3856
3860
|
context = context || element;
|
3857
|
-
if (typeof query
|
3858
|
-
query = query.split(/[
|
3861
|
+
if (typeof query === 'string' && object !== undefined) {
|
3862
|
+
query = query.split(/[ .]/);
|
3859
3863
|
maxDepth = query.length - 1;
|
3860
3864
|
$.each(query, function (depth, value) {
|
3861
3865
|
var camelCaseValue = (depth != maxDepth)
|
@@ -4039,7 +4043,7 @@
|
|
4039
4043
|
},
|
4040
4044
|
|
4041
4045
|
regExp: {
|
4042
|
-
escape: /[
|
4046
|
+
escape: /[\s#$()*+,.:=?@[\\\]^{|}-]/g,
|
4043
4047
|
quote: /"/g,
|
4044
4048
|
},
|
4045
4049
|
|
@@ -4155,8 +4159,8 @@
|
|
4155
4159
|
return string;
|
4156
4160
|
}
|
4157
4161
|
var
|
4158
|
-
badChars = /[
|
4159
|
-
shouldEscape = /[
|
4162
|
+
badChars = /["'<>`]/g,
|
4163
|
+
shouldEscape = /["&'<>`]/,
|
4160
4164
|
escape = {
|
4161
4165
|
'<': '<',
|
4162
4166
|
'>': '>',
|
@@ -4169,7 +4173,7 @@
|
|
4169
4173
|
}
|
4170
4174
|
;
|
4171
4175
|
if (shouldEscape.test(string)) {
|
4172
|
-
string = string.replace(/&(?![a-
|
4176
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
4173
4177
|
|
4174
4178
|
return string.replace(badChars, escapedChar);
|
4175
4179
|
}
|
@@ -4185,11 +4189,9 @@
|
|
4185
4189
|
deQuote = $.fn.dropdown.settings.templates.deQuote
|
4186
4190
|
;
|
4187
4191
|
html += '<i class="dropdown icon"></i>';
|
4188
|
-
|
4189
|
-
|
4190
|
-
|
4191
|
-
html += '<div class="text"></div>';
|
4192
|
-
}
|
4192
|
+
html += placeholder
|
4193
|
+
? '<div class="default text">' + escape(placeholder, preserveHTML) + '</div>'
|
4194
|
+
: '<div class="text"></div>';
|
4193
4195
|
html += '<div class="' + deQuote(className.menu) + '">';
|
4194
4196
|
html += $.fn.dropdown.settings.templates.menu(select, fields, preserveHTML, className);
|
4195
4197
|
html += '</div>';
|
@@ -4207,9 +4209,7 @@
|
|
4207
4209
|
;
|
4208
4210
|
$.each(values, function (index, option) {
|
4209
4211
|
var
|
4210
|
-
itemType =
|
4211
|
-
? option[fields.type]
|
4212
|
-
: 'item',
|
4212
|
+
itemType = option[fields.type] || 'item',
|
4213
4213
|
isMenu = itemType.indexOf('menu') !== -1
|
4214
4214
|
;
|
4215
4215
|
|
@@ -4229,15 +4229,15 @@
|
|
4229
4229
|
: '',
|
4230
4230
|
hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
|
4231
4231
|
;
|
4232
|
-
html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class]
|
4232
|
+
html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + '>';
|
4233
4233
|
if (isMenu) {
|
4234
4234
|
html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
|
4235
4235
|
}
|
4236
4236
|
if (option[fields.image]) {
|
4237
|
-
html += '<img class="' + deQuote(option[fields.imageClass]
|
4237
|
+
html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + '">';
|
4238
4238
|
}
|
4239
4239
|
if (option[fields.icon]) {
|
4240
|
-
html += '<i class="' + deQuote(option[fields.icon] + ' ' + (option[fields.iconClass]
|
4240
|
+
html += '<i class="' + deQuote(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
|
4241
4241
|
}
|
4242
4242
|
if (hasDescription) {
|
4243
4243
|
html += '<span class="' + deQuote(className.description) + '">' + escape(option[fields.description] || '', preserveHTML) + '</span>';
|
@@ -4259,12 +4259,12 @@
|
|
4259
4259
|
} else if (itemType === 'header') {
|
4260
4260
|
var
|
4261
4261
|
groupName = escape(option[fields.name] || '', preserveHTML),
|
4262
|
-
groupIcon = deQuote(option[fields.icon]
|
4262
|
+
groupIcon = deQuote(option[fields.icon] || className.groupIcon)
|
4263
4263
|
;
|
4264
4264
|
if (groupName !== '' || groupIcon !== '') {
|
4265
|
-
html += '<div class="' + deQuote(option[fields.class]
|
4265
|
+
html += '<div class="' + deQuote(option[fields.class] || className.header) + '">';
|
4266
4266
|
if (groupIcon !== '') {
|
4267
|
-
html += '<i class="' + deQuote(groupIcon + ' ' + (option[fields.iconClass]
|
4267
|
+
html += '<i class="' + deQuote(groupIcon + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
|
4268
4268
|
}
|
4269
4269
|
html += groupName;
|
4270
4270
|
html += '</div>';
|