@northdata/fomantic-ui 2.8.722 → 2.9.401

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 (157) 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 +5610 -6590
  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/lib/semantic-ui/types/fomantic-ui-accordion.d.ts +244 -0
  108. package/lib/semantic-ui/types/fomantic-ui-api.d.ts +561 -0
  109. package/lib/semantic-ui/types/fomantic-ui-calendar.d.ts +867 -0
  110. package/lib/semantic-ui/types/fomantic-ui-checkbox.d.ts +342 -0
  111. package/lib/semantic-ui/types/fomantic-ui-dimmer.d.ts +408 -0
  112. package/lib/semantic-ui/types/fomantic-ui-dropdown.d.ts +1221 -0
  113. package/lib/semantic-ui/types/fomantic-ui-embed.d.ts +343 -0
  114. package/lib/semantic-ui/types/fomantic-ui-flyout.d.ts +539 -0
  115. package/lib/semantic-ui/types/fomantic-ui-form.d.ts +759 -0
  116. package/lib/semantic-ui/types/fomantic-ui-modal.d.ts +567 -0
  117. package/lib/semantic-ui/types/fomantic-ui-nag.d.ts +270 -0
  118. package/lib/semantic-ui/types/fomantic-ui-popup.d.ts +549 -0
  119. package/lib/semantic-ui/types/fomantic-ui-progress.d.ts +465 -0
  120. package/lib/semantic-ui/types/fomantic-ui-rating.d.ts +187 -0
  121. package/lib/semantic-ui/types/fomantic-ui-search.d.ts +612 -0
  122. package/lib/semantic-ui/types/fomantic-ui-shape.d.ts +274 -0
  123. package/lib/semantic-ui/types/fomantic-ui-sidebar.d.ts +402 -0
  124. package/lib/semantic-ui/types/fomantic-ui-slider.d.ts +368 -0
  125. package/lib/semantic-ui/types/fomantic-ui-sticky.d.ts +215 -0
  126. package/lib/semantic-ui/types/fomantic-ui-tab.d.ts +361 -0
  127. package/lib/semantic-ui/types/fomantic-ui-toast.d.ts +526 -0
  128. package/lib/semantic-ui/types/fomantic-ui-transition.d.ts +389 -0
  129. package/lib/semantic-ui/types/fomantic-ui-visibility.d.ts +355 -0
  130. package/lib/semantic-ui/types/index.d.ts +63 -0
  131. package/package.json +19 -8
  132. package/lib/semantic-ui/dist/components/shape.css +0 -160
  133. package/lib/semantic-ui/dist/components/shape.js +0 -848
  134. package/lib/semantic-ui/dist/components/shape.min.css +0 -9
  135. package/lib/semantic-ui/dist/components/shape.min.js +0 -11
  136. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.eot +0 -0
  137. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.svg +0 -450
  138. package/lib/semantic-ui/dist/themes/basic/assets/fonts/icons.ttf +0 -0
  139. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.eot +0 -0
  140. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.svg +0 -3570
  141. package/lib/semantic-ui/dist/themes/default/assets/fonts/brand-icons.ttf +0 -0
  142. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.eot +0 -0
  143. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.svg +0 -4938
  144. package/lib/semantic-ui/dist/themes/default/assets/fonts/icons.ttf +0 -0
  145. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.eot +0 -0
  146. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.svg +0 -803
  147. package/lib/semantic-ui/dist/themes/default/assets/fonts/outline-icons.ttf +0 -0
  148. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons-local.ttf +0 -0
  149. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.svg +0 -200
  150. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.ttf +0 -0
  151. package/lib/semantic-ui/dist/themes/github/assets/fonts/octicons.woff +0 -0
  152. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.eot +0 -0
  153. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.svg +0 -2373
  154. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.ttf +0 -0
  155. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.woff +0 -0
  156. package/lib/semantic-ui/dist/themes/material/assets/fonts/icons.woff2 +0 -0
  157. /package/lib/semantic-ui/dist/themes/{default → famfamfam}/assets/images/flags.png +0 -0
