client_side_validations-simple_form 7.0.0 → 8.0.0

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
  SHA256:
3
- metadata.gz: c342252657d107301bea3efe9a6b1bfe40212134ce912dad3a9d85b7745e7423
4
- data.tar.gz: 9898b2d60653f80336122671262319fd0cc41d008389f3c0a35ad949441b0b4d
3
+ metadata.gz: 7ab91f749363a961a924494e11a2b086ffb4ba86b9e088af0cfa3b68ac8d64f4
4
+ data.tar.gz: e3b535668b7197948a78884b3b8d04615356dfdcc34fe0a269547d07cf80b4c0
5
5
  SHA512:
6
- metadata.gz: 5f09f68843fd3844eccd386fc7a7716720d852df7c4104eed937168e3afa6f87318bfc2c7f22f9dee0bbe0a4a4d6051f4813c2f2db135f4274ded36337a60226
7
- data.tar.gz: adf0cc462f91ffa49620a5405a7be611f1a3749e602cc523442b5ddfee5fea401ceaf79f19f6033ccc24a059c3df2a292052756a153a693b791831d393a0532d
6
+ metadata.gz: 6571d8fdbfc6700501bc09e8ade73d3ce4c4447b735f0da1885c950826b31994b2d0bb6f079012ae298171304b0c257d0128408b18c322dd75497fa21f536144
7
+ data.tar.gz: 20c0db51744292669d32b3a50e5b9c51d16bb5f3382edb5937b321f860288477874033f4d96475a1bcc6b221666e7c60988a6ffd18f9950c295ffcbcf3a1ba00
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0 / 2019-08-25
4
+
5
+ * [FEATURE] Move to ES6
6
+ * [FEATURE] Add ClientSideValidations 16.0 compatibility
7
+ * [FEATURE] Add Webpacker compatibility
8
+ * [FEATURE] Drop Simple Form 3.5 compatibility
9
+ * [ENHANCEMENT] Update development dependencies
10
+
3
11
  ## 7.0.0 / 2019-05-14
4
12
 
