less-rails-semantic_ui 2.2.11.0 → 2.2.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d477837a7be01ca7239764a19594ac8d1194f963
4
- data.tar.gz: c6c168faa6f43180f91e61884c9ae231adcc6301
3
+ metadata.gz: aacf50940a4e0bc57c380fc73ae34b0dda05d217
4
+ data.tar.gz: 8b2f22f7ddd48f40f0e6fbb630d00259cf57cb3a
5
5
  SHA512:
6
- metadata.gz: a9721ac19d26e54823071fdf0bb52d343c3f3239910b526377747b3bf168ac8a2fe79573e5c7f6629e79d0f1340efb159ecd6b9ed8bdea02437bef32eafc9a4a
7
- data.tar.gz: a267be9c25cb2db24cbea2d452d8da9b1b25ddf0593ec6275e1de83f3fd90673007a3e43bde4e2dc74dafa8e6d289ddb270ed7f7e3ab76a7353f154d96e3715c
6
+ metadata.gz: 9f11911c48cc9522f474e0989d291c057b2d945d68faf98ad734e9a8796fa27d0a3d6dcdca553427aef5c3d089102772adedd76852e69760acf125c557c4949b
7
+ data.tar.gz: 97b66e0343e6ebb4deea59b34605ac13d98e08540bddc2b35ccb90a14cab7b80befb6c55e9d4c3f06ca4725191a3b1e344812dda0ec8a20f1f40e3151385da86
data/README.md CHANGED
@@ -17,6 +17,7 @@ Add this block to your application's Gemfile:
17
17
 
18
18
  gem 'less-rails-semantic_ui', '~> x.x.x'
19
19
  gem 'autoprefixer-rails', '~> x.x.x'
