fomantic-ui 2.9.1-beta.23 → 2.9.1-beta.25
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/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +26 -0
- package/.eslint/no-extra-parens-rule.js +17 -0
- package/.eslint/package.json +11 -0
- package/.eslintrc.js +7 -13
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +24 -24
- 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 +58 -58
- 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 +1 -1
- package/dist/components/calendar.js +84 -72
- package/dist/components/calendar.min.css +1 -1
- 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 +17 -17
- 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 +18 -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 +264 -254
- 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 +19 -19
- 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 +1 -1
- package/dist/components/flyout.js +29 -25
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +158 -141
- package/dist/components/form.min.css +1 -1
- 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 +32 -28
- 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 +10 -10
- 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 +79 -71
- 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 +40 -42
- 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 +13 -13
- 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 +42 -42
- 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 +36 -36
- 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 +29 -29
- 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 +16 -16
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +79 -58
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +14 -14
- 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 +25 -25
- 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 +34 -34
- 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 +43 -19
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +26 -26
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +29 -29
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +1218 -1120
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/gulpfile.js +1 -1
- package/package.json +2 -1
- package/scripts/nightly-version.js +3 -1
- package/src/definitions/behaviors/api.js +57 -57
- package/src/definitions/behaviors/form.js +157 -140
- package/src/definitions/behaviors/state.js +13 -13
- package/src/definitions/behaviors/visibility.js +28 -28
- package/src/definitions/globals/site.js +15 -15
- package/src/definitions/modules/accordion.js +23 -23
- package/src/definitions/modules/calendar.js +83 -71
- package/src/definitions/modules/checkbox.js +16 -16
- package/src/definitions/modules/dimmer.js +17 -17
- package/src/definitions/modules/dropdown.js +263 -253
- package/src/definitions/modules/embed.js +18 -18
- package/src/definitions/modules/flyout.js +28 -24
- package/src/definitions/modules/modal.js +31 -27
- package/src/definitions/modules/nag.js +9 -9
- package/src/definitions/modules/popup.js +78 -70
- package/src/definitions/modules/progress.js +39 -41
- package/src/definitions/modules/rating.js +12 -12
- package/src/definitions/modules/search.js +41 -41
- package/src/definitions/modules/shape.js +35 -35
- package/src/definitions/modules/sidebar.js +28 -28
- package/src/definitions/modules/slider.js +78 -57
- package/src/definitions/modules/sticky.js +24 -24
- package/src/definitions/modules/tab.js +33 -33
- package/src/definitions/modules/toast.js +42 -18
- package/src/definitions/modules/transition.js +25 -25
- package/tasks/admin/components/create.js +1 -1
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +4 -4
- package/tasks/admin/distributions/create.js +6 -7
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/admin/publish.js +1 -3
- package/tasks/admin/register.js +5 -5
- package/tasks/admin/release.js +1 -3
- package/tasks/build/assets.js +1 -1
- package/tasks/build.js +1 -1
- package/tasks/check-install.js +1 -1
- package/tasks/clean.js +1 -1
- package/tasks/collections/admin.js +1 -1
- package/tasks/collections/rtl.js +1 -1
- package/tasks/config/admin/github.js +3 -4
- package/tasks/config/npm/gulpfile.js +1 -1
- package/tasks/config/project/config.js +10 -8
- package/tasks/config/project/install.js +14 -14
- package/tasks/config/project/release.js +3 -2
- package/tasks/config/tasks.js +4 -4
- package/tasks/config/user.js +5 -3
- package/tasks/docs/build.js +1 -1
- package/tasks/docs/metadata.js +2 -2
- package/tasks/docs/serve.js +2 -1
- package/tasks/install.js +3 -3
- package/tasks/rtl/build.js +1 -3
- package/tasks/rtl/watch.js +1 -3
- package/tasks/version.js +1 -3
- package/tasks/watch.js +1 -1
- package/test/modules/module.spec.js +1 -1
@@ -12,14 +12,14 @@
|
|
12
12
|
'use strict';
|
13
13
|
|
14
14
|
function isWindow(obj) {
|
15
|
-
return obj
|
15
|
+
return obj !== null && obj === obj.window;
|
16
16
|
}
|
17
17
|
|
18
18
|
function isFunction(obj) {
|
19
19
|
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
|
20
20
|
}
|
21
21
|
|
22
|
-
window =
|
22
|
+
window = window !== undefined && window.Math === Math
|
23
23
|
? window
|
24
24
|
: globalThis;
|
25
25
|
|
@@ -35,7 +35,7 @@
|
|
35
35
|
performance = [],
|
36
36
|
|
37
37
|
query = arguments[0],
|
38
|
-
methodInvoked =
|
38
|
+
methodInvoked = typeof query === 'string',
|
39
39
|
queryArguments = [].slice.call(arguments, 1),
|
40
40
|
|
41
41
|
initializedHistory = false,
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
$allModules.each(function () {
|
46
46
|
var
|
47
|
-
settings =
|
47
|
+
settings = $.isPlainObject(parameters)
|
48
48
|
? $.extend(true, {}, $.fn.tab.settings, parameters)
|
49
49
|
: $.extend({}, $.fn.tab.settings),
|
50
50
|
|
@@ -94,12 +94,12 @@
|
|
94
94
|
}
|
95
95
|
|
96
96
|
var activeTab = module.determine.activeTab();
|
97
|
-
if (settings.autoTabActivation && instance === undefined && activeTab
|
97
|
+
if (settings.autoTabActivation && instance === undefined && activeTab === null) {
|
98
98
|
activeTab = settings.autoTabActivation === true ? module.get.initialPath() : settings.autoTabActivation;
|
99
99
|
module.debug('No active tab detected, setting tab active', activeTab);
|
100
100
|
module.changeTab(activeTab);
|
101
101
|
}
|
102
|
-
if (activeTab
|
102
|
+
if (activeTab !== null && settings.history) {
|
103
103
|
var autoUpdate = $.address.autoUpdate();
|
104
104
|
$.address.autoUpdate(false);
|
105
105
|
$.address.value(activeTab);
|
@@ -193,7 +193,7 @@
|
|
193
193
|
|
194
194
|
return false;
|
195
195
|
}
|
196
|
-
if (settings.historyType
|
196
|
+
if (settings.historyType === 'state') {
|
197
197
|
module.debug('Using HTML5 to manage state');
|
198
198
|
if (settings.path !== false) {
|
199
199
|
$.address
|
@@ -259,7 +259,7 @@
|
|
259
259
|
cache: {
|
260
260
|
|
261
261
|
read: function (cacheKey) {
|
262
|
-
return
|
262
|
+
return cacheKey !== undefined
|
263
263
|
? cache[cacheKey]
|
264
264
|
: false;
|
265
265
|
},
|
@@ -286,7 +286,7 @@
|
|
286
286
|
set: {
|
287
287
|
auto: function () {
|
288
288
|
var
|
289
|
-
url =
|
289
|
+
url = typeof settings.path === 'string'
|
290
290
|
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
291
291
|
: '/{$tab}'
|
292
292
|
;
|
@@ -323,11 +323,11 @@
|
|
323
323
|
|
324
324
|
changeTab: function (tabPath) {
|
325
325
|
var
|
326
|
-
pushStateAvailable =
|
327
|
-
shouldIgnoreLoad =
|
328
|
-
remoteContent =
|
326
|
+
pushStateAvailable = window.history && window.history.pushState,
|
327
|
+
shouldIgnoreLoad = pushStateAvailable && settings.ignoreFirstLoad && firstLoad,
|
328
|
+
remoteContent = settings.auto || $.isPlainObject(settings.apiSettings),
|
329
329
|
// only add default path if not remote content
|
330
|
-
pathArray =
|
330
|
+
pathArray = remoteContent && !shouldIgnoreLoad
|
331
331
|
? module.utilities.pathToArray(tabPath)
|
332
332
|
: module.get.defaultPathArray(tabPath)
|
333
333
|
;
|
@@ -338,7 +338,7 @@
|
|
338
338
|
currentPath = module.utilities.arrayToPath(currentPathArray),
|
339
339
|
|
340
340
|
isTab = module.is.tab(currentPath),
|
341
|
-
isLastIndex =
|
341
|
+
isLastIndex = index + 1 === pathArray.length,
|
342
342
|
|
343
343
|
$tab = module.get.tabElement(currentPath),
|
344
344
|
$anchor,
|
@@ -358,7 +358,7 @@
|
|
358
358
|
} else {
|
359
359
|
nextPathArray = pathArray.slice(0, index + 2);
|
360
360
|
nextPath = module.utilities.arrayToPath(nextPathArray);
|
361
|
-
isLastTab =
|
361
|
+
isLastTab = !module.is.tab(nextPath);
|
362
362
|
if (isLastTab) {
|
363
363
|
module.verbose('Tab parameters found', nextPathArray);
|
364
364
|
}
|
@@ -392,7 +392,7 @@
|
|
392
392
|
settings.onFirstLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
393
393
|
}
|
394
394
|
settings.onLoad.call($tab[0], currentPath, parameterArray, historyEvent);
|
395
|
-
} else if (tabPath.search('/')
|
395
|
+
} else if (tabPath.search('/') === -1 && tabPath !== '') {
|
396
396
|
// look for in page anchor
|
397
397
|
tabPath = module.escape.string(tabPath);
|
398
398
|
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
|
@@ -431,7 +431,7 @@
|
|
431
431
|
|
432
432
|
scrollTo: function ($element) {
|
433
433
|
var
|
434
|
-
scrollOffset =
|
434
|
+
scrollOffset = $element && $element.length > 0
|
435
435
|
? $element.offset().top
|
436
436
|
: false
|
437
437
|
;
|
@@ -447,10 +447,10 @@
|
|
447
447
|
$tab = module.get.tabElement(tabPath),
|
448
448
|
tab = $tab[0]
|
449
449
|
;
|
450
|
-
evaluateScripts =
|
450
|
+
evaluateScripts = evaluateScripts !== undefined
|
451
451
|
? evaluateScripts
|
452
452
|
: settings.evaluateScripts;
|
453
|
-
if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase()
|
453
|
+
if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && typeof html !== 'string') {
|
454
454
|
$tab
|
455
455
|
.empty()
|
456
456
|
.append($(html).clone(true))
|
@@ -481,7 +481,7 @@
|
|
481
481
|
'X-Remote': true,
|
482
482
|
},
|
483
483
|
onSuccess: function (response) {
|
484
|
-
if (settings.cacheType
|
484
|
+
if (settings.cacheType === 'response') {
|
485
485
|
module.cache.add(fullTabPath, response);
|
486
486
|
}
|
487
487
|
module.update.content(tabPath, response);
|
@@ -496,7 +496,7 @@
|
|
496
496
|
|
497
497
|
if (settings.loadOnce) {
|
498
498
|
module.cache.add(fullTabPath, true);
|
499
|
-
} else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase()
|
499
|
+
} else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() === 'dom' && $tab.children().length > 0) {
|
500
500
|
setTimeout(function () {
|
501
501
|
var
|
502
502
|
$clone = $tab.children().clone(true)
|
@@ -513,7 +513,7 @@
|
|
513
513
|
},
|
514
514
|
},
|
515
515
|
request = $tab.api('get request') || false,
|
516
|
-
existingRequest =
|
516
|
+
existingRequest = request && request.state() === 'pending',
|
517
517
|
requestSettings,
|
518
518
|
cachedContent
|
519
519
|
;
|
@@ -525,7 +525,7 @@
|
|
525
525
|
module.activate.tab(tabPath);
|
526
526
|
module.debug('Adding cached content', fullTabPath);
|
527
527
|
if (!settings.loadOnce) {
|
528
|
-
if (settings.evaluateScripts
|
528
|
+
if (settings.evaluateScripts === 'once') {
|
529
529
|
module.update.content(tabPath, cachedContent, false);
|
530
530
|
} else {
|
531
531
|
module.update.content(tabPath, cachedContent);
|
@@ -554,7 +554,7 @@
|
|
554
554
|
tab: function (tabPath) {
|
555
555
|
var
|
556
556
|
$tab = module.get.tabElement(tabPath),
|
557
|
-
$deactiveTabs =
|
557
|
+
$deactiveTabs = settings.deactivate === 'siblings'
|
558
558
|
? $tab.siblings($tabs)
|
559
559
|
: $tabs.not($tab),
|
560
560
|
isActive = $tab.hasClass(className.active)
|
@@ -575,7 +575,7 @@
|
|
575
575
|
navigation: function (tabPath) {
|
576
576
|
var
|
577
577
|
$navigation = module.get.navElement(tabPath),
|
578
|
-
$deactiveNavigation =
|
578
|
+
$deactiveNavigation = settings.deactivate === 'siblings'
|
579
579
|
? $navigation.siblings($allModules)
|
580
580
|
: $allModules.not($navigation),
|
581
581
|
isActive = $navigation.hasClass(className.active)
|
@@ -611,8 +611,8 @@
|
|
611
611
|
|
612
612
|
is: {
|
613
613
|
tab: function (tabName) {
|
614
|
-
return
|
615
|
-
?
|
614
|
+
return tabName !== undefined
|
615
|
+
? module.get.tabElement(tabName).length > 0
|
616
616
|
: false;
|
617
617
|
},
|
618
618
|
},
|
@@ -666,7 +666,7 @@
|
|
666
666
|
$fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(tabPath) + '"]');
|
667
667
|
$simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + module.escape.string(lastTab) + '"]');
|
668
668
|
|
669
|
-
return
|
669
|
+
return $fullPathTab.length > 0
|
670
670
|
? $fullPathTab
|
671
671
|
: $simplePathTab;
|
672
672
|
},
|
@@ -701,7 +701,7 @@
|
|
701
701
|
utilities: {
|
702
702
|
filterArray: function (keepArray, removeArray) {
|
703
703
|
return $.grep(keepArray, function (keepValue) {
|
704
|
-
return
|
704
|
+
return $.inArray(keepValue, removeArray) === -1;
|
705
705
|
});
|
706
706
|
},
|
707
707
|
last: function (array) {
|
@@ -837,17 +837,17 @@
|
|
837
837
|
query = query.split(/[ .]/);
|
838
838
|
maxDepth = query.length - 1;
|
839
839
|
$.each(query, function (depth, value) {
|
840
|
-
var camelCaseValue =
|
840
|
+
var camelCaseValue = depth !== maxDepth
|
841
841
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
842
842
|
: query
|
843
843
|
;
|
844
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
844
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
845
845
|
object = object[camelCaseValue];
|
846
846
|
} else if (object[camelCaseValue] !== undefined) {
|
847
847
|
found = object[camelCaseValue];
|
848
848
|
|
849
849
|
return false;
|
850
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
850
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
851
851
|
object = object[value];
|
852
852
|
} else if (object[value] !== undefined) {
|
853
853
|
found = object[value];
|
@@ -889,7 +889,7 @@
|
|
889
889
|
}
|
890
890
|
});
|
891
891
|
|
892
|
-
return
|
892
|
+
return returnedValue !== undefined
|
893
893
|
? returnedValue
|
894
894
|
: this;
|
895
895
|
};
|
@@ -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
|
|
@@ -28,13 +28,13 @@
|
|
28
28
|
performance = [],
|
29
29
|
|
30
30
|
query = arguments[0],
|
31
|
-
methodInvoked =
|
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
|
-
settings =
|
37
|
+
settings = $.isPlainObject(parameters)
|
38
38
|
? $.extend(true, {}, $.fn.toast.settings, parameters)
|
39
39
|
: $.extend({}, $.fn.toast.settings),
|
40
40
|
|
@@ -55,7 +55,7 @@
|
|
55
55
|
$progressBar,
|
56
56
|
$animationObject,
|
57
57
|
$close,
|
58
|
-
$context =
|
58
|
+
$context = settings.context
|
59
59
|
? ([window, document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context))
|
60
60
|
: $('body'),
|
61
61
|
|
@@ -147,7 +147,11 @@
|
|
147
147
|
create: {
|
148
148
|
container: function () {
|
149
149
|
module.verbose('Creating container');
|
150
|
-
$context.append($('<div/>', {
|
150
|
+
$context.append($('<div/>', {
|
151
|
+
class: settings.position + ' ' + className.container + ' '
|
152
|
+
+ (settings.horizontal ? className.horizontal : '') + ' '
|
153
|
+
+ (settings.context && settings.context !== 'body' ? className.absolute : ''),
|
154
|
+
}));
|
151
155
|
},
|
152
156
|
id: function () {
|
153
157
|
id = (Math.random().toString(16) + '000000000').slice(2, 10);
|
@@ -208,7 +212,7 @@
|
|
208
212
|
} else {
|
209
213
|
$toast = settings.cloneModule ? $module.clone().removeAttr('id') : $module;
|
210
214
|
$close = $toast.find('> i' + module.helpers.toClass(className.close));
|
211
|
-
settings.closeIcon =
|
215
|
+
settings.closeIcon = $close.length > 0;
|
212
216
|
if (iconClass !== '') {
|
213
217
|
$toast.find(selector.icon).attr('class', iconClass + ' ' + className.icon);
|
214
218
|
}
|
@@ -242,10 +246,15 @@
|
|
242
246
|
}
|
243
247
|
settings.actions.forEach(function (el) {
|
244
248
|
var
|
245
|
-
icon = el[fields.icon]
|
249
|
+
icon = el[fields.icon]
|
250
|
+
? '<i ' + (el[fields.text] ? 'aria-hidden="true"' : '')
|
251
|
+
+ ' class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>'
|
252
|
+
: '',
|
246
253
|
text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
|
247
254
|
cls = module.helpers.deQuote(el[fields.class] || ''),
|
248
|
-
click = el[fields.click] && isFunction(el[fields.click])
|
255
|
+
click = el[fields.click] && isFunction(el[fields.click])
|
256
|
+
? el[fields.click]
|
257
|
+
: function () {}
|
249
258
|
;
|
250
259
|
$actions.append($('<button/>', {
|
251
260
|
html: icon + text,
|
@@ -482,7 +491,13 @@
|
|
482
491
|
return id;
|
483
492
|
},
|
484
493
|
containers: function () {
|
485
|
-
return $context.children(module.helpers.toClass(settings.position) + selector.container
|
494
|
+
return $context.children(module.helpers.toClass(settings.position) + selector.container
|
495
|
+
+ (settings.horizontal
|
496
|
+
? module.helpers.toClass(className.horizontal)
|
497
|
+
: ':not(' + module.helpers.toClass(className.horizontal) + ')')
|
498
|
+
+ (settings.context && settings.context !== 'body'
|
499
|
+
? module.helpers.toClass(className.absolute)
|
500
|
+
: ':not(' + module.helpers.toClass(className.absolute) + ')'));
|
486
501
|
},
|
487
502
|
container: function () {
|
488
503
|
return module.get.containers()[0];
|
@@ -497,7 +512,11 @@
|
|
497
512
|
return $(module.get.container()).find(selector.box);
|
498
513
|
},
|
499
514
|
iconClass: function () {
|
500
|
-
return typeof settings.showIcon === 'string'
|
515
|
+
return typeof settings.showIcon === 'string'
|
516
|
+
? settings.showIcon
|
517
|
+
: (settings.showIcon && settings.icons[settings.class]
|
518
|
+
? settings.icons[settings.class]
|
519
|
+
: '');
|
501
520
|
},
|
502
521
|
remainingTime: function () {
|
503
522
|
return $animationObject ? $animationObject.css('opacity') * settings.displayTime : 0;
|
@@ -715,17 +734,17 @@
|
|
715
734
|
query = query.split(/[ .]/);
|
716
735
|
maxDepth = query.length - 1;
|
717
736
|
$.each(query, function (depth, value) {
|
718
|
-
var camelCaseValue =
|
737
|
+
var camelCaseValue = depth !== maxDepth
|
719
738
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
720
739
|
: query
|
721
740
|
;
|
722
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
741
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
723
742
|
object = object[camelCaseValue];
|
724
743
|
} else if (object[camelCaseValue] !== undefined) {
|
725
744
|
found = object[camelCaseValue];
|
726
745
|
|
727
746
|
return false;
|
728
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
747
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
729
748
|
object = object[value];
|
730
749
|
} else if (object[value] !== undefined) {
|
731
750
|
found = object[value];
|
@@ -769,7 +788,7 @@
|
|
769
788
|
}
|
770
789
|
});
|
771
790
|
|
772
|
-
return
|
791
|
+
return returnedValue !== undefined
|
773
792
|
? returnedValue
|
774
793
|
: this;
|
775
794
|
};
|
@@ -913,16 +932,21 @@
|
|
913
932
|
return n1 * x * x;
|
914
933
|
}
|
915
934
|
if (x < 2 / d1) {
|
916
|
-
|
935
|
+
x -= 1.5 / d1;
|
936
|
+
|
937
|
+
return n1 * x * x + 0.75;
|
917
938
|
}
|
918
939
|
if (x < 2.5 / d1) {
|
919
|
-
|
940
|
+
x -= 2.25 / d1;
|
941
|
+
|
942
|
+
return n1 * x * x + 0.9375;
|
920
943
|
}
|
944
|
+
x -= 2.625 / d1;
|
921
945
|
|
922
|
-
return n1 *
|
946
|
+
return n1 * x * x + 0.984375;
|
923
947
|
},
|
924
948
|
easeOutCubic: function (t) {
|
925
|
-
return
|
949
|
+
return --t * t * t + 1;
|
926
950
|
},
|
927
951
|
});
|
928
952
|
})(jQuery, window, document);
|
@@ -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,7 +30,7 @@
|
|
30
30
|
moduleArguments = arguments,
|
31
31
|
query = moduleArguments[0],
|
32
32
|
queryArguments = [].slice.call(arguments, 1),
|
33
|
-
methodInvoked =
|
33
|
+
methodInvoked = typeof query === 'string',
|
34
34
|
|
35
35
|
returnedValue
|
36
36
|
;
|
@@ -139,11 +139,11 @@
|
|
139
139
|
? module.get.direction()
|
140
140
|
: 'static';
|
141
141
|
}
|
142
|
-
interval =
|
142
|
+
interval = interval !== undefined
|
143
143
|
? interval
|
144
144
|
: settings.interval;
|
145
|
-
shouldReverse =
|
146
|
-
delay =
|
145
|
+
shouldReverse = settings.reverse === 'auto' && direction === className.outward;
|
146
|
+
delay = shouldReverse || settings.reverse === true
|
147
147
|
? ($allModules.length - index) * interval
|
148
148
|
: index * interval;
|
149
149
|
module.debug('Delaying animation by', delay);
|
@@ -253,7 +253,7 @@
|
|
253
253
|
var
|
254
254
|
style = $module.attr('style'),
|
255
255
|
currentDisplay = $module.css('display'),
|
256
|
-
emptyStyle =
|
256
|
+
emptyStyle = style === undefined || style === ''
|
257
257
|
;
|
258
258
|
if (currentDisplay !== 'none' && !module.is.hidden()) {
|
259
259
|
module.verbose('Overriding default display to hide element');
|
@@ -315,7 +315,7 @@
|
|
315
315
|
},
|
316
316
|
duration: function (animationName, duration) {
|
317
317
|
duration = duration || settings.duration;
|
318
|
-
duration =
|
318
|
+
duration = typeof duration === 'number'
|
319
319
|
? duration + 'ms'
|
320
320
|
: duration;
|
321
321
|
if (duration || duration === 0) {
|
@@ -329,7 +329,7 @@
|
|
329
329
|
},
|
330
330
|
direction: function (direction) {
|
331
331
|
direction = direction || module.get.direction();
|
332
|
-
if (direction
|
332
|
+
if (direction === className.inward) {
|
333
333
|
module.set.inward();
|
334
334
|
} else {
|
335
335
|
module.set.outward();
|
@@ -525,7 +525,7 @@
|
|
525
525
|
animationClass: function (animation) {
|
526
526
|
var
|
527
527
|
animationClass = animation || settings.animation,
|
528
|
-
directionClass =
|
528
|
+
directionClass = module.can.transition() && !module.has.direction()
|
529
529
|
? module.get.direction() + ' '
|
530
530
|
: ''
|
531
531
|
;
|
@@ -536,7 +536,7 @@
|
|
536
536
|
+ animationClass;
|
537
537
|
},
|
538
538
|
currentAnimation: function () {
|
539
|
-
return
|
539
|
+
return module.cache && module.cache.animation !== undefined
|
540
540
|
? module.cache.animation
|
541
541
|
: false;
|
542
542
|
},
|
@@ -579,14 +579,14 @@
|
|
579
579
|
duration = $module.css('animation-duration') || 0;
|
580
580
|
}
|
581
581
|
|
582
|
-
return
|
583
|
-
? (duration.indexOf('ms') > -1
|
582
|
+
return typeof duration === 'string'
|
583
|
+
? (duration.indexOf('ms') > -1
|
584
584
|
? parseFloat(duration)
|
585
|
-
: parseFloat(duration) * 1000
|
585
|
+
: parseFloat(duration) * 1000)
|
586
586
|
: duration;
|
587
587
|
},
|
588
588
|
displayType: function (shouldDetermine) {
|
589
|
-
shouldDetermine =
|
589
|
+
shouldDetermine = shouldDetermine !== undefined
|
590
590
|
? shouldDetermine
|
591
591
|
: true;
|
592
592
|
if (settings.displayType) {
|
@@ -700,10 +700,10 @@
|
|
700
700
|
}
|
701
701
|
|
702
702
|
$clone.remove();
|
703
|
-
if (currentAnimation
|
703
|
+
if (currentAnimation !== inAnimation) {
|
704
704
|
module.debug('Direction exists for animation', animation);
|
705
705
|
directionExists = true;
|
706
|
-
} else if (currentAnimation
|
706
|
+
} else if (currentAnimation === 'none' || !currentAnimation) {
|
707
707
|
module.debug('No animation defined in css', animation);
|
708
708
|
|
709
709
|
return;
|
@@ -714,13 +714,13 @@
|
|
714
714
|
module.save.transitionExists(animation, directionExists);
|
715
715
|
}
|
716
716
|
|
717
|
-
return
|
717
|
+
return transitionExists !== undefined
|
718
718
|
? transitionExists
|
719
719
|
: directionExists;
|
720
720
|
},
|
721
721
|
animate: function () {
|
722
722
|
// can transition does not return a value if animation does not exist
|
723
|
-
return
|
723
|
+
return module.can.transition() !== undefined;
|
724
724
|
},
|
725
725
|
},
|
726
726
|
|
@@ -741,7 +741,7 @@
|
|
741
741
|
animation = animation || settings.animation;
|
742
742
|
animation = '.' + animation.replace(' ', '.');
|
743
743
|
|
744
|
-
return
|
744
|
+
return $module.filter(animation).length > 0;
|
745
745
|
},
|
746
746
|
visible: function () {
|
747
747
|
return $module.is(':visible');
|
@@ -750,7 +750,7 @@
|
|
750
750
|
return $module.css('visibility') === 'hidden';
|
751
751
|
},
|
752
752
|
supported: function () {
|
753
|
-
return
|
753
|
+
return animationEnd !== false;
|
754
754
|
},
|
755
755
|
},
|
756
756
|
|
@@ -943,17 +943,17 @@
|
|
943
943
|
query = query.split(/[ .]/);
|
944
944
|
maxDepth = query.length - 1;
|
945
945
|
$.each(query, function (depth, value) {
|
946
|
-
var camelCaseValue =
|
946
|
+
var camelCaseValue = depth !== maxDepth
|
947
947
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
948
948
|
: query
|
949
949
|
;
|
950
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
950
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
951
951
|
object = object[camelCaseValue];
|
952
952
|
} else if (object[camelCaseValue] !== undefined) {
|
953
953
|
found = object[camelCaseValue];
|
954
954
|
|
955
955
|
return false;
|
956
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
956
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
957
957
|
object = object[value];
|
958
958
|
} else if (object[value] !== undefined) {
|
959
959
|
found = object[value];
|
@@ -978,7 +978,7 @@
|
|
978
978
|
returnedValue = response;
|
979
979
|
}
|
980
980
|
|
981
|
-
return
|
981
|
+
return found !== undefined
|
982
982
|
? found
|
983
983
|
: false;
|
984
984
|
},
|
@@ -986,7 +986,7 @@
|
|
986
986
|
module.initialize();
|
987
987
|
});
|
988
988
|
|
989
|
-
return
|
989
|
+
return returnedValue !== undefined
|
990
990
|
? returnedValue
|
991
991
|
: this;
|
992
992
|
};
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
*/
|
14
14
|
|
15
|
-
|
15
|
+
const
|
16
16
|
gulp = require('gulp'),
|
17
17
|
|
18
18
|
// node dependencies
|
@@ -85,7 +85,7 @@ module.exports = function (callback) {
|
|
85
85
|
}
|
86
86
|
|
87
87
|
// clean folder
|
88
|
-
if (release.outputRoot.
|
88
|
+
if (release.outputRoot.startsWith('../repos')) {
|
89
89
|
console.info('Cleaning dir', outputDirectory);
|
90
90
|
del.sync([outputDirectory + '**/*'], { silent: true, force: true });
|
91
91
|
}
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
*/
|
14
14
|
|
15
|
-
|
15
|
+
const
|
16
16
|
gulp = require('gulp'),
|
17
17
|
|
18
18
|
// node dependencies
|
@@ -68,7 +68,7 @@ module.exports = function (callback) {
|
|
68
68
|
gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git',
|
69
69
|
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
|
70
70
|
|
71
|
-
commitArgs =
|
71
|
+
commitArgs = oAuth.name !== undefined && oAuth.email !== undefined
|
72
72
|
? '--author "' + oAuth.name + ' <' + oAuth.email + '>"'
|
73
73
|
: '',
|
74
74
|
|
@@ -76,9 +76,9 @@ module.exports = function (callback) {
|
|
76
76
|
? require(outputDirectory + 'package.json') // eslint-disable-line import/no-dynamic-require
|
77
77
|
: false,
|
78
78
|
|
79
|
-
isNewVersion =
|
79
|
+
isNewVersion = version && componentPackage.version !== version,
|
80
80
|
|
81
|
-
commitMessage =
|
81
|
+
commitMessage = isNewVersion
|
82
82
|
? 'Updated component to version ' + version
|
83
83
|
: 'Updated files from main repo',
|
84
84
|
|