less-rails-semantic_ui 1.7.3.0 → 1.8.0.0

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/assets/javascripts/semantic_ui/definitions/behaviors/api.js +22 -11
  3. data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +259 -43
  4. data/assets/javascripts/semantic_ui/definitions/modules/checkbox.js +1 -1
  5. data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +204 -105
  6. data/assets/javascripts/semantic_ui/definitions/modules/popup.js +4 -3
  7. data/assets/javascripts/semantic_ui/definitions/modules/search.js +310 -152
  8. data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +18 -7
  9. data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +1 -1
  10. data/assets/javascripts/semantic_ui/definitions/modules/transition.js +35 -23
  11. data/assets/stylesheets/semantic_ui/definitions/collections/form.less +2 -2
  12. data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +30 -0
  13. data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +13 -11
  14. data/assets/stylesheets/semantic_ui/definitions/elements/button.less +16 -2
  15. data/assets/stylesheets/semantic_ui/definitions/elements/header.less +70 -31
  16. data/assets/stylesheets/semantic_ui/definitions/elements/label.less +3 -3
  17. data/assets/stylesheets/semantic_ui/definitions/elements/list.less +8 -18
  18. data/assets/stylesheets/semantic_ui/definitions/modules/checkbox.less +54 -27
  19. data/assets/stylesheets/semantic_ui/definitions/modules/modal.less +2 -1
  20. data/assets/stylesheets/semantic_ui/definitions/modules/popup.less +5 -0
  21. data/assets/stylesheets/semantic_ui/definitions/modules/sidebar.less +1 -0
  22. data/assets/stylesheets/semantic_ui/definitions/modules/transition.less +0 -5
  23. data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +7 -5
  24. data/assets/stylesheets/semantic_ui/themes/default/collections/table.variables +1 -1
  25. data/assets/stylesheets/semantic_ui/themes/default/elements/button.variables +2 -2
  26. data/assets/stylesheets/semantic_ui/themes/default/elements/header.variables +20 -9
  27. data/assets/stylesheets/semantic_ui/themes/default/elements/label.variables +5 -3
  28. data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +1 -0
  29. data/assets/stylesheets/semantic_ui/themes/default/modules/accordion.variables +5 -6
  30. data/assets/stylesheets/semantic_ui/themes/default/modules/modal.variables +3 -2
  31. data/assets/stylesheets/semantic_ui/themes/default/modules/popup.variables +3 -3
  32. data/assets/stylesheets/semantic_ui/themes/default/modules/transition.overrides +690 -222
  33. data/assets/stylesheets/semantic_ui/themes/default/modules/transition.variables +1 -1
  34. data/lib/less/rails/semantic_ui/version.rb +1 -1
  35. metadata +3 -3