20
+ gem 'therubyracer'
20
21
  ```
21
22
 
22
23
  > Semantic UI is using [autoprefixer](https://github.com/postcss/autoprefixer) (in our case [autoprefixer-rails](https://github.com/ai/autoprefixer-rails))
@@ -97,7 +97,13 @@ $.fn.dropdown = function(parameters) {
97
97
  module.setup.reference();
98
98
  }
99
99
  else {
100
+
100
101
  module.setup.layout();
102
+
103
+ if(settings.values) {
104
+ module.change.values(settings.values);
105
+ }
106
+
101
107
  module.refreshData();
102
108
 
103
109
  module.save.defaults();
@@ -162,7 +168,7 @@ $.fn.dropdown = function(parameters) {
162
168
  observe: {
163
169
  select: function() {
164
170
  if(module.has.input()) {
165
- selectObserver.observe($input[0], {
171
+ selectObserver.observe($module[0], {
166
172
  childList : true,
167
173
  subtree : true
168
174
  });
@@ -383,19 +389,16 @@ $.fn.dropdown = function(parameters) {
383
389
  reference: function() {
384
390
  module.debug('Dropdown behavior was called on select, replacing with closest dropdown');
385
391
  // replace module reference
386
- $module = $module.parent(selector.dropdown);
392
+ $module = $module.parent(selector.dropdown);
393
+ instance = $module.data(moduleNamespace);
394
+ element = $module.get(0);
387
395
  module.refresh();
388
396
  module.setup.returnedObject();
389
- // invoke method in context of current instance
390
- if(methodInvoked) {
391
- instance = module;
392
- module.invoke(query);
393
- }
394
397
  },
395
398
  returnedObject: function() {
396
399
  var
397
400
  $firstModules = $allModules.slice(0, elementIndex),
398
- $lastModules = $allModules.slice(elementIndex + 1)
401
+ $lastModules = $allModules.slice(elementIndex + 1)
399
402
  ;
400
403
  // adjust all modules to use correct reference
401
404
  $allModules = $firstModules.add($module).add($lastModules);
@@ -913,6 +916,23 @@ $.fn.dropdown = function(parameters) {
913
916
  }
914
917
  },
915
918
 
919
+ change: {
920
+ values: function(values) {
921
+ if(!settings.allowAdditions) {
922
+ module.clear();
923
+ }
924
+ module.debug('Creating dropdown with specified values', values);
925
+ module.setup.menu({values: values});
926
+ $.each(values, function(index, item) {
927
+ if(item.selected == true) {
928
+ module.debug('Setting initial selection to', item.value);
929
+ module.set.selected(item.value);
930
+ return true;
931
+ }
932
+ });
933
+ }
934
+ },
935
+
916
936
  event: {
917
937
  change: function() {
918
938
  if(!internalChange) {
@@ -1081,7 +1101,22 @@ $.fn.dropdown = function(parameters) {
1081
1101
  select: {
1082
1102
  mutation: function(mutations) {
1083
1103
  module.debug('<select> modified, recreating menu');
1084
- module.setup.select();
1104
+ var
1105
+ isSelectMutation = false
1106
+ ;
1107
+ $.each(mutations, function(index, mutation) {
1108
+ if($(mutation.target).is('select') || $(mutation.addedNodes).is('select')) {
1109
+ isSelectMutation = true;
1110
+ return true;
1111
+ }
1112
+ });
1113
+ if(isSelectMutation) {
1114
+ module.disconnect.selectObserver();
1115
+ module.refresh();
1116
+ module.setup.select();
1117
+ module.set.selected();
1118
+ module.observe.select();
1119
+ }
1085
1120
  }
1086
1121
  },
1087
1122
  menu: {
@@ -1619,6 +1654,9 @@ $.fn.dropdown = function(parameters) {
1619
1654
  return $module.data(metadata.defaultValue);
1620
1655
  },
1621
1656
  placeholderText: function() {
1657
+ if(settings.placeholder != 'auto' && typeof settings.placeholder == 'string') {
1658
+ return settings.placeholder;
1659
+ }
1622
1660
  return $module.data(metadata.placeholderText) || '';
1623
1661
  },
1624
1662
  text: function() {
@@ -3044,7 +3082,7 @@ $.fn.dropdown = function(parameters) {
3044
3082
  return $(event.target).closest($icon).length > 0;
3045
3083
  },
3046
3084
  alreadySetup: function() {
3047
- return ($module.is('select') && $module.parent(selector.dropdown).length > 0 && $module.prev().length === 0);
3085
+ return ($module.is('select') && $module.parent(selector.dropdown).data(moduleNamespace) !== undefined && $module.prev().length === 0);
3048
3086
  },
3049
3087
  animating: function($subMenu) {
3050
3088
  return ($subMenu)
@@ -3594,6 +3632,7 @@ $.fn.dropdown.settings = {
3594
3632
  on : 'click', // what event should show menu action on item selection
3595
3633
  action : 'activate', // action on item selection (nothing, activate, select, combo, hide, function(){})
3596
3634
 
3635
+ values : false, // specify values to use for dropdown
3597
3636
 
3598
3637
  apiSettings : false,
3599
3638
  selectOnKeydown : true, // Whether selection should occur automatically when keyboard shortcuts used
@@ -329,6 +329,9 @@ $.fn.modal = function(parameters) {
329
329
  module.hideOthers(module.showModal);
330
330
  }
331
331
  else {
332
+ if(settings.allowMultiple && settings.detachable) {
333
+ $module.detach().appendTo($dimmer);
334
+ }
332
335
  settings.onShow.call(element);
333
336
  if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
334
337
  module.debug('Showing modal with css animations');
@@ -532,24 +535,41 @@ $.fn.modal = function(parameters) {
532
535
  },
533
536
 
534
537
  cacheSizes: function() {
538
+ $module.addClass(className.loading);
535
539
  var
536
- modalHeight = $module.outerHeight()
540
+ scrollHeight = $module.prop('scrollHeight'),
541
+ modalHeight = $module.outerHeight()
537
542
  ;
538
543
  if(module.cache === undefined || modalHeight !== 0) {
539
544
  module.cache = {
540
545
  pageHeight : $(document).outerHeight(),
541
546
  height : modalHeight + settings.offset,
547
+ scrollHeight : scrollHeight + settings.offset,
542
548
  contextHeight : (settings.context == 'body')
543
549
  ? $(window).height()
544
- : $dimmable.height()
550
+ : $dimmable.height(),
545
551
  };
552
+ module.cache.topOffset = -(module.cache.height / 2);
546
553
  }
554
+ $module.removeClass(className.loading);
547
555
  module.debug('Caching modal and container sizes', module.cache);
548
556
  },
549
557
 
550
558
  can: {
551
559
  fit: function() {
552
- return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
560
+ var
561
+ contextHeight = module.cache.contextHeight,
562
+ verticalCenter = module.cache.contextHeight / 2,
563
+ topOffset = module.cache.topOffset,
564
+ scrollHeight = module.cache.scrollHeight,
565
+ height = module.cache.height,
566
+ paddingHeight = settings.padding,
567
+ startPosition = (verticalCenter + topOffset)
568
+ ;
569
+ return (scrollHeight > height)
570
+ ? (startPosition + scrollHeight + paddingHeight < contextHeight)
571
+ : (height + (paddingHeight * 2) < contextHeight)
572
+ ;
553
573
  }
554
574
  },
555
575
 
@@ -664,7 +684,7 @@ $.fn.modal = function(parameters) {
664
684
  $module
665
685
  .css({
666
686
  top: '',
667
- marginTop: -(module.cache.height / 2)
687
+ marginTop: module.cache.topOffset
668
688
  })
669
689
  ;
670
690
  }
@@ -937,6 +957,7 @@ $.fn.modal.settings = {
937
957
  animating : 'animating',
938
958
  blurring : 'blurring',
939
959
  inverted : 'inverted',
960
+ loading : 'loading',
940
961
  scrolling : 'scrolling',
941
962
  undetached : 'undetached'
942
963
  }
@@ -125,7 +125,7 @@ $.fn.popup = function(parameters) {
125
125
  }
126
126
  if(settings.popup) {
127
127
  $popup.addClass(className.loading);
128
- $offsetParent = module.get.offsetParent($target);
128
+ $offsetParent = module.get.offsetParent();
129
129
  $popup.removeClass(className.loading);
130
130
  if(settings.movePopup && module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {
131
131
  module.debug('Moving popup to the same offset parent as target');
@@ -139,7 +139,7 @@ $.fn.popup = function(parameters) {
139
139
  $offsetParent = (settings.inline)
140
140
  ? module.get.offsetParent($target)
141
141
  : module.has.popup()
142
- ? module.get.offsetParent($target)
142
+ ? module.get.offsetParent($popup)
143
143
  : $body
144
144
  ;
145
145
  }
@@ -221,7 +221,6 @@
221
221
 
222
222
  /* Menu */
223
223
  .ui.menu .dropdown.item .menu {
224
- left: 0px;
225
224
  min-width: ~"calc(100% - 1px)";
226
225
  border-radius: 0em 0em @dropdownMenuBorderRadius @dropdownMenuBorderRadius;
227
226
  background: @dropdownBackground;
@@ -843,8 +843,8 @@ select.ui.dropdown {
843
843
  .ui.default.dropdown:not(.button) > .text {
844
844
  color: @defaultTextColor;
845
845
  }
846
- .ui.dropdown:not(.button) > input:focus + .default.text,
847
- .ui.default.dropdown:not(.button) > input:focus + .text {
846
+ .ui.dropdown:not(.button) > input:focus ~ .default.text,
847
+ .ui.default.dropdown:not(.button) > input:focus ~ .text {
848
848
  color: @defaultTextFocusColor;
849
849
  }
850
850
  /*--------------------
@@ -333,6 +333,12 @@
333
333
  States
334
334
  *******************************/
335
335
 
336
+ .ui.loading.modal {
337
+ display: block;
338
+ visibility: hidden;
339
+ z-index: @loadingZIndex;
340
+ }
341
+
336
342
  .ui.active.modal {
337
343
  display: block;
338
344
  }
@@ -2,7 +2,7 @@
2
2
  Overrides
3
3
  *******************************/
4
4
 
5
- @import url(http://fonts.googleapis.com/css?family=Karma);
5
+ @import url(https://fonts.googleapis.com/css?family=Karma);
6
6
 
7
7
  h1.ui.header,
8
8
  .ui.huge.header {
@@ -2,7 +2,7 @@
2
2
  Overrides
3
3
  *******************************/
4
4
 
5
- @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);
5
+ @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro);
6
6
 
7
7
  .ui.labeled.icon.buttons > .button > .icon,
8
8
  .ui.labeled.icon.button > .icon {
@@ -2,4 +2,4 @@
2
2
  Overrides
3
3
  *******************************/
4
4
 
5
- @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);
5
+ @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro);
@@ -40,7 +40,7 @@
40
40
  /* Icon */
41
41
  @iconOpacity: 1;
42
42
  @iconSize: 1.5em;
43
- @iconOffset: @lineHeightOffset;
43
+ @iconOffset: 0em;
44
44
  @iconMargin: 0.75rem;
45
45
  @iconAlignment: middle;
46
46
 
@@ -35,7 +35,7 @@
35
35
 
36
36
  /* Icon */
37
37
  @iconDistance: @relative4px;
38
- @iconOffset: ((@itemLineHeight - 1rem) / 2);
38
+ @iconOffset: 0em;
39
39
  @iconTransition: color @defaultDuration @defaultEasing;
40
40
  @iconVerticalAlign: top;
41
41
  @iconContentVerticalAlign: top;
@@ -97,6 +97,12 @@
97
97
  /* Coupling */
98
98
  @invertedBoxShadow: 1px 3px 10px 2px rgba(0, 0, 0, 0.2);
99
99
 
100
+ /*-------------------
101
+ States
102
+ --------------------*/
103
+
104
+ @loadingZIndex: -1;
105
+
100
106
  /*-------------------
101
107
  Types
102
108
  --------------------*/
@@ -3,7 +3,7 @@
3
3
  *******************************/
4
4
 
5
5
 
6
- @import url(http://fonts.googleapis.com/css?family=Montserrat:700,400);
6
+ @import url(https://fonts.googleapis.com/css?family=Montserrat:700,400);
7
7
 
8
8
  .ui.cards > .card,
9
9
  .ui.card {
@@ -3,4 +3,4 @@
3
3
  *******************************/
4
4
 
5
5
  /* Import Droid Arabic Kufi */
6
- @import 'http://fonts.googleapis.com/earlyaccess/droidarabickufi.css';
6
+ @import 'https://fonts.googleapis.com/earlyaccess/droidarabickufi.css';
@@ -1,7 +1,7 @@
1
1
  module Less
2
2
  module Rails
3
3
  module SemanticUI
4
- VERSION = '2.2.11.0'
4
+ VERSION = '2.2.13.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less-rails-semantic_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.11.0
4
+ version: 2.2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Dobryakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-19 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: less-rails
@@ -62,16 +62,16 @@ dependencies:
62
62
  name: rack
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '1'
67
+ version: 2.0.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '1'
74
+ version: 2.0.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minispec
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -2466,7 +2466,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2466
2466
  version: '0'
2467
2467
  requirements: []
2468
2468
  rubyforge_project:
2469
- rubygems_version: 2.4.8
2469
+ rubygems_version: 2.6.12
2470
2470
  signing_key:
2471
2471
  specification_version: 4
2472
2472
  summary: Semantic UI assets for Rails