client_side_validations 22.2.0 → 22.3.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: 35e341b74ca2a5e885ff8306cc7ba2270c4dc5fcc5a44deaeed7256e9fed0e11
4
- data.tar.gz: 34bb3f201ed59e17af087541c779af80292108f1c5661ed0a69c59e5a3638c38
3
+ metadata.gz: f1342f7f8b0ec1f863f4dbeba606d8780e40c9cff18f3dc64de4b427210623ad
4
+ data.tar.gz: 0dfa9f5419ed63e44bb9b650a9712f8630edfd78d2b52fea74c7327e8dd38743
5
5
  SHA512:
6
- metadata.gz: 9ba714585652b3a19e307f79d44c0c50259c3c421f8c64445718b9c56c041d8e5b3296e5e21a444747b975383503dbf95afe5eb5d5e664a1b0dc9b2427c11648
7
- data.tar.gz: 989fdc90e7459cfa942666bb5dbab62fb49d6abe5c86c696e368bcbd1b1398b4d1ffdd64b966b6e9d9c19602a5b936a144792a2fbdc4292718d5b11c27daf477
6
+ metadata.gz: 4e47cf16b407a6c0499c36e3cfbac13fa54eb5cd7b2f4ec55f613c190d623e3d8634ca3ee868a34a80c769d996ec22b9c803f004ea97c45d96ce9ea6fe6cc0e8
7
+ data.tar.gz: f2fa5e933de5947ac26f4a05762eb24514a5afaa807876866a31e9214327e9a2d66bc8aa459690d824deeb52ba3fe301b10f4e871e9b5a87afe198bba742e97f
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## 22.2.0 / 2026-06-01
3
+ ## 22.3.0 / 2024-11-12
4
+
5
+ * [FEATURE] Rails 8.0 compatibility
6
+ * [ENHANCEMENT] Update QUnit to 2.22.0
7
+
8
+ ## 22.2.0 / 2024-06-01
4
9
 
5
10
  * [FEATURE] Allow Rails 8.0 alpha
6
11
  * [ENHANCEMENT] Test against Ruby 3.3
@@ -37,7 +42,7 @@
37
42
 
38
43
  ## 20.0.1 / 2021-12-22
39
44
 
40
- * [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issue/867))
45
+ * [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issues/867))
41
46
  * [ENHANCEMENT] Update development dependencies
42
47
 
43
48
  ## 20.0.0 / 2021-12-16
@@ -190,7 +195,7 @@
190
195
 
191
196
  * [FEATURE] Drop the deprecated tokenizer support in length validator
