@northdata/fomantic-ui 2.8.722 → 2.9.400

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.
Files changed (133) hide show
  1. package/lib/semantic-ui/dist/components/accordion.css +62 -69
  2. package/lib/semantic-ui/dist/components/accordion.js +595 -618
  3. package/lib/semantic-ui/dist/components/accordion.min.css +4 -4
  4. package/lib/semantic-ui/dist/components/accordion.min.js +6 -6
  5. package/lib/semantic-ui/dist/components/api.js +1225 -1177
  6. package/lib/semantic-ui/dist/components/api.min.js +6 -6
  7. package/lib/semantic-ui/dist/components/button.css +291 -634
  8. package/lib/semantic-ui/dist/components/button.min.css +4 -4
  9. package/lib/semantic-ui/dist/components/calendar.css +149 -33
  10. package/lib/semantic-ui/dist/components/calendar.js +2045 -1774
  11. package/lib/semantic-ui/dist/components/calendar.min.css +4 -4
  12. package/lib/semantic-ui/dist/components/calendar.min.js +6 -6
  13. package/lib/semantic-ui/dist/components/card.css +147 -537
  14. package/lib/semantic-ui/dist/components/card.min.css +4 -4
  15. package/lib/semantic-ui/dist/components/checkbox.css +215 -405
  16. package/lib/semantic-ui/dist/components/checkbox.js +888 -876
  17. package/lib/semantic-ui/dist/components/checkbox.min.css +4 -4
  18. package/lib/semantic-ui/dist/components/checkbox.min.js +6 -6
  19. package/lib/semantic-ui/dist/components/container.css +20 -21
  20. package/lib/semantic-ui/dist/components/container.min.css +4 -4
  21. package/lib/semantic-ui/dist/components/dimmer.css +76 -184
  22. package/lib/semantic-ui/dist/components/dimmer.js +732 -753
  23. package/lib/semantic-ui/dist/components/dimmer.min.css +4 -4
  24. package/lib/semantic-ui/dist/components/dimmer.min.js +6 -6
  25. package/lib/semantic-ui/dist/components/divider.css +81 -88
  26. package/lib/semantic-ui/dist/components/divider.min.css +4 -4
  27. package/lib/semantic-ui/dist/components/dropdown.css +431 -450
  28. package/lib/semantic-ui/dist/components/dropdown.js +4432 -4238
  29. package/lib/semantic-ui/dist/components/dropdown.min.css +4 -4
  30. package/lib/semantic-ui/dist/components/dropdown.min.js +6 -6
  31. package/lib/semantic-ui/dist/components/feed.css +130 -87
  32. package/lib/semantic-ui/dist/components/feed.min.css +4 -4
  33. package/lib/semantic-ui/dist/components/flag.css +541 -511
  34. package/lib/semantic-ui/dist/components/flag.min.css +4 -4
  35. package/lib/semantic-ui/dist/components/form.css +437 -476
  36. package/lib/semantic-ui/dist/components/form.js +2199 -2033
  37. package/lib/semantic-ui/dist/components/form.min.css +4 -4
  38. package/lib/semantic-ui/dist/components/form.min.js +6 -6
  39. package/lib/semantic-ui/dist/components/grid.css +151 -306
  40. package/lib/semantic-ui/dist/components/grid.min.css +4 -4
  41. package/lib/semantic-ui/dist/components/header.css +82 -99
  42. package/lib/semantic-ui/dist/components/header.min.css +4 -4
  43. package/lib/semantic-ui/dist/components/icon.css +2744 -2706
  44. package/lib/semantic-ui/dist/components/icon.min.css +4 -4
  45. package/lib/semantic-ui/dist/components/image.css +38 -73
  46. package/lib/semantic-ui/dist/components/image.min.css +4 -4
  47. package/lib/semantic-ui/dist/components/input.css +344 -254
  48. package/lib/semantic-ui/dist/components/input.min.css +4 -4
  49. package/lib/semantic-ui/dist/components/item.css +91 -139
  50. package/lib/semantic-ui/dist/components/item.min.css +4 -4
  51. package/lib/semantic-ui/dist/components/label.css +244 -267
  52. package/lib/semantic-ui/dist/components/label.min.css +4 -4
  53. package/lib/semantic-ui/dist/components/list.css +75 -113
  54. package/lib/semantic-ui/dist/components/list.min.css +4 -4
  55. package/lib/semantic-ui/dist/components/loader.css +142 -601
  56. package/lib/semantic-ui/dist/components/loader.min.css +4 -4
  57. package/lib/semantic-ui/dist/components/menu.css +398 -638
  58. package/lib/semantic-ui/dist/components/menu.min.css +9 -1
  59. package/lib/semantic-ui/dist/components/message.css +116 -332
  60. package/lib/semantic-ui/dist/components/message.min.css +4 -4
  61. package/lib/semantic-ui/dist/components/modal.css +149 -138
  62. package/lib/semantic-ui/dist/components/modal.js +1637 -1209
  63. package/lib/semantic-ui/dist/components/modal.min.css +4 -4
  64. package/lib/semantic-ui/dist/components/modal.min.js +6 -6
  65. package/lib/semantic-ui/dist/components/popup.css +284 -277
  66. package/lib/semantic-ui/dist/components/popup.js +1561 -1541
  67. package/lib/semantic-ui/dist/components/popup.min.css +4 -4
  68. package/lib/semantic-ui/dist/components/popup.min.js +6 -6
  69. package/lib/semantic-ui/dist/components/reset.css +12 -17
  70. package/lib/semantic-ui/dist/components/reset.min.css +4 -4
  71. package/lib/semantic-ui/dist/components/search.css +99 -137
  72. package/lib/semantic-ui/dist/components/search.js +1641 -1565
  73. package/lib/semantic-ui/dist/components/search.min.css +4 -4
  74. package/lib/semantic-ui/dist/components/search.min.js +6 -6
  75. package/lib/semantic-ui/dist/components/segment.css +149 -275
  76. package/lib/semantic-ui/dist/components/segment.min.css +4 -4
  77. package/lib/semantic-ui/dist/components/site.css +40 -48
  78. package/lib/semantic-ui/dist/components/site.js +455 -493
  79. package/lib/semantic-ui/dist/components/site.min.css +4 -4
  80. package/lib/semantic-ui/dist/components/site.min.js +6 -6
  81. package/lib/semantic-ui/dist/components/tab.css +16 -20
  82. package/lib/semantic-ui/dist/components/tab.js +967 -1001
  83. package/lib/semantic-ui/dist/components/tab.min.css +4 -4
  84. package/lib/semantic-ui/dist/components/tab.min.js +6 -6
  85. package/lib/semantic-ui/dist/components/table.css +465 -424
  86. package/lib/semantic-ui/dist/components/table.min.css +4 -4
  87. package/lib/semantic-ui/dist/components/transition.css +264 -1282
  88. package/lib/semantic-ui/dist/components/transition.js +1034 -1109
  89. package/lib/semantic-ui/dist/components/transition.min.css +4 -4
  90. package/lib/semantic-ui/dist/components/transition.min.js +6 -6
  91. package/lib/semantic-ui/dist/semantic-packed.css +5619 -6592
  92. package/lib/semantic-ui/dist/semantic.css +8547 -11697
  93. package/lib/semantic-ui/dist/semantic.full.css +14698 -11227
  94. package/lib/semantic-ui/dist/semantic.full.min.css +6 -262
  95. package/lib/semantic-ui/dist/semantic.js +19428 -19253
  96. package/lib/semantic-ui/dist/semantic.min.css +128 -128
  97. package/lib/semantic-ui/dist/semantic.min.js +6 -6
  98. package/lib/semantic-ui/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
  99. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.woff2 +0 -0
  100. package/lib/semantic-ui/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  101. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.woff +0 -0
  102. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  103. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.woff +0 -0
  104. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.woff2 +0 -0
  105. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.woff +0 -0
  106. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  107. package/package.json +17 -7
  108. package/lib/semantic-ui/dist/components/shape.css +0 -160
  109. package/lib/semantic-ui/dist/components/shape.js +0 -848
  110. package/lib/semantic-ui/dist/components/shape.min.css +0 -9
  111. package/lib/semantic-ui/dist/components/shape.min.js +0 -11
  112. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.eot +0 -0
  113. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.svg +0 -450
  114. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.ttf +0 -0
  115. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
  116. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.svg +0 -3570
  117. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
  118. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.eot +0 -0
  119. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.svg +0 -4938
  120. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.ttf +0 -0
  121. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
  122. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.svg +0 -803
  123. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
  124. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons-local.ttf +0 -0
  125. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.svg +0 -200
  126. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.ttf +0 -0
  127. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.woff +0 -0
  128. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.eot +0 -0
  129. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.svg +0 -2373
  130. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.ttf +0 -0
  131. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.woff +0 -0
  132. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.woff2 +0 -0
  133. /package/lib/semantic-ui/dist/themes/{default → famfamfam}/assets/images/flags.png +0 -0
