fomantic-ui-sass 2.9.1 → 2.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/app/assets/fonts/semantic-ui/Lato-Bold.woff +0 -0
  4. data/app/assets/fonts/semantic-ui/Lato-Bold.woff2 +0 -0
  5. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff +0 -0
  6. data/app/assets/fonts/semantic-ui/Lato-BoldItalic.woff2 +0 -0
  7. data/app/assets/fonts/semantic-ui/Lato-Italic.woff +0 -0
  8. data/app/assets/fonts/semantic-ui/Lato-Italic.woff2 +0 -0
  9. data/app/assets/fonts/semantic-ui/Lato-Regular.woff +0 -0
  10. data/app/assets/fonts/semantic-ui/Lato-Regular.woff2 +0 -0
  11. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff +0 -0
  12. data/app/assets/fonts/semantic-ui/LatoLatin-Bold.woff2 +0 -0
  13. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff +0 -0
  14. data/app/assets/fonts/semantic-ui/LatoLatin-BoldItalic.woff2 +0 -0
  15. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff +0 -0
  16. data/app/assets/fonts/semantic-ui/LatoLatin-Italic.woff2 +0 -0
  17. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff +0 -0
  18. data/app/assets/fonts/semantic-ui/LatoLatin-Regular.woff2 +0 -0
  19. data/app/assets/javascripts/semantic-ui/accordion.js +4 -8
  20. data/app/assets/javascripts/semantic-ui/api.js +22 -15
  21. data/app/assets/javascripts/semantic-ui/calendar.js +1 -6
  22. data/app/assets/javascripts/semantic-ui/checkbox.js +4 -6
  23. data/app/assets/javascripts/semantic-ui/dimmer.js +3 -7
  24. data/app/assets/javascripts/semantic-ui/dropdown.js +58 -35
  25. data/app/assets/javascripts/semantic-ui/embed.js +2 -7
  26. data/app/assets/javascripts/semantic-ui/flyout.js +56 -86
  27. data/app/assets/javascripts/semantic-ui/form.js +216 -157
  28. data/app/assets/javascripts/semantic-ui/modal.js +58 -39
  29. data/app/assets/javascripts/semantic-ui/nag.js +17 -9
  30. data/app/assets/javascripts/semantic-ui/popup.js +46 -26
  31. data/app/assets/javascripts/semantic-ui/progress.js +3 -34
  32. data/app/assets/javascripts/semantic-ui/rating.js +1 -5
  33. data/app/assets/javascripts/semantic-ui/search.js +5 -8
  34. data/app/assets/javascripts/semantic-ui/shape.js +15 -41
  35. data/app/assets/javascripts/semantic-ui/sidebar.js +21 -64
  36. data/app/assets/javascripts/semantic-ui/site.js +1 -1
  37. data/app/assets/javascripts/semantic-ui/slider.js +130 -34
  38. data/app/assets/javascripts/semantic-ui/state.js +23 -20
  39. data/app/assets/javascripts/semantic-ui/sticky.js +17 -16
  40. data/app/assets/javascripts/semantic-ui/tab.js +18 -8
  41. data/app/assets/javascripts/semantic-ui/toast.js +19 -11
  42. data/app/assets/javascripts/semantic-ui/transition.js +11 -66
  43. data/app/assets/javascripts/semantic-ui/visibility.js +15 -6
  44. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
  45. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +118 -56
  46. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +113 -107
  47. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +39 -9
  48. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +1 -1
  49. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +66 -2
  50. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +2 -2
  51. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +62 -1
  52. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
  53. data/app/assets/stylesheets/semantic-ui/elements/_emoji.scss +698 -250
  54. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +3 -2
  55. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +1 -1
  56. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +62 -62
  57. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
  58. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +61 -51
  59. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +21 -2
  60. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +13 -13
  61. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +282 -282
  62. data/app/assets/stylesheets/semantic-ui/elements/_placeholder.scss +1 -1
  63. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
  64. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +1 -1
  65. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +186 -37
  66. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +4 -4
  67. data/app/assets/stylesheets/semantic-ui/elements/_text.scss +2 -2
  68. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -1
  69. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +1 -10
  70. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +1 -1
  71. data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +145 -8
  72. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +89 -45
  73. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +3 -3
  74. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +126 -31
  75. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +2 -2
  76. data/app/assets/stylesheets/semantic-ui/modules/_flyout.scss +1 -1
  77. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +10 -3
  78. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
  79. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +188 -42
  80. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +1 -1
  81. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +1 -1
  82. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +26 -1
  83. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
  84. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +1 -1
  85. data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +9 -6
  86. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
  87. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -1
  88. data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +6 -1
  89. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
  90. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +1 -1
  91. data/app/assets/stylesheets/semantic-ui/views/_card.scss +1 -1
  92. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +6 -1
  93. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +486 -5
  94. data/app/assets/stylesheets/semantic-ui/views/_item.scss +7 -2
  95. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
  96. data/lib/fomantic/ui/sass/version.rb +2 -2
  97. metadata +1 -1
