fomantic-ui 2.9.0-beta.302 → 2.9.0-beta.305

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 (161) hide show
  1. package/.all-contributorsrc +23 -1
  2. package/CONTRIBUTORS.md +5 -1
  3. package/dist/components/accordion.css +1 -1
  4. package/dist/components/accordion.js +1 -1
  5. package/dist/components/accordion.min.css +1 -1
  6. package/dist/components/accordion.min.js +1 -1
  7. package/dist/components/ad.css +1 -1
  8. package/dist/components/ad.min.css +1 -1
  9. package/dist/components/api.js +1 -1
  10. package/dist/components/api.min.js +1 -1
  11. package/dist/components/breadcrumb.css +1 -1
  12. package/dist/components/breadcrumb.min.css +1 -1
  13. package/dist/components/button.css +1 -1
  14. package/dist/components/button.min.css +1 -1
  15. package/dist/components/calendar.css +1 -1
  16. package/dist/components/calendar.js +6 -3
  17. package/dist/components/calendar.min.css +1 -1
  18. package/dist/components/calendar.min.js +2 -2
  19. package/dist/components/card.css +1 -1
  20. package/dist/components/card.min.css +1 -1
  21. package/dist/components/checkbox.css +1 -1
  22. package/dist/components/checkbox.js +2 -1
  23. package/dist/components/checkbox.min.css +1 -1
  24. package/dist/components/checkbox.min.js +2 -2
  25. package/dist/components/comment.css +1 -1
  26. package/dist/components/comment.min.css +1 -1
  27. package/dist/components/container.css +1 -1
  28. package/dist/components/container.min.css +1 -1
  29. package/dist/components/dimmer.css +1 -1
  30. package/dist/components/dimmer.js +1 -1
  31. package/dist/components/dimmer.min.css +1 -1
  32. package/dist/components/dimmer.min.js +1 -1
  33. package/dist/components/divider.css +1 -1
  34. package/dist/components/divider.min.css +1 -1
  35. package/dist/components/dropdown.css +1 -1
  36. package/dist/components/dropdown.js +31 -18
  37. package/dist/components/dropdown.min.css +1 -1
  38. package/dist/components/dropdown.min.js +2 -2
  39. package/dist/components/embed.css +1 -1
  40. package/dist/components/embed.js +12 -6
  41. package/dist/components/embed.min.css +1 -1
  42. package/dist/components/embed.min.js +2 -2
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/form.css +2 -2
  48. package/dist/components/form.js +1 -1
  49. package/dist/components/form.min.css +2 -2
  50. package/dist/components/form.min.js +1 -1
  51. package/dist/components/grid.css +1 -1
  52. package/dist/components/grid.min.css +1 -1
  53. package/dist/components/header.css +1 -1
  54. package/dist/components/header.min.css +1 -1
  55. package/dist/components/icon.css +1 -1
  56. package/dist/components/icon.min.css +1 -1
  57. package/dist/components/image.css +1 -1
  58. package/dist/components/image.min.css +1 -1
  59. package/dist/components/input.css +1 -1
  60. package/dist/components/input.min.css +1 -1
  61. package/dist/components/item.css +1 -1
  62. package/dist/components/item.min.css +1 -1
  63. package/dist/components/label.css +1 -1
  64. package/dist/components/label.min.css +1 -1
  65. package/dist/components/list.css +1 -1
  66. package/dist/components/list.min.css +1 -1
  67. package/dist/components/loader.css +1 -1
  68. package/dist/components/loader.min.css +1 -1
  69. package/dist/components/message.css +1 -1
  70. package/dist/components/message.min.css +1 -1
  71. package/dist/components/modal.css +1 -1
  72. package/dist/components/modal.js +4 -4
  73. package/dist/components/modal.min.css +1 -1
  74. package/dist/components/modal.min.js +2 -2
  75. package/dist/components/nag.css +1 -1
  76. package/dist/components/nag.js +1 -1
  77. package/dist/components/nag.min.css +1 -1
  78. package/dist/components/nag.min.js +1 -1
  79. package/dist/components/placeholder.css +1 -1
  80. package/dist/components/placeholder.min.css +1 -1
  81. package/dist/components/popup.css +1 -1
  82. package/dist/components/popup.js +3 -3
  83. package/dist/components/popup.min.css +1 -1
  84. package/dist/components/popup.min.js +2 -2
  85. package/dist/components/progress.css +1 -1
  86. package/dist/components/progress.js +1 -1
  87. package/dist/components/progress.min.css +1 -1
  88. package/dist/components/progress.min.js +1 -1
  89. package/dist/components/rail.css +1 -1
  90. package/dist/components/rail.min.css +1 -1
  91. package/dist/components/rating.css +1 -1
  92. package/dist/components/rating.js +7 -3
  93. package/dist/components/rating.min.css +1 -1
  94. package/dist/components/rating.min.js +2 -2
  95. package/dist/components/reset.css +1 -1
  96. package/dist/components/reset.min.css +1 -1
  97. package/dist/components/reveal.css +1 -1
  98. package/dist/components/reveal.min.css +1 -1
  99. package/dist/components/search.css +1 -1
  100. package/dist/components/search.js +5 -4
  101. package/dist/components/search.min.css +1 -1
  102. package/dist/components/search.min.js +2 -2
  103. package/dist/components/segment.css +1 -1
  104. package/dist/components/segment.min.css +1 -1
  105. package/dist/components/shape.css +1 -1
  106. package/dist/components/shape.js +1 -1
  107. package/dist/components/shape.min.css +1 -1
  108. package/dist/components/shape.min.js +1 -1
  109. package/dist/components/sidebar.css +1 -1
  110. package/dist/components/sidebar.js +1 -1
  111. package/dist/components/sidebar.min.css +1 -1
  112. package/dist/components/sidebar.min.js +1 -1
  113. package/dist/components/site.css +1 -1
  114. package/dist/components/site.js +1 -1
  115. package/dist/components/site.min.css +1 -1
  116. package/dist/components/site.min.js +1 -1
  117. package/dist/components/slider.js +1 -1
  118. package/dist/components/slider.min.js +1 -1
  119. package/dist/components/state.js +1 -1
  120. package/dist/components/state.min.js +1 -1
  121. package/dist/components/statistic.css +1 -1
  122. package/dist/components/statistic.min.css +1 -1
  123. package/dist/components/step.css +1 -1
  124. package/dist/components/step.min.css +1 -1
  125. package/dist/components/sticky.css +1 -1
  126. package/dist/components/sticky.js +1 -1
  127. package/dist/components/sticky.min.css +1 -1
  128. package/dist/components/sticky.min.js +1 -1
  129. package/dist/components/tab.css +1 -1
  130. package/dist/components/tab.js +1 -1
  131. package/dist/components/tab.min.css +1 -1
  132. package/dist/components/tab.min.js +1 -1
  133. package/dist/components/table.css +1 -1
  134. package/dist/components/table.min.css +1 -1
  135. package/dist/components/text.css +1 -1
  136. package/dist/components/text.min.css +1 -1
  137. package/dist/components/toast.css +1 -1
  138. package/dist/components/toast.js +1 -1
  139. package/dist/components/toast.min.css +1 -1
  140. package/dist/components/toast.min.js +1 -1
  141. package/dist/components/transition.css +1 -1
  142. package/dist/components/transition.js +3 -1
  143. package/dist/components/transition.min.css +1 -1
  144. package/dist/components/transition.min.js +2 -2
  145. package/dist/components/visibility.js +1 -1
  146. package/dist/components/visibility.min.js +1 -1
  147. package/dist/semantic.css +50 -50
  148. package/dist/semantic.js +89 -59
  149. package/dist/semantic.min.css +2 -2
  150. package/dist/semantic.min.js +2 -2
  151. package/package.json +1 -1
  152. package/src/definitions/collections/form.less +3 -4
  153. package/src/definitions/modules/calendar.js +5 -2
  154. package/src/definitions/modules/checkbox.js +1 -0
  155. package/src/definitions/modules/dropdown.js +30 -17
  156. package/src/definitions/modules/embed.js +11 -5
  157. package/src/definitions/modules/modal.js +3 -3
  158. package/src/definitions/modules/popup.js +2 -2
  159. package/src/definitions/modules/rating.js +6 -2
  160. package/src/definitions/modules/search.js +4 -3
  161. package/src/definitions/modules/transition.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fomantic-ui",