5
13
  * [FEATURE] Add ClientSideValidations 15.0 compatibility
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # ClientSideValidations-SimpleForm #
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/client_side_validations-simple_form.svg)](https://badge.fury.io/rb/client_side_validations-simple_form)
4
+ [![npm version](https://badge.fury.io/js/%40client-side-validations%2Fsimple-form.svg)](https://badge.fury.io/js/%40client-side-validations%2Fsimple-form)
4
5
  [![Build Status](https://secure.travis-ci.org/DavyJonesLocker/client_side_validations-simple_form.svg?branch=master)](https://travis-ci.org/DavyJonesLocker/client_side_validations-simple_form)
5
6
  [![Code Climate](https://codeclimate.com/github/DavyJonesLocker/client_side_validations-simple_form/badges/gpa.svg)](https://codeclimate.com/github/DavyJonesLocker/client_side_validations-simple_form)
6
7
  [![Coverage Status](https://coveralls.io/repos/github/DavyJonesLocker/client_side_validations-simple_form/badge.svg?branch=master)](https://coveralls.io/github/DavyJonesLocker/client_side_validations-simple_form?branch=master)
7
8
 
8
- [SimpleForm](https://github.com/plataformatec/simple_form) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
9
+ [Simple Form](https://github.com/plataformatec/simple_form) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
9
10
 
10
11
  ## Installation ##
11
12
 
@@ -17,36 +18,60 @@ gem 'client_side_validations'
17
18
  gem 'client_side_validations-simple_form'
18
19
  ```
19
20
 
20
- Order matters here. `SimpleForm` and `ClientSideValidations` need to be
21
- required **before** `ClientSideValidations-SimpleForm`.
21
+ Order matters here. `simple_form` and `client_side_validations` need to be
22
+ required **before** `client_side_validations-simple_form`.
22
23
 
23
24
  [Follow the remaining installation instructions for ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations/blob/master/README.md)
24
25
 
25
- According to the web framework you are using, add **one** of the following lines to `app/assets/javascripts/application.js`
26
+ ### JavaScript file ###
26
27
 
27
- ```javascript
28
+ Instructions depend on your technology stack.
29
+
30
+ #### When using Webpacker ####
31
+
32
+ Make sure that you are requiring jQuery and Client Side Validations.
33
+
34
+ Add the following package:
35
+
36
+ ```sh
37
+ yarn add @client-side-validations/simple-form
38
+ ```
39
+
40
+ Then, according to the CSS framework you are using, add **one** of the following
41
+ lines to your `app/javascript/packs/application.js` pack, **after**
42
+ `import '@client-side-validations/client-side-validations'`:
43
+
44
+ ```js
28
45
  // No framework / Generic frameworks / Bootstrap 3
29
- //= require rails.validations.simple_form
46
+ import '@client-side-validations/simple-form'
30
47
 
31
48
  // Bootstrap 4
32
- //= require rails.validations.simple_form.bootstrap4
49
+ import '@client-side-validations/simple-form/dist/simple-form.bootstrap4'
33
50
  ```
34
51
 
35
- Again, order matters. You should add this line after the require for `rails.validations` as described in the `ClientSideValidations` installation instructions.
52
+ #### When using Sprockets ####
36
53
 
37
- If the asset pipeline is disabled the asset file will be copied
38
- into `public/javascripts` when the `ClientSideValidations` install generator is run.
54
+ Make sure that you are requiring jQuery and Client Side Validations.
55
+
56
+ According to the web framework you are using, add **one** of the following
57
+ lines to your `app/assets/javascripts/application.js`, **after**
58
+ `//= require rails.validations`
59
+
60
+ ```js
61
+ // No framework / Generic frameworks / Bootstrap 3
62
+ //= require rails.validations.simple_form
63
+
64
+ // Bootstrap 4
65
+ //= require rails.validations.simple_form.bootstrap4
66
+ ```
39
67
 
40
- At any time you can copy the asset file into your project by running:
68
+ If you need to copy the asset files from the gem into your project, run:
41
69
 
42
70
  ```
43
71
  rails g client_side_validations:copy_assets
44
72
  ```
45
73
 
46
- If the asset pipeline is disabled the asset file will be copied
47
- into `public/javascripts`. Otherwise the asset file will be copied into
48
- `app/assets/javascripts` (or whatever asset directory you have
49
- defined)
74
+ Note: If you run `copy_assets`, you will need to run it again each time you update this project.
50
75
 
51
76
  ## Usage ##
52
77
 
@@ -5,13 +5,13 @@ module ClientSideValidations
5
5
  module FormBuilder
6
6
  def client_side_form_settings(options, _form_helper)
7
7
  {
8
- type: self.class.to_s,
9
- error_class: wrapper.find(:error).defaults[:class].first,
10
- error_tag: wrapper.find(:error).defaults[:tag],
8
+ type: self.class.to_s,
9
+ error_class: wrapper.find(:error).defaults[:class].first,
10
+ error_tag: wrapper.find(:error).defaults[:tag],
11
11
  wrapper_error_class: wrapper.defaults[:error_class],
12
- wrapper_tag: wrapper.defaults[:tag],
13
- wrapper_class: wrapper.defaults[:class].first,
14
- wrapper: options[:wrapper] || ::SimpleForm.default_wrapper
12
+ wrapper_tag: wrapper.defaults[:tag],
13
+ wrapper_class: wrapper.defaults[:class].first,
14
+ wrapper: options[:wrapper] || ::SimpleForm.default_wrapper
15
15
  }
16
16
  end
17
17
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ClientSideValidations
4
4
  module SimpleForm
5
- VERSION = '7.0.0'
5
+ VERSION = '8.0.0'
6
6
  end
7
7
  end
@@ -1,48 +1,55 @@
1
-
2
1
  /*!
3
- * Client Side Validations - SimpleForm (Bootstrap 4) - v7.0.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
2
+ * Client Side Validations Simple Form JS (Bootstrap 4) - v0.0.1 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
4
3
  * Copyright (c) 2019 Geremia Taglialatela, Brian Cardarella
5
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
6
5
  */
7
6
 
8
- (function() {
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('@client-side-validations/client-side-validations')) :
9
+ typeof define === 'function' && define.amd ? define(['jquery', '@client-side-validations/client-side-validations'], factory) :
10
+ (global = global || self, factory(global.$, global.ClientSideValidations));
11
+ }(this, function ($, ClientSideValidations) { 'use strict';
12
+
13
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
14
+ ClientSideValidations = ClientSideValidations && ClientSideValidations.hasOwnProperty('default') ? ClientSideValidations['default'] : ClientSideValidations;
15
+
9
16
  ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
10
- add: function(element, settings, message) {
11
- return this.wrapper(settings.wrapper).add.call(this, element, settings, message);
17
+ add: function add(element, settings, message) {
18
+ this.wrapper(settings.wrapper).add.call(this, element, settings, message);
12
19
  },
13
- remove: function(element, settings) {
14
- return this.wrapper(settings.wrapper).remove.call(this, element, settings);
20
+ remove: function remove(element, settings) {
21
+ this.wrapper(settings.wrapper).remove.call(this, element, settings);
15
22
  },
16
- wrapper: function(name) {
23
+ wrapper: function wrapper(name) {
17
24
  return this.wrappers[name] || this.wrappers["default"];
18
25
  },
19
26
  wrappers: {
20
27
  "default": {
21
- add: function(element, settings, message) {
22
- var errorElement, wrapperElement;
23
- wrapperElement = element.parent();
24
- errorElement = wrapperElement.find(settings.error_tag + ".invalid-feedback");
28
+ add: function add(element, settings, message) {
29
+ var wrapperElement = element.parent();
30
+ var errorElement = wrapperElement.find(settings.error_tag + '.invalid-feedback');
31
+
25
32
  if (!errorElement.length) {
26
- errorElement = $("<" + settings.error_tag + "/>", {
33
+ errorElement = $('<' + settings.error_tag + '/>', {
27
34
  "class": 'invalid-feedback',
28
35
  text: message
29
36
  });
30
37
  wrapperElement.append(errorElement);
31
38
  }
39
+
32
40
  wrapperElement.addClass(settings.wrapper_error_class);
33
41
  element.addClass('is-invalid');
34
- return errorElement.text(message);
42
+ errorElement.text(message);
35
43
  },
36
- remove: function(element, settings) {
37
- var errorElement, wrapperElement;
38
- wrapperElement = element.parent();
39
- errorElement = wrapperElement.find(settings.error_tag + ".invalid-feedback");
44
+ remove: function remove(element, settings) {
45
+ var wrapperElement = element.parent();
46
+ var errorElement = wrapperElement.find(settings.error_tag + '.invalid-feedback');
40
47
  wrapperElement.removeClass(settings.wrapper_error_class);
41
48
  element.removeClass('is-invalid');
42
- return errorElement.remove();
49
+ errorElement.remove();
43
50
  }
44
51
  }
45
52
  }
46
53
  };
47
54
 
48
- }).call(this);
55
+ }));
@@ -1,41 +1,48 @@
1
-
2
1
  /*!
3
- * Client Side Validations - SimpleForm - v7.0.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
2
+ * Client Side Validations Simple Form JS (Default) - v0.0.1 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
4
3
  * Copyright (c) 2019 Geremia Taglialatela, Brian Cardarella
5
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
6
5
  */
7
6
 
8
- (function() {
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('@client-side-validations/client-side-validations')) :
9
+ typeof define === 'function' && define.amd ? define(['jquery', '@client-side-validations/client-side-validations'], factory) :
10
+ (global = global || self, factory(global.$, global.ClientSideValidations));
11
+ }(this, function ($, ClientSideValidations) { 'use strict';
12
+
13
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
14
+ ClientSideValidations = ClientSideValidations && ClientSideValidations.hasOwnProperty('default') ? ClientSideValidations['default'] : ClientSideValidations;
15
+
9
16
  ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
10
- add: function(element, settings, message) {
11
- return this.wrapper(settings.wrapper).add.call(this, element, settings, message);
17
+ add: function add(element, settings, message) {
18
+ this.wrapper(settings.wrapper).add.call(this, element, settings, message);
12
19
  },
13
- remove: function(element, settings) {
14
- return this.wrapper(settings.wrapper).remove.call(this, element, settings);
20
+ remove: function remove(element, settings) {
21
+ this.wrapper(settings.wrapper).remove.call(this, element, settings);
15
22
  },
16
- wrapper: function(name) {
23
+ wrapper: function wrapper(name) {
17
24
  return this.wrappers[name] || this.wrappers["default"];
18
25
  },
19
26
  wrappers: {
20
27
  "default": {
21
- add: function(element, settings, message) {
22
- var errorElement, wrapper;
23
- wrapper = element.closest(settings.wrapper_tag + "." + (settings.wrapper_class.replace(/\ /g, '.')));
24
- errorElement = wrapper.find(settings.error_tag + "." + (settings.error_class.replace(/\ /g, '.')));
28
+ add: function add(element, settings, message) {
29
+ var wrapper = element.closest(settings.wrapper_tag + '.' + settings.wrapper_class.replace(/ /g, '.'));
30
+ var errorElement = wrapper.find(settings.error_tag + '.' + settings.error_class.replace(/ /g, '.'));
31
+
25
32
  if (!errorElement.length) {
26
- errorElement = $("<" + settings.error_tag + "/>", {
33
+ errorElement = $('<' + settings.error_tag + '/>', {
27
34
  "class": settings.error_class,
28
35
  text: message
29
36
  });
30
37
  wrapper.append(errorElement);
31
38
  }
39
+
32
40
  wrapper.addClass(settings.wrapper_error_class);
33
41
  return errorElement.text(message);
34
42
  },
35
- remove: function(element, settings) {
36
- var errorElement, wrapper;
37
- wrapper = element.closest(settings.wrapper_tag + "." + (settings.wrapper_class.replace(/\ /g, '.')) + "." + settings.wrapper_error_class);
38
- errorElement = wrapper.find(settings.error_tag + "." + (settings.error_class.replace(/\ /g, '.')));
43
+ remove: function remove(element, settings) {
44
+ var wrapper = element.closest(settings.wrapper_tag + '.' + settings.wrapper_class.replace(/ /g, '.') + '.' + settings.wrapper_error_class);
45
+ var errorElement = wrapper.find(settings.error_tag + '.' + settings.error_class.replace(/ /g, '.'));
39
46
  wrapper.removeClass(settings.wrapper_error_class);
40
47
  return errorElement.remove();
41
48
  }
@@ -43,4 +50,4 @@
43
50
  }
44
51
  };
45
52
 
46
- }).call(this);
53
+ }));
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations-simple_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,42 +9,42 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-14 00:00:00.000000000 Z
12
+ date: 2019-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: client_side_validations
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '15.0'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '17.0'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: '15.0'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '17.0'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: simple_form
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '3.5'
35
- - - "<"
38
+ - - "~>"
36
39
  - !ruby/object:Gem::Version
37
- version: '5'
40
+ version: '4.0'
38
41
  type: :runtime
39
42
  prerelease: false
40
43
  version_requirements: !ruby/object:Gem::Requirement
41
44
  requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: '3.5'
45
- - - "<"
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5'
47
+ version: '4.0'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: appraisal
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -85,14 +85,14 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.12.0
88
+ version: 0.13.1
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.12.0
95
+ version: 0.13.1
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: m
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -127,14 +127,14 @@ dependencies:
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '1.8'
130
+ version: '1.9'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '1.8'
137
+ version: '1.9'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rake
140
140
  requirement: !ruby/object:Gem::Requirement
@@ -155,56 +155,56 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 0.69.0
158
+ version: 0.74.0
159
159
  type: :development
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: 0.69.0
165
+ version: 0.74.0
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: rubocop-performance
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '1.3'
172
+ version: '1.4'
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '1.3'
179
+ version: '1.4'
180
180
  - !ruby/object:Gem::Dependency
181
- name: simplecov
181
+ name: rubocop-rails
182
182
  requirement: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 0.16.1
186
+ version: '2.3'
187
187
  type: :development
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: 0.16.1
193
+ version: '2.3'
194
194
  - !ruby/object:Gem::Dependency
195
- name: coffee-script
195
+ name: simplecov
196
196
  requirement: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '2.4'
200
+ version: 0.17.0
201
201
  type: :development
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '2.4'
207
+ version: 0.17.0
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: shotgun
210
210
  requirement: !ruby/object:Gem::Requirement