client_side_validations-simple_form 11.0.0 → 13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d25ab6ebdb873b200ac6fba902939e13fb24dc2c8e879a18536d71a457c66683
4
- data.tar.gz: ed745d60b6c1f98df01e7fb6ec7a02135a42174a72bbe5c3ac950c789a493341
3
+ metadata.gz: e6a6fb1a1aa70ad970e7f5f44d0b41fe12019c91b3b2bfdaaccd23a543ac61c7
4
+ data.tar.gz: 107d3ff909595f79a9d60ca214916862d743d9e40ed0891a309a7123b0fe0721
5
5
  SHA512:
6
- metadata.gz: df07c951e8cdd1a59317a1fe4321d566a54c4a0e58178799f7832d2ec05a1e4b0d7bc8763b3244c2dbd1b9ef7e526db5e815b06bd983169157e5dac3db859167
7
- data.tar.gz: 5e5d930f6f03e08833aa348b42f79436dd9f258b24ef60eddcba0c51b1ce3407770c526f0627c61a9c9f1c0bbc5527721915fcda85dbebf769af346c04c0d005
6
+ metadata.gz: b83aeba8857abe85776fddaee53f4f55b02d3cf60268000f46f6b8c4e5dc4fb0c6f8449498ba1bef55c03f12d039c8d593ea6cd136c099f277be507083210632
7
+ data.tar.gz: c6200f5b9bd6c184d43f8851877a7bfd0af4fa162896619fe345c91c55bc17443a0b1858f7382a6c22e8614270477525a004dd7cade00150673d70da263d7730
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## main / unreleased
4
+
5
+ * [FEATURE] Insert validation feedback before help text [#116](https://github.com/DavyJonesLocker/client_side_validations-simple_form/pull/116) **POSSIBLE BREAKING CHANGE!**
6
+ * [ENHANCEMENT] Test against jQuery 3.6.0 by default
7
+ * [ENHANCEMENT] Update development dependencies
8
+
9
+ ## 12.1.0 / 2020-02-13
10
+
11
+ * Add CSV 18.0 compatibility
12
+ * [ENHANCEMENT] Update development dependencies
13
+
14
+ ## 12.0.0 / 2020-01-23
15
+
16
+ * [FEATURE] Allow nested `:error` component [#111](https://github.com/DavyJonesLocker/client_side_validations-simple_form/pull/111) **POSSIBLE BREAKING CHANGE!**
17
+ * [ENHANCEMENT] Default branch is now `main` **POSSIBLE BREAKING CHANGE!**
18
+ * [ENHANCEMENT] Update QUnit to 2.14.0
19
+ * [ENHANCEMENT] Update development dependencies
20
+
21
+ ## 11.2.0 / 2020-12-21
22
+
23
+ * [FEATURE] Allow Ruby 3.0.0 (really)
24
+ * [ENHANCEMENT] Replace Thin with Webrick
25
+ * [ENHANCEMENT] Update development dependencies
26
+
27
+ ## 11.1.0 / 2020-10-10
28
+
29
+ * [FEATURE] Allow Ruby 3.0.0
30
+ * [ENHANCEMENT] Test against latest Ruby 2.7.2
31
+ * [ENHANCEMENT] Update QUnit to 2.11.3
32
+ * [ENHANCEMENT] Update development dependencies
33
+
3
34
  ## 11.0.0 / 2020-05-16
4
35
 
5
36
  * [FEATURE] Drop Ruby 2.3 support
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Geremia Taglialatela, Brian Cardarella
3
+ Copyright (c) 2021 Geremia Taglialatela, Brian Cardarella
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -3,9 +3,9 @@
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
4
  [![npm version](https://badge.fury.io/js/%40client-side-validations%2Fsimple-form.svg)](https://badge.fury.io/js/%40client-side-validations%2Fsimple-form)
5
5
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=client_side_validations-simple_form&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=client_side_validations-simple_form&package-manager=bundler&version-scheme=semver)
6
- [![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)
6
+ [![Build Status](https://secure.travis-ci.org/DavyJonesLocker/client_side_validations-simple_form.svg?branch=main)](https://travis-ci.org/DavyJonesLocker/client_side_validations-simple_form)
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/b9e9cbbd0d9f454adba7/maintainability)](https://codeclimate.com/github/DavyJonesLocker/client_side_validations-simple_form/maintainability)
8
- [![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)
8
+ [![Coverage Status](https://coveralls.io/repos/github/DavyJonesLocker/client_side_validations-simple_form/badge.svg?branch=main)](https://coveralls.io/github/DavyJonesLocker/client_side_validations-simple_form?branch=main)
9
9
 
10
10
  [Simple Form](https://github.com/plataformatec/simple_form) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
11
11
 
@@ -22,7 +22,7 @@ gem 'client_side_validations-simple_form'
22
22
  Order matters here. `simple_form` and `client_side_validations` need to be
23
23
  required **before** `client_side_validations-simple_form`.
24
24
 
25
- [Follow the remaining installation instructions for ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations/blob/master/README.md)
25
+ [Follow the remaining installation instructions for ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations/blob/main/README.md)
26
26
 
27
27
  ### JavaScript file ###
28
28
 
@@ -111,12 +111,12 @@ This gem follows [Semantic Versioning](https://semver.org)
111
111
  ## Want to help? ##
112
112
 
113
113
  Please do! We are always looking to improve this gem. Please see our
114
- [Contribution Guidelines](https://github.com/DavyJonesLocker/client_side_validations-simple_form/blob/master/CONTRIBUTING.md)
114
+ [Contribution Guidelines](https://github.com/DavyJonesLocker/client_side_validations-simple_form/blob/main/CONTRIBUTING.md)
115
115
  on how to properly submit issues and pull requests.
116
116
 
117
117
  ## Legal ##
118
118
 
119
- [DockYard](https://dockyard.com/), LLC © 2012-2020
119
+ [DockYard](https://dockyard.com/), LLC © 2012-2021
120
120
 
121
121
  [@dockyard](https://twitter.com/dockyard)
122
122
 
@@ -28,12 +28,22 @@ module ClientSideValidations
28
28
  private
29
29
 
30
30
  def wrapper_error_component
31
- if wrapper.components.map(&:namespace).include?(:error)
31
+ if namespace_present?(wrapper, :error)
32
32
  wrapper.find(:error)
33
33
  else
34
34
  wrapper.find(:full_error)
35
35
  end
36
36
  end
37
+
38
+ def namespace_present?(component, namespace)
39
+ return true if component.namespace == namespace
40
+
41
+ component.try(:components)&.each do |child_component|
42
+ return true if namespace_present?(child_component, namespace)
43
+ end
44
+
45
+ false
46
+ end
37
47
  end
38
48
  end
39
49
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ClientSideValidations
4
4
  module SimpleForm
5
- VERSION = '11.0.0'
5
+ VERSION = '13.0.0'
6
6
  end
7
7
  end
@@ -1,19 +1,21 @@
1
1
  /*!
2
- * Client Side Validations Simple Form JS (Bootstrap 4) - v0.1.3 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
3
- * Copyright (c) 2020 Geremia Taglialatela, Brian Cardarella
2
+ * Client Side Validations Simple Form JS (Bootstrap 4) - v0.2.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
3
+ * Copyright (c) 2021 Geremia Taglialatela, Brian Cardarella
4
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
5
5
  */
6
6
 
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('@client-side-validations/client-side-validations')) :
9
9
  typeof define === 'function' && define.amd ? define(['jquery', '@client-side-validations/client-side-validations'], factory) :
10
- (global = global || self, factory(global.$, global.ClientSideValidations));
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.$, global.ClientSideValidations));
11
11
  }(this, (function ($, ClientSideValidations) { 'use strict';
12
12
 
13
- $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
14
- ClientSideValidations = ClientSideValidations && Object.prototype.hasOwnProperty.call(ClientSideValidations, 'default') ? ClientSideValidations['default'] : ClientSideValidations;
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
- ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
15
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
16
+ var ClientSideValidations__default = /*#__PURE__*/_interopDefaultLegacy(ClientSideValidations);
17
+
18
+ ClientSideValidations__default['default'].formBuilders['SimpleForm::FormBuilder'] = {
17
19
  add: function add(element, settings, message) {
18
20
  this.wrapper(settings.wrapper).add.call(this, element, settings, message);
19
21
  },
@@ -30,11 +32,17 @@
30
32
  var errorElement = wrapperElement.find(settings.error_tag + '.invalid-feedback');
31
33
 
32
34
  if (!errorElement.length) {
33
- errorElement = $('<' + settings.error_tag + '>', {
35
+ var formTextElement = wrapperElement.find('.form-text');
36
+ errorElement = $__default['default']('<' + settings.error_tag + '>', {
34
37
  "class": 'invalid-feedback',
35
38
  text: message
36
39
  });
37
- wrapperElement.append(errorElement);
40
+
41
+ if (formTextElement.length) {
42
+ formTextElement.before(errorElement);
43
+ } else {
44
+ wrapperElement.append(errorElement);
45
+ }
38
46
  }
39
47
 
40
48
  wrapperElement.addClass(settings.wrapper_error_class);
@@ -1,19 +1,21 @@
1
1
  /*!
2
- * Client Side Validations Simple Form JS (Default) - v0.1.3 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
3
- * Copyright (c) 2020 Geremia Taglialatela, Brian Cardarella
2
+ * Client Side Validations Simple Form JS (Default) - v0.2.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
3
+ * Copyright (c) 2021 Geremia Taglialatela, Brian Cardarella
4
4
  * Licensed under MIT (https://opensource.org/licenses/mit-license.php)
5
5
  */
6
6
 
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('@client-side-validations/client-side-validations')) :
9
9
  typeof define === 'function' && define.amd ? define(['jquery', '@client-side-validations/client-side-validations'], factory) :
10
- (global = global || self, factory(global.$, global.ClientSideValidations));
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.$, global.ClientSideValidations));
11
11
  }(this, (function ($, ClientSideValidations) { 'use strict';
12
12
 
13
- $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
14
- ClientSideValidations = ClientSideValidations && Object.prototype.hasOwnProperty.call(ClientSideValidations, 'default') ? ClientSideValidations['default'] : ClientSideValidations;
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
16
- ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
15
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
16
+ var ClientSideValidations__default = /*#__PURE__*/_interopDefaultLegacy(ClientSideValidations);
17
+
18
+ ClientSideValidations__default['default'].formBuilders['SimpleForm::FormBuilder'] = {
17
19
  add: function add(element, settings, message) {
18
20
  this.wrapper(settings.wrapper).add.call(this, element, settings, message);
19
21
  },
@@ -30,7 +32,7 @@
30
32
  var errorElement = wrapper.find(settings.error_tag + '.' + settings.error_class.replace(/ /g, '.'));
31
33
 
32
34
  if (!errorElement.length) {
33
- errorElement = $('<' + settings.error_tag + '>', {
35
+ errorElement = $__default['default']('<' + settings.error_tag + '>', {
34
36
  "class": settings.error_class,
35
37
  text: message
36
38
  });
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations-simple_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
8
8
  - Brian Cardarella
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-16 00:00:00.000000000 Z
12
+ date: 2021-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: client_side_validations
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '15.0'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '18.0'
23
+ version: '19.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '15.0'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '18.0'
33
+ version: '19.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: simple_form
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -51,14 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.2'
54
+ version: '2.4'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.2'
61
+ version: '2.4'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: byebug
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -79,14 +79,14 @@ dependencies:
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.16.0
82
+ version: 0.21.0
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.16.0
89
+ version: 0.21.0
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: m
92
92
  requirement: !ruby/object:Gem::Requirement
@@ -149,56 +149,90 @@ dependencies:
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.83.0
152
+ version: '1.12'
153
153
  type: :development
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.83.0
159
+ version: '1.12'
160
+ - !ruby/object:Gem::Dependency
161
+ name: rubocop-minitest
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.11.0
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.11.0
160
174
  - !ruby/object:Gem::Dependency
161
175
  name: rubocop-performance
162
176
  requirement: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: '1.5'
180
+ version: '1.10'
167
181
  type: :development
168
182
  prerelease: false
169
183
  version_requirements: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: '1.5'
187
+ version: '1.10'
174
188
  - !ruby/object:Gem::Dependency
175
189
  name: rubocop-rails
176
190
  requirement: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: '2.5'
194
+ version: '2.9'
181
195
  type: :development
182
196
  prerelease: false
183
197
  version_requirements: !ruby/object:Gem::Requirement
184
198
  requirements:
185
199
  - - "~>"
186
200
  - !ruby/object:Gem::Version
187
- version: '2.5'
201
+ version: '2.9'
188
202
  - !ruby/object:Gem::Dependency
189
- name: simplecov
203
+ name: rubocop-rake
190
204
  requirement: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: 0.18.5
208
+ version: 0.5.1
195
209
  type: :development
196
210
  prerelease: false
197
211
  version_requirements: !ruby/object:Gem::Requirement
198
212
  requirements:
199
213
  - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 0.5.1
216
+ - !ruby/object:Gem::Dependency
217
+ name: simplecov
218
+ requirement: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 0.18.5
223
+ - - "<"
224
+ - !ruby/object:Gem::Version
225
+ version: '0.22'
226
+ type: :development
227
+ prerelease: false
228
+ version_requirements: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - ">="
200
231
  - !ruby/object:Gem::Version
201
232
  version: 0.18.5
233
+ - - "<"
234
+ - !ruby/object:Gem::Version
235
+ version: '0.22'
202
236
  - !ruby/object:Gem::Dependency
203
237
  name: shotgun
204
238
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +262,7 @@ dependencies:
228
262
  - !ruby/object:Gem::Version
229
263
  version: '2.0'
230
264
  - !ruby/object:Gem::Dependency
231
- name: thin
265
+ name: webrick
232
266
  requirement: !ruby/object:Gem::Requirement
233
267
  requirements:
234
268
  - - "~>"
@@ -264,15 +298,15 @@ licenses:
264
298
  - MIT
265
299
  metadata:
266
300
  bug_tracker_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form/issues
267
- changelog_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form/blob/master/CHANGELOG.md
301
+ changelog_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form/blob/main/CHANGELOG.md
268
302
  source_code_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form
269
- post_install_message:
303
+ post_install_message:
270
304
  rdoc_options: []
271
305
  require_paths:
272
306
  - lib
273
307
  required_ruby_version: !ruby/object:Gem::Requirement
274
308
  requirements:
275
- - - "~>"
309
+ - - ">="
276
310
  - !ruby/object:Gem::Version
277
311
  version: '2.4'
278
312
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -281,8 +315,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
315
  - !ruby/object:Gem::Version
282
316
  version: '0'
283
317
  requirements: []
284
- rubygems_version: 3.1.2
285
- signing_key:
318
+ rubygems_version: 3.1.4
319
+ signing_key:
286
320
  specification_version: 4
287
321
  summary: ClientSideValidations SimpleForm
288
322
  test_files: []