@@ -1,1109 +1,1034 @@
1
- /*!
2
- * # Fomantic-UI - Transition
3
- * http://github.com/fomantic/Fomantic-UI/
4
- *
5
- *
6
- * Released under the MIT license
7
- * http://opensource.org/licenses/MIT
8
- *
9
- */
10
-
11
- ;(function ($, window, document, undefined) {
12
-
13
- 'use strict';
14
-
15
- $.isFunction = $.isFunction || function(obj) {
16
- return typeof obj === "function" && typeof obj.nodeType !== "number";
17
- };
18
-
19
- window = (typeof window != 'undefined' && window.Math == Math)
20
- ? window
21
- : (typeof self != 'undefined' && self.Math == Math)
22
- ? self
23
- : Function('return this')()
24
- ;
25
-
26
- $.fn.transition = function() {
27
- var
28
- $allModules = $(this),
29
- moduleSelector = $allModules.selector || '',
30
-
31
- time = new Date().getTime(),
32
- performance = [],
33
-
34
- moduleArguments = arguments,
35
- query = moduleArguments[0],
36
- queryArguments = [].slice.call(arguments, 1),
37
- methodInvoked = (typeof query === 'string'),
38
-
39
- returnedValue
40
- ;
41
- $allModules
42
- .each(function(index) {
43
- var
44
- $module = $(this),
45
- element = this,
46
-
47
- // set at run time
48
- settings,
49
- instance,
50
-
51
- error,
52
- className,
53
- metadata,
54
- animationEnd,
55
-
56
- moduleNamespace,
57
- eventNamespace,
58
- module
59
- ;
60
-
61
- module = {
62
-
63
- initialize: function() {
64
-
65
- // get full settings
66
- settings = module.get.settings.apply(element, moduleArguments);
67
-
68
- // shorthand
69
- className = settings.className;
70
- error = settings.error;
71
- metadata = settings.metadata;
72
-
73
- // define namespace
74
- eventNamespace = '.' + settings.namespace;
75
- moduleNamespace = 'module-' + settings.namespace;
76
- instance = $module.data(moduleNamespace) || module;
77
-
78
- // get vendor specific events
79
- animationEnd = module.get.animationEndEvent();
80
-
81
- if(methodInvoked) {
82
- methodInvoked = module.invoke(query);
83
- }
84
-
85
- // method not invoked, lets run an animation
86
- if(methodInvoked === false) {
87
- module.verbose('Converted arguments into settings object', settings);
88
- if(settings.interval) {
89
- module.delay(settings.animate);
90
- }
91
- else {
92
- module.animate();
93
- }
94
- module.instantiate();
95
- }
96
- },
97
-
98
- instantiate: function() {
99
- module.verbose('Storing instance of module', module);
100
- instance = module;
101
- $module
102
- .data(moduleNamespace, instance)
103
- ;
104
- },
105
-
106
- destroy: function() {
107
- module.verbose('Destroying previous module for', element);
108
- $module
109
- .removeData(moduleNamespace)
110
- ;
111
- },
112
-
113
- refresh: function() {
114
- module.verbose('Refreshing display type on next animation');
115
- delete module.displayType;
116
- },
117
-
118
- forceRepaint: function() {
119
- module.verbose('Forcing element repaint');
120
- var
121
- $parentElement = $module.parent(),
122
- $nextElement = $module.next()
123
- ;
124
- if($nextElement.length === 0) {
125
- $module.detach().appendTo($parentElement);
126
- }
127
- else {
128
- $module.detach().insertBefore($nextElement);
129
- }
130
- },
131
-
132
- repaint: function() {
133
- module.verbose('Repainting element');
134
- var
135
- fakeAssignment = element.offsetWidth
136
- ;
137
- },
138
-
139
- delay: function(interval) {
140
- var
141
- direction = module.get.animationDirection(),
142
- shouldReverse,
143
- delay
144
- ;
145
- if(!direction) {
146
- direction = module.can.transition()
147
- ? module.get.direction()
148
- : 'static'
149
- ;
150
- }
151
- interval = (interval !== undefined)
152
- ? interval
153
- : settings.interval
154
- ;
155
- shouldReverse = (settings.reverse == 'auto' && direction == className.outward);
156
- delay = (shouldReverse || settings.reverse == true)
157
- ? ($allModules.length - index) * settings.interval
158
- : index * settings.interval
159
- ;
160
- module.debug('Delaying animation by', delay);
161
- setTimeout(module.animate, delay);
162
- },
163
-
164
- animate: function(overrideSettings) {
165
- settings = overrideSettings || settings;
166
- if(!module.is.supported()) {
167
- module.error(error.support);
168
- return false;
169
- }
170
- module.debug('Preparing animation', settings.animation);
171
- if(module.is.animating()) {
172
- if(settings.queue) {
173
- if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
174
- module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
175
- }
176
- else {
177
- module.queue(settings.animation);
178
- }
179
- return false;
180
- }
181
- else if(!settings.allowRepeats && module.is.occurring()) {
182
- module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
183
- return false;
184
- }
185
- else {
186
- module.debug('New animation started, completing previous early', settings.animation);
187
- instance.complete();
188
- }
189
- }
190
- if( module.can.animate() ) {
191
- module.set.animating(settings.animation);
192
- }
193
- else {
194
- module.error(error.noAnimation, settings.animation, element);
195
- }
196
- },
197
-
198
- reset: function() {
199
- module.debug('Resetting animation to beginning conditions');
200
- module.remove.animationCallbacks();
201
- module.restore.conditions();
202
- module.remove.animating();
203
- },
204
-
205
- queue: function(animation) {
206
- module.debug('Queueing animation of', animation);
207
- module.queuing = true;
208
- $module
209
- .one(animationEnd + '.queue' + eventNamespace, function() {
210
- module.queuing = false;
211
- module.repaint();
212
- module.animate.apply(this, settings);
213
- })
214
- ;
215
- },
216
-
217
- complete: function (event) {
218
- if(event && event.target === element) {
219
- event.stopPropagation();
220
- }
221
- module.debug('Animation complete', settings.animation);
222
- module.remove.completeCallback();
223
- module.remove.failSafe();
224
- if(!module.is.looping()) {
225
- if( module.is.outward() ) {
226
- module.verbose('Animation is outward, hiding element');
227
- module.restore.conditions();
228
- module.hide();
229
- }
230
- else if( module.is.inward() ) {
231
- module.verbose('Animation is outward, showing element');
232
- module.restore.conditions();
233
- module.show();
234
- }
235
- else {
236
- module.verbose('Static animation completed');
237
- module.restore.conditions();
238
- settings.onComplete.call(element);
239
- }
240
- }
241
- },
242
-
243
- force: {
244
- visible: function() {
245
- var
246
- style = $module.attr('style'),
247
- userStyle = module.get.userStyle(style),
248
- displayType = module.get.displayType(),
249
- overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
250
- inlineDisplay = $module[0].style.display,
251
- mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
252
- ;
253
- if (mustStayHidden){
254
- module.remove.transition();
255
- return false;
256
- }
257
- module.verbose('Overriding default display to show element', displayType);
258
- $module
259
- .attr('style', overrideStyle)
260
- ;
261
- return true;
262
- },
263
- hidden: function() {
264
- var
265
- style = $module.attr('style'),
266
- currentDisplay = $module.css('display'),
267
- emptyStyle = (style === undefined || style === '')
268
- ;
269
- if(currentDisplay !== 'none' && !module.is.hidden()) {
270
- module.verbose('Overriding default display to hide element');
271
- $module
272
- .css('display', 'none')
273
- ;
274
- }
275
- else if(emptyStyle) {
276
- $module
277
- .removeAttr('style')
278
- ;
279
- }
280
- }
281
- },
282
-
283
- has: {
284
- direction: function(animation) {
285
- var
286
- hasDirection = false
287
- ;
288
- animation = animation || settings.animation;
289
- if(typeof animation === 'string') {
290
- animation = animation.split(' ');
291
- $.each(animation, function(index, word){
292
- if(word === className.inward || word === className.outward) {
293
- hasDirection = true;
294
- }
295
- });
296
- }
297
- return hasDirection;
298
- },
299
- inlineDisplay: function() {
300
- var
301
- style = $module.attr('style') || ''
302
- ;
303
- return Array.isArray(style.match(/display.*?;/, ''));
304
- }
305
- },
306
-
307
- set: {
308
- animating: function(animation) {
309
- // remove previous callbacks
310
- module.remove.completeCallback();
311
-
312
- // determine exact animation
313
- animation = animation || settings.animation;
314
- var animationClass = module.get.animationClass(animation);
315
-
316
- // save animation class in cache to restore class names
317
- module.save.animation(animationClass);
318
-
319
- if(module.force.visible()) {
320
- module.remove.hidden();
321
- module.remove.direction();
322
-
323
- module.start.animation(animationClass);
324
- }
325
- },
326
- duration: function(animationName, duration) {
327
- duration = duration || settings.duration;
328
- duration = (typeof duration == 'number')
329
- ? duration + 'ms'
330
- : duration
331
- ;
332
- if(duration || duration === 0) {
333
- module.verbose('Setting animation duration', duration);
334
- $module
335
- .css({
336
- 'animation-duration': duration
337
- })
338
- ;
339
- }
340
- },
341
- direction: function(direction) {
342
- direction = direction || module.get.direction();
343
- if(direction == className.inward) {
344
- module.set.inward();
345
- }
346
- else {
347
- module.set.outward();
348
- }
349
- },
350
- looping: function() {
351
- module.debug('Transition set to loop');
352
- $module
353
- .addClass(className.looping)
354
- ;
355
- },
356
- hidden: function() {
357
- $module
358
- .addClass(className.transition)
359
- .addClass(className.hidden)
360
- ;
361
- },
362
- inward: function() {
363
- module.debug('Setting direction to inward');
364
- $module
365
- .removeClass(className.outward)
366
- .addClass(className.inward)
367
- ;
368
- },
369
- outward: function() {
370
- module.debug('Setting direction to outward');
371
- $module
372
- .removeClass(className.inward)
373
- .addClass(className.outward)
374
- ;
375
- },
376
- visible: function() {
377
- $module
378
- .addClass(className.transition)
379
- .addClass(className.visible)
380
- ;
381
- }
382
- },
383
-
384
- start: {
385
- animation: function(animationClass) {
386
- animationClass = animationClass || module.get.animationClass();
387
- module.debug('Starting tween', animationClass);
388
- $module
389
- .addClass(animationClass)
390
- .one(animationEnd + '.complete' + eventNamespace, module.complete)
391
- ;
392
- if(settings.useFailSafe) {
393
- module.add.failSafe();
394
- }
395
- module.set.duration(settings.duration);
396
- settings.onStart.call(element);
397
- }
398
- },
399
-
400
- save: {
401
- animation: function(animation) {
402
- if(!module.cache) {
403
- module.cache = {};
404
- }
405
- module.cache.animation = animation;
406
- },
407
- displayType: function(displayType) {
408
- if(displayType !== 'none') {
409
- $module.data(metadata.displayType, displayType);
410
- }
411
- },
412
- transitionExists: function(animation, exists) {
413
- $.fn.transition.exists[animation] = exists;
414
- module.verbose('Saving existence of transition', animation, exists);
415
- }
416
- },
417
-
418
- restore: {
419
- conditions: function() {
420
- var
421
- animation = module.get.currentAnimation()
422
- ;
423
- if(animation) {
424
- $module
425
- .removeClass(animation)
426
- ;
427
- module.verbose('Removing animation class', module.cache);
428
- }
429
- module.remove.duration();
430
- }
431
- },
432
-
433
- add: {
434
- failSafe: function() {
435
- var
436
- duration = module.get.duration()
437
- ;
438
- module.timer = setTimeout(function() {
439
- $module.triggerHandler(animationEnd);
440
- }, duration + settings.failSafeDelay);
441
- module.verbose('Adding fail safe timer', module.timer);
442
- }
443
- },
444
-
445
- remove: {
446
- animating: function() {
447
- $module.removeClass(className.animating);
448
- },
449
- animationCallbacks: function() {
450
- module.remove.queueCallback();
451
- module.remove.completeCallback();
452
- },
453
- queueCallback: function() {
454
- $module.off('.queue' + eventNamespace);
455
- },
456
- completeCallback: function() {
457
- $module.off('.complete' + eventNamespace);
458
- },
459
- display: function() {
460
- $module.css('display', '');
461
- },
462
- direction: function() {
463
- $module
464
- .removeClass(className.inward)
465
- .removeClass(className.outward)
466
- ;
467
- },
468
- duration: function() {
469
- $module
470
- .css('animation-duration', '')
471
- ;
472
- },
473
- failSafe: function() {
474
- module.verbose('Removing fail safe timer', module.timer);
475
- if(module.timer) {
476
- clearTimeout(module.timer);
477
- }
478
- },
479
- hidden: function() {
480
- $module.removeClass(className.hidden);
481
- },
482
- visible: function() {
483
- $module.removeClass(className.visible);
484
- },
485
- looping: function() {
486
- module.debug('Transitions are no longer looping');
487
- if( module.is.looping() ) {
488
- module.reset();
489
- $module
490
- .removeClass(className.looping)
491
- ;
492
- }
493
- },
494
- transition: function() {
495
- $module
496
- .removeClass(className.transition)
497
- .removeClass(className.visible)
498
- .removeClass(className.hidden)
499
- ;
500
- }
501
- },
502
- get: {
503
- settings: function(animation, duration, onComplete) {
504
- // single settings object
505
- if(typeof animation == 'object') {
506
- return $.extend(true, {}, $.fn.transition.settings, animation);
507
- }
508
- // all arguments provided
509
- else if(typeof onComplete == 'function') {
510
- return $.extend({}, $.fn.transition.settings, {
511
- animation : animation,
512
- onComplete : onComplete,
513
- duration : duration
514
- });
515
- }
516
- // only duration provided
517
- else if(typeof duration == 'string' || typeof duration == 'number') {
518
- return $.extend({}, $.fn.transition.settings, {
519
- animation : animation,
520
- duration : duration
521
- });
522
- }
523
- // duration is actually settings object
524
- else if(typeof duration == 'object') {
525
- return $.extend({}, $.fn.transition.settings, duration, {
526
- animation : animation
527
- });
528
- }
529
- // duration is actually callback
530
- else if(typeof duration == 'function') {
531
- return $.extend({}, $.fn.transition.settings, {
532
- animation : animation,
533
- onComplete : duration
534
- });
535
- }
536
- // only animation provided
537
- else {
538
- return $.extend({}, $.fn.transition.settings, {
539
- animation : animation
540
- });
541
- }
542
- },
543
- animationClass: function(animation) {
544
- var
545
- animationClass = animation || settings.animation,
546
- directionClass = (module.can.transition() && !module.has.direction())
547
- ? module.get.direction() + ' '
548
- : ''
549
- ;
550
- return className.animating + ' '
551
- + className.transition + ' '
552
- + directionClass
553
- + animationClass
554
- ;
555
- },
556
- currentAnimation: function() {
557
- return (module.cache && module.cache.animation !== undefined)
558
- ? module.cache.animation
559
- : false
560
- ;
561
- },
562
- currentDirection: function() {
563
- return module.is.inward()
564
- ? className.inward
565
- : className.outward
566
- ;
567
- },
568
- direction: function() {
569
- return module.is.hidden() || !module.is.visible()
570
- ? className.inward
571
- : className.outward
572
- ;
573
- },
574
- animationDirection: function(animation) {
575
- var
576
- direction
577
- ;
578
- animation = animation || settings.animation;
579
- if(typeof animation === 'string') {
580
- animation = animation.split(' ');
581
- // search animation name for out/in class
582
- $.each(animation, function(index, word){
583
- if(word === className.inward) {
584
- direction = className.inward;
585
- }
586
- else if(word === className.outward) {
587
- direction = className.outward;
588
- }
589
- });
590
- }
591
- // return found direction
592
- if(direction) {
593
- return direction;
594
- }
595
- return false;
596
- },
597
- duration: function(duration) {
598
- duration = duration || settings.duration;
599
- if(duration === false) {
600
- duration = $module.css('animation-duration') || 0;
601
- }
602
- return (typeof duration === 'string')
603
- ? (duration.indexOf('ms') > -1)
604
- ? parseFloat(duration)
605
- : parseFloat(duration) * 1000
606
- : duration
607
- ;
608
- },
609
- displayType: function(shouldDetermine) {
610
- shouldDetermine = (shouldDetermine !== undefined)
611
- ? shouldDetermine
612
- : true
613
- ;
614
- if(settings.displayType) {
615
- return settings.displayType;
616
- }
617
- if(shouldDetermine && $module.data(metadata.displayType) === undefined) {
618
- var currentDisplay = $module.css('display');
619
- if(currentDisplay === '' || currentDisplay === 'none'){
620
- // create fake element to determine display state
621
- module.can.transition(true);
622
- } else {
623
- module.save.displayType(currentDisplay);
624
- }
625
- }
626
- return $module.data(metadata.displayType);
627
- },
628
- userStyle: function(style) {
629
- style = style || $module.attr('style') || '';
630
- return style.replace(/display.*?;/, '');
631
- },
632
- transitionExists: function(animation) {
633
- return $.fn.transition.exists[animation];
634
- },
635
- animationStartEvent: function() {
636
- var
637
- element = document.createElement('div'),
638
- animations = {
639
- 'animation' :'animationstart',
640
- 'OAnimation' :'oAnimationStart',
641
- 'MozAnimation' :'mozAnimationStart',
642
- 'WebkitAnimation' :'webkitAnimationStart'
643
- },
644
- animation
645
- ;
646
- for(animation in animations){
647
- if( element.style[animation] !== undefined ){
648
- return animations[animation];
649
- }
650
- }
651
- return false;
652
- },
653
- animationEndEvent: function() {
654
- var
655
- element = document.createElement('div'),
656
- animations = {
657
- 'animation' :'animationend',
658
- 'OAnimation' :'oAnimationEnd',
659
- 'MozAnimation' :'mozAnimationEnd',
660
- 'WebkitAnimation' :'webkitAnimationEnd'
661
- },
662
- animation
663
- ;
664
- for(animation in animations){
665
- if( element.style[animation] !== undefined ){
666
- return animations[animation];
667
- }
668
- }
669
- return false;
670
- }
671
-
672
- },
673
-
674
- can: {
675
- transition: function(forced) {
676
- var
677
- animation = settings.animation,
678
- transitionExists = module.get.transitionExists(animation),
679
- displayType = module.get.displayType(false),
680
- elementClass,
681
- tagName,
682
- $clone,
683
- currentAnimation,
684
- inAnimation,
685
- directionExists
686
- ;
687
- if( transitionExists === undefined || forced) {
688
- module.verbose('Determining whether animation exists');
689
- elementClass = $module.attr('class');
690
- tagName = $module.prop('tagName');
691
-
692
- $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
693
- currentAnimation = $clone
694
- .addClass(animation)
695
- .removeClass(className.inward)
696
- .removeClass(className.outward)
697
- .addClass(className.animating)
698
- .addClass(className.transition)
699
- .css('animationName')
700
- ;
701
- inAnimation = $clone
702
- .addClass(className.inward)
703
- .css('animationName')
704
- ;
705
- if(!displayType) {
706
- displayType = $clone
707
- .attr('class', elementClass)
708
- .removeAttr('style')
709
- .removeClass(className.hidden)
710
- .removeClass(className.visible)
711
- .show()
712
- .css('display')
713
- ;
714
- module.verbose('Determining final display state', displayType);
715
- module.save.displayType(displayType);
716
- }
717
-
718
- $clone.remove();
719
- if(currentAnimation != inAnimation) {
720
- module.debug('Direction exists for animation', animation);
721
- directionExists = true;
722
- }
723
- else if(currentAnimation == 'none' || !currentAnimation) {
724
- module.debug('No animation defined in css', animation);
725
- return;
726
- }
727
- else {
728
- module.debug('Static animation found', animation, displayType);
729
- directionExists = false;
730
- }
731
- module.save.transitionExists(animation, directionExists);
732
- }
733
- return (transitionExists !== undefined)
734
- ? transitionExists
735
- : directionExists
736
- ;
737
- },
738
- animate: function() {
739
- // can transition does not return a value if animation does not exist
740
- return (module.can.transition() !== undefined);
741
- }
742
- },
743
-
744
- is: {
745
- animating: function() {
746
- return $module.hasClass(className.animating);
747
- },
748
- inward: function() {
749
- return $module.hasClass(className.inward);
750
- },
751
- outward: function() {
752
- return $module.hasClass(className.outward);
753
- },
754
- looping: function() {
755
- return $module.hasClass(className.looping);
756
- },
757
- occurring: function(animation) {
758
- animation = animation || settings.animation;
759
- animation = '.' + animation.replace(' ', '.');
760
- return ( $module.filter(animation).length > 0 );
761
- },
762
- visible: function() {
763
- return $module.is(':visible');
764
- },
765
- hidden: function() {
766
- return $module.css('visibility') === 'hidden';
767
- },
768
- supported: function() {
769
- return(animationEnd !== false);
770
- }
771
- },
772
-
773
- hide: function() {
774
- module.verbose('Hiding element');
775
- if( module.is.animating() ) {
776
- module.reset();
777
- }
778
- element.blur(); // IE will trigger focus change if element is not blurred before hiding
779
- module.remove.display();
780
- module.remove.visible();
781
- if($.isFunction(settings.onBeforeHide)){
782
- settings.onBeforeHide.call(element,function(){
783
- module.hideNow();
784
- });
785
- } else {
786
- module.hideNow();
787
- }
788
-
789
- },
790
-
791
- hideNow: function() {
792
- module.set.hidden();
793
- module.force.hidden();
794
- settings.onHide.call(element);
795
- settings.onComplete.call(element);
796
- // module.repaint();
797
- },
798
-
799
- show: function(display) {
800
- module.verbose('Showing element', display);
801
- if(module.force.visible()) {
802
- module.remove.hidden();
803
- module.set.visible();
804
- settings.onShow.call(element);
805
- settings.onComplete.call(element);
806
- // module.repaint();
807
- }
808
- },
809
-
810
- toggle: function() {
811
- if( module.is.visible() ) {
812
- module.hide();
813
- }
814
- else {
815
- module.show();
816
- }
817
- },
818
-
819
- stop: function() {
820
- module.debug('Stopping current animation');
821
- $module.triggerHandler(animationEnd);
822
- },
823
-
824
- stopAll: function() {
825
- module.debug('Stopping all animation');
826
- module.remove.queueCallback();
827
- $module.triggerHandler(animationEnd);
828
- },
829
-
830
- clear: {
831
- queue: function() {
832
- module.debug('Clearing animation queue');
833
- module.remove.queueCallback();
834
- }
835
- },
836
-
837
- enable: function() {
838
- module.verbose('Starting animation');
839
- $module.removeClass(className.disabled);
840
- },
841
-
842
- disable: function() {
843
- module.debug('Stopping animation');
844
- $module.addClass(className.disabled);
845
- },
846
-
847
- setting: function(name, value) {
848
- module.debug('Changing setting', name, value);
849
- if( $.isPlainObject(name) ) {
850
- $.extend(true, settings, name);
851
- }
852
- else if(value !== undefined) {
853
- if($.isPlainObject(settings[name])) {
854
- $.extend(true, settings[name], value);
855
- }
856
- else {
857
- settings[name] = value;
858
- }
859
- }
860
- else {
861
- return settings[name];
862
- }
863
- },
864
- internal: function(name, value) {
865
- if( $.isPlainObject(name) ) {
866
- $.extend(true, module, name);
867
- }
868
- else if(value !== undefined) {
869
- module[name] = value;
870
- }
871
- else {
872
- return module[name];
873
- }
874
- },
875
- debug: function() {
876
- if(!settings.silent && settings.debug) {
877
- if(settings.performance) {
878
- module.performance.log(arguments);
879
- }
880
- else {
881
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
882
- module.debug.apply(console, arguments);
883
- }
884
- }
885
- },
886
- verbose: function() {
887
- if(!settings.silent && settings.verbose && settings.debug) {
888
- if(settings.performance) {
889
- module.performance.log(arguments);
890
- }
891
- else {
892
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
893
- module.verbose.apply(console, arguments);
894
- }
895
- }
896
- },
897
- error: function() {
898
- if(!settings.silent) {
899
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
900
- module.error.apply(console, arguments);
901
- }
902
- },
903
- performance: {
904
- log: function(message) {
905
- var
906
- currentTime,
907
- executionTime,
908
- previousTime
909
- ;
910
- if(settings.performance) {
911
- currentTime = new Date().getTime();
912
- previousTime = time || currentTime;
913
- executionTime = currentTime - previousTime;
914
- time = currentTime;
915
- performance.push({
916
- 'Name' : message[0],
917
- 'Arguments' : [].slice.call(message, 1) || '',
918
- 'Element' : element,
919
- 'Execution Time' : executionTime
920
- });
921
- }
922
- clearTimeout(module.performance.timer);
923
- module.performance.timer = setTimeout(module.performance.display, 500);
924
- },
925
- display: function() {
926
- var
927
- title = settings.name + ':',
928
- totalTime = 0
929
- ;
930
- time = false;
931
- clearTimeout(module.performance.timer);
932
- $.each(performance, function(index, data) {
933
- totalTime += data['Execution Time'];
934
- });
935
- title += ' ' + totalTime + 'ms';
936
- if(moduleSelector) {
937
- title += ' \'' + moduleSelector + '\'';
938
- }
939
- if($allModules.length > 1) {
940
- title += ' ' + '(' + $allModules.length + ')';
941
- }
942
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
943
- console.groupCollapsed(title);
944
- if(console.table) {
945
- console.table(performance);
946
- }
947
- else {
948
- $.each(performance, function(index, data) {
949
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
950
- });
951
- }
952
- console.groupEnd();
953
- }
954
- performance = [];
955
- }
956
- },
957
- // modified for transition to return invoke success
958
- invoke: function(query, passedArguments, context) {
959
- var
960
- object = instance,
961
- maxDepth,
962
- found,
963
- response
964
- ;
965
- passedArguments = passedArguments || queryArguments;
966
- context = element || context;
967
- if(typeof query == 'string' && object !== undefined) {
968
- query = query.split(/[\. ]/);
969
- maxDepth = query.length - 1;
970
- $.each(query, function(depth, value) {
971
- var camelCaseValue = (depth != maxDepth)
972
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
973
- : query
974
- ;
975
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
976
- object = object[camelCaseValue];
977
- }
978
- else if( object[camelCaseValue] !== undefined ) {
979
- found = object[camelCaseValue];
980
- return false;
981
- }
982
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
983
- object = object[value];
984
- }
985
- else if( object[value] !== undefined ) {
986
- found = object[value];
987
- return false;
988
- }
989
- else {
990
- return false;
991
- }
992
- });
993
- }
994
- if ( $.isFunction( found ) ) {
995
- response = found.apply(context, passedArguments);
996
- }
997
- else if(found !== undefined) {
998
- response = found;
999
- }
1000
-
1001
- if(Array.isArray(returnedValue)) {
1002
- returnedValue.push(response);
1003
- }
1004
- else if(returnedValue !== undefined) {
1005
- returnedValue = [returnedValue, response];
1006
- }
1007
- else if(response !== undefined) {
1008
- returnedValue = response;
1009
- }
1010
- return (found !== undefined)
1011
- ? found
1012
- : false
1013
- ;
1014
- }
1015
- };
1016
- module.initialize();
1017
- })
1018
- ;
1019
- return (returnedValue !== undefined)
1020
- ? returnedValue
1021
- : this
1022
- ;
1023
- };
1024
-
1025
- // Records if CSS transition is available
1026
- $.fn.transition.exists = {};
1027
-
1028
- $.fn.transition.settings = {
1029
-
1030
- // module info
1031
- name : 'Transition',
1032
-
1033
- // hide all output from this component regardless of other settings
1034
- silent : false,
1035
-
1036
- // debug content outputted to console
1037
- debug : false,
1038
-
1039
- // verbose debug output
1040
- verbose : false,
1041
-
1042
- // performance data output
1043
- performance : true,
1044
-
1045
- // event namespace
1046
- namespace : 'transition',
1047
-
1048
- // delay between animations in group
1049
- interval : 0,
1050
-
1051
- // whether group animations should be reversed
1052
- reverse : 'auto',
1053
-
1054
- // animation callback event
1055
- onStart : function() {},
1056
- onComplete : function() {},
1057
- onShow : function() {},
1058
- onHide : function() {},
1059
-
1060
- // whether timeout should be used to ensure callback fires in cases animationend does not
1061
- useFailSafe : true,
1062
-
1063
- // delay in ms for fail safe
1064
- failSafeDelay : 100,
1065
-
1066
- // whether EXACT animation can occur twice in a row
1067
- allowRepeats : false,
1068
-
1069
- // Override final display type on visible
1070
- displayType : false,
1071
-
1072
- // animation duration
1073
- animation : 'fade',
1074
- duration : false,
1075
-
1076
- // new animations will occur after previous ones
1077
- queue : true,
1078
-
1079
- // whether initially inline hidden objects should be skipped for transition
1080
- skipInlineHidden: false,
1081
-
1082
- metadata : {
1083
- displayType: 'display'
1084
- },
1085
-
1086
- className : {
1087
- animating : 'animating',
1088
- disabled : 'disabled',
1089
- hidden : 'hidden',
1090
- inward : 'in',
1091
- loading : 'loading',
1092
- looping : 'looping',
1093
- outward : 'out',
1094
- transition : 'transition',
1095
- visible : 'visible'
1096
- },
1097
-
1098
- // possible errors
1099
- error: {
1100
- noAnimation : 'Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.',
1101
- repeated : 'That animation is already occurring, cancelling repeated animation',
1102
- method : 'The method you called is not defined',
1103
- support : 'This browser does not support CSS animations'
1104
- }
1105
-
1106
- };
1107
-
1108
-
1109
- })( jQuery, window, document );
1
+ /*!
2
+ * # Fomantic-UI 2.9.4 - Transition
3
+ * https://github.com/fomantic/Fomantic-UI/
4
+ *
5
+ *
6
+ * Released under the MIT license
7
+ * https://opensource.org/licenses/MIT
8
+ *
9
+ */
10
+
11
+ (function ($, window, document) {
12
+ 'use strict';
13
+
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
17
+
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
21
+
22
+ $.fn.transition = function () {
23
+ var
24
+ $allModules = $(this),
25
+
26
+ time = Date.now(),
27
+ performance = [],
28
+
29
+ moduleArguments = arguments,
30
+ query = moduleArguments[0],
31
+ queryArguments = [].slice.call(arguments, 1),
32
+ methodInvoked = typeof query === 'string',
33
+
34
+ returnedValue
35
+ ;
36
+ $allModules.each(function (index) {
37
+ var
38
+ $module = $(this),
39
+ element = this,
40
+
41
+ // set at run time
42
+ settings,
43
+ instance,
44
+
45
+ error,
46
+ className,
47
+ metadata,
48
+
49
+ moduleNamespace,
50
+ eventNamespace,
51
+ module
52
+ ;
53
+
54
+ module = {
55
+
56
+ initialize: function () {
57
+ // get full settings
58
+ settings = module.get.settings.apply(element, moduleArguments);
59
+
60
+ // shorthand
61
+ className = settings.className;
62
+ error = settings.error;
63
+ metadata = settings.metadata;
64
+
65
+ // define namespace
66
+ eventNamespace = '.' + settings.namespace;
67
+ moduleNamespace = 'module-' + settings.namespace;
68
+ instance = $module.data(moduleNamespace) || module;
69
+
70
+ if (methodInvoked) {
71
+ methodInvoked = module.invoke(query);
72
+ }
73
+
74
+ // method not invoked, lets run an animation
75
+ if (methodInvoked === false) {
76
+ module.verbose('Converted arguments into settings object', settings);
77
+ if (settings.interval) {
78
+ module.delay(settings.interval);
79
+ } else {
80
+ module.animate();
81
+ }
82
+ module.instantiate();
83
+ }
84
+ },
85
+
86
+ instantiate: function () {
87
+ module.verbose('Storing instance of module', module);
88
+ instance = module;
89
+ $module
90
+ .data(moduleNamespace, instance)
91
+ ;
92
+ },
93
+
94
+ destroy: function () {
95
+ module.verbose('Destroying previous module for', element);
96
+ $module
97
+ .removeData(moduleNamespace)
98
+ ;
99
+ },
100
+
101
+ refresh: function () {
102
+ module.verbose('Refreshing display type on next animation');
103
+ delete module.displayType;
104
+ },
105
+
106
+ forceRepaint: function () {
107
+ module.verbose('Forcing element repaint');
108
+ var
109
+ $parentElement = $module.parent(),
110
+ $nextElement = $module.next()
111
+ ;
112
+ if ($nextElement.length === 0) {
113
+ $module.detach().appendTo($parentElement);
114
+ } else {
115
+ $module.detach().insertBefore($nextElement);
116
+ }
117
+ },
118
+
119
+ repaint: function () {
120
+ module.verbose('Repainting element');
121
+ var
122
+ fakeAssignment = element.offsetWidth
123
+ ;
124
+ },
125
+
126
+ delay: function (interval) {
127
+ var
128
+ direction = module.get.animationDirection(),
129
+ shouldReverse,
130
+ delay
131
+ ;
132
+ if (!direction) {
133
+ direction = module.can.transition()
134
+ ? module.get.direction()
135
+ : 'static';
136
+ }
137
+ interval = interval !== undefined
138
+ ? interval
139
+ : settings.interval;
140
+ shouldReverse = settings.reverse === 'auto' && direction === className.outward;
141
+ delay = shouldReverse || settings.reverse === true
142
+ ? ($allModules.length - index) * interval
143
+ : index * interval;
144
+ module.debug('Delaying animation by', delay);
145
+ setTimeout(function () {
146
+ module.animate();
147
+ }, delay);
148
+ },
149
+
150
+ animate: function (overrideSettings) {
151
+ settings = overrideSettings || settings;
152
+
153
+ module.debug('Preparing animation', settings.animation);
154
+ if (module.is.animating()) {
155
+ if (settings.queue) {
156
+ if (!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
157
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
158
+ } else {
159
+ module.queue(settings.animation);
160
+ }
161
+
162
+ return false;
163
+ }
164
+ if (!settings.allowRepeats && module.is.occurring()) {
165
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
166
+
167
+ return false;
168
+ }
169
+
170
+ module.debug('New animation started, completing previous early', settings.animation);
171
+ instance.complete();
172
+ }
173
+ if (module.can.animate()) {
174
+ module.set.animating(settings.animation);
175
+ } else {
176
+ module.error(error.noAnimation, settings.animation, element);
177
+ }
178
+ },
179
+
180
+ reset: function () {
181
+ module.debug('Resetting animation to beginning conditions');
182
+ module.remove.animationCallbacks();
183
+ module.restore.conditions();
184
+ module.remove.animating();
185
+ },
186
+
187
+ queue: function (animation) {
188
+ module.debug('Queueing animation of', animation);
189
+ module.queuing = true;
190
+ $module
191
+ .one('animationend.queue' + eventNamespace, function () {
192
+ module.queuing = false;
193
+ module.repaint();
194
+ module.animate.apply(this, settings);
195
+ })
196
+ ;
197
+ },
198
+
199
+ complete: function (event) {
200
+ if (event && event.target === element) {
201
+ event.stopPropagation();
202
+ }
203
+ module.debug('Animation complete', settings.animation);
204
+ module.remove.completeCallback();
205
+ module.remove.failSafe();
206
+ if (!module.is.looping()) {
207
+ if (module.is.outward()) {
208
+ module.verbose('Animation is outward, hiding element');
209
+ module.restore.conditions();
210
+ module.hide();
211
+ } else if (module.is.inward()) {
212
+ module.verbose('Animation is inward, showing element');
213
+ module.restore.conditions();
214
+ module.show();
215
+ } else {
216
+ module.verbose('Static animation completed');
217
+ module.restore.conditions();
218
+ settings.onComplete.call(element);
219
+ }
220
+ }
221
+ },
222
+
223
+ force: {
224
+ visible: function () {
225
+ var
226
+ style = $module.attr('style'),
227
+ userStyle = module.get.userStyle(style),
228
+ displayType = module.get.displayType(),
229
+ overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
230
+ inlineDisplay = $module[0].style.display,
231
+ mustStayHidden = !displayType || (inlineDisplay === 'none' && settings.skipInlineHidden) || $module[0].tagName.match(/(script|link|style)/i)
232
+ ;
233
+ if (mustStayHidden) {
234
+ module.remove.transition();
235
+
236
+ return false;
237
+ }
238
+ module.verbose('Overriding default display to show element', displayType);
239
+ $module
240
+ .attr('style', overrideStyle)
241
+ ;
242
+
243
+ return true;
244
+ },
245
+ hidden: function () {
246
+ var
247
+ style = $module.attr('style'),
248
+ currentDisplay = $module.css('display'),
249
+ emptyStyle = style === undefined || style === ''
250
+ ;
251
+ if (currentDisplay !== 'none' && !module.is.hidden()) {
252
+ module.verbose('Overriding default display to hide element');
253
+ $module
254
+ .css('display', 'none')
255
+ ;
256
+ } else if (emptyStyle) {
257
+ $module
258
+ .removeAttr('style')
259
+ ;
260
+ }
261
+ },
262
+ },
263
+
264
+ has: {
265
+ direction: function (animation) {
266
+ var
267
+ hasDirection = false
268
+ ;
269
+ animation = animation || settings.animation;
270
+ if (typeof animation === 'string') {
271
+ animation = animation.split(' ');
272
+ $.each(animation, function (index, word) {
273
+ if (word === className.inward || word === className.outward) {
274
+ hasDirection = true;
275
+ }
276
+ });
277
+ }
278
+
279
+ return hasDirection;
280
+ },
281
+ inlineDisplay: function () {
282
+ var
283
+ style = $module.attr('style') || ''
284
+ ;
285
+
286
+ return Array.isArray(style.match(/display.*?;/, ''));
287
+ },
288
+ },
289
+
290
+ set: {
291
+ animating: function (animation) {
292
+ // remove previous callbacks
293
+ module.remove.completeCallback();
294
+
295
+ // determine exact animation
296
+ animation = animation || settings.animation;
297
+ var animationClass = module.get.animationClass(animation);
298
+
299
+ // save animation class in cache to restore class names
300
+ module.save.animation(animationClass);
301
+
302
+ if (module.force.visible()) {
303
+ module.remove.hidden();
304
+ module.remove.direction();
305
+
306
+ module.start.animation(animationClass);
307
+ }
308
+ },
309
+ duration: function (animationName, duration) {
310
+ duration = duration || settings.duration;
311
+ duration = typeof duration === 'number'
312
+ ? duration + 'ms'
313
+ : duration;
314
+ if (duration || duration === 0) {
315
+ module.verbose('Setting animation duration', duration);
316
+ $module
317
+ .css({
318
+ 'animation-duration': duration,
319
+ })
320
+ ;
321
+ }
322
+ },
323
+ direction: function (direction) {
324
+ direction = direction || module.get.direction();
325
+ if (direction === className.inward) {
326
+ module.set.inward();
327
+ } else {
328
+ module.set.outward();
329
+ }
330
+ },
331
+ looping: function () {
332
+ module.debug('Transition set to loop');
333
+ $module
334
+ .addClass(className.looping)
335
+ ;
336
+ },
337
+ hidden: function () {
338
+ $module
339
+ .addClass(className.transition)
340
+ .addClass(className.hidden)
341
+ ;
342
+ },
343
+ inward: function () {
344
+ module.debug('Setting direction to inward');
345
+ $module
346
+ .removeClass(className.outward)
347
+ .addClass(className.inward)
348
+ ;
349
+ },
350
+ outward: function () {
351
+ module.debug('Setting direction to outward');
352
+ $module
353
+ .removeClass(className.inward)
354
+ .addClass(className.outward)
355
+ ;
356
+ },
357
+ visible: function () {
358
+ $module
359
+ .addClass(className.transition)
360
+ .addClass(className.visible)
361
+ ;
362
+ },
363
+ },
364
+
365
+ start: {
366
+ animation: function (animationClass) {
367
+ animationClass = animationClass || module.get.animationClass();
368
+ module.debug('Starting tween', animationClass);
369
+ $module
370
+ .addClass(animationClass)
371
+ .one('animationend.complete' + eventNamespace, module.complete)
372
+ ;
373
+ if (settings.useFailSafe) {
374
+ module.add.failSafe();
375
+ }
376
+ module.set.duration(settings.duration);
377
+ settings.onStart.call(element);
378
+ },
379
+ },
380
+
381
+ save: {
382
+ animation: function (animation) {
383
+ if (!module.cache) {
384
+ module.cache = {};
385
+ }
386
+ module.cache.animation = animation;
387
+ },
388
+ displayType: function (displayType) {
389
+ if (displayType !== 'none') {
390
+ $module.data(metadata.displayType, displayType);
391
+ }
392
+ },
393
+ transitionExists: function (animation, exists) {
394
+ $.fn.transition.exists[animation] = exists;
395
+ module.verbose('Saving existence of transition', animation, exists);
396
+ },
397
+ },
398
+
399
+ restore: {
400
+ conditions: function () {
401
+ var
402
+ animation = module.get.currentAnimation()
403
+ ;
404
+ if (animation) {
405
+ $module
406
+ .removeClass(animation)
407
+ ;
408
+ module.verbose('Removing animation class', module.cache);
409
+ }
410
+ module.remove.duration();
411
+ },
412
+ },
413
+
414
+ add: {
415
+ failSafe: function () {
416
+ var
417
+ duration = module.get.duration()
418
+ ;
419
+ module.timer = setTimeout(function () {
420
+ $module.triggerHandler('animationend');
421
+ }, duration + settings.failSafeDelay);
422
+ module.verbose('Adding fail safe timer', module.timer);
423
+ },
424
+ },
425
+
426
+ remove: {
427
+ animating: function () {
428
+ $module.removeClass(className.animating);
429
+ },
430
+ animationCallbacks: function () {
431
+ module.remove.queueCallback();
432
+ module.remove.completeCallback();
433
+ },
434
+ queueCallback: function () {
435
+ $module.off('.queue' + eventNamespace);
436
+ },
437
+ completeCallback: function () {
438
+ $module.off('.complete' + eventNamespace);
439
+ },
440
+ display: function () {
441
+ $module.css('display', '');
442
+ },
443
+ direction: function () {
444
+ $module
445
+ .removeClass(className.inward)
446
+ .removeClass(className.outward)
447
+ ;
448
+ },
449
+ duration: function () {
450
+ $module
451
+ .css('animation-duration', '')
452
+ ;
453
+ },
454
+ failSafe: function () {
455
+ module.verbose('Removing fail safe timer', module.timer);
456
+ if (module.timer) {
457
+ clearTimeout(module.timer);
458
+ }
459
+ },
460
+ hidden: function () {
461
+ $module.removeClass(className.hidden);
462
+ },
463
+ visible: function () {
464
+ $module.removeClass(className.visible);
465
+ },
466
+ looping: function () {
467
+ module.debug('Transitions are no longer looping');
468
+ if (module.is.looping()) {
469
+ module.reset();
470
+ $module
471
+ .removeClass(className.looping)
472
+ ;
473
+ }
474
+ },
475
+ transition: function () {
476
+ $module
477
+ .removeClass(className.transition)
478
+ .removeClass(className.visible)
479
+ .removeClass(className.hidden)
480
+ ;
481
+ },
482
+ },
483
+ get: {
484
+ settings: function (animation, duration, onComplete) {
485
+ if (typeof animation === 'object') { // single settings object
486
+ return $.extend(true, {}, $.fn.transition.settings, animation);
487
+ }
488
+ if (typeof onComplete === 'function') { // all arguments provided
489
+ return $.extend({}, $.fn.transition.settings, {
490
+ animation: animation,
491
+ onComplete: onComplete,
492
+ duration: duration,
493
+ });
494
+ }
495
+ if (typeof duration === 'string' || typeof duration === 'number') { // only duration provided
496
+ return $.extend({}, $.fn.transition.settings, {
497
+ animation: animation,
498
+ duration: duration,
499
+ });
500
+ }
501
+ if (typeof duration === 'object') { // duration is actually settings object
502
+ return $.extend({}, $.fn.transition.settings, duration, {
503
+ animation: animation,
504
+ });
505
+ }
506
+ if (typeof duration === 'function') { // duration is actually callback
507
+ return $.extend({}, $.fn.transition.settings, {
508
+ animation: animation,
509
+ onComplete: duration,
510
+ });
511
+ }
512
+
513
+ // only animation provided
514
+ return $.extend({}, $.fn.transition.settings, {
515
+ animation: animation,
516
+ });
517
+ },
518
+ animationClass: function (animation) {
519
+ var
520
+ animationClass = animation || settings.animation,
521
+ directionClass = module.can.transition() && !module.has.direction()
522
+ ? module.get.direction() + ' '
523
+ : ''
524
+ ;
525
+
526
+ return className.animating + ' '
527
+ + className.transition + ' '
528
+ + directionClass
529
+ + animationClass;
530
+ },
531
+ currentAnimation: function () {
532
+ return module.cache && module.cache.animation !== undefined
533
+ ? module.cache.animation
534
+ : false;
535
+ },
536
+ currentDirection: function () {
537
+ return module.is.inward()
538
+ ? className.inward
539
+ : className.outward;
540
+ },
541
+ direction: function () {
542
+ return module.is.hidden() || !module.is.visible()
543
+ ? className.inward
544
+ : className.outward;
545
+ },
546
+ animationDirection: function (animation) {
547
+ var
548
+ direction
549
+ ;
550
+ animation = animation || settings.animation;
551
+ if (typeof animation === 'string') {
552
+ animation = animation.split(' ');
553
+ // search animation name for out/in class
554
+ $.each(animation, function (index, word) {
555
+ if (word === className.inward) {
556
+ direction = className.inward;
557
+ } else if (word === className.outward) {
558
+ direction = className.outward;
559
+ }
560
+ });
561
+ }
562
+ // return found direction
563
+ if (direction) {
564
+ return direction;
565
+ }
566
+
567
+ return false;
568
+ },
569
+ duration: function (duration) {
570
+ duration = duration || settings.duration;
571
+ if (duration === false) {
572
+ duration = $module.css('animation-duration') || 0;
573
+ }
574
+
575
+ return typeof duration === 'string'
576
+ ? (duration.indexOf('ms') > -1
577
+ ? parseFloat(duration)
578
+ : parseFloat(duration) * 1000)
579
+ : duration;
580
+ },
581
+ displayType: function (shouldDetermine) {
582
+ shouldDetermine = shouldDetermine !== undefined
583
+ ? shouldDetermine
584
+ : true;
585
+ if (settings.displayType) {
586
+ return settings.displayType;
587
+ }
588
+ if (shouldDetermine && $module.data(metadata.displayType) === undefined) {
589
+ var currentDisplay = $module.css('display');
590
+ if (currentDisplay === '' || currentDisplay === 'none') {
591
+ // create fake element to determine display state
592
+ module.can.transition(true);
593
+ } else {
594
+ module.save.displayType(currentDisplay);
595
+ }
596
+ }
597
+
598
+ return $module.data(metadata.displayType);
599
+ },
600
+ userStyle: function (style) {
601
+ style = style || $module.attr('style') || '';
602
+
603
+ return style.replace(/display.*?;/, '');
604
+ },
605
+ transitionExists: function (animation) {
606
+ return $.fn.transition.exists[animation];
607
+ },
608
+ },
609
+
610
+ can: {
611
+ transition: function (forced) {
612
+ var
613
+ animation = settings.animation,
614
+ transitionExists = module.get.transitionExists(animation),
615
+ displayType = module.get.displayType(false),
616
+ elementClass,
617
+ tagName,
618
+ $clone,
619
+ currentAnimation,
620
+ inAnimation,
621
+ directionExists
622
+ ;
623
+ if (transitionExists === undefined || forced) {
624
+ module.verbose('Determining whether animation exists');
625
+ elementClass = $module.attr('class');
626
+ tagName = $module.prop('tagName');
627
+
628
+ $clone = $('<' + tagName + ' />').addClass(elementClass).insertAfter($module);
629
+ currentAnimation = $clone
630
+ .addClass(animation)
631
+ .removeClass(className.inward)
632
+ .removeClass(className.outward)
633
+ .addClass(className.animating)
634
+ .addClass(className.transition)
635
+ .css('animationName')
636
+ ;
637
+ $clone.detach().insertAfter($module);
638
+ inAnimation = $clone
639
+ .addClass(className.inward)
640
+ .css('animationName')
641
+ ;
642
+ if (!displayType) {
643
+ $clone.detach().insertAfter($module);
644
+ displayType = $clone
645
+ .attr('class', elementClass)
646
+ .removeAttr('style')
647
+ .removeClass(className.hidden)
648
+ .removeClass(className.visible)
649
+ .show()
650
+ .css('display')
651
+ ;
652
+ module.verbose('Determining final display state', displayType);
653
+ module.save.displayType(displayType);
654
+ }
655
+
656
+ $clone.remove();
657
+ if (currentAnimation !== inAnimation) {
658
+ module.debug('Direction exists for animation', animation);
659
+ directionExists = true;
660
+ } else if (currentAnimation === 'none' || !currentAnimation) {
661
+ module.debug('No animation defined in css', animation);
662
+
663
+ return;
664
+ } else {
665
+ module.debug('Static animation found', animation, displayType);
666
+ directionExists = false;
667
+ }
668
+ module.save.transitionExists(animation, directionExists);
669
+ }
670
+
671
+ return transitionExists !== undefined
672
+ ? transitionExists
673
+ : directionExists;
674
+ },
675
+ animate: function () {
676
+ // can transition does not return a value if animation does not exist
677
+ return module.can.transition() !== undefined;
678
+ },
679
+ },
680
+
681
+ is: {
682
+ animating: function () {
683
+ return $module.hasClass(className.animating);
684
+ },
685
+ inward: function () {
686
+ return $module.hasClass(className.inward);
687
+ },
688
+ outward: function () {
689
+ return $module.hasClass(className.outward);
690
+ },
691
+ looping: function () {
692
+ return $module.hasClass(className.looping);
693
+ },
694
+ occurring: function (animation) {
695
+ animation = animation || settings.animation;
696
+ animation = '.' + animation.replace(' ', '.');
697
+
698
+ return $module.filter(animation).length > 0;
699
+ },
700
+ visible: function () {
701
+ return $module.is(':visible');
702
+ },
703
+ hidden: function () {
704
+ return $module.css('visibility') === 'hidden';
705
+ },
706
+ supported: function () {
707
+ // keep method for backward compatibility until 2.10.0
708
+ return true;
709
+ },
710
+ },
711
+
712
+ hide: function () {
713
+ if (settings.onHide.call(element) === false) {
714
+ module.verbose('Hide callback returned false cancelling hide');
715
+
716
+ return false;
717
+ }
718
+ module.verbose('Hiding element');
719
+ if (module.is.animating()) {
720
+ module.reset();
721
+ }
722
+ element.blur(); // IE will trigger focus change if element is not blurred before hiding
723
+ module.remove.display();
724
+ module.remove.visible();
725
+ settings.onBeforeHide.call(element, module.hideNow);
726
+ },
727
+
728
+ hideNow: function () {
729
+ module.set.hidden();
730
+ module.force.hidden();
731
+ settings.onHidden.call(element);
732
+ settings.onComplete.call(element);
733
+ },
734
+
735
+ show: function (display) {
736
+ if (module.force.visible() && settings.onShow.call(element) !== false) {
737
+ module.verbose('Showing element', display);
738
+ module.remove.hidden();
739
+ settings.onBeforeShow.call(element, module.showNow);
740
+ }
741
+ },
742
+
743
+ showNow: function () {
744
+ module.set.visible();
745
+ settings.onVisible.call(element);
746
+ settings.onComplete.call(element);
747
+ },
748
+
749
+ toggle: function () {
750
+ if (module.is.visible()) {
751
+ module.hide();
752
+ } else {
753
+ module.show();
754
+ }
755
+ },
756
+
757
+ stop: function () {
758
+ module.debug('Stopping current animation');
759
+ $module.triggerHandler('animationend');
760
+ },
761
+
762
+ stopAll: function () {
763
+ module.debug('Stopping all animation');
764
+ module.remove.queueCallback();
765
+ $module.triggerHandler('animationend');
766
+ },
767
+
768
+ clear: {
769
+ queue: function () {
770
+ module.debug('Clearing animation queue');
771
+ module.remove.queueCallback();
772
+ },
773
+ },
774
+
775
+ enable: function () {
776
+ module.verbose('Starting animation');
777
+ $module.removeClass(className.disabled);
778
+ },
779
+
780
+ disable: function () {
781
+ module.debug('Stopping animation');
782
+ $module.addClass(className.disabled);
783
+ },
784
+
785
+ setting: function (name, value) {
786
+ module.debug('Changing setting', name, value);
787
+ if ($.isPlainObject(name)) {
788
+ $.extend(true, settings, name);
789
+ } else if (value !== undefined) {
790
+ if ($.isPlainObject(settings[name])) {
791
+ $.extend(true, settings[name], value);
792
+ } else {
793
+ settings[name] = value;
794
+ }
795
+ } else {
796
+ return settings[name];
797
+ }
798
+ },
799
+ internal: function (name, value) {
800
+ if ($.isPlainObject(name)) {
801
+ $.extend(true, module, name);
802
+ } else if (value !== undefined) {
803
+ module[name] = value;
804
+ } else {
805
+ return module[name];
806
+ }
807
+ },
808
+ debug: function () {
809
+ if (!settings.silent && settings.debug) {
810
+ if (settings.performance) {
811
+ module.performance.log(arguments);
812
+ } else {
813
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
814
+ module.debug.apply(console, arguments);
815
+ }
816
+ }
817
+ },
818
+ verbose: function () {
819
+ if (!settings.silent && settings.verbose && settings.debug) {
820
+ if (settings.performance) {
821
+ module.performance.log(arguments);
822
+ } else {
823
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
824
+ module.verbose.apply(console, arguments);
825
+ }
826
+ }
827
+ },
828
+ error: function () {
829
+ if (!settings.silent) {
830
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
831
+ module.error.apply(console, arguments);
832
+ }
833
+ },
834
+ performance: {
835
+ log: function (message) {
836
+ var
837
+ currentTime,
838
+ executionTime,
839
+ previousTime
840
+ ;
841
+ if (settings.performance) {
842
+ currentTime = Date.now();
843
+ previousTime = time || currentTime;
844
+ executionTime = currentTime - previousTime;
845
+ time = currentTime;
846
+ performance.push({
847
+ Name: message[0],
848
+ Arguments: [].slice.call(message, 1) || '',
849
+ Element: element,
850
+ 'Execution Time': executionTime,
851
+ });
852
+ }
853
+ clearTimeout(module.performance.timer);
854
+ module.performance.timer = setTimeout(function () {
855
+ module.performance.display();
856
+ }, 500);
857
+ },
858
+ display: function () {
859
+ var
860
+ title = settings.name + ':',
861
+ totalTime = 0
862
+ ;
863
+ time = false;
864
+ clearTimeout(module.performance.timer);
865
+ $.each(performance, function (index, data) {
866
+ totalTime += data['Execution Time'];
867
+ });
868
+ title += ' ' + totalTime + 'ms';
869
+ if ($allModules.length > 1) {
870
+ title += ' (' + $allModules.length + ')';
871
+ }
872
+ if (performance.length > 0) {
873
+ console.groupCollapsed(title);
874
+ if (console.table) {
875
+ console.table(performance);
876
+ } else {
877
+ $.each(performance, function (index, data) {
878
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
879
+ });
880
+ }
881
+ console.groupEnd();
882
+ }
883
+ performance = [];
884
+ },
885
+ },
886
+ // modified for transition to return invoke success
887
+ invoke: function (query, passedArguments, context) {
888
+ var
889
+ object = instance,
890
+ maxDepth,
891
+ found,
892
+ response
893
+ ;
894
+ passedArguments = passedArguments || queryArguments;
895
+ context = context || element;
896
+ if (typeof query === 'string' && object !== undefined) {
897
+ query = query.split(/[ .]/);
898
+ maxDepth = query.length - 1;
899
+ $.each(query, function (depth, value) {
900
+ var camelCaseValue = depth !== maxDepth
901
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
902
+ : query;
903
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
904
+ object = object[camelCaseValue];
905
+ } else if (object[camelCaseValue] !== undefined) {
906
+ found = object[camelCaseValue];
907
+
908
+ return false;
909
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
910
+ object = object[value];
911
+ } else if (object[value] !== undefined) {
912
+ found = object[value];
913
+
914
+ return false;
915
+ } else {
916
+ return false;
917
+ }
918
+ });
919
+ }
920
+ if (isFunction(found)) {
921
+ response = found.apply(context, passedArguments);
922
+ } else if (found !== undefined) {
923
+ response = found;
924
+ }
925
+
926
+ if (Array.isArray(returnedValue)) {
927
+ returnedValue.push(response);
928
+ } else if (returnedValue !== undefined) {
929
+ returnedValue = [returnedValue, response];
930
+ } else if (response !== undefined) {
931
+ returnedValue = response;
932
+ }
933
+
934
+ return found !== undefined
935
+ ? found
936
+ : false;
937
+ },
938
+ };
939
+ module.initialize();
940
+ });
941
+
942
+ return returnedValue !== undefined
943
+ ? returnedValue
944
+ : this;
945
+ };
946
+
947
+ // Records if CSS transition is available
948
+ $.fn.transition.exists = {};
949
+
950
+ $.fn.transition.settings = {
951
+
952
+ // module info
953
+ name: 'Transition',
954
+
955
+ // hide all output from this component regardless of other settings
956
+ silent: false,
957
+
958
+ // debug content outputted to console
959
+ debug: false,
960
+
961
+ // verbose debug output
962
+ verbose: false,
963
+
964
+ // performance data output
965
+ performance: true,
966
+
967
+ // event namespace
968
+ namespace: 'transition',
969
+
970
+ // delay between animations in group
971
+ interval: 0,
972
+
973
+ // whether group animations should be reversed
974
+ reverse: 'auto',
975
+
976
+ // animation callback event
977
+ onStart: function () {},
978
+ onComplete: function () {},
979
+ onShow: function () {},
980
+ onBeforeShow: function (callback) {
981
+ callback.call(this);
982
+ },
983
+ onVisible: function () {},
984
+ onHide: function () {},
985
+ onHidden: function () {},
986
+ onBeforeHide: function (callback) {
987
+ callback.call(this);
988
+ },
989
+
990
+ // whether timeout should be used to ensure callback fires in cases animationend does not
991
+ useFailSafe: true,
992
+
993
+ // delay in ms for fail safe
994
+ failSafeDelay: 100,
995
+
996
+ // whether EXACT animation can occur twice in a row
997
+ allowRepeats: false,
998
+
999
+ // Override final display type on visible
1000
+ displayType: false,
1001
+
1002
+ // animation duration
1003
+ animation: 'fade',
1004
+ duration: false,
1005
+
1006
+ // new animations will occur after previous ones
1007
+ queue: true,
1008
+
1009
+ // whether initially inline hidden objects should be skipped for transition
1010
+ skipInlineHidden: false,
1011
+
1012
+ metadata: {
1013
+ displayType: 'display',
1014
+ },
1015
+
1016
+ className: {
1017
+ animating: 'animating',
1018
+ disabled: 'disabled',
1019
+ hidden: 'hidden',
1020
+ inward: 'in',
1021
+ loading: 'loading',
1022
+ looping: 'looping',
1023
+ outward: 'out',
1024
+ transition: 'transition',
1025
+ visible: 'visible',
1026
+ },
1027
+
1028
+ // possible errors
1029
+ error: {
1030
+ noAnimation: 'Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.',
1031
+ },
1032
+
1033
+ };
1034
+ })(jQuery, window, document);