ad2games-ui_components 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9034d29a048c3558401f2ee9b7253e1f72c7292b
4
- data.tar.gz: ec7f023e4fd016d3ae99712184822f1a21c7ad2b
3
+ metadata.gz: 1cfcef8221e4ba9259021e97c253598167796485
4
+ data.tar.gz: d51d62652b25afbfd73166fd14711f998c42479d
5
5
  SHA512:
6
- metadata.gz: 050bd79188ef56087676254f87a35a08a5f47bf801da60a87b5a4d7fee1d0b63e5de3530521af0c256cdf1497eccc22f77fc789fc929ac63bac2d2ad62a948c5
7
- data.tar.gz: e63298403223ecea7f9a73d12451acc84d3f0eda3383fe4d309dd174b8a16c180285337d24d298e5c6f9345263f8e4196c88fe36acaca7eced46f77274659552
6
+ metadata.gz: b197dc903aa03cd5f1542d8b31dbb16539e355f9899dce7a2f3a40184e95096235a967510f06119a342a11c9d43073ef61a0ce86eeeac183b1ef1f431c3f4877
7
+ data.tar.gz: 8fdc35c21ffb4dfeba65d011480cd4ddb08ab0dfe9a9047af94d7db2ca5437c151685f20a75829e04dc9a03f491f3455add71b36c7b09083a61a4f4787c59ac2
@@ -25,7 +25,7 @@ class DateRangeCell < FormCellBase
25
25
  private
26
26
 
27
27
  def date_field(type)