@@ -1,848 +0,0 @@
1
- /*!
2
- * # Fomantic-UI - Shape
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.shape = function(parameters) {
27
- var
28
- $allModules = $(this),
29
-
30
- time = new Date().getTime(),
31
- performance = [],
32
-
33
- query = arguments[0],
34
- methodInvoked = (typeof query == 'string'),
35
- queryArguments = [].slice.call(arguments, 1),
36
-
37
- requestAnimationFrame = window.requestAnimationFrame
38
- || window.mozRequestAnimationFrame
39
- || window.webkitRequestAnimationFrame
40
- || window.msRequestAnimationFrame
41
- || function(callback) { setTimeout(callback, 0); },
42
-
43
- returnedValue
44
- ;
45
-
46
- $allModules
47
- .each(function() {
48
- var
49
- moduleSelector = $allModules.selector || '',
50
- settings = ( $.isPlainObject(parameters) )
51
- ? $.extend(true, {}, $.fn.shape.settings, parameters)
52
- : $.extend({}, $.fn.shape.settings),
53
-
54
- // internal aliases
55
- namespace = settings.namespace,
56
- selector = settings.selector,
57
- error = settings.error,
58
- className = settings.className,
59
-
60
- // define namespaces for modules
61
- eventNamespace = '.' + namespace,
62
- moduleNamespace = 'module-' + namespace,
63
-
64
- // selector cache
65
- $module = $(this),
66
- $sides = $module.find('>' + selector.sides),
67
- $side = $sides.find('>' + selector.side),
68
-
69
- // private variables
70
- nextIndex = false,
71
- $activeSide,
72
- $nextSide,
73
-
74
- // standard module
75
- element = this,
76
- instance = $module.data(moduleNamespace),
77
- module
78
- ;
79
-
80
- module = {
81
-
82
- initialize: function() {
83
- module.verbose('Initializing module for', element);
84
- module.set.defaultSide();
85
- module.instantiate();
86
- },
87
-
88
- instantiate: function() {
89
- module.verbose('Storing instance of module', module);
90
- instance = module;
91
- $module
92
- .data(moduleNamespace, instance)
93
- ;
94
- },
95
-
96
- destroy: function() {
97
- module.verbose('Destroying previous module for', element);
98
- $module
99
- .removeData(moduleNamespace)
100
- .off(eventNamespace)
101
- ;
102
- },
103
-
104
- refresh: function() {
105
- module.verbose('Refreshing selector cache for', element);
106
- $module = $(element);
107
- $sides = $(this).find(selector.sides);
108
- $side = $(this).find(selector.side);
109
- },
110
-
111
- repaint: function() {
112
- module.verbose('Forcing repaint event');
113
- var
114
- shape = $sides[0] || document.createElement('div'),
115
- fakeAssignment = shape.offsetWidth
116
- ;
117
- },
118
-
119
- animate: function(propertyObject, callback) {
120
- module.verbose('Animating box with properties', propertyObject);
121
- callback = callback || function(event) {
122
- module.verbose('Executing animation callback');
123
- if(event !== undefined) {
124
- event.stopPropagation();
125
- }
126
- module.reset();
127
- module.set.active();
128
- };
129
- settings.beforeChange.call($nextSide[0]);
130
- if(module.get.transitionEvent()) {
131
- module.verbose('Starting CSS animation');
132
- $module
133
- .addClass(className.animating)
134
- ;
135
- $sides
136
- .css(propertyObject)
137
- .one(module.get.transitionEvent(), callback)
138
- ;
139
- module.set.duration(settings.duration);
140
- requestAnimationFrame(function() {
141
- $module
142
- .addClass(className.animating)
143
- ;
144
- $activeSide
145
- .addClass(className.hidden)
146
- ;
147
- });
148
- }
149
- else {
150
- callback();
151
- }
152
- },
153
-
154
- queue: function(method) {
155
- module.debug('Queueing animation of', method);
156
- $sides
157
- .one(module.get.transitionEvent(), function() {
158
- module.debug('Executing queued animation');
159
- setTimeout(function(){
160
- $module.shape(method);
161
- }, 0);
162
- })
163
- ;
164
- },
165
-
166
- reset: function() {
167
- module.verbose('Animating states reset');
168
- $module
169
- .removeClass(className.animating)
170
- .attr('style', '')
171
- .removeAttr('style')
172
- ;
173
- // removeAttr style does not consistently work in safari
174
- $sides
175
- .attr('style', '')
176
- .removeAttr('style')
177
- ;
178
- $side
179
- .attr('style', '')
180
- .removeAttr('style')
181
- .removeClass(className.hidden)
182
- ;
183
- $nextSide
184
- .removeClass(className.animating)
185
- .attr('style', '')
186
- .removeAttr('style')
187
- ;
188
- },
189
-
190
- is: {
191
- complete: function() {
192
- return ($side.filter('.' + className.active)[0] == $nextSide[0]);
193
- },
194
- animating: function() {
195
- return $module.hasClass(className.animating);
196
- },
197
- hidden: function() {
198
- return $module.closest(':hidden').length > 0;
199
- }
200
- },
201
-
202
- set: {
203
-
204
- defaultSide: function() {
205
- $activeSide = $side.filter('.' + settings.className.active);
206
- $nextSide = ( $activeSide.next(selector.side).length > 0 )
207
- ? $activeSide.next(selector.side)
208
- : $side.first()
209
- ;
210
- nextIndex = false;
211
- module.verbose('Active side set to', $activeSide);
212
- module.verbose('Next side set to', $nextSide);
213
- },
214
-
215
- duration: function(duration) {
216
- duration = duration || settings.duration;
217
- duration = (typeof duration == 'number')
218
- ? duration + 'ms'
219
- : duration
220
- ;
221
- module.verbose('Setting animation duration', duration);
222
- if(settings.duration || settings.duration === 0) {
223
- $sides.add($side)
224
- .css({
225
- '-webkit-transition-duration': duration,
226
- '-moz-transition-duration': duration,
227
- '-ms-transition-duration': duration,
228
- '-o-transition-duration': duration,
229
- 'transition-duration': duration
230
- })
231
- ;
232
- }
233
- },
234
-
235
- currentStageSize: function() {
236
- var
237
- $activeSide = $side.filter('.' + settings.className.active),
238
- width = $activeSide.outerWidth(true),
239
- height = $activeSide.outerHeight(true)
240
- ;
241
- $module
242
- .css({
243
- width: width,
244
- height: height
245
- })
246
- ;
247
- },
248
-
249
- stageSize: function() {
250
- var
251
- $clone = $module.clone().addClass(className.loading),
252
- $side = $clone.find('>' + selector.sides + '>' + selector.side),
253
- $activeSide = $side.filter('.' + settings.className.active),
254
- $nextSide = (nextIndex)
255
- ? $side.eq(nextIndex)
256
- : ( $activeSide.next(selector.side).length > 0 )
257
- ? $activeSide.next(selector.side)
258
- : $side.first(),
259
- newWidth = (settings.width === 'next')
260
- ? $nextSide.outerWidth(true)
261
- : (settings.width === 'initial')
262
- ? $module.width()
263
- : settings.width,
264
- newHeight = (settings.height === 'next')
265
- ? $nextSide.outerHeight(true)
266
- : (settings.height === 'initial')
267
- ? $module.height()
268
- : settings.height
269
- ;
270
- $activeSide.removeClass(className.active);
271
- $nextSide.addClass(className.active);
272
- $clone.insertAfter($module);
273
- $clone.remove();
274
- if(settings.width !== 'auto') {
275
- $module.css('width', newWidth + settings.jitter);
276
- module.verbose('Specifying width during animation', newWidth);
277
- }
278
- if(settings.height !== 'auto') {
279
- $module.css('height', newHeight + settings.jitter);
280
- module.verbose('Specifying height during animation', newHeight);
281
- }
282
- },
283
-
284
- nextSide: function(selector) {
285
- nextIndex = selector;
286
- $nextSide = $side.filter(selector);
287
- nextIndex = $side.index($nextSide);
288
- if($nextSide.length === 0) {
289
- module.set.defaultSide();
290
- module.error(error.side);
291
- }
292
- module.verbose('Next side manually set to', $nextSide);
293
- },
294
-
295
- active: function() {
296
- module.verbose('Setting new side to active', $nextSide);
297
- $side
298
- .removeClass(className.active)
299
- ;
300
- $nextSide
301
- .addClass(className.active)
302
- ;
303
- settings.onChange.call($nextSide[0]);
304
- module.set.defaultSide();
305
- }
306
- },
307
-
308
- flip: {
309
- to: function(type,stage){
310
- if(module.is.hidden()) {
311
- module.debug('Module not visible', $nextSide);
312
- return;
313
- }
314
- if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
315
- module.debug('Side already visible', $nextSide);
316
- return;
317
- }
318
- var
319
- transform = module.get.transform[type]()
320
- ;
321
- if( !module.is.animating()) {
322
- module.debug('Flipping '+type, $nextSide);
323
- module.set.stageSize();
324
- module.stage[stage]();
325
- module.animate(transform);
326
- }
327
- else {
328
- module.queue('flip '+type);
329
- }
330
- },
331
-
332
- up: function() {
333
- module.flip.to('up','above');
334
- },
335
-
336
- down: function() {
337
- module.flip.to('down','below');
338
- },
339
-
340
- left: function() {
341
- module.flip.to('left','left');
342
- },
343
-
344
- right: function() {
345
- module.flip.to('right','right');
346
- },
347
-
348
- over: function() {
349
- module.flip.to('over','behind');
350
- },
351
-
352
- back: function() {
353
- module.flip.to('back','behind');
354
- }
355
-
356
- },
357
-
358
- get: {
359
-
360
- transform: {
361
- up: function() {
362
- var
363
- translateZ = $activeSide.outerHeight(true) / 2,
364
- translateY = $nextSide.outerHeight(true) - translateZ
365
- ;
366
- return {
367
- transform: 'translateY(' + translateY + 'px) translateZ(-'+ translateZ + 'px) rotateX(-90deg)'
368
- };
369
- },
370
-
371
- down: function() {
372
- var
373
- translate = {
374
- z: $activeSide.outerHeight(true) / 2
375
- }
376
- ;
377
- return {
378
- transform: 'translateY(-' + translate.z + 'px) translateZ(-'+ translate.z + 'px) rotateX(90deg)'
379
- };
380
- },
381
-
382
- left: function() {
383
- var
384
- translateZ = $activeSide.outerWidth(true) / 2,
385
- translateX = $nextSide.outerWidth(true) - translateZ
386
- ;
387
- return {
388
- transform: 'translateX(' + translateX + 'px) translateZ(-' + translateZ + 'px) rotateY(90deg)'
389
- };
390
- },
391
-
392
- right: function() {
393
- var
394
- translate = {
395
- z : $activeSide.outerWidth(true) / 2
396
- }
397
- ;
398
- return {
399
- transform: 'translateX(-' + translate.z + 'px) translateZ(-' + translate.z + 'px) rotateY(-90deg)'
400
- };
401
- },
402
-
403
- over: function() {
404
- var
405
- translate = {
406
- x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
407
- }
408
- ;
409
- return {
410
- transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
411
- };
412
- },
413
-
414
- back: function() {
415
- var
416
- translate = {
417
- x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
418
- }
419
- ;
420
- return {
421
- transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
422
- };
423
- }
424
- },
425
-
426
- transitionEvent: function() {
427
- var
428
- element = document.createElement('element'),
429
- transitions = {
430
- 'transition' :'transitionend',
431
- 'OTransition' :'oTransitionEnd',
432
- 'MozTransition' :'transitionend',
433
- 'WebkitTransition' :'webkitTransitionEnd'
434
- },
435
- transition
436
- ;
437
- for(transition in transitions){
438
- if( element.style[transition] !== undefined ){
439
- return transitions[transition];
440
- }
441
- }
442
- },
443
-
444
- nextSide: function() {
445
- return ( $activeSide.next(selector.side).length > 0 )
446
- ? $activeSide.next(selector.side)
447
- : $side.first()
448
- ;
449
- }
450
-
451
- },
452
-
453
- stage: {
454
-
455
- above: function() {
456
- var
457
- box = {
458
- origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
459
- depth : {
460
- active : ($nextSide.outerHeight(true) / 2),
461
- next : ($activeSide.outerHeight(true) / 2)
462
- }
463
- }
464
- ;
465
- module.verbose('Setting the initial animation position as above', $nextSide, box);
466
- $activeSide
467
- .css({
468
- 'transform' : 'rotateX(0deg)'
469
- })
470
- ;
471
- $nextSide
472
- .addClass(className.animating)
473
- .css({
474
- 'top' : box.origin + 'px',
475
- 'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px) translateY(-' + box.depth.active + 'px)'
476
- })
477
- ;
478
- },
479
-
480
- below: function() {
481
- var
482
- box = {
483
- origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
484
- depth : {
485
- active : ($nextSide.outerHeight(true) / 2),
486
- next : ($activeSide.outerHeight(true) / 2)
487
- }
488
- }
489
- ;
490
- module.verbose('Setting the initial animation position as below', $nextSide, box);
491
- $activeSide
492
- .css({
493
- 'transform' : 'rotateX(0deg)'
494
- })
495
- ;
496
- $nextSide
497
- .addClass(className.animating)
498
- .css({
499
- 'top' : box.origin + 'px',
500
- 'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px) translateY(' + box.depth.active + 'px)'
501
- })
502
- ;
503
- },
504
-
505
- left: function() {
506
- var
507
- height = {
508
- active : $activeSide.outerWidth(true),
509
- next : $nextSide.outerWidth(true)
510
- },
511
- box = {
512
- origin : ( ( height.active - height.next ) / 2),
513
- depth : {
514
- active : (height.next / 2),
515
- next : (height.active / 2)
516
- }
517
- }
518
- ;
519
- module.verbose('Setting the initial animation position as left', $nextSide, box);
520
- $activeSide
521
- .css({
522
- 'transform' : 'rotateY(0deg)'
523
- })
524
- ;
525
- $nextSide
526
- .addClass(className.animating)
527
- .css({
528
- 'left' : box.origin + 'px',
529
- 'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px) translateX(-' + box.depth.active + 'px)'
530
- })
531
- ;
532
- },
533
-
534
- right: function() {
535
- var
536
- height = {
537
- active : $activeSide.outerWidth(true),
538
- next : $nextSide.outerWidth(true)
539
- },
540
- box = {
541
- origin : ( ( height.active - height.next ) / 2),
542
- depth : {
543
- active : (height.next / 2),
544
- next : (height.active / 2)
545
- }
546
- }
547
- ;
548
- module.verbose('Setting the initial animation position as right', $nextSide, box);
549
- $activeSide
550
- .css({
551
- 'transform' : 'rotateY(0deg)'
552
- })
553
- ;
554
- $nextSide
555
- .addClass(className.animating)
556
- .css({
557
- 'left' : box.origin + 'px',
558
- 'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px) translateX(' + box.depth.active + 'px)'
559
- })
560
- ;
561
- },
562
-
563
- behind: function() {
564
- var
565
- height = {
566
- active : $activeSide.outerWidth(true),
567
- next : $nextSide.outerWidth(true)
568
- },
569
- box = {
570
- origin : ( ( height.active - height.next ) / 2),
571
- depth : {
572
- active : (height.next / 2),
573
- next : (height.active / 2)
574
- }
575
- }
576
- ;
577
- module.verbose('Setting the initial animation position as behind', $nextSide, box);
578
- $activeSide
579
- .css({
580
- 'transform' : 'rotateY(0deg)'
581
- })
582
- ;
583
- $nextSide
584
- .addClass(className.animating)
585
- .css({
586
- 'left' : box.origin + 'px',
587
- 'transform' : 'rotateY(-180deg)'
588
- })
589
- ;
590
- }
591
- },
592
- setting: function(name, value) {
593
- module.debug('Changing setting', name, value);
594
- if( $.isPlainObject(name) ) {
595
- $.extend(true, settings, name);
596
- }
597
- else if(value !== undefined) {
598
- if($.isPlainObject(settings[name])) {
599
- $.extend(true, settings[name], value);
600
- }
601
- else {
602
- settings[name] = value;
603
- }
604
- }
605
- else {
606
- return settings[name];
607
- }
608
- },
609
- internal: function(name, value) {
610
- if( $.isPlainObject(name) ) {
611
- $.extend(true, module, name);
612
- }
613
- else if(value !== undefined) {
614
- module[name] = value;
615
- }
616
- else {
617
- return module[name];
618
- }
619
- },
620
- debug: function() {
621
- if(!settings.silent && settings.debug) {
622
- if(settings.performance) {
623
- module.performance.log(arguments);
624
- }
625
- else {
626
- module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
627
- module.debug.apply(console, arguments);
628
- }
629
- }
630
- },
631
- verbose: function() {
632
- if(!settings.silent && settings.verbose && settings.debug) {
633
- if(settings.performance) {
634
- module.performance.log(arguments);
635
- }
636
- else {
637
- module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
638
- module.verbose.apply(console, arguments);
639
- }
640
- }
641
- },
642
- error: function() {
643
- if(!settings.silent) {
644
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
645
- module.error.apply(console, arguments);
646
- }
647
- },
648
- performance: {
649
- log: function(message) {
650
- var
651
- currentTime,
652
- executionTime,
653
- previousTime
654
- ;
655
- if(settings.performance) {
656
- currentTime = new Date().getTime();
657
- previousTime = time || currentTime;
658
- executionTime = currentTime - previousTime;
659
- time = currentTime;
660
- performance.push({
661
- 'Name' : message[0],
662
- 'Arguments' : [].slice.call(message, 1) || '',
663
- 'Element' : element,
664
- 'Execution Time' : executionTime
665
- });
666
- }
667
- clearTimeout(module.performance.timer);
668
- module.performance.timer = setTimeout(module.performance.display, 500);
669
- },
670
- display: function() {
671
- var
672
- title = settings.name + ':',
673
- totalTime = 0
674
- ;
675
- time = false;
676
- clearTimeout(module.performance.timer);
677
- $.each(performance, function(index, data) {
678
- totalTime += data['Execution Time'];
679
- });
680
- title += ' ' + totalTime + 'ms';
681
- if(moduleSelector) {
682
- title += ' \'' + moduleSelector + '\'';
683
- }
684
- if($allModules.length > 1) {
685
- title += ' ' + '(' + $allModules.length + ')';
686
- }
687
- if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
688
- console.groupCollapsed(title);
689
- if(console.table) {
690
- console.table(performance);
691
- }
692
- else {
693
- $.each(performance, function(index, data) {
694
- console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
695
- });
696
- }
697
- console.groupEnd();
698
- }
699
- performance = [];
700
- }
701
- },
702
- invoke: function(query, passedArguments, context) {
703
- var
704
- object = instance,
705
- maxDepth,
706
- found,
707
- response
708
- ;
709
- passedArguments = passedArguments || queryArguments;
710
- context = element || context;
711
- if(typeof query == 'string' && object !== undefined) {
712
- query = query.split(/[\. ]/);
713
- maxDepth = query.length - 1;
714
- $.each(query, function(depth, value) {
715
- var camelCaseValue = (depth != maxDepth)
716
- ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
717
- : query
718
- ;
719
- if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
720
- object = object[camelCaseValue];
721
- }
722
- else if( object[camelCaseValue] !== undefined ) {
723
- found = object[camelCaseValue];
724
- return false;
725
- }
726
- else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
727
- object = object[value];
728
- }
729
- else if( object[value] !== undefined ) {
730
- found = object[value];
731
- return false;
732
- }
733
- else {
734
- return false;
735
- }
736
- });
737
- }
738
- if ( $.isFunction( found ) ) {
739
- response = found.apply(context, passedArguments);
740
- }
741
- else if(found !== undefined) {
742
- response = found;
743
- }
744
- if(Array.isArray(returnedValue)) {
745
- returnedValue.push(response);
746
- }
747
- else if(returnedValue !== undefined) {
748
- returnedValue = [returnedValue, response];
749
- }
750
- else if(response !== undefined) {
751
- returnedValue = response;
752
- }
753
- return found;
754
- }
755
- };
756
-
757
- if(methodInvoked) {
758
- if(instance === undefined) {
759
- module.initialize();
760
- }
761
- var $inputs = $module.find('input');
762
- if( $inputs.length > 0) {
763
- $inputs.blur();
764
- setTimeout(function(){
765
- module.invoke(query);
766
- }, 150);
767
- } else {
768
- module.invoke(query);
769
- }
770
- }
771
- else {
772
- if(instance !== undefined) {
773
- instance.invoke('destroy');
774
- }
775
- module.initialize();
776
- }
777
- })
778
- ;
779
-
780
- return (returnedValue !== undefined)
781
- ? returnedValue
782
- : this
783
- ;
784
- };
785
-
786
- $.fn.shape.settings = {
787
-
788
- // module info
789
- name : 'Shape',
790
-
791
- // hide all debug content
792
- silent : false,
793
-
794
- // debug content outputted to console
795
- debug : false,
796
-
797
- // verbose debug output
798
- verbose : false,
799
-
800
- // fudge factor in pixels when swapping from 2d to 3d (can be useful to correct rounding errors)
801
- jitter : 0,
802
-
803
- // performance data output
804
- performance: true,
805
-
806
- // event namespace
807
- namespace : 'shape',
808
-
809
- // width during animation, can be set to 'auto', initial', 'next' or pixel amount
810
- width: 'initial',
811
-
812
- // height during animation, can be set to 'auto', 'initial', 'next' or pixel amount
813
- height: 'initial',
814
-
815
- // callback occurs on side change
816
- beforeChange : function() {},
817
- onChange : function() {},
818
-
819
- // allow animation to same side
820
- allowRepeats: false,
821
-
822
- // animation duration
823
- duration : false,
824
-
825
- // possible errors
826
- error: {
827
- side : 'You tried to switch to a side that does not exist.',
828
- method : 'The method you called is not defined'
829
- },
830
-
831
- // classnames used
832
- className : {
833
- animating : 'animating',
834
- hidden : 'hidden',
835
- loading : 'loading',
836
- active : 'active'
837
- },
838
-
839
- // selectors used
840
- selector : {
841
- sides : '.sides',
842
- side : '.side'
843
- }
844
-
845
- };
846
-
847
-
848
- })( jQuery, window, document );