client_side_validations-simple_form 16.0.0 → 17.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/LICENSE.md +1 -1
- data/README.md +3 -3
- data/lib/client_side_validations/simple_form/form_builder.rb +2 -2
- data/lib/client_side_validations/simple_form/version.rb +1 -1
- data/lib/client_side_validations/simple_form.rb +4 -3
- data/vendor/assets/javascripts/rails.validations.simple_form.bootstrap4.js +16 -44
- data/vendor/assets/javascripts/rails.validations.simple_form.js +15 -43
- metadata +12 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebf9d3042a4f3be6d85d8fbe2fb9f92e178bdb9ae1f8eee83c27969b82b8e941
|
|
4
|
+
data.tar.gz: f861a3f23a66616b580bcbe0cf98eff4799737649a703f90b421c335deda3bce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9c68651915c31fda268f6ba48db65a4ea78476b518f255645e624d532075f815ec08a702ccf87f26f33435d831779b40f49b3fa6db396fbdade14046077c835
|
|
7
|
+
data.tar.gz: c3a0abda4e8071e03e204adfcdb7b5664f393cdd10f0fad6c8a5c5da2929003838496c9eacac7bd752c07b2bc6dc6c88b37bb7b31a69080a9cf6b129199a36e7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 17.0.0 / 2026-01-07
|
|
4
|
+
|
|
5
|
+
* [FEATURE] Drop Internet Explorer and other older browsers support
|
|
6
|
+
* [FEATURE] Drop CSV < 23 compatibility
|
|
7
|
+
* [FEATURE] Drop Ruby < 3.2 compatibility
|
|
8
|
+
* [ENHANCEMENT] Test against Ruby 3.3, 3.4, and 4.0
|
|
9
|
+
* [ENHANCEMENT] Update QUnit to 2.25.0
|
|
10
|
+
* [ENHANCEMENT] Match node package version with gem version
|
|
11
|
+
|
|
3
12
|
## 16.0.0 / 2023-09-02
|
|
4
13
|
|
|
5
14
|
* [FEATURE] Do not require jQuery
|
data/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 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
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
[](https://badge.fury.io/js/%40client-side-validations%2Fsimple-form)
|
|
5
5
|
[](https://github.com/DavyJonesLocker/client_side_validations-simple_form/actions)
|
|
6
6
|
[](https://github.com/DavyJonesLocker/client_side_validations-simple_form/actions)
|
|
7
|
-
[](https://qlty.sh/gh/DavyJonesLocker/projects/client_side_validations-simple_form)
|
|
8
8
|
[](https://coveralls.io/github/DavyJonesLocker/client_side_validations-simple_form?branch=main)
|
|
9
9
|
|
|
10
|
-
[Simple Form](https://github.com/
|
|
10
|
+
[Simple Form](https://github.com/heartcombo/simple_form) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
|
|
11
11
|
|
|
12
12
|
## Installation ##
|
|
13
13
|
|
|
@@ -120,4 +120,4 @@ on how to properly submit issues and pull requests.
|
|
|
120
120
|
|
|
121
121
|
[@dockyard](https://twitter.com/dockyard)
|
|
122
122
|
|
|
123
|
-
[Licensed under the MIT license](https://opensource.org/licenses/mit
|
|
123
|
+
[Licensed under the MIT license](https://opensource.org/licenses/mit)
|
|
@@ -15,14 +15,14 @@ module ClientSideValidations
|
|
|
15
15
|
}
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def input(attribute_name, options = {}, &
|
|
18
|
+
def input(attribute_name, options = {}, &)
|
|
19
19
|
if options.key?(:validate)
|
|
20
20
|
options[:input_html] ||= {}
|
|
21
21
|
options[:input_html][:validate] = options[:validate]
|
|
22
22
|
options.delete(:validate)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
super
|
|
25
|
+
super
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
private
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require 'simple_form'
|
|
4
4
|
require 'client_side_validations'
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
require_relative 'simple_form/form_builder'
|
|
6
7
|
|
|
7
8
|
if defined?(Rails)
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
require_relative 'simple_form/engine'
|
|
10
|
+
require_relative 'generators/simple_form'
|
|
10
11
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Client Side Validations Simple Form JS (Bootstrap 4+) -
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* Client Side Validations Simple Form JS (Bootstrap 4+) - v17.0.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
|
|
3
|
+
* Copyright (c) 2026 Geremia Taglialatela, Brian Cardarella
|
|
4
4
|
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -10,62 +10,34 @@
|
|
|
10
10
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ClientSideValidations));
|
|
11
11
|
})(this, (function (ClientSideValidations) { 'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
15
|
-
}
|
|
16
|
-
function _arrayWithoutHoles(arr) {
|
|
17
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
18
|
-
}
|
|
19
|
-
function _iterableToArray(iter) {
|
|
20
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
21
|
-
}
|
|
22
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
23
|
-
if (!o) return;
|
|
24
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
25
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
26
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
27
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
28
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
29
|
-
}
|
|
30
|
-
function _arrayLikeToArray(arr, len) {
|
|
31
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
32
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
33
|
-
return arr2;
|
|
34
|
-
}
|
|
35
|
-
function _nonIterableSpread() {
|
|
36
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var addClass = function addClass(element, customClass) {
|
|
13
|
+
const addClass = (element, customClass) => {
|
|
40
14
|
if (customClass) {
|
|
41
|
-
|
|
42
|
-
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(customClass.split(' ')));
|
|
15
|
+
element.classList.add(...customClass.split(' '));
|
|
43
16
|
}
|
|
44
17
|
};
|
|
45
|
-
|
|
18
|
+
const removeClass = (element, customClass) => {
|
|
46
19
|
if (customClass) {
|
|
47
|
-
|
|
48
|
-
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(customClass.split(' ')));
|
|
20
|
+
element.classList.remove(...customClass.split(' '));
|
|
49
21
|
}
|
|
50
22
|
};
|
|
51
23
|
|
|
52
24
|
ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
|
|
53
|
-
add: function
|
|
25
|
+
add: function ($element, settings, message) {
|
|
54
26
|
this.wrapper(settings.wrapper).add.call(this, $element[0], settings, message);
|
|
55
27
|
},
|
|
56
|
-
remove: function
|
|
28
|
+
remove: function ($element, settings) {
|
|
57
29
|
this.wrapper(settings.wrapper).remove.call(this, $element[0], settings);
|
|
58
30
|
},
|
|
59
|
-
wrapper: function
|
|
31
|
+
wrapper: function (name) {
|
|
60
32
|
return this.wrappers[name] || this.wrappers.default;
|
|
61
33
|
},
|
|
62
34
|
wrappers: {
|
|
63
35
|
default: {
|
|
64
|
-
add
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
add(element, settings, message) {
|
|
37
|
+
const wrapperElement = element.parentElement;
|
|
38
|
+
let errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
|
|
67
39
|
if (!errorElement) {
|
|
68
|
-
|
|
40
|
+
const formTextElement = wrapperElement.querySelector('.form-text');
|
|
69
41
|
errorElement = document.createElement(settings.error_tag);
|
|
70
42
|
addClass(errorElement, 'invalid-feedback');
|
|
71
43
|
errorElement.textContent = message;
|
|
@@ -79,9 +51,9 @@
|
|
|
79
51
|
addClass(element, 'is-invalid');
|
|
80
52
|
errorElement.textContent = message;
|
|
81
53
|
},
|
|
82
|
-
remove
|
|
83
|
-
|
|
84
|
-
|
|
54
|
+
remove(element, settings) {
|
|
55
|
+
const wrapperElement = element.parentElement;
|
|
56
|
+
const errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
|
|
85
57
|
removeClass(wrapperElement, settings.wrapper_error_class);
|
|
86
58
|
removeClass(element, 'is-invalid');
|
|
87
59
|
if (errorElement) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Client Side Validations Simple Form JS (Default) -
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* Client Side Validations Simple Form JS (Default) - v17.0.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
|
|
3
|
+
* Copyright (c) 2026 Geremia Taglialatela, Brian Cardarella
|
|
4
4
|
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -10,60 +10,32 @@
|
|
|
10
10
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ClientSideValidations));
|
|
11
11
|
})(this, (function (ClientSideValidations) { 'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
15
|
-
}
|
|
16
|
-
function _arrayWithoutHoles(arr) {
|
|
17
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
18
|
-
}
|
|
19
|
-
function _iterableToArray(iter) {
|
|
20
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
21
|
-
}
|
|
22
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
23
|
-
if (!o) return;
|
|
24
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
25
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
26
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
27
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
28
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
29
|
-
}
|
|
30
|
-
function _arrayLikeToArray(arr, len) {
|
|
31
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
32
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
33
|
-
return arr2;
|
|
34
|
-
}
|
|
35
|
-
function _nonIterableSpread() {
|
|
36
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var addClass = function addClass(element, customClass) {
|
|
13
|
+
const addClass = (element, customClass) => {
|
|
40
14
|
if (customClass) {
|
|
41
|
-
|
|
42
|
-
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(customClass.split(' ')));
|
|
15
|
+
element.classList.add(...customClass.split(' '));
|
|
43
16
|
}
|
|
44
17
|
};
|
|
45
|
-
|
|
18
|
+
const removeClass = (element, customClass) => {
|
|
46
19
|
if (customClass) {
|
|
47
|
-
|
|
48
|
-
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(customClass.split(' ')));
|
|
20
|
+
element.classList.remove(...customClass.split(' '));
|
|
49
21
|
}
|
|
50
22
|
};
|
|
51
23
|
|
|
52
24
|
ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
|
|
53
|
-
add: function
|
|
25
|
+
add: function ($element, settings, message) {
|
|
54
26
|
this.wrapper(settings.wrapper).add.call(this, $element[0], settings, message);
|
|
55
27
|
},
|
|
56
|
-
remove: function
|
|
28
|
+
remove: function ($element, settings) {
|
|
57
29
|
this.wrapper(settings.wrapper).remove.call(this, $element[0], settings);
|
|
58
30
|
},
|
|
59
|
-
wrapper: function
|
|
31
|
+
wrapper: function (name) {
|
|
60
32
|
return this.wrappers[name] || this.wrappers.default;
|
|
61
33
|
},
|
|
62
34
|
wrappers: {
|
|
63
35
|
default: {
|
|
64
|
-
add
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
add(element, settings, message) {
|
|
37
|
+
const wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
|
|
38
|
+
let errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
|
|
67
39
|
if (!errorElement) {
|
|
68
40
|
errorElement = document.createElement(settings.error_tag);
|
|
69
41
|
addClass(errorElement, settings.error_class);
|
|
@@ -73,9 +45,9 @@
|
|
|
73
45
|
addClass(wrapperElement, settings.wrapper_error_class);
|
|
74
46
|
errorElement.textContent = message;
|
|
75
47
|
},
|
|
76
|
-
remove
|
|
77
|
-
|
|
78
|
-
|
|
48
|
+
remove(element, settings) {
|
|
49
|
+
const wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
|
|
50
|
+
const errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
|
|
79
51
|
removeClass(wrapperElement, settings.wrapper_error_class);
|
|
80
52
|
if (errorElement) {
|
|
81
53
|
errorElement.remove();
|
metadata
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: client_side_validations-simple_form
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 17.0.0
|
|
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: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: client_side_validations
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
16
|
requirements:
|
|
18
|
-
- - "
|
|
17
|
+
- - ">="
|
|
19
18
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: '
|
|
19
|
+
version: '23.0'
|
|
21
20
|
type: :runtime
|
|
22
21
|
prerelease: false
|
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
23
|
requirements:
|
|
25
|
-
- - "
|
|
24
|
+
- - ">="
|
|
26
25
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: '
|
|
26
|
+
version: '23.0'
|
|
28
27
|
- !ruby/object:Gem::Dependency
|
|
29
28
|
name: simple_form
|
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
|
31
30
|
requirements:
|
|
32
|
-
- - "
|
|
31
|
+
- - ">="
|
|
33
32
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '5.
|
|
33
|
+
version: '5.4'
|
|
35
34
|
type: :runtime
|
|
36
35
|
prerelease: false
|
|
37
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
37
|
requirements:
|
|
39
|
-
- - "
|
|
38
|
+
- - ">="
|
|
40
39
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '5.
|
|
40
|
+
version: '5.4'
|
|
42
41
|
description: SimpleForm Plugin for ClientSideValidations
|
|
43
42
|
email:
|
|
44
43
|
- tagliala.dev@gmail.com
|
|
@@ -65,7 +64,6 @@ metadata:
|
|
|
65
64
|
bug_tracker_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form/issues
|
|
66
65
|
changelog_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form/blob/main/CHANGELOG.md
|
|
67
66
|
source_code_uri: https://github.com/DavyJonesLocker/client_side_validations-simple_form
|
|
68
|
-
post_install_message:
|
|
69
67
|
rdoc_options: []
|
|
70
68
|
require_paths:
|
|
71
69
|
- lib
|
|
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
73
71
|
requirements:
|
|
74
72
|
- - ">="
|
|
75
73
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '2
|
|
74
|
+
version: '3.2'
|
|
77
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
76
|
requirements:
|
|
79
77
|
- - ">="
|
|
80
78
|
- !ruby/object:Gem::Version
|
|
81
79
|
version: '0'
|
|
82
80
|
requirements: []
|
|
83
|
-
rubygems_version:
|
|
84
|
-
signing_key:
|
|
81
|
+
rubygems_version: 4.0.3
|
|
85
82
|
specification_version: 4
|
|
86
83
|
summary: ClientSideValidations SimpleForm
|
|
87
84
|
test_files: []
|