28
- options[:form].text_field(
28
+ options[:form].hidden_field(
29
29
  "#{options[:name]}_#{type}",
30
30
  id: "#{id}_#{type}",
31
31
  skip_label: true,
@@ -1,5 +1,5 @@
1
1
  .modal.fade id=id
2
- .modal-dialog
2
+ .modal-dialog class=extra_class
3
3
  .modal-content
4
4
  .modal-header
5
5
  button.close aria-label="Close" data-dismiss="modal" type="button"
@@ -16,7 +16,8 @@ examples:
16
16
  title: "Hello!",
17
17
  content: "'If you knew Time as well as I do,' said the Hatter, " \
18
18
  "'you wouldn't talk about wasting IT. It's HIM.'",
19
- buttons: [:close, :submit]
19
+ buttons: [:close, :submit],
20
+ extra_class: 'modal-sm'
20
21
 
21
22
  button.btn.btn-default data-toggle="modal" data-target="#hatter"
22
23
  = 'Click me!'
@@ -2,6 +2,7 @@
2
2
  class ModalCell < UiComponents::Cell
3
3
  attribute :id, mandatory: true, description: 'The HTML id attribute.'
4
4
  attribute :content, mandatory: true, description: "The modal's content."
5
+ attribute :extra_class, description: 'Any extra class on the .modal-dialog element'
5
6
  attribute :title, description: 'A title.'
6
7
  attribute :buttons, description: 'An array of button types. ' \
7
8
  'Valid types are `:close` and `:submit`.'
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  class SelectCell < FormCellBase
3
+ DATA_ATTRIBUTES = %i(
4
+ placeholder
5
+ error
6
+ width
7
+ remote_options
8
+ disable_search
9
+ ).freeze
3
10
  attribute :disabled, description: 'Whether or not the field is disabled.'
4
11
  attribute :form, mandatory: true, description: 'A form object.'
5
12
  attribute :name, mandatory: true, description: 'The name attribute.'
@@ -20,6 +27,7 @@ class SelectCell < FormCellBase
20
27
  attribute :hide_label,
21
28
  description: 'Hide the label, but keep it accessible to screen readers (e.g. Capybara)'
22
29
  attribute :help, description: 'Help text associated with the control'
30
+ attribute :disable_search, description: 'Hide the search input'
23
31
 
24
32
  def show
25
33
  options[:form].select(
@@ -39,11 +47,9 @@ class SelectCell < FormCellBase
39
47
  end
40
48
 
41
49
  def html_options
42
- html_opts = { class: css_class }
43
- html_opts.update(options.slice(:required, :multiple, :disabled))
44
- html_opts[:data] = options.slice(:placeholder, :error, :width, :remote_options)
45
- html_opts[:data][:allow_single_deselect] = !options[:required]
46
- html_opts
50
+ options
51
+ .slice(:required, :multiple, :disabled)
52
+ .merge(class: css_class, data: data_options)
47
53
  end
48
54
 
49
55
  def select_options
@@ -56,4 +62,8 @@ class SelectCell < FormCellBase
56
62
  classes << options[:classes] if options[:classes]
57
63
  classes.join(' ')
58
64
  end
65
+
66
+ def data_options
67
+ options.slice(*DATA_ATTRIBUTES).merge(allow_single_deselect: !options[:required])
68
+ end
59
69
  end
@@ -0,0 +1,2 @@
1
+ # frozen_string_literal: true
2
+ task release: :'bower:install:production'
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module UiComponents
3
- VERSION = '2.0.7'
3
+ VERSION = '2.0.8'
4
4
  end
@@ -0,0 +1,35 @@
1
+ # Chosen
2
+
3
+ Chosen is a library for making long, unwieldy select boxes more user friendly.
4
+
5
+ - jQuery support: 1.4+
6
+ - Prototype support: 1.7+
7
+
8
+ For **documentation**, usage, and examples, see:
9
+ http://harvesthq.github.io/chosen/
10
+
11
+ For **downloads**, see:
12
+ https://github.com/harvesthq/chosen/releases/
13
+
14
+ ### Bower Installation
15
+
16
+ Chosen is available for Bower installation:
17
+ `bower install chosen`
18
+
19
+ The compiled files for the Bower package are automatically generated and stored in a [2nd Chosen repository](https://github.com/harvesthq/bower-chosen). No pull requests will be accepted to that repository.
20
+
21
+ ### Contributing to this project
22
+
23
+ We welcome all to participate in making Chosen the best software it can be. The repository is maintained by only a few people, but has accepted contributions from over 50 authors after reviewing hundreds of pull requests related to thousands of issues. You can help reduce the maintainers' workload (and increase your chance of having an accepted contribution to Chosen) by following the
24
+ [guidelines for contributing](contributing.md).
25
+
26
+ * [Bug reports](contributing.md#bugs)
27
+ * [Feature requests](contributing.md#features)
28
+ * [Pull requests](contributing.md#pull-requests)
29
+
30
+ ### Chosen Credits
31
+
32
+ - Concept and development by [Patrick Filler](http://patrickfiller.com) for [Harvest](http://getharvest.com/).
33
+ - Design and CSS by [Matthew Lettini](http://matthewlettini.com/)
34
+ - Repository maintained by [@pfiller](http://github.com/pfiller), [@kenearley](http://github.com/kenearley), [@stof](http://github.com/stof), [@koenpunt](http://github.com/koenpunt), and [@tjschuck](http://github.com/tjschuck).
35
+ - Chosen includes [contributions by many fine folks](https://github.com/harvesthq/chosen/contributors).
@@ -1,17 +1,6 @@
1
1
  {
2
2
  "name": "chosen",
3
3
  "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.",
4
- "main": [
5
- "chosen.jquery.js",
6
- "chosen.css"
7
- ],
8
- "license": [
9
- {
10
- "type": "MIT",
11
- "url": "https://github.com/harvesthq/chosen/blob/master/LICENSE.md"
12
- }
13
- ],
14
- "ignore": [],
15
4
  "keywords": [
16
5
  "select",
17
6
  "multiselect",
@@ -20,6 +9,8 @@
20
9
  "input",
21
10
  "ui"
22
11
  ],
12
+ "homepage": "https://harvesthq.github.io/chosen/",
13
+ "license": "https://github.com/harvesthq/chosen/blob/master/LICENSE.md",
23
14
  "authors": [
24
15
  {
25
16
  "name": "Patrick Filler",
@@ -38,13 +29,16 @@
38
29
  "url": "https://github.com/koenpunt"
39
30
  }
40
31
  ],
41
- "homepage": "http://harvesthq.github.io/chosen/",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/harvesthq/chosen"
45
- },
46
32
  "dependencies": {
47
33
  "jquery": ">=1.4.4"
48
34
  },
49
- "devDependencies": []
35
+ "main": [
36
+ "chosen.jquery.js",
37
+ "chosen.css"
38
+ ],
39
+ "ignore": [],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/harvesthq/chosen.git"
43
+ }
50
44
  }
@@ -2,7 +2,7 @@
2
2
  Chosen, a Select Box Enhancer for jQuery and Prototype
3
3
  by Patrick Filler for Harvest, http://getharvest.com
4
4
 
5
- Version 1.5.0
5
+ Version 1.6.1
6
6
  Full source at https://github.com/harvesthq/chosen
7
7
  Copyright (c) 2011-2016 Harvest http://getharvest.com
8
8
 
@@ -218,8 +218,7 @@ This file is generated by `grunt build`, do not edit it by hand.
218
218
  margin: 0;
219
219
  padding: 0 5px;
220
220
  width: 100%;
221
- height: auto !important;
222
- height: 1%;
221
+ height: auto;
223
222
  border: 1px solid #aaa;
224
223
  background-color: #fff;
225
224
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
@@ -145,7 +145,8 @@
145
145
  this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
146
146
  this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
147
147
  this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
148
- return this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
148
+ this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
149
+ return this.case_sensitive_search = this.options.case_sensitive_search || false;
149
150
  };
150
151
 
151
152
  AbstractChosen.prototype.set_default_text = function() {
@@ -388,9 +389,10 @@
388
389
  };
389
390
 
390
391
  AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
391
- var regex_anchor;
392
+ var regex_anchor, regex_flag;
392
393
  regex_anchor = this.search_contains ? "" : "^";
393
- return new RegExp(regex_anchor + escaped_search_string, 'i');
394
+ regex_flag = this.case_sensitive_search ? "" : "i";
395
+ return new RegExp(regex_anchor + escaped_search_string, regex_flag);
394
396
  };
395
397
 
396
398
  AbstractChosen.prototype.search_string_match = function(search_string, regex) {
@@ -525,29 +527,12 @@
525
527
  };
526
528
 
527
529
  AbstractChosen.browser_is_supported = function() {
528
- if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
529
- return false;
530
- }
531
- if (/Android/i.test(window.navigator.userAgent)) {
532
- if (/Mobile/i.test(window.navigator.userAgent)) {
533
- return false;
534
- }
535
- }
536
- if (/IEMobile/i.test(window.navigator.userAgent)) {
537
- return false;
538
- }
539
- if (/Windows Phone/i.test(window.navigator.userAgent)) {
540
- return false;
541
- }
542
- if (/BlackBerry/i.test(window.navigator.userAgent)) {
543
- return false;
530
+ if ("Microsoft Internet Explorer" === window.navigator.appName) {
531
+ return document.documentMode >= 8;
544
532
  }
545
- if (/BB10/i.test(window.navigator.userAgent)) {
533
+ if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
546
534
  return false;
547
535
  }
548
- if (window.navigator.appName === "Microsoft Internet Explorer") {
549
- return document.documentMode >= 8;
550
- }
551
536
  return true;
552
537
  };
553
538
 
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "chosen-js",
3
+ "version": "1.6.1",
4
+ "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.",
5
+ "keywords": [
6
+ "select",
7
+ "multiselect",
8
+ "dropdown",
9
+ "form",
10
+ "input",
11
+ "ui"
12
+ ],
13
+ "homepage": "https://harvesthq.github.io/chosen/",
14
+ "bugs": "https://github.com/harvesthq/chosen/issues",
15
+ "license": "MIT",
16
+ "contributors": [
17
+ {
18
+ "name": "Patrick Filler",
19
+ "url": "https://github.com/pfiller"
20
+ },
21
+ {
22
+ "name": "Christophe Coevoet",
23
+ "url": "https://github.com/stof"
24
+ },
25
+ {
26
+ "name": "Ken Earley",
27
+ "url": "https://github.com/kenearley"
28
+ },
29
+ {
30
+ "name": "Koen Punt",
31
+ "url": "https://github.com/koenpunt"
32
+ }
33
+ ],
34
+ "dependencies": {
35
+ "jquery": ">=1.4.4"
36
+ },
37
+ "files": [
38
+ "chosen.jquery.js",
39
+ "chosen.css"
40
+ ],
41
+ "main": "chosen.jquery.js",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/harvesthq/chosen.git"
45
+ }
46
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ad2games-ui_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ad2games
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -353,6 +353,7 @@ files:
353
353
  - app/helpers/ui_components/view_helper.rb
354
354
  - config/locales/en.yml
355
355
  - lib/generators/generate_component.thor
356
+ - lib/tasks/release.rake
356
357
  - lib/tasks/styleguide.rake
357
358
  - lib/ui_components.rb
358
359
  - lib/ui_components/cell.rb
@@ -396,11 +397,13 @@ files:
396
397
  - vendor/assets/bower_components/bootstrap-daterangepicker/examples.html
397
398
  - vendor/assets/bower_components/bootstrap-daterangepicker/package.js
398
399
  - vendor/assets/bower_components/bootstrap-daterangepicker/package.json
400
+ - vendor/assets/bower_components/chosen/README.md
399
401
  - vendor/assets/bower_components/chosen/bower.json
400
402
  - vendor/assets/bower_components/chosen/chosen-sprite.png
401
403
  - vendor/assets/bower_components/chosen/chosen-sprite@2x.png
402
404
  - vendor/assets/bower_components/chosen/chosen.css
403
405
  - vendor/assets/bower_components/chosen/chosen.jquery.js
406
+ - vendor/assets/bower_components/chosen/package.json
404
407
  - vendor/assets/bower_components/highlightjs/LICENSE
405
408
  - vendor/assets/bower_components/highlightjs/Makefile
406
409
  - vendor/assets/bower_components/highlightjs/README.md