3
- "version": "2.9.0-beta.302+091bcb0",
3
+ "version": "2.9.0-beta.305+4585cd0",
4
4
  "description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
5
5
  "keywords": [
6
6
  "fomantic-ui",
@@ -69,11 +69,10 @@
69
69
  font-size: @labelFontSize;
70
70
  font-weight: @labelFontWeight;
71
71
  text-transform: @labelTextTransform;
72
- &:not(.button) {
73
- color: @labelColor;
74
- }
75
72
  }
76
-
73
+ .ui.form:not(.inverted) .field > label:not(.button) {
74
+ color: @labelColor;
75
+ }
77
76
  /*--------------------
78
77
  Standard Inputs
79
78
  ---------------------*/
@@ -593,8 +593,8 @@ $.fn.calendar = function(parameters) {
593
593
  },
594
594
  keydown: function (event) {
595
595
  var keyCode = event.which;
596
- if (keyCode === 27 || keyCode === 9) {
597
- //esc || tab
596
+ if (keyCode === 9) {
597
+ //tab
598
598
  module.popup('hide');
599
599
  }
600
600
 
@@ -630,6 +630,9 @@ $.fn.calendar = function(parameters) {
630
630
  //disable form submission:
631
631
  event.preventDefault();
632
632
  event.stopPropagation();
633
+ } else if (keyCode === 27) {
634
+ module.popup('hide');
635
+ event.stopPropagation();
633
636
  }
634
637
  }
635
638
 
@@ -244,6 +244,7 @@ $.fn.checkbox = function(parameters) {
244
244
  module.verbose('Escape key pressed blurring field');
245
245
  $input.blur();
246
246
  shortcutPressed = true;
247
+ event.stopPropagation();
247
248
  }
248
249
  else if(!event.ctrlKey && module.can.change()) {
249
250
  if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
@@ -111,6 +111,7 @@ $.fn.dropdown = function(parameters) {
111
111
  module.error(error.noNormalize, element);
112
112
  }
113
113
 
114
+ module.create.id();
114
115
  module.setup.layout();
115
116
 
116
117
  if(settings.values) {
@@ -124,7 +125,6 @@ $.fn.dropdown = function(parameters) {
124
125
  module.save.defaults();
125
126
  module.restore.selected();
126
127
 
127
- module.create.id();
128
128
  module.bind.events();
129
129
 
130
130
  module.observeChanges();
@@ -366,11 +366,20 @@ $.fn.dropdown = function(parameters) {
366
366
  }
367
367
  if( module.is.search() && !module.has.search() ) {
368
368
  module.verbose('Adding search input');
369
+ var
370
+ labelNode = $module.prev('label')
371
+ ;
369
372
  $search = $('<input />')
370
373
  .addClass(className.search)
371
374
  .prop('autocomplete', module.is.chrome() ? 'fomantic-search' : 'off')
372
- .insertBefore($text)
373
375
  ;
376
+ if (labelNode.length) {
377
+ if (!labelNode.attr('id')) {
378
+ labelNode.attr('id', module.get.id() + '_formLabel');
379
+ }
380
+ $search.attr('aria-labelledby', labelNode.attr('id'));
381
+ }
382
+ $search.insertBefore($text);
374
383
  }
375
384
  if( module.is.multiple() && module.is.searchSelection() && !module.has.sizer()) {
376
385
  module.create.sizer();
@@ -1690,6 +1699,7 @@ $.fn.dropdown = function(parameters) {
1690
1699
  if(pressedKey == keys.escape) {
1691
1700
  module.verbose('Escape key pressed, closing dropdown');
1692
1701
  module.hide();
1702
+ event.stopPropagation();
1693
1703
  }
1694
1704
 
1695
1705
  }
@@ -4248,7 +4258,8 @@ $.fn.dropdown.settings.templates = {
4248
4258
  var
4249
4259
  placeholder = select.placeholder || false,
4250
4260
  html = '',
4251
- escape = $.fn.dropdown.settings.templates.escape
4261
+ escape = $.fn.dropdown.settings.templates.escape,
4262
+ deQuote = $.fn.dropdown.settings.templates.deQuote
4252
4263
  ;
4253
4264
  html += '<i class="dropdown icon"></i>';
4254
4265
  if(placeholder) {
@@ -4257,7 +4268,7 @@ $.fn.dropdown.settings.templates = {
4257
4268
  else {
4258
4269
  html += '<div class="text"></div>';
4259
4270
  }
4260
- html += '<div class="'+className.menu+'">';
4271
+ html += '<div class="'+deQuote(className.menu)+'">';
4261
4272
  html += $.fn.dropdown.settings.templates.menu(select, fields, preserveHTML,className);
4262
4273
  html += '</div>';
4263
4274
  return html;
@@ -4295,27 +4306,27 @@ $.fn.dropdown.settings.templates = {
4295
4306
  : '',
4296
4307
  hasDescription = (escape(option[fields.description] || '', preserveHTML) != '')
4297
4308
  ;
4298
- html += '<div class="'+ maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? deQuote(option[fields.class]) : className.item)+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
4309
+ html += '<div class="'+ deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] ? option[fields.class] : className.item))+'" data-value="' + deQuote(option[fields.value],true) + '"' + maybeText + '>';
4299
4310
  if (isMenu) {
4300
4311
  html += '<i class="'+ (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
4301
4312
  }
4302
4313
  if(option[fields.image]) {
4303
- html += '<img class="'+(option[fields.imageClass] ? deQuote(option[fields.imageClass]) : className.image)+'" src="' + deQuote(option[fields.image]) + '">';
4314
+ html += '<img class="'+deQuote(option[fields.imageClass] ? option[fields.imageClass] : className.image)+'" src="' + deQuote(option[fields.image]) + '">';
4304
4315
  }
4305
4316
  if(option[fields.icon]) {
4306
- html += '<i class="'+deQuote(option[fields.icon])+' '+(option[fields.iconClass] ? deQuote(option[fields.iconClass]) : className.icon)+'"></i>';
4317
+ html += '<i class="'+deQuote(option[fields.icon]+' '+(option[fields.iconClass] ? option[fields.iconClass] : className.icon))+'"></i>';
4307
4318
  }
4308
4319
  if(hasDescription){
4309
- html += '<span class="'+ className.description +'">'+ escape(option[fields.description] || '', preserveHTML) + '</span>';
4310
- html += (!isMenu) ? '<span class="'+ className.text + '">' : '';
4320
+ html += '<span class="'+ deQuote(className.description) +'">'+ escape(option[fields.description] || '', preserveHTML) + '</span>';
4321
+ html += (!isMenu) ? '<span class="'+ deQuote(className.text) + '">' : '';
4311
4322
  }
4312
4323
  if (isMenu) {
4313
- html += '<span class="' + className.text + '">';
4324
+ html += '<span class="' + deQuote(className.text) + '">';
4314
4325
  }
4315
4326
  html += escape(option[fields.name] || '', preserveHTML);
4316
4327
  if (isMenu) {
4317
4328
  html += '</span>';
4318
- html += '<div class="' + itemType + '">';
4329
+ html += '<div class="' + deQuote(itemType) + '">';
4319
4330
  html += $.fn.dropdown.settings.templates.menu(option, fields, preserveHTML, className);
4320
4331
  html += '</div>';
4321
4332
  } else if(hasDescription){
@@ -4324,18 +4335,18 @@ $.fn.dropdown.settings.templates = {
4324
4335
  html += '</div>';
4325
4336
  } else if (itemType === 'header') {
4326
4337
  var groupName = escape(option[fields.name] || '', preserveHTML),
4327
- groupIcon = option[fields.icon] ? deQuote(option[fields.icon]) : className.groupIcon
4338
+ groupIcon = deQuote(option[fields.icon] ? option[fields.icon] : className.groupIcon)
4328
4339
  ;
4329
4340
  if(groupName !== '' || groupIcon !== '') {
4330
- html += '<div class="' + (option[fields.class] ? deQuote(option[fields.class]) : className.header) + '">';
4341
+ html += '<div class="' + deQuote(option[fields.class] ? option[fields.class] : className.header) + '">';
4331
4342
  if (groupIcon !== '') {
4332
- html += '<i class="' + groupIcon + ' ' + (option[fields.iconClass] ? deQuote(option[fields.iconClass]) : className.icon) + '"></i>';
4343
+ html += '<i class="' + deQuote(groupIcon + ' ' + (option[fields.iconClass] ? option[fields.iconClass] : className.icon)) + '"></i>';
4333
4344
  }
4334
4345
  html += groupName;
4335
4346
  html += '</div>';
4336
4347
  }
4337
4348
  if(option[fields.divider]){
4338
- html += '<div class="'+className.divider+'"></div>';
4349
+ html += '<div class="'+deQuote(className.divider)+'"></div>';
4339
4350
  }
4340
4351
  }
4341
4352
  });
@@ -4345,8 +4356,10 @@ $.fn.dropdown.settings.templates = {
4345
4356
  // generates label for multiselect
4346
4357
  label: function(value, text, preserveHTML, className) {
4347
4358
  var
4348
- escape = $.fn.dropdown.settings.templates.escape;
4349
- return escape(text,preserveHTML) + '<i class="'+className.delete+' icon"></i>';
4359
+ escape = $.fn.dropdown.settings.templates.escape,
4360
+ deQuote = $.fn.dropdown.settings.templates.deQuote
4361
+ ;
4362
+ return escape(text,preserveHTML) + '<i class="'+deQuote(className.delete)+' icon"></i>';
4350
4363
  },
4351
4364
 
4352
4365
 
@@ -671,26 +671,32 @@ $.fn.embed.settings = {
671
671
  },
672
672
 
673
673
  templates: {
674
+ deQuote: function(string, encode) {
675
+ return String(string).replace(/"/g,encode ? "&quot;" : "");
676
+ },
674
677
  iframe : function(url, parameters) {
675
- var src = url;
678
+ var src = url,
679
+ deQuote = $.fn.embed.settings.templates.deQuote
680
+ ;
676
681
  if (parameters) {
677
682
  src += '?' + parameters;
678
683
  }
679
684
  return ''
680
- + '<iframe src="' + src + '"'
685
+ + '<iframe src="' + deQuote(src) + '"'
681
686
  + ' width="100%" height="100%"'
682
687
  + ' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
683
688
  ;
684
689
  },
685
690
  placeholder : function(image, icon) {
686
691
  var
687
- html = ''
692
+ html = '',
693
+ deQuote = $.fn.embed.settings.templates.deQuote
688
694
  ;
689
695
  if(icon) {
690
- html += '<i class="' + icon + ' icon"></i>';
696
+ html += '<i class="' + deQuote(icon) + ' icon"></i>';
691
697
  }
692
698
  if(image) {
693
- html += '<img class="placeholder" src="' + image + '">';
699
+ html += '<img class="placeholder" src="' + deQuote(image) + '">';
694
700
  }
695
701
  return html;
696
702
  }
@@ -723,7 +723,7 @@ $.fn.modal = function(parameters) {
723
723
  keyboardShortcuts: function() {
724
724
  module.verbose('Adding keyboard shortcuts');
725
725
  $document
726
- .on('keyup' + eventNamespace, module.event.keyboard)
726
+ .on('keydown' + eventNamespace, module.event.keyboard)
727
727
  ;
728
728
  }
729
729
  },
@@ -803,7 +803,7 @@ $.fn.modal = function(parameters) {
803
803
  keyboardShortcuts: function() {
804
804
  module.verbose('Removing keyboard shortcuts');
805
805
  $document
806
- .off('keyup' + eventNamespace)
806
+ .off('keydown' + eventNamespace)
807
807
  ;
808
808
  },
809
809
  scrolling: function() {
@@ -1507,7 +1507,7 @@ $.fn.modal.settings.templates = {
1507
1507
  denyFn = function(){args.handler(null)}
1508
1508
  ;
1509
1509
  if (input.length === 0) {
1510
- args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
1510
+ args.content += '<p><div class="'+this.helpers.deQuote(settings.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
1511
1511
  }
1512
1512
  return {
1513
1513
  title : args.title,
@@ -121,7 +121,7 @@ $.fn.popup = function(parameters) {
121
121
  },
122
122
 
123
123
  refresh: function() {
124
- if(settings.popup && typeof settings.popup === 'string') {
124
+ if(settings.popup) {
125
125
  $popup = $(document).find(settings.popup).eq(0);
126
126
  }
127
127
  else {
@@ -286,7 +286,7 @@ $.fn.popup = function(parameters) {
286
286
  }
287
287
  settings.onCreate.call($popup, element);
288
288
  }
289
- else if(settings.popup && typeof settings.popup === 'string') {
289
+ else if(settings.popup) {
290
290
  $(document).find(settings.popup).data(metadata.activator, $module);
291
291
  module.verbose('Used popup specified in settings');
292
292
  module.refresh();
@@ -536,13 +536,17 @@ $.fn.rating.settings = {
536
536
  },
537
537
 
538
538
  templates: {
539
+ deQuote: function(string, encode) {
540
+ return String(string).replace(/"/g,encode ? "&quot;" : "");
541
+ },
539
542
  icon: function(maxRating, iconClass) {
540
543
  var
541
544
  icon = 1,
542
- html = ''
545
+ html = '',
546
+ deQuote = $.fn.rating.settings.templates.deQuote
543
547
  ;
544
548
  while(icon <= maxRating) {
545
- html += '<i class="'+iconClass+' icon"></i>';
549
+ html += '<i class="'+deQuote(iconClass)+' icon"></i>';
546
550
  icon++;
547
551
  }
548
552
  return html;
@@ -262,7 +262,7 @@ $.fn.search = function(parameters) {
262
262
 
263
263
  resultsScrollTop = $results.scrollTop();
264
264
  resultsHeight = $results.height();
265
-
265
+
266
266
  if (elTop < 0) {
267
267
  $results.scrollTop(resultsScrollTop + elTop);
268
268
  }
@@ -295,6 +295,7 @@ $.fn.search = function(parameters) {
295
295
  if(keyCode == keys.escape) {
296
296
  module.verbose('Escape key pressed, blurring search field');
297
297
  module.hideResults();
298
+ event.stopPropagation();
298
299
  resultsDismissed = true;
299
300
  }
300
301
  if( module.is.visible() ) {
@@ -678,10 +679,10 @@ $.fn.search = function(parameters) {
678
679
  ;
679
680
  if(fieldExists) {
680
681
  var text;
681
- if (typeof content[field] === 'string'){
682
+ if (typeof content[field] === 'string'){
682
683
  text = module.remove.diacritics(content[field]);
683
684
  } else {
684
- text = content[field].toString();
685
+ text = content[field].toString();
685
686
  }
686
687
  if( text.search(matchRegExp) !== -1) {
687
688
  // content starts with value (first in results)
@@ -698,11 +698,13 @@ $.fn.transition = function() {
698
698
  .addClass(className.transition)
699
699
  .css('animationName')
700
700
  ;
701
+ $clone.detach().insertAfter($module);
701
702
  inAnimation = $clone
702
703
  .addClass(className.inward)
703
704
  .css('animationName')
704
705
  ;
705
706
  if(!displayType) {
707
+ $clone.detach().insertAfter($module);
706
708
  displayType = $clone
707
709
  .attr('class', elementClass)
708
710
  .removeAttr('style')