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
|
|
@@ -25,11 +25,11 @@
|
|
25
25
|
|
26
26
|
moduleSelector = $allModules.selector || '',
|
27
27
|
|
28
|
-
time =
|
28
|
+
time = Date.now(),
|
29
29
|
performance = [],
|
30
30
|
|
31
31
|
query = arguments[0],
|
32
|
-
methodInvoked = (typeof query
|
32
|
+
methodInvoked = (typeof query === 'string'),
|
33
33
|
queryArguments = [].slice.call(arguments, 1),
|
34
34
|
|
35
35
|
returnedValue
|
@@ -95,7 +95,7 @@
|
|
95
95
|
var precision = 1;
|
96
96
|
var ratio = min / total;
|
97
97
|
while (precisionPower < 10) {
|
98
|
-
ratio
|
98
|
+
ratio *= precision;
|
99
99
|
if (ratio > 1) {
|
100
100
|
break;
|
101
101
|
}
|
@@ -109,7 +109,7 @@
|
|
109
109
|
? element
|
110
110
|
: !isNaN(element)
|
111
111
|
? [element]
|
112
|
-
: typeof element
|
112
|
+
: typeof element === 'string'
|
113
113
|
? element.split(',')
|
114
114
|
: [];
|
115
115
|
},
|
@@ -262,13 +262,16 @@
|
|
262
262
|
|
263
263
|
get: {
|
264
264
|
text: function (templateText, index) {
|
265
|
+
if (!index) {
|
266
|
+
index = 0;
|
267
|
+
}
|
268
|
+
|
265
269
|
var
|
266
|
-
|
267
|
-
value = module.get.value(index_),
|
270
|
+
value = module.get.value(index),
|
268
271
|
total = module.get.total(),
|
269
272
|
percent = (animating)
|
270
|
-
? module.get.displayPercent(
|
271
|
-
: module.get.percent(
|
273
|
+
? module.get.displayPercent(index)
|
274
|
+
: module.get.percent(index),
|
272
275
|
left = (total !== false)
|
273
276
|
? Math.max(0, total - value)
|
274
277
|
: (100 - percent)
|
@@ -279,7 +282,7 @@
|
|
279
282
|
.replace('{total}', total || 0)
|
280
283
|
.replace('{left}', left)
|
281
284
|
.replace('{percent}', percent)
|
282
|
-
.replace('{bar}', settings.text.bars[
|
285
|
+
.replace('{bar}', settings.text.bars[index] || '')
|
283
286
|
;
|
284
287
|
module.verbose('Adding variables to progress bar text', templateText);
|
285
288
|
|
@@ -355,7 +358,7 @@
|
|
355
358
|
totalWidth = $module.width(),
|
356
359
|
minDisplay = parseInt($bar.css('min-width'), 10),
|
357
360
|
displayPercent = (barWidth > minDisplay)
|
358
|
-
? (barWidth / totalWidth * 100)
|
361
|
+
? ((barWidth / totalWidth) * 100)
|
359
362
|
: module.percent
|
360
363
|
;
|
361
364
|
|
@@ -365,10 +368,10 @@
|
|
365
368
|
},
|
366
369
|
|
367
370
|
percent: function (index) {
|
368
|
-
return module.percent && module.percent[index || 0] || 0;
|
371
|
+
return (module.percent && module.percent[index || 0]) || 0;
|
369
372
|
},
|
370
373
|
value: function (index) {
|
371
|
-
return module.nextValue || module.value && module.value[index || 0] || 0;
|
374
|
+
return module.nextValue || (module.value && module.value[index || 0]) || 0;
|
372
375
|
},
|
373
376
|
total: function () {
|
374
377
|
return module.total !== undefined ? module.total : false;
|
@@ -486,7 +489,7 @@
|
|
486
489
|
},
|
487
490
|
duration: function (duration) {
|
488
491
|
duration = duration || settings.duration;
|
489
|
-
duration = (typeof duration
|
492
|
+
duration = (typeof duration === 'number')
|
490
493
|
? duration + 'ms'
|
491
494
|
: duration;
|
492
495
|
module.verbose('Setting progress bar transition duration', duration);
|
@@ -498,7 +501,7 @@
|
|
498
501
|
},
|
499
502
|
percent: function (percents) {
|
500
503
|
percents = module.helper.forceArray(percents).map(function (percent) {
|
501
|
-
percent = (typeof percent
|
504
|
+
percent = (typeof percent === 'string')
|
502
505
|
? +(percent.replace('%', ''))
|
503
506
|
: percent;
|
504
507
|
|
@@ -574,7 +577,6 @@
|
|
574
577
|
module.set.state();
|
575
578
|
},
|
576
579
|
label: function (text) {
|
577
|
-
text = text || '';
|
578
580
|
if (text) {
|
579
581
|
text = module.get.text(text);
|
580
582
|
module.verbose('Setting label to text', text);
|
@@ -807,7 +809,7 @@
|
|
807
809
|
previousTime
|
808
810
|
;
|
809
811
|
if (settings.performance) {
|
810
|
-
currentTime =
|
812
|
+
currentTime = Date.now();
|
811
813
|
previousTime = time || currentTime;
|
812
814
|
executionTime = currentTime - previousTime;
|
813
815
|
time = currentTime;
|
@@ -858,8 +860,8 @@
|
|
858
860
|
;
|
859
861
|
passedArguments = passedArguments || queryArguments;
|
860
862
|
context = context || element;
|
861
|
-
if (typeof query
|
862
|
-
query = query.split(/[
|
863
|
+
if (typeof query === 'string' && object !== undefined) {
|
864
|
+
query = query.split(/[ .]/);
|
863
865
|
maxDepth = query.length - 1;
|
864
866
|
$.each(query, function (depth, value) {
|
865
867
|
var camelCaseValue = (depth != maxDepth)
|
@@ -972,7 +974,7 @@
|
|
972
974
|
},
|
973
975
|
|
974
976
|
regExp: {
|
975
|
-
variable:
|
977
|
+
variable: /{\$*[\da-z]+}/gi,
|
976
978
|
},
|
977
979
|
|
978
980
|
metadata: {
|
@@ -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
|
|
@@ -24,11 +24,11 @@
|
|
24
24
|
$allModules = $(this),
|
25
25
|
moduleSelector = $allModules.selector || '',
|
26
26
|
|
27
|
-
time =
|
27
|
+
time = Date.now(),
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked = (typeof query
|
31
|
+
methodInvoked = (typeof query === 'string'),
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue
|
34
34
|
;
|
@@ -356,7 +356,7 @@
|
|
356
356
|
previousTime
|
357
357
|
;
|
358
358
|
if (settings.performance) {
|
359
|
-
currentTime =
|
359
|
+
currentTime = Date.now();
|
360
360
|
previousTime = time || currentTime;
|
361
361
|
executionTime = currentTime - previousTime;
|
362
362
|
time = currentTime;
|
@@ -385,7 +385,7 @@
|
|
385
385
|
title += ' \'' + moduleSelector + '\'';
|
386
386
|
}
|
387
387
|
if ($allModules.length > 1) {
|
388
|
-
title += '
|
388
|
+
title += ' (' + $allModules.length + ')';
|
389
389
|
}
|
390
390
|
if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
391
391
|
console.groupCollapsed(title);
|
@@ -410,8 +410,8 @@
|
|
410
410
|
;
|
411
411
|
passedArguments = passedArguments || queryArguments;
|
412
412
|
context = context || element;
|
413
|
-
if (typeof query
|
414
|
-
query = query.split(/[
|
413
|
+
if (typeof query === 'string' && object !== undefined) {
|
414
|
+
query = query.split(/[ .]/);
|
415
415
|
maxDepth = query.length - 1;
|
416
416
|
$.each(query, function (depth, value) {
|
417
417
|
var camelCaseValue = (depth != maxDepth)
|
@@ -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
|
|
@@ -24,15 +24,15 @@
|
|
24
24
|
$allModules = $(this),
|
25
25
|
moduleSelector = $allModules.selector || '',
|
26
26
|
|
27
|
-
time =
|
27
|
+
time = Date.now(),
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked = (typeof query
|
31
|
+
methodInvoked = (typeof query === 'string'),
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
33
|
returnedValue
|
34
34
|
;
|
35
|
-
$
|
35
|
+
$allModules.each(function () {
|
36
36
|
var
|
37
37
|
settings = ($.isPlainObject(parameters))
|
38
38
|
? $.extend(true, {}, $.fn.search.settings, parameters)
|
@@ -545,7 +545,7 @@
|
|
545
545
|
$searchButton.removeClass(className.pressed);
|
546
546
|
},
|
547
547
|
diacritics: function (text) {
|
548
|
-
return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\
|
548
|
+
return settings.ignoreDiacritics ? text.normalize('NFD').replace(/[\u0300-\u036F]/g, '') : text;
|
549
549
|
},
|
550
550
|
},
|
551
551
|
|
@@ -663,15 +663,13 @@
|
|
663
663
|
$.each(searchFields, function (index, field) {
|
664
664
|
$.each(source, function (label, content) {
|
665
665
|
var
|
666
|
-
fieldExists = (typeof content[field]
|
666
|
+
fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number')
|
667
667
|
;
|
668
668
|
if (fieldExists) {
|
669
669
|
var text;
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
text = content[field].toString();
|
674
|
-
}
|
670
|
+
text = typeof content[field] === 'string'
|
671
|
+
? module.remove.diacritics(content[field])
|
672
|
+
: content[field].toString();
|
675
673
|
if (text.search(matchRegExp) !== -1) {
|
676
674
|
// content starts with value (first in results)
|
677
675
|
addResult(results, content);
|
@@ -713,17 +711,22 @@
|
|
713
711
|
if (queryLength === termLength) {
|
714
712
|
return (query === term);
|
715
713
|
}
|
716
|
-
|
714
|
+
for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
|
717
715
|
var
|
716
|
+
continueSearch = false,
|
718
717
|
queryCharacter = query.charCodeAt(characterIndex)
|
719
718
|
;
|
720
719
|
while (nextCharacterIndex < termLength) {
|
721
720
|
if (term.charCodeAt(nextCharacterIndex++) === queryCharacter) {
|
722
|
-
|
721
|
+
continueSearch = true;
|
722
|
+
|
723
|
+
break;
|
723
724
|
}
|
724
725
|
}
|
725
726
|
|
726
|
-
|
727
|
+
if (!continueSearch) {
|
728
|
+
return false;
|
729
|
+
}
|
727
730
|
}
|
728
731
|
|
729
732
|
return true;
|
@@ -807,7 +810,7 @@
|
|
807
810
|
if (settings.cache) {
|
808
811
|
module.verbose('Checking cache for generated html for query', name);
|
809
812
|
|
810
|
-
return (typeof cache
|
813
|
+
return (typeof cache === 'object') && (cache[name] !== undefined)
|
811
814
|
? cache[name]
|
812
815
|
: false;
|
813
816
|
}
|
@@ -1129,7 +1132,7 @@
|
|
1129
1132
|
previousTime
|
1130
1133
|
;
|
1131
1134
|
if (settings.performance) {
|
1132
|
-
currentTime =
|
1135
|
+
currentTime = Date.now();
|
1133
1136
|
previousTime = time || currentTime;
|
1134
1137
|
executionTime = currentTime - previousTime;
|
1135
1138
|
time = currentTime;
|
@@ -1158,7 +1161,7 @@
|
|
1158
1161
|
title += ' \'' + moduleSelector + '\'';
|
1159
1162
|
}
|
1160
1163
|
if ($allModules.length > 1) {
|
1161
|
-
title += '
|
1164
|
+
title += ' (' + $allModules.length + ')';
|
1162
1165
|
}
|
1163
1166
|
if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
1164
1167
|
console.groupCollapsed(title);
|
@@ -1183,8 +1186,8 @@
|
|
1183
1186
|
;
|
1184
1187
|
passedArguments = passedArguments || queryArguments;
|
1185
1188
|
context = context || element;
|
1186
|
-
if (typeof query
|
1187
|
-
query = query.split(/[
|
1189
|
+
if (typeof query === 'string' && object !== undefined) {
|
1190
|
+
query = query.split(/[ .]/);
|
1188
1191
|
maxDepth = query.length - 1;
|
1189
1192
|
$.each(query, function (depth, value) {
|
1190
1193
|
var camelCaseValue = (depth != maxDepth)
|
@@ -1355,7 +1358,7 @@
|
|
1355
1358
|
},
|
1356
1359
|
|
1357
1360
|
regExp: {
|
1358
|
-
escape: /[
|
1361
|
+
escape: /[$()*+./?[\\\]^{|}-]/g,
|
1359
1362
|
beginsWith: '(?:\\s|^)',
|
1360
1363
|
},
|
1361
1364
|
|
@@ -1391,8 +1394,8 @@
|
|
1391
1394
|
return string;
|
1392
1395
|
}
|
1393
1396
|
var
|
1394
|
-
badChars = /[
|
1395
|
-
shouldEscape = /[
|
1397
|
+
badChars = /["'<>`]/g,
|
1398
|
+
shouldEscape = /["&'<>`]/,
|
1396
1399
|
escape = {
|
1397
1400
|
'<': '<',
|
1398
1401
|
'>': '>',
|
@@ -1404,7 +1407,7 @@
|
|
1404
1407
|
return escape[chr];
|
1405
1408
|
};
|
1406
1409
|
if (shouldEscape.test(string)) {
|
1407
|
-
string = string.replace(/&(?![a-
|
1410
|
+
string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&');
|
1408
1411
|
|
1409
1412
|
return string.replace(badChars, escapedChar);
|
1410
1413
|
}
|
@@ -1446,11 +1449,9 @@
|
|
1446
1449
|
// each item inside category
|
1447
1450
|
html += '<div class="results">';
|
1448
1451
|
$.each(category.results, function (index, result) {
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
html += '<a class="result">';
|
1453
|
-
}
|
1452
|
+
html += result[fields.url]
|
1453
|
+
? '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">'
|
1454
|
+
: '<a class="result">';
|
1454
1455
|
if (result[fields.image] !== undefined) {
|
1455
1456
|
html += ''
|
1456
1457
|
+ '<div class="image">'
|
@@ -1477,17 +1478,15 @@
|
|
1477
1478
|
}
|
1478
1479
|
});
|
1479
1480
|
if (response[fields.action]) {
|
1480
|
-
|
1481
|
-
|
1481
|
+
html += fields.actionURL === false
|
1482
|
+
? ''
|
1482
1483
|
+ '<div class="action">'
|
1483
1484
|
+ escape(response[fields.action][fields.actionText], preserveHTML)
|
1484
|
-
+ '</div>'
|
1485
|
-
|
1486
|
-
html += ''
|
1485
|
+
+ '</div>'
|
1486
|
+
: ''
|
1487
1487
|
+ '<a href="' + response[fields.action][fields.actionURL].replace(/"/g, '') + '" class="action">'
|
1488
1488
|
+ escape(response[fields.action][fields.actionText], preserveHTML)
|
1489
1489
|
+ '</a>';
|
1490
|
-
}
|
1491
1490
|
}
|
1492
1491
|
|
1493
1492
|
return html;
|
@@ -1503,11 +1502,9 @@
|
|
1503
1502
|
if (response[fields.results] !== undefined) {
|
1504
1503
|
// each result
|
1505
1504
|
$.each(response[fields.results], function (index, result) {
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
html += '<a class="result">';
|
1510
|
-
}
|
1505
|
+
html += result[fields.url]
|
1506
|
+
? '<a class="result" href="' + result[fields.url].replace(/"/g, '') + '">'
|
1507
|
+
: '<a class="result">';
|
1511
1508
|
if (result[fields.image] !== undefined) {
|
1512
1509
|
html += ''
|
1513
1510
|
+ '<div class="image">'
|
@@ -1529,17 +1526,15 @@
|
|
1529
1526
|
html += '</a>';
|
1530
1527
|
});
|
1531
1528
|
if (response[fields.action]) {
|
1532
|
-
|
1533
|
-
|
1529
|
+
html += fields.actionURL === false
|
1530
|
+
? ''
|
1534
1531
|
+ '<div class="action">'
|
1535
1532
|
+ escape(response[fields.action][fields.actionText], preserveHTML)
|
1536
|
-
+ '</div>'
|
1537
|
-
|
1538
|
-
html += ''
|
1533
|
+
+ '</div>'
|
1534
|
+
: ''
|
1539
1535
|
+ '<a href="' + response[fields.action][fields.actionURL].replace(/"/g, '') + '" class="action">'
|
1540
1536
|
+ escape(response[fields.action][fields.actionText], preserveHTML)
|
1541
1537
|
+ '</a>';
|
1542
|
-
}
|
1543
1538
|
}
|
1544
1539
|
|
1545
1540
|
return html;
|
@@ -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
|
requestAnimationFrame = window.requestAnimationFrame
|
@@ -209,7 +209,7 @@
|
|
209
209
|
|
210
210
|
duration: function (duration) {
|
211
211
|
duration = duration || settings.duration;
|
212
|
-
duration = (typeof duration
|
212
|
+
duration = (typeof duration === 'number')
|
213
213
|
? duration + 'ms'
|
214
214
|
: duration;
|
215
215
|
module.verbose('Setting animation duration', duration);
|
@@ -646,7 +646,7 @@
|
|
646
646
|
previousTime
|
647
647
|
;
|
648
648
|
if (settings.performance) {
|
649
|
-
currentTime =
|
649
|
+
currentTime = Date.now();
|
650
650
|
previousTime = time || currentTime;
|
651
651
|
executionTime = currentTime - previousTime;
|
652
652
|
time = currentTime;
|
@@ -675,7 +675,7 @@
|
|
675
675
|
title += ' \'' + moduleSelector + '\'';
|
676
676
|
}
|
677
677
|
if ($allModules.length > 1) {
|
678
|
-
title += '
|
678
|
+
title += ' (' + $allModules.length + ')';
|
679
679
|
}
|
680
680
|
if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
681
681
|
console.groupCollapsed(title);
|
@@ -700,8 +700,8 @@
|
|
700
700
|
;
|
701
701
|
passedArguments = passedArguments || queryArguments;
|
702
702
|
context = context || element;
|
703
|
-
if (typeof query
|
704
|
-
query = query.split(/[
|
703
|
+
if (typeof query === 'string' && object !== undefined) {
|
704
|
+
query = query.split(/[ .]/);
|
705
705
|
maxDepth = query.length - 1;
|
706
706
|
$.each(query, function (depth, value) {
|
707
707
|
var camelCaseValue = (depth != maxDepth)
|
@@ -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
|
|
@@ -30,11 +30,11 @@
|
|
30
30
|
|
31
31
|
moduleSelector = $allModules.selector || '',
|
32
32
|
|
33
|
-
time =
|
33
|
+
time = Date.now(),
|
34
34
|
performance = [],
|
35
35
|
|
36
36
|
query = arguments[0],
|
37
|
-
methodInvoked = (typeof query
|
37
|
+
methodInvoked = (typeof query === 'string'),
|
38
38
|
queryArguments = [].slice.call(arguments, 1),
|
39
39
|
|
40
40
|
requestAnimationFrame = window.requestAnimationFrame
|
@@ -309,7 +309,7 @@
|
|
309
309
|
module.verbose('Forcing repaint event');
|
310
310
|
element.style.display = 'none';
|
311
311
|
var ignored = element.offsetHeight;
|
312
|
-
element.scrollTop = element.scrollTop;
|
312
|
+
element.scrollTop = element.scrollTop; // eslint-disable-line no-self-assign
|
313
313
|
element.style.display = '';
|
314
314
|
},
|
315
315
|
|
@@ -374,7 +374,7 @@
|
|
374
374
|
bodyMargin: function () {
|
375
375
|
initialBodyMargin = $context.css((isBody ? 'margin-' : 'padding-') + (module.can.leftBodyScrollbar() ? 'left' : 'right'));
|
376
376
|
var
|
377
|
-
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
|
377
|
+
bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, ''), 10),
|
378
378
|
bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth
|
379
379
|
;
|
380
380
|
tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
|
@@ -403,9 +403,9 @@
|
|
403
403
|
module.hideOthers(module.show);
|
404
404
|
|
405
405
|
return;
|
406
|
-
} else {
|
407
|
-
module.hideOthers();
|
408
406
|
}
|
407
|
+
|
408
|
+
module.hideOthers();
|
409
409
|
} else {
|
410
410
|
settings.transition = 'overlay';
|
411
411
|
}
|
@@ -709,9 +709,11 @@
|
|
709
709
|
direction: function () {
|
710
710
|
if ($module.hasClass(className.top)) {
|
711
711
|
return className.top;
|
712
|
-
}
|
712
|
+
}
|
713
|
+
if ($module.hasClass(className.right)) {
|
713
714
|
return className.right;
|
714
|
-
}
|
715
|
+
}
|
716
|
+
if ($module.hasClass(className.bottom)) {
|
715
717
|
return className.bottom;
|
716
718
|
}
|
717
719
|
|
@@ -803,9 +805,9 @@
|
|
803
805
|
module.verbose('Browser was found to be iOS', userAgent);
|
804
806
|
|
805
807
|
return true;
|
806
|
-
} else {
|
807
|
-
return false;
|
808
808
|
}
|
809
|
+
|
810
|
+
return false;
|
809
811
|
},
|
810
812
|
mobile: function () {
|
811
813
|
var
|
@@ -816,11 +818,11 @@
|
|
816
818
|
module.verbose('Browser was found to be mobile', userAgent);
|
817
819
|
|
818
820
|
return true;
|
819
|
-
} else {
|
820
|
-
module.verbose('Browser is not mobile, using regular transition', userAgent);
|
821
|
-
|
822
|
-
return false;
|
823
821
|
}
|
822
|
+
|
823
|
+
module.verbose('Browser is not mobile, using regular transition', userAgent);
|
824
|
+
|
825
|
+
return false;
|
824
826
|
},
|
825
827
|
hidden: function () {
|
826
828
|
return !module.is.visible();
|
@@ -907,7 +909,7 @@
|
|
907
909
|
previousTime
|
908
910
|
;
|
909
911
|
if (settings.performance) {
|
910
|
-
currentTime =
|
912
|
+
currentTime = Date.now();
|
911
913
|
previousTime = time || currentTime;
|
912
914
|
executionTime = currentTime - previousTime;
|
913
915
|
time = currentTime;
|
@@ -958,8 +960,8 @@
|
|
958
960
|
;
|
959
961
|
passedArguments = passedArguments || queryArguments;
|
960
962
|
context = context || element;
|
961
|
-
if (typeof query
|
962
|
-
query = query.split(/[
|
963
|
+
if (typeof query === 'string' && object !== undefined) {
|
964
|
+
query = query.split(/[ .]/);
|
963
965
|
maxDepth = query.length - 1;
|
964
966
|
$.each(query, function (depth, value) {
|
965
967
|
var camelCaseValue = (depth != maxDepth)
|