@@ -59,6 +59,7 @@ $.fn.sidebar = function(parameters) {
59
59
  $context = $(settings.context),
60
60
 
61
61
  $sidebars = $module.children(selector.sidebar),
62
+ $fixed = $context.children(selector.fixed),
62
63
  $pusher = $context.children(selector.pusher),
63
64
  $style,
64
65
 
@@ -134,10 +135,18 @@ $.fn.sidebar = function(parameters) {
134
135
 
135
136
  event: {
136
137
  clickaway: function(event) {
137
- if( $(event.target).closest(selector.sidebar).length === 0 ) {
138
+ var
139
+ clickedInPusher = ($pusher.find(event.target).length > 0 || $pusher.is(event.target)),
140
+ clickedContext = ($context.is(event.target))
141
+ ;
142
+ if(clickedInPusher) {
138
143
  module.verbose('User clicked on dimmed page');
139
144
  module.hide();
140
145
  }
146
+ if(clickedContext) {
147
+ module.verbose('User clicked on dimmable context (scaled out page)');
148
+ module.hide();
149
+ }
141
150
  },
142
151
  touch: function(event) {
143
152
  //event.stopPropagation();
@@ -267,7 +276,6 @@ $.fn.sidebar = function(parameters) {
267
276
  + ' }'
268
277
  ;
269
278
  }
270
-
271
279
  style += '</style>';
272
280
  $head.append(style);
273
281
  $style = $('style[title=' + namespace + ']');
@@ -280,6 +288,7 @@ $.fn.sidebar = function(parameters) {
280
288
  $context = $(settings.context);
281
289
  $sidebars = $context.children(selector.sidebar);
282
290
  $pusher = $context.children(selector.pusher);
291
+ $fixed = $context.children(selector.fixed);
283
292
  },
284
293
 
285
294
  refreshSidebars: function() {
@@ -453,7 +462,7 @@ $.fn.sidebar = function(parameters) {
453
462
  if(settings.transition == 'scale down') {
454
463
  module.scrollToTop();
455
464
  }
456
- module.set.transition();
465
+ module.set.transition(transition);
457
466
  module.repaint();
458
467
  animate = function() {
459
468
  module.bind.clickaway();
@@ -496,7 +505,7 @@ $.fn.sidebar = function(parameters) {
496
505
  ;
497
506
  module.verbose('Removing context push state', module.get.direction());
498
507
 
499
- module.set.transition();
508
+ module.set.transition(transition);
500
509
  module.unbind.clickaway();
501
510
  module.unbind.scrollLock();
502
511
 
@@ -686,7 +695,7 @@ $.fn.sidebar = function(parameters) {
686
695
  direction = module.get.direction(),
687
696
  transition
688
697
  ;
689
- return ( module.is.mobile() )
698
+ transition = ( module.is.mobile() )
690
699
  ? (settings.mobileTransition == 'auto')
691
700
  ? settings.defaultTransition.mobile[direction]
692
701
  : settings.mobileTransition
@@ -694,6 +703,8 @@ $.fn.sidebar = function(parameters) {
694
703
  ? settings.defaultTransition.computer[direction]
695
704
  : settings.transition
696
705
  ;
706
+ module.verbose('Determined transition', transition);
707
+ return transition;
697
708
  },
698
709
  transitionEvent: function() {
699
710
  var
@@ -754,7 +765,7 @@ $.fn.sidebar = function(parameters) {
754
765
  ios: function() {
755
766
  var
756
767
  userAgent = navigator.userAgent,
757
- isIOS = regExp.ios.test(userAgent)
768
+ isIOS = userAgent.match(regExp.ios)
758
769
  ;
759
770
  if(isIOS) {
760
771
  module.verbose('Browser was found to be iOS', userAgent);
@@ -767,7 +778,7 @@ $.fn.sidebar = function(parameters) {
767
778
  mobile: function() {
768
779
  var
769
780
  userAgent = navigator.userAgent,
770
- isMobile = regExp.mobile.test(userAgent)
781
+ isMobile = userAgent.match(regExp.mobile)
771
782
  ;
772
783
  if(isMobile) {
773
784
  module.verbose('Browser was found to be mobile', userAgent);
@@ -226,7 +226,7 @@ $.fn.sticky = function(parameters) {
226
226
  }
227
227
  };
228
228
  module.set.containerSize();
229
- module.set.length;
229
+ module.set.size();
230
230
  module.stick();
231
231
  module.debug('Caching element positions', module.cache);
232
232
  }
@@ -135,16 +135,17 @@ $.fn.transition = function() {
135
135
  module.debug('Preparing animation', settings.animation);
136
136
  if(module.is.animating()) {
137
137
  if(settings.queue) {
138
- if(!settings.allowRepeats && module.has.direction() && module.is.occuring() && module.queuing !== true) {
139
- module.error(error.repeated, settings.animation, $module);
138
+ if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
139
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
140
140
  }
141
141
  else {
142
142
  module.queue(settings.animation);
143
143
  }
144
144
  return false;
145
145
  }
146
- else {
147
-
146
+ else if(!settings.allowRepeats && module.is.occurring()) {
147
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
148
+ return false;
148
149
  }
149
150
  }
150
151
  if( module.can.animate() ) {
@@ -203,12 +204,19 @@ $.fn.transition = function() {
203
204
 
204
205
  has: {
205
206
  direction: function(animation) {
207
+ var
208
+ hasDirection = false
209
+ ;
206
210
  animation = animation || settings.animation;
207
- if( animation.search(className.inward) !== -1 || animation.search(className.outward) !== -1) {
208
- module.debug('Direction already set in animation');
209
- return true;
211
+ if(typeof animation === 'string') {
212
+ animation = animation.split(' ');
213
+ $.each(animation, function(index, word){
214
+ if(word === className.inward || word === className.outward) {
215
+ hasDirection = true;
216
+ }
217
+ });
210
218
  }
211
- return false;
219
+ return hasDirection;
212
220
  },
213
221
  inlineDisplay: function() {
214
222
  var
@@ -232,8 +240,7 @@ $.fn.transition = function() {
232
240
  module.remove.hidden();
233
241
  module.set.display();
234
242
  $module
235
- .addClass(className.animating)
236
- .addClass(className.transition)
243
+ .addClass(className.animating + ' ' + className.transition + ' ' + animation)
237
244
  .addClass(animation)
238
245
  .one(animationEnd + '.complete' + eventNamespace, module.complete)
239
246
  ;
@@ -251,15 +258,17 @@ $.fn.transition = function() {
251
258
  : duration
252
259
  ;
253
260
  module.verbose('Setting animation duration', duration);
254
- $module
255
- .css({
256
- '-webkit-animation-duration': duration,
257
- '-moz-animation-duration': duration,
258
- '-ms-animation-duration': duration,
259
- '-o-animation-duration': duration,
260
- 'animation-duration': duration
261
- })
262
- ;
261
+ if(duration || duration === 0) {
262
+ $module
263
+ .css({
264
+ '-webkit-animation-duration': duration,
265
+ '-moz-animation-duration': duration,
266
+ '-ms-animation-duration': duration,
267
+ '-o-animation-duration': duration,
268
+ 'animation-duration': duration
269
+ })
270
+ ;
271
+ }
263
272
  },
264
273
  display: function() {
265
274
  var
@@ -472,7 +481,10 @@ $.fn.transition = function() {
472
481
  },
473
482
  duration: function(duration) {
474
483
  duration = duration || settings.duration;
475
- return (typeof settings.duration === 'string')
484
+ if(duration === false) {
485
+ duration = $module.css('animation-duration') || 0;
486
+ }
487
+ return (typeof duration === 'string')
476
488
  ? (duration.indexOf('ms') > -1)
477
489
  ? parseFloat(duration)
478
490
  : parseFloat(duration) * 1000
@@ -632,9 +644,9 @@ $.fn.transition = function() {
632
644
  looping: function() {
633
645
  return $module.hasClass(className.looping);
634
646
  },
635
- occuring: function(animation) {
647
+ occurring: function(animation) {
636
648
  animation = animation || settings.animation;
637
- animation = animation.replace(' ', '.');
649
+ animation = '.' + animation.replace(' ', '.');
638
650
  return ( $module.filter(animation).length > 0 );
639
651
  },
640
652
  visible: function() {
@@ -889,7 +901,7 @@ $.fn.transition.settings = {
889
901
 
890
902
  // animation duration
891
903
  animation : 'fade',
892
- duration : '500ms',
904
+ duration : false,
893
905
 
894
906
  // new animations will occur after previous ones
895
907
  queue : true,
@@ -674,7 +674,7 @@
674
674
  }
675
675
 
676
676
  /* Swap to full width on mobile */
677
- @media only screen and (max-width : 767px) {
677
+ @media only screen and (max-width : @largestMobileScreen) {
678
678
  .ui.form .two.fields > .fields,
679
679
  .ui.form .two.fields > .field,
680
680
  .ui.form .three.fields > .fields,
@@ -772,7 +772,7 @@
772
772
  }
773
773
 
774
774
  /* Swap to full width on mobile */
775
- @media only screen and (max-width : 767px) {
775
+ @media only screen and (max-width : @largestMobileScreen) {
776
776
  .ui.form .two.fields > .fields,
777
777
  .ui.form .two.fields > .field,
778
778
  .ui.form .three.fields > .fields,
@@ -1538,16 +1538,31 @@
1538
1538
  .ui.grid > [class*="ten column"].doubling.row > .column {
1539
1539
  width: @fiveColumn !important;
1540
1540
  }
1541
+ .ui[class*="eleven column"].doubling.grid > .row > .column,
1542
+ .ui[class*="eleven column"].doubling.grid > .column,
1543
+ .ui.grid > [class*="eleven column"].doubling.row > .column {
1544
+ width: @fiveColumn !important;
1545
+ }
1541
1546
  .ui[class*="twelve column"].doubling.grid > .row > .column,
1542
1547
  .ui[class*="twelve column"].doubling.grid > .column,
1543
1548
  .ui.grid > [class*="twelve column"].doubling.row > .column {
1544
1549
  width: @sixColumn !important;
1545
1550
  }
1551
+ .ui[class*="thirteen column"].doubling.grid > .row > .column,
1552
+ .ui[class*="thirteen column"].doubling.grid > .column,
1553
+ .ui.grid > [class*="thirteen column"].doubling.row > .column {
1554
+ width: @sixColumn !important;
1555
+ }
1546
1556
  .ui[class*="fourteen column"].doubling.grid > .row > .column,
1547
1557
  .ui[class*="fourteen column"].doubling.grid > .column,
1548
1558
  .ui.grid > [class*="fourteen column"].doubling.row > .column {
1549
1559
  width: @sevenColumn !important;
1550
1560
  }
1561
+ .ui[class*="fifteen column"].doubling.grid > .row > .column,
1562
+ .ui[class*="fifteen column"].doubling.grid > .column,
1563
+ .ui.grid > [class*="fifteen column"].doubling.row > .column {
1564
+ width: @sevenColumn !important;
1565
+ }
1551
1566
  .ui[class*="sixteen column"].doubling.grid > .row > .column,
1552
1567
  .ui[class*="sixteen column"].doubling.grid > .column,
1553
1568
  .ui.grid > [class*="sixteen column"].doubling.row > .column {
@@ -1618,16 +1633,31 @@
1618
1633
  .ui.grid > [class*="ten column"].doubling:not(.stackable).row > .column {
1619
1634
  width: @threeColumn !important;
1620
1635
  }
1636
+ .ui[class*="eleven column"].doubling:not(.stackable).grid > .row > .column,
1637
+ .ui[class*="eleven column"].doubling:not(.stackable).grid > .column,
1638
+ .ui.grid > [class*="eleven column"].doubling:not(.stackable).row > .column {
1639
+ width: @threeColumn !important;
1640
+ }
1621
1641
  .ui[class*="twelve column"].doubling:not(.stackable).grid > .row > .column,
1622
1642
  .ui[class*="twelve column"].doubling:not(.stackable).grid > .column,
1623
1643
  .ui.grid > [class*="twelve column"].doubling:not(.stackable).row > .column {
1624
1644
  width: @threeColumn !important;
1625
1645
  }
1646
+ .ui[class*="thirteen column"].doubling:not(.stackable).grid > .row > .column,
1647
+ .ui[class*="thirteen column"].doubling:not(.stackable).grid > .column,
1648
+ .ui.grid > [class*="thirteen column"].doubling:not(.stackable).row > .column {
1649
+ width: @threeColumn !important;
1650
+ }
1626
1651
  .ui[class*="fourteen column"].doubling:not(.stackable).grid > .row > .column,
1627
1652
  .ui[class*="fourteen column"].doubling:not(.stackable).grid > .column,
1628
1653
  .ui.grid > [class*="fourteen column"].doubling:not(.stackable).row > .column {
1629
1654
  width: @fourColumn !important;
1630
1655
  }
1656
+ .ui[class*="fifteen column"].doubling:not(.stackable).grid > .row > .column,
1657
+ .ui[class*="fifteen column"].doubling:not(.stackable).grid > .column,
1658
+ .ui.grid > [class*="fifteen column"].doubling:not(.stackable).row > .column {
1659
+ width: @fourColumn !important;
1660
+ }
1631
1661
  .ui[class*="sixteen column"].doubling:not(.stackable).grid > .row > .column,
1632
1662
  .ui[class*="sixteen column"].doubling:not(.stackable).grid > .column,
1633
1663
  .ui.grid > [class*="sixteen column"].doubling:not(.stackable).row > .column {
@@ -1508,11 +1508,15 @@
1508
1508
 
1509
1509
  .ui.pointing.menu .active.item:after {
1510
1510
  position: absolute;
1511
- bottom: @arrowOffset;
1512
- left: 50%;
1513
1511
  content: '';
1514
1512
 
1515
- margin-left: @arrowOffset;
1513
+ top: 100%;
1514
+ left: 50%;
1515
+ transform: translateX(-50%) translateY(-50%) rotate(45deg);
1516
+ margin: @arrowBorderSize 0em 0em 0em;
1517
+
1518
+ background: none;
1519
+
1516
1520
  width: @arrowSize;
1517
1521
  height: @arrowSize;
1518
1522
 
@@ -1520,13 +1524,9 @@
1520
1524
  border-bottom: @arrowBorder;
1521
1525
  border-right: @arrowBorder;
1522
1526
 
1523
- background: none;
1524
- transform: rotate(45deg);
1525
- z-index: 2;
1527
+ z-index: @arrowZIndex;
1526
1528
 
1527
- transition:
1528
- background 0.2s ease
1529
- ;
1529
+ transition: @arrowTransition;
1530
1530
  }
1531
1531
 
1532
1532
  /* Don't double up pointers */
@@ -1537,11 +1537,13 @@
1537
1537
  .ui.vertical.pointing.menu .active.item:after {
1538
1538
  position: absolute;
1539
1539
  top: 50%;
1540
- margin-top: @arrowOffset;
1541
- right: @arrowOffset;
1540
+ right: 0%;
1542
1541
  bottom: auto;
1543
1542
  left: auto;
1544
1543
 
1544
+ transform: translateX(50%) translateY(-50%) rotate(45deg);
1545
+ margin: 0em -@arrowBorderSize 0em 0em;
1546
+
1545
1547
  border: none;
1546
1548
  border-top: @arrowBorder;
1547
1549
  border-right: @arrowBorder;
@@ -90,9 +90,9 @@
90
90
 
91
91
  .ui.button:focus {
92
92
  background-color: @focusBackgroundColor;
93
- background-image: @focusBackgroundImage;
94
- box-shadow: @focusBoxShadow;
95
93
  color: @focusColor;
94
+ background-image: @focusBackgroundImage !important;
95
+ box-shadow: @focusBoxShadow !important;
96
96
  }
97
97
 
98
98
  .ui.button:focus .icon {
@@ -217,6 +217,11 @@
217
217
  pointer-events: none;
218
218
  }
219
219
 
220
+ /* Basic Group With Disabled */
221
+ .ui.basic.buttons .ui.disabled.button {
222
+ border-color: @disabledBorderColor;
223
+ }
224
+
220
225
  /*******************************
221
226
  Types
222
227
  *******************************/
@@ -719,6 +724,15 @@
719
724
  border-left: none;
720
725
  }
721
726
 
727
+ .ui.basic.vertical.buttons .button {
728
+ border-left-width: 0px;
729
+ border-top: @basicGroupBorder;
730
+ }
731
+ .ui.basic.vertical.buttons .button:first-child {
732
+ border-top-width: 0px;
733
+ }
734
+
735
+
722
736
 
723
737
  /*--------------
724
738
  Labeled Icon
@@ -40,23 +40,26 @@
40
40
  color: @textColor;
41
41
  }
42
42
 
43
+ .ui.header:first-child {
44
+ margin-top: @firstMargin;
45
+ }
46
+ .ui.header:last-child {
47
+ margin-bottom: @lastMargin;
48
+ }
49
+
50
+ /*--------------
51
+ Sub Header
52
+ ---------------*/
53
+
43
54
  .ui.header .sub.header {
44
- font-size: @subHeaderFontSize;
45
55
  font-weight: normal;
46
56
  margin: 0em;
47
57
  padding: 0em;
48
-
58
+ font-size: @subHeaderFontSize;
49
59
  line-height: @subHeaderLineHeight;
50
60
  color: @subHeaderColor;
51
61
  }
52
62
 
53
- .ui.header:first-child {
54
- margin-top: @firstMargin;
55
- }
56
- .ui.header:last-child {
57
- margin-bottom: @lastMargin;
58
- }
59
-
60
63
  /*--------------
61
64
  Icon
62
65
  ---------------*/
@@ -94,27 +97,6 @@
94
97
  vertical-align: @contentIconAlignment;
95
98
  }
96
99
 
97
- /*--------------
98
- Content Heading
99
- ---------------*/
100
-
101
- .ui.tiny.header {
102
- font-size: @tiny;
103
- }
104
- .ui.small.header {
105
- font-size: @small;
106
- }
107
- .ui.medium.header {
108
- font-size: @medium;
109
- }
110
- .ui.large.header {
111
- font-size: @large;
112
- }
113
- .ui.huge.header {
114
- min-height: 1em;
115
- font-size: @huge;
116
- }
117
-
118
100
 
119
101
  /*--------------
120
102
  Loose Coupling
@@ -136,11 +118,11 @@
136
118
  Types
137
119
  *******************************/
138
120
 
121
+
139
122
  /*--------------
140
123
  Page
141
124
  ---------------*/
142
125
 
143
-
144
126
  h1.ui.header {
145
127
  font-size: @h1;
146
128
  }
@@ -158,6 +140,63 @@ h5.ui.header {
158
140
  }
159
141
 
160
142
 
143
+ /* Sub Header */
144
+ h1.ui.header .sub.header {
145
+ font-size: @h1SubHeaderFontSize;
146
+ }
147
+ h2.ui.header .sub.header {
148
+ font-size: @h2SubHeaderFontSize;
149
+ }
150
+ h3.ui.header .sub.header {
151
+ font-size: @h3SubHeaderFontSize;
152
+ }
153
+ h4.ui.header .sub.header {
154
+ font-size: @h4SubHeaderFontSize;
155
+ }
156
+ h5.ui.header .sub.header {
157
+ font-size: @h5SubHeaderFontSize;
158
+ }
159
+
160
+
161
+ /*--------------
162
+ Content Heading
163
+ ---------------*/
164
+
165
+ .ui.huge.header {
166
+ min-height: 1em;
167
+ font-size: @huge;
168
+ }
169
+ .ui.large.header {
170
+ font-size: @large;
171
+ }
172
+ .ui.medium.header {
173
+ font-size: @medium;
174
+ }
175
+ .ui.small.header {
176
+ font-size: @small;
177
+ }
178
+ .ui.tiny.header {
179
+ font-size: @tiny;
180
+ }
181
+
182
+ /* Sub Header */
183
+ .ui.huge.header .sub.header {
184
+ font-size: @hugeSubHeaderFontSize;
185
+ }
186
+ .ui.large.header .sub.header {
187
+ font-size: @hugeSubHeaderFontSize;
188
+ }
189
+ .ui.header .sub.header {
190
+ font-size: @subHeaderFontSize;
191
+ }
192
+ .ui.small.header .sub.header {
193
+ font-size: @smallSubHeaderFontSize;
194
+ }
195
+ .ui.tiny.header .sub.header {
196
+ font-size: @tinySubHeaderFontSize;
197
+ }
198
+
199
+
161
200
  /*-------------------
162
201
  Icon
163
202
  --------------------*/