@@ -24,14 +24,25 @@
24
24
  $allModules = $(this),
25
25
  $document = $(document),
26
26
 
27
- moduleSelector = $allModules.selector || '',
28
-
29
27
  time = Date.now(),
30
28
  performance = [],
31
29
 
32
30
  query = arguments[0],
33
31
  methodInvoked = typeof query === 'string',
34
32
  queryArguments = [].slice.call(arguments, 1),
33
+ contextCheck = function (context, win) {
34
+ var $context;
35
+ if ([window, document].indexOf(context) >= 0) {
36
+ $context = $(context);
37
+ } else {
38
+ $context = $(win.document).find(context);
39
+ if ($context.length === 0) {
40
+ $context = win.frameElement ? contextCheck(context, win.parent) : window;
41
+ }
42
+ }
43
+
44
+ return $context;
45
+ },
35
46
  returnedValue
36
47
  ;
37
48
 
@@ -56,7 +67,7 @@
56
67
  moduleNamespace = 'module-' + namespace,
57
68
 
58
69
  $module = $(this),
59
- $context = [window, document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $(settings.context),
70
+ $context = contextCheck(settings.context, window),
60
71
  $text = $module.find(selector.text),
61
72
  $search = $module.find(selector.search),
62
73
  $sizer = $module.find(selector.sizer),
@@ -91,7 +102,8 @@
91
102
  selectObserver,
92
103
  menuObserver,
93
104
  classObserver,
94
- module
105
+ module,
106
+ tempDisableApiCache = false
95
107
  ;
96
108
 
97
109
  module = {
@@ -351,7 +363,7 @@
351
363
  module.verbose('Adding clear icon');
352
364
  $clear = $('<i />')
353
365
  .addClass('remove icon')
354
- .insertBefore($text)
366
+ .insertAfter($icon)
355
367
  ;
356
368
  }
357
369
  if (module.is.search() && !module.has.search()) {
@@ -517,7 +529,7 @@
517
529
  callback = isFunction(callback)
518
530
  ? callback
519
531
  : function () {};
520
- if ((focused || iconClicked) && module.is.remote() && module.is.noApiCache()) {
532
+ if ((focused || iconClicked) && module.is.remote() && module.is.noApiCache() && !module.has.maxSelections()) {
521
533
  module.clearItems();
522
534
  }
523
535
  if (!module.can.show() && module.is.remote()) {
@@ -567,7 +579,10 @@
567
579
  if ($subMenu.length > 0) {
568
580
  module.verbose('Hiding sub-menu', $subMenu);
569
581
  $subMenu.each(function () {
570
- module.animate.hide(false, $(this));
582
+ var $sub = $(this);
583
+ if (!module.is.animating($sub)) {
584
+ module.animate.hide(false, $sub);
585
+ }
571
586
  });
572
587
  }
573
588
  }
@@ -762,6 +777,8 @@
762
777
  }
763
778
  ;
764
779
  if (settings.useLabels && module.has.maxSelections()) {
780
+ module.show();
781
+
765
782
  return;
766
783
  }
767
784
  if (settings.apiSettings) {
@@ -858,11 +875,12 @@
858
875
  if (!$module.api('get request')) {
859
876
  module.setup.api();
860
877
  }
861
- apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks);
878
+ apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks, tempDisableApiCache ? { cache: false } : {});
862
879
  $module
863
880
  .api('setting', apiSettings)
864
881
  .api('query')
865
882
  ;
883
+ tempDisableApiCache = false;
866
884
  },
