client_side_validations 22.2.0 → 22.3.1
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 +4 -4
- data/CHANGELOG.md +14 -5
- data/README.md +3 -3
- data/lib/client_side_validations/action_view/form_builder.rb +12 -1
- data/lib/client_side_validations/action_view/form_with_helper.rb +1 -1
- data/lib/client_side_validations/action_view.rb +4 -4
- data/lib/client_side_validations/active_model.rb +3 -3
- data/lib/client_side_validations/active_record.rb +1 -2
- data/lib/client_side_validations/core_ext.rb +3 -2
- data/lib/client_side_validations/generators.rb +1 -1
- data/lib/client_side_validations/version.rb +1 -1
- data/lib/client_side_validations.rb +6 -6
- data/vendor/assets/javascripts/rails.validations.js +2 -2
- metadata +4 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7662e8aec397da640a1f6b4f08e759c3782a2076462123eef87936d1a06d6ff3
|
|
4
|
+
data.tar.gz: 9725cf62580eab661912618fe45ecf4c114948f7dbd3acb2289c28ef9d9c9ffa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b6a935bd15704eed3f311088d803db19011d12cfb228cf906fd170104c5e5281b27f472b807bc267013993aadb99ef780443400223457ed4c1bd1992248cc01
|
|
7
|
+
data.tar.gz: 1999e64d1237f0fae8ebda641c440d21653a05dee87c918c9a35478060cf795de6f61f0228361d201e626a1dcf858338906cfc76c52bc9bac619de57a3c8f110
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 22.
|
|
3
|
+
## 22.3.1 / 2025-01-29
|
|
4
|
+
|
|
5
|
+
* [BUGFIX] `form_with` default argument exception on Rails 8.0 ([#974](https://github.com/DavyJonesLocker/client_side_validations/issues/974))
|
|
6
|
+
|
|
7
|
+
## 22.3.0 / 2024-11-12
|
|
8
|
+
|
|
9
|
+
* [FEATURE] Rails 8.0 compatibility
|
|
10
|
+
* [ENHANCEMENT] Update QUnit to 2.22.0
|
|
11
|
+
|
|
12
|
+
## 22.2.0 / 2024-06-01
|
|
4
13
|
|
|
5
14
|
* [FEATURE] Allow Rails 8.0 alpha
|
|
6
15
|
* [ENHANCEMENT] Test against Ruby 3.3
|
|
@@ -37,7 +46,7 @@
|
|
|
37
46
|
|
|
38
47
|
## 20.0.1 / 2021-12-22
|
|
39
48
|
|
|
40
|
-
* [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/
|
|
49
|
+
* [BUGFIX] Fix missing HTTP method ([#867](https://github.com/DavyJonesLocker/client_side_validations/issues/867))
|
|
41
50
|
* [ENHANCEMENT] Update development dependencies
|
|
42
51
|
|
|
43
52
|
## 20.0.0 / 2021-12-16
|
|
@@ -190,7 +199,7 @@
|
|
|
190
199
|
|
|
191
200
|
* [FEATURE] Drop the deprecated tokenizer support in length validator
|
|
192
201
|
* [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/
|
|
202
|
+
* [ENHANCEMENT] Remove 'g' flag from RegExp conversions ([#750](https://github.com/DavyJonesLocker/client_side_validations/pull/750))
|
|
194
203
|
* [ENHANCEMENT] Update dependencies
|
|
195
204
|
|
|
196
205
|
## 11.1.3 / 2018-09-08
|
|
@@ -325,7 +334,7 @@
|
|
|
325
334
|
|
|
326
335
|
## 4.2.11 / 2016-12-08
|
|
327
336
|
|
|
328
|
-
* [BUGFIX] Fix conditional validators ([#686](https://github.com/DavyJonesLocker/client_side_validations/
|
|
337
|
+
* [BUGFIX] Fix conditional validators ([#686](https://github.com/DavyJonesLocker/client_side_validations/pull/686))
|
|
329
338
|
|
|
330
339
|
## 4.2.10 / 2016-11-16
|
|
331
340
|
|
|
@@ -337,7 +346,7 @@
|
|
|
337
346
|
|
|
338
347
|
## 4.2.8 / 2016-11-11
|
|
339
348
|
|
|
340
|
-
* [BUGFIX] Fix numericality validator ([#679](https://github.com/DavyJonesLocker/client_side_validations/
|
|
349
|
+
* [BUGFIX] Fix numericality validator ([#679](https://github.com/DavyJonesLocker/client_side_validations/issues/679))
|
|
341
350
|
|
|
342
351
|
## 4.2.7 / 2016-10-08
|
|
343
352
|
|
data/README.md
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[](https://coveralls.io/github/DavyJonesLocker/client_side_validations?branch=main)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
`ClientSideValidations` made easy for your Rails 6.1
|
|
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
|
|
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
|
-
|
|
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)
|
|
@@ -4,7 +4,7 @@ module ClientSideValidations
|
|
|
4
4
|
module ActionView
|
|
5
5
|
module Helpers
|
|
6
6
|
module FormHelper
|
|
7
|
-
def form_with(model:
|
|
7
|
+
def form_with(model: false, scope: nil, url: nil, format: nil, **options, &block)
|
|
8
8
|
return super unless options[:validate]
|
|
9
9
|
|
|
10
10
|
options[:allow_method_names_outside_object] = true
|
|
@@ -7,14 +7,14 @@ module ClientSideValidations
|
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
+
require_relative 'action_view/form_with_helper'
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
|
|
9
|
+
require_relative 'client_side_validations/engine'
|
|
10
|
+
require_relative 'client_side_validations/generators'
|
|
11
11
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
|
|
4
4
|
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -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';
|
|
704
|
+
return (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined';
|
|
705
705
|
}
|
|
706
706
|
|
|
707
707
|
return ClientSideValidations;
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: client_side_validations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 22.
|
|
4
|
+
version: 22.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geremia Taglialatela
|
|
8
8
|
- Brian Cardarella
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: js_regex
|
|
@@ -32,9 +31,6 @@ dependencies:
|
|
|
32
31
|
- - ">="
|
|
33
32
|
- !ruby/object:Gem::Version
|
|
34
33
|
version: '6.1'
|
|
35
|
-
- - "<"
|
|
36
|
-
- !ruby/object:Gem::Version
|
|
37
|
-
version: '8.0'
|
|
38
34
|
type: :runtime
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -42,10 +38,7 @@ dependencies:
|
|
|
42
38
|
- - ">="
|
|
43
39
|
- !ruby/object:Gem::Version
|
|
44
40
|
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
|
|
41
|
+
description: Client Side Validations made easy for your Rails 6.1, 7.x, and 8.0 applications
|
|
49
42
|
email:
|
|
50
43
|
- tagliala.dev@gmail.com
|
|
51
44
|
- bcardarella@gmail.com
|
|
@@ -95,7 +88,6 @@ metadata:
|
|
|
95
88
|
bug_tracker_uri: https://github.com/DavyJonesLocker/client_side_validations/issues
|
|
96
89
|
changelog_uri: https://github.com/DavyJonesLocker/client_side_validations/blob/main/CHANGELOG.md
|
|
97
90
|
source_code_uri: https://github.com/DavyJonesLocker/client_side_validations
|
|
98
|
-
post_install_message:
|
|
99
91
|
rdoc_options: []
|
|
100
92
|
require_paths:
|
|
101
93
|
- lib
|
|
@@ -110,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
102
|
- !ruby/object:Gem::Version
|
|
111
103
|
version: '0'
|
|
112
104
|
requirements: []
|
|
113
|
-
rubygems_version: 3.
|
|
114
|
-
signing_key:
|
|
105
|
+
rubygems_version: 3.6.3
|
|
115
106
|
specification_version: 4
|
|
116
107
|
summary: Client Side Validations
|
|
117
108
|
test_files: []
|