192
197
  * [ENHANCEMENT] Do not use `New Function` ([#733](https://github.com/DavyJonesLocker/client_side_validations/issues/733))
193
- * [ENHANCEMENT] Remove 'g' flag from RegExp conversions ([#750](https://github.com/DavyJonesLocker/client_side_validations/issues/750))
198
+ * [ENHANCEMENT] Remove 'g' flag from RegExp conversions ([#750](https://github.com/DavyJonesLocker/client_side_validations/pull/750))
194
199
  * [ENHANCEMENT] Update dependencies
195
200
 
196
201
  ## 11.1.3 / 2018-09-08
@@ -325,7 +330,7 @@
325
330
 
326
331
  ## 4.2.11 / 2016-12-08
327
332
 
328
- * [BUGFIX] Fix conditional validators ([#686](https://github.com/DavyJonesLocker/client_side_validations/issues/686))
333
+ * [BUGFIX] Fix conditional validators ([#686](https://github.com/DavyJonesLocker/client_side_validations/pull/686))
329
334
 
330
335
  ## 4.2.10 / 2016-11-16
331
336
 
@@ -337,7 +342,7 @@
337
342
 
338
343
  ## 4.2.8 / 2016-11-11
339
344
 
340
- * [BUGFIX] Fix numericality validator ([#679](https://github.com/DavyJonesLocker/client_side_validations/pull/679))
345
+ * [BUGFIX] Fix numericality validator ([#679](https://github.com/DavyJonesLocker/client_side_validations/issues/679))
341
346
 
342
347
  ## 4.2.7 / 2016-10-08
343
348
 
data/README.md CHANGED
@@ -8,11 +8,11 @@
8
8
  [![Coverage Status](https://coveralls.io/repos/github/DavyJonesLocker/client_side_validations/badge.svg?branch=main)](https://coveralls.io/github/DavyJonesLocker/client_side_validations?branch=main)
9
9
 
10
10
 
11
- `ClientSideValidations` made easy for your Rails 6.1 / 7.x applications!
11
+ `ClientSideValidations` made easy for your Rails 6.1, 7.x, and 8.0 applications!
12
12
 
13
13
  ## Project Goals ##
14
14
 
15
- 1. Follow the best practices for client side validations developed by [Luke Wroblewski](https://alistapart.com/article/inline-validation-in-web-forms)
15
+ 1. Follow the best practices for client side validations developed by [Luke Wroblewski](https://alistapart.com/article/inline-validation-in-web-forms/)
16
16
  2. Automatically extract and apply validation rules defined on the
17
17
  server to the client.
18
18
  3. In the cases where a server-side validation rule would not work on
@@ -547,4 +547,4 @@ on how to properly submit issues and pull requests.
547
547
 
548
548
  [@dockyard](https://twitter.com/dockyard)
549
549
 
550
- [Licensed under the MIT license](https://opensource.org/licenses/mit-license.php)
550
+ [Licensed under the MIT license](https://opensource.org/licenses/mit)
@@ -5,7 +5,9 @@ module ClientSideValidations
5
5
  module Helpers
6
6
  module FormBuilder
7
7
  def self.prepended(base)
8
- (base.field_helpers - %i[label check_box radio_button fields_for fields hidden_field file_field]).each do |selector|
8
+ selectors = base.field_helpers - %i[label check_box checkbox radio_button fields_for fields hidden_field file_field]
9
+
10
+ selectors.each do |selector|
9
11
  base.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
10
12
  # Cannot call super here, rewrite all
11
13
  def #{selector}(method, options = {}) # def text_field(method, options = {})
@@ -19,6 +21,10 @@ module ClientSideValidations
19
21
  end # end
20
22
  RUBY_EVAL
21
23
  end
24
+
25
+ base.class_eval do
26
+ alias_method :text_area, :textarea if ::ActionView::Helpers::FormBuilder.field_helpers.include?(:textarea)
27
+ end
22
28
  end
23
29
 
24
30
  def initialize(object_name, object, template, options)
@@ -47,6 +53,7 @@ module ClientSideValidations
47
53
  options.delete(:validate)
48
54
  super
49
55
  end
56
+ alias checkbox check_box if ::ActionView::Helpers::FormBuilder.field_helpers.include?(:checkbox)
50
57
 
51
58
  %i[collection_check_boxes collection_radio_buttons].each do |method_name|
52
59
  define_method method_name do |method, collection, value_method, text_method, options = {}, html_options = {}, &block|
@@ -56,6 +63,10 @@ module ClientSideValidations
56
63
  end
57
64
  end
58
65
 
66
+ if ::ActionView::Helpers::FormBuilder.public_instance_methods.include?(:collection_checkboxes)
67
+ alias collection_checkboxes collection_check_boxes
68
+ end
69
+
59
70
  def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
60
71
  build_validation_options(method, html_options.merge(name: options[:name]))
61
72
  html_options.delete(:validate)
@@ -7,14 +7,14 @@ module ClientSideValidations
7
7
  end
8
8
  end
9
9
 
10
- require 'client_side_validations/core_ext'
11
- require 'client_side_validations/action_view/form_helper'
10
+ require_relative 'core_ext'
11
+ require_relative 'action_view/form_helper'
12
12
 
13
13
  if ActionView::Helpers::FormHelper.method_defined?(:form_with)
14
- require 'client_side_validations/action_view/form_with_helper'
14
+ require_relative 'action_view/form_with_helper'
15
15
  end
16
16
 
17
- require 'client_side_validations/action_view/form_builder'
17
+ require_relative 'action_view/form_builder'
18
18
 
19
19
  ActiveSupport.on_load(:action_view) { include ClientSideValidations::ActionView::Helpers::FormHelper }
20
20
  ActionView::Helpers::FormBuilder.prepend ClientSideValidations::ActionView::Helpers::FormBuilder
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'client_side_validations/core_ext'
4
- require 'client_side_validations/extender'
5
- require 'client_side_validations/active_model/conditionals'
3
+ require_relative 'core_ext'
4
+ require_relative 'extender'
5
+ require_relative 'active_model/conditionals'
6
6
 
7
7
  module ClientSideValidations
8
8
  module ActiveModel
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'client_side_validations/active_model'
4
- require 'client_side_validations/extender'
3
+ require_relative 'active_model'
5
4
 
6
5
  ActiveSupport.on_load(:active_record) { include ClientSideValidations::ActiveModel::Validations }
7
6
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/json'
4
- require 'client_side_validations/core_ext/range'
5
- require 'client_side_validations/core_ext/regexp'
4
+
5
+ require_relative 'core_ext/range'
6
+ require_relative 'core_ext/regexp'
@@ -14,4 +14,4 @@ module ClientSideValidations
14
14
  end
15
15
  end
16
16
 
17
- require 'client_side_validations/generators/rails_validations'
17
+ require_relative 'generators/rails_validations'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '22.2.0'
4
+ VERSION = '22.3.0'
5
5
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'client_side_validations/config'
4
- require 'client_side_validations/active_model' if defined?(ActiveModel)
5
- require 'client_side_validations/active_record' if defined?(ActiveRecord)
6
- require 'client_side_validations/action_view' if defined?(ActionView)
3
+ require_relative 'client_side_validations/config'
4
+ require_relative 'client_side_validations/active_model' if defined?(ActiveModel)
5
+ require_relative 'client_side_validations/active_record' if defined?(ActiveRecord)
6
+ require_relative 'client_side_validations/action_view' if defined?(ActionView)
7
7
 
8
8
  if defined?(Rails)
9
- require 'client_side_validations/engine'
10
- require 'client_side_validations/generators'
9
+ require_relative 'client_side_validations/engine'
10
+ require_relative 'client_side_validations/generators'
11
11
  end
@@ -701,7 +701,7 @@
701
701
  return typeof define === 'function' && define.amd; // eslint-disable-line no-undef
702
702
  }
703
703
  function isCommonJS() {
704
- return (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined'; // eslint-disable-line no-undef
704
+ return (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined';
705
705
  }
706
706
 
707
707
  return ClientSideValidations;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.2.0
4
+ version: 22.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-06-01 00:00:00.000000000 Z
12
+ date: 2024-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: js_regex
@@ -32,9 +32,6 @@ dependencies:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '6.1'
35
- - - "<"
36
- - !ruby/object:Gem::Version
37
- version: '8.0'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,10 +39,7 @@ dependencies:
42
39
  - - ">="
43
40
  - !ruby/object:Gem::Version
44
41
  version: '6.1'
45
- - - "<"
46
- - !ruby/object:Gem::Version
47
- version: '8.0'
48
- description: Client Side Validations made easy for your Rails 6.1 and 7.x applications
42
+ description: Client Side Validations made easy for your Rails 6.1, 7.x, and 8.0 applications
49
43
  email:
50
44
  - tagliala.dev@gmail.com
51
45
  - bcardarella@gmail.com
@@ -110,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
104
  - !ruby/object:Gem::Version
111
105
  version: '0'
112
106
  requirements: []
113
- rubygems_version: 3.5.9
107
+ rubygems_version: 3.5.18
114
108
  signing_key:
115
109
  specification_version: 4
116
110
  summary: Client Side Validations