867
885
 
868
886
  filterItems: function (query) {
@@ -1084,8 +1102,8 @@
1084
1102
  notFoundTokens = []
1085
1103
  ;
1086
1104
  tokens.forEach(function (value) {
1087
- if (module.set.selected(module.escape.htmlEntities(value.trim()), null, true, true) === false) {
1088
- notFoundTokens.push(value);
1105
+ if (module.set.selected(module.escape.htmlEntities(value.trim()), null, false, true) === false) {
1106
+ notFoundTokens.push(value.trim());
1089
1107
  }
1090
1108
  });
1091
1109
  event.preventDefault();
@@ -1218,7 +1236,7 @@
1218
1236
  module.set.filtered();
1219
1237
  }
1220
1238
  clearTimeout(module.timer);
1221
- module.timer = setTimeout(module.search, settings.delay.search);
1239
+ module.timer = setTimeout(function () { module.search(); }, settings.delay.search);
1222
1240
  },
1223
1241
  label: {
1224
1242
  click: function (event) {
@@ -1394,11 +1412,13 @@
1394
1412
  if (settings.allowAdditions) {
1395
1413
  module.remove.userAddition();
1396
1414
  }
1397
- module.remove.filteredItem();
1415
+ if (!settings.keepSearchTerm) {
1416
+ module.remove.filteredItem();
1417
+ module.remove.searchTerm();
1418
+ }
1398
1419
  if (!module.is.visible() && $target.length > 0) {
1399
1420
  module.show();
1400
1421
  }
1401
- module.remove.searchTerm();
1402
1422
  if (!module.is.focusedOnSearch() && skipRefocus !== true) {
1403
1423
  module.focusSearch(true);
1404
1424
  }
@@ -1584,7 +1604,9 @@
1584
1604
  module.verbose('Selecting item from keyboard shortcut', $selectedItem);
1585
1605
  module.event.item.click.call($selectedItem, event);
1586
1606
  if (module.is.searchSelection()) {
1587
- module.remove.searchTerm();
1607
+ if (!settings.keepSearchTerm) {
1608
+ module.remove.searchTerm();
1609
+ }
1588
1610
  if (module.is.multiple()) {
1589
1611
  $search.trigger('focus');
1590
1612
  }
@@ -1801,7 +1823,7 @@
1801
1823
  ? value
1802
1824
  : text;
1803
1825
  if (module.can.activate($(element))) {
1804
- module.set.selected(value, $(element));
1826
+ module.set.selected(value, $(element), false, settings.keepSearchTerm);
1805
1827
  if (!module.is.multiple() && !(!settings.collapseOnActionable && $(element).hasClass(className.actionable))) {
1806
1828
  module.hideAndClear();
1807
1829
  }
@@ -2065,7 +2087,7 @@
2065
2087
  values.push({
2066
2088
  name: name,
2067
2089
  value: value,
2068
- text: text,
2090
+ text: module.escape.htmlEntities(text, true),
2069
2091
  disabled: disabled,
2070
2092
  });
2071
2093
  }
@@ -2153,7 +2175,7 @@
2153
2175
  return;
2154
2176
  }
2155
2177
  if (isMultiple) {
2156
- if ($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(String)) !== -1) {
2178
+ if ($.inArray(module.escape.htmlEntities(String(optionValue)), value.map(String).map(module.escape.htmlEntities)) !== -1) {
2157
2179
  $selectedItem = $selectedItem
2158
2180
  ? $selectedItem.add($choice)
2159
2181
  : $choice;
@@ -2214,7 +2236,7 @@
2214
2236
  return false;
2215
2237
  }
2216
2238
 
2217
- return true;
2239
+ return false;
2218
2240
  },
2219
2241
  disabled: function () {
2220
2242
  $search.attr('tabindex', module.is.disabled() ? -1 : 0);
@@ -2304,7 +2326,7 @@
2304
2326
  $.each(values, function (value, name) {
2305
2327
  module.set.text(name);
2306
2328
  });
2307
- } else {
2329
+ } else if (settings.useLabels) {
2308
2330
  $.each(values, function (value, name) {
2309
2331
  module.add.label(value, name);
2310
2332
  });
@@ -2388,6 +2410,11 @@
2388
2410
  module.set.value('', null, null, preventChangeTrigger);
2389
2411
  },
2390
2412
 
2413
+ clearCache: function () {
2414
+ module.debug('Clearing API cache once');
2415
+ tempDisableApiCache = true;
2416
+ },
2417
+
2391
2418
  scrollPage: function (direction, $selectedItem) {
2392
2419
  var
2393
2420
  $currentItem = $selectedItem || module.get.selectedItem(),
@@ -2446,7 +2473,7 @@
2446
2473
  valueIsSet = searchValue !== ''
2447
2474
  ;
2448
2475
  if (isMultiple && hasSearchValue) {
2449
- module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
2476
+ module.verbose('Adjusting input width', searchWidth);
2450
2477
  $search.css('width', searchWidth + 'px');
2451
2478
  }
2452
2479
  if (hasSearchValue || (isSearchMultiple && valueIsSet)) {
@@ -2745,7 +2772,7 @@
2745
2772
  return false;
2746
2773
  }
2747
2774
  module.debug('Setting selected menu item to', $selectedItem);
2748
- if (module.is.multiple()) {
2775
+ if (module.is.multiple() && !keepSearchTerm) {
2749
2776
  module.remove.searchWidth();
2750
2777
  }
2751
2778
  if (module.is.single()) {
@@ -3438,7 +3465,7 @@
3438
3465
  return settings.apiSettings && module.can.useAPI();
3439
3466
  },
3440
3467
  noApiCache: function () {
3441
- return settings.apiSettings && !settings.apiSettings.cache;
3468
+ return tempDisableApiCache || (settings.apiSettings && !settings.apiSettings.cache);
3442
3469
  },
3443
3470
  single: function () {
3444
3471
  return !module.is.multiple();
@@ -3448,7 +3475,7 @@
3448
3475
  selectChanged = false
3449
3476
  ;
3450
3477
  $.each(mutations, function (index, mutation) {
3451
- if ($(mutation.target).is('select, option, optgroup') || $(mutation.addedNodes).is('select')) {
3478
+ if ($(mutation.target).is('option, optgroup') || $(mutation.addedNodes).is('select') || ($(mutation.target).is('select') && mutation.type !== 'attributes')) {
3452
3479
  selectChanged = true;
3453
3480
 
3454
3481
  return false;
@@ -3637,7 +3664,7 @@
3637
3664
  displayType: module.get.displayType(),
3638
3665
  }).transition('show');
3639
3666
  callback.call(element);
3640
- } else if (module.can.useElement('transition') && $module.transition('is supported')) {
3667
+ } else if (module.can.useElement('transition')) {
3641
3668
  $currentMenu
3642
3669
  .transition({
3643
3670
  animation: transition + ' in',
@@ -3679,7 +3706,7 @@
3679
3706
  displayType: module.get.displayType(),
3680
3707
  }).transition('hide');
3681
3708
  callback.call(element);
3682
- } else if ($.fn.transition !== undefined && $module.transition('is supported')) {
3709
+ } else if ($.fn.transition !== undefined) {
3683
3710
  $currentMenu
3684
3711
  .transition({
3685
3712
  animation: transition + ' out',
@@ -3720,12 +3747,12 @@
3720
3747
  show: function () {
3721
3748
  module.verbose('Delaying show event to ensure user intent');
3722
3749
  clearTimeout(module.timer);
3723
- module.timer = setTimeout(module.show, settings.delay.show);
3750
+ module.timer = setTimeout(function () { module.show(); }, settings.delay.show);
3724
3751
  },
3725
3752
  hide: function () {
3726
3753
  module.verbose('Delaying hide event to ensure user intent');
3727
3754
  clearTimeout(module.timer);
3728
- module.timer = setTimeout(module.hide, settings.delay.hide);
3755
+ module.timer = setTimeout(function () { module.hide(); }, settings.delay.hide);
3729
3756
  },
3730
3757
  },
3731
3758
 
@@ -3757,7 +3784,7 @@
3757
3784
 
3758
3785
  return text.replace(regExp.escape, '\\$&');
3759
3786
  },
3760
- htmlEntities: function (string) {
3787
+ htmlEntities: function (string, forceAmpersand) {
3761
3788
  var
3762
3789
  badChars = /["'<>`]/g,
3763
3790
  shouldEscape = /["&'<>`]/,
@@ -3773,7 +3800,7 @@
3773
3800
  }
3774
3801
  ;
3775
3802
  if (shouldEscape.test(string)) {
3776
- string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
3803
+ string = string.replace(forceAmpersand ? /&/g : /&(?![\d#a-z]{1,12};)/gi, '&amp;');
3777
3804
 
3778
3805
  return string.replace(badChars, escapedChar);
3779
3806
  }
@@ -3851,7 +3878,7 @@
3851
3878
  });
3852
3879
  }
3853
3880
  clearTimeout(module.performance.timer);
3854
- module.performance.timer = setTimeout(module.performance.display, 500);
3881
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
3855
3882
  },
3856
3883
  display: function () {
3857
3884
  var
@@ -3864,9 +3891,6 @@
3864
3891
  totalTime += data['Execution Time'];
3865
3892
  });
3866
3893
  title += ' ' + totalTime + 'ms';
3867
- if (moduleSelector) {
3868
- title += ' \'' + moduleSelector + '\'';
3869
- }
3870
3894
  if (performance.length > 0) {
3871
3895
  console.groupCollapsed(title);
3872
3896
  if (console.table) {
@@ -3991,6 +4015,7 @@
3991
4015
  forceSelection: false, // force a choice on blur with search selection
3992
4016
 
3993
4017
  allowAdditions: false, // whether multiple select should allow user added values
4018
+ keepSearchTerm: false, // whether the search value should be kept and menu stays filtered on item selection
3994
4019
  ignoreCase: false, // whether to consider case sensitivity when creating labels
3995
4020
  ignoreSearchCase: true, // whether to consider case sensitivity when filtering items
3996
4021
  hideAdditions: true, // whether or not to hide special message prompting a user they can enter a value
@@ -4010,8 +4035,6 @@
4010
4035
  duration: 200, // duration of transition
4011
4036
  displayType: false, // displayType of transition
4012
4037
 
4013
- glyphWidth: 1.037, // widest glyph width in em (W is 1.037 em) used to calculate multiselect input width
4014
-
4015
4038
  headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>
4016
4039
 
4017
4040
  collapseOnActionable: true, // whether the dropdown should collapse upon selection of an actionable item
@@ -23,8 +23,6 @@
23
23
  var
24
24
  $allModules = $(this),
25
25
 
26
- moduleSelector = $allModules.selector || '',
27
-
28
26
  time = Date.now(),
29
27
  performance = [],
30
28
 
@@ -442,7 +440,7 @@
442
440
  });
443
441
  }
444
442
  clearTimeout(module.performance.timer);
445
- module.performance.timer = setTimeout(module.performance.display, 500);
443
+ module.performance.timer = setTimeout(function () { module.performance.display(); }, 500);
446
444
  },
447
445
  display: function () {
448
446
  var
@@ -455,9 +453,6 @@
455
453
  totalTime += data['Execution Time'];
456
454
  });
457
455
  title += ' ' + totalTime + 'ms';
458
- if (moduleSelector) {
459
- title += ' \'' + moduleSelector + '\'';
460
- }
461
456
  if ($allModules.length > 1) {
462
457
  title += ' (' + $allModules.length + ')';
463
458
  }
@@ -655,7 +650,7 @@
655
650
  return ''
656
651
  + '<iframe src="' + deQuote(src) + '"'
657
652
  + ' width="100%" height="100%"'
658
- + ' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
653
+ + ' msallowFullScreen allowFullScreen></iframe>';
659
654
  },
660
655
  placeholder: function (image, icon) {
661
656
  var