Skip to content

Commit

Permalink
Merge pull request #184 from DavyJonesLocker/feature/drop-older-browsers
Browse files Browse the repository at this point in the history
Drop older browsers support
  • Loading branch information
tagliala authored Dec 22, 2024
2 parents d318027 + 44919d9 commit 1b7acd2
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
- name: Install node dependencies
run: pnpm install
- name: Run JavaScript linter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
- name: Install node dependencies
run: pnpm install
- name: Run tests
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby-version: ['3.1', '3.2', '3.3']
gemfile: [ csv_22.0 ]
channel: ['stable']

include:
- ruby-version: 'head'
gemfile: csv_22.0
channel: 'experimental'
- ruby-version: '2.7'
gemfile: csv_edge
channel: 'experimental'
- ruby-version: '3.0'
gemfile: csv_edge
channel: 'experimental'
- ruby-version: '3.1'
gemfile: csv_edge
channel: 'experimental'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require:

AllCops:
TargetRailsVersion: 6.1
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
NewCops: enable
DisplayStyleGuide: true
ExtraDetails: true
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## main / unreleased
## 17.0.0 / unreleased

* [FEATURE] Drop Internet Explorer and other older browsers support
* [ENHANCEMENT] Test against Ruby 3.3
* [ENHANCEMENT] Update QUnit to 2.21.0
* [ENHANCEMENT] Update QUnit to 2.23.0

## 16.0.0 / 2023-09-02

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace :test do
desc %(Test Ruby code)
Rake::TestTask.new(:ruby) do |test|
test.libs << 'lib' << 'test'
test.test_files = Dir.glob("#{File.dirname(__FILE__)}/test/**/test_*.rb").sort
test.test_files = Dir.glob("#{File.dirname(__FILE__)}/test/**/test_*.rb")
test.warning = false
end

Expand Down
4 changes: 2 additions & 2 deletions client_side_validations-simple_form.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.platform = Gem::Platform::RUBY
spec.required_ruby_version = '>= 2.7'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency 'client_side_validations', '~> 22.0'
spec.add_dependency 'client_side_validations', '>= 22.0', '< 24'
spec.add_dependency 'simple_form', '~> 5.2'
end
57 changes: 15 additions & 42 deletions dist/simple-form.bootstrap4.esm.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,39 @@
/*!
* Client Side Validations Simple Form JS (Default) - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Client Side Validations Simple Form JS (Default) - v0.5.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/

import ClientSideValidations from '@client-side-validations/client-side-validations';

function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}

var addClass = function addClass(element, customClass) {
const addClass = (element, customClass) => {
if (customClass) {
var _element$classList;
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(customClass.split(' ')));
element.classList.add(...customClass.split(' '));
}
};
var removeClass = function removeClass(element, customClass) {
const removeClass = (element, customClass) => {
if (customClass) {
var _element$classList2;
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(customClass.split(' ')));
element.classList.remove(...customClass.split(' '));
}
};

ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
add: function add($element, settings, message) {
add: function ($element, settings, message) {
this.wrapper(settings.wrapper).add.call(this, $element[0], settings, message);
},
remove: function remove($element, settings) {
remove: function ($element, settings) {
this.wrapper(settings.wrapper).remove.call(this, $element[0], settings);
},
wrapper: function wrapper(name) {
wrapper: function (name) {
return this.wrappers[name] || this.wrappers.default;
},
wrappers: {
default: {
add: function add(element, settings, message) {
var wrapperElement = element.parentElement;
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
add(element, settings, message) {
const wrapperElement = element.parentElement;
let errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
if (!errorElement) {
var formTextElement = wrapperElement.querySelector('.form-text');
const formTextElement = wrapperElement.querySelector('.form-text');
errorElement = document.createElement(settings.error_tag);
addClass(errorElement, 'invalid-feedback');
errorElement.textContent = message;
Expand All @@ -74,9 +47,9 @@ ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
addClass(element, 'is-invalid');
errorElement.textContent = message;
},
remove: function remove(element, settings) {
var wrapperElement = element.parentElement;
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
remove(element, settings) {
const wrapperElement = element.parentElement;
const errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
removeClass(wrapperElement, settings.wrapper_error_class);
removeClass(element, 'is-invalid');
if (errorElement) {
Expand Down
57 changes: 15 additions & 42 deletions dist/simple-form.bootstrap4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Client Side Validations Simple Form JS (Bootstrap 4+) - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Client Side Validations Simple Form JS (Bootstrap 4+) - v0.5.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/
Expand All @@ -10,61 +10,34 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ClientSideValidations));
})(this, (function (ClientSideValidations) { 'use strict';

function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}

var addClass = function addClass(element, customClass) {
const addClass = (element, customClass) => {
if (customClass) {
var _element$classList;
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(customClass.split(' ')));
element.classList.add(...customClass.split(' '));
}
};
var removeClass = function removeClass(element, customClass) {
const removeClass = (element, customClass) => {
if (customClass) {
var _element$classList2;
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(customClass.split(' ')));
element.classList.remove(...customClass.split(' '));
}
};

ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
add: function add($element, settings, message) {
add: function ($element, settings, message) {
this.wrapper(settings.wrapper).add.call(this, $element[0], settings, message);
},
remove: function remove($element, settings) {
remove: function ($element, settings) {
this.wrapper(settings.wrapper).remove.call(this, $element[0], settings);
},
wrapper: function wrapper(name) {
wrapper: function (name) {
return this.wrappers[name] || this.wrappers.default;
},
wrappers: {
default: {
add: function add(element, settings, message) {
var wrapperElement = element.parentElement;
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
add(element, settings, message) {
const wrapperElement = element.parentElement;
let errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
if (!errorElement) {
var formTextElement = wrapperElement.querySelector('.form-text');
const formTextElement = wrapperElement.querySelector('.form-text');
errorElement = document.createElement(settings.error_tag);
addClass(errorElement, 'invalid-feedback');
errorElement.textContent = message;
Expand All @@ -78,9 +51,9 @@
addClass(element, 'is-invalid');
errorElement.textContent = message;
},
remove: function remove(element, settings) {
var wrapperElement = element.parentElement;
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
remove(element, settings) {
const wrapperElement = element.parentElement;
const errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".invalid-feedback"));
removeClass(wrapperElement, settings.wrapper_error_class);
removeClass(element, 'is-invalid');
if (errorElement) {
Expand Down
55 changes: 14 additions & 41 deletions dist/simple-form.esm.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,37 @@
/*!
* Client Side Validations Simple Form JS (Default) - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Client Side Validations Simple Form JS (Default) - v0.5.0 (https://github.com/DavyJonesLocker/client_side_validations-simple_form)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/

import ClientSideValidations from '@client-side-validations/client-side-validations';

function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}

var addClass = function addClass(element, customClass) {
const addClass = (element, customClass) => {
if (customClass) {
var _element$classList;
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(customClass.split(' ')));
element.classList.add(...customClass.split(' '));
}
};
var removeClass = function removeClass(element, customClass) {
const removeClass = (element, customClass) => {
if (customClass) {
var _element$classList2;
(_element$classList2 = element.classList).remove.apply(_element$classList2, _toConsumableArray(customClass.split(' ')));
element.classList.remove(...customClass.split(' '));
}
};

ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
add: function add($element, settings, message) {
add: function ($element, settings, message) {
this.wrapper(settings.wrapper).add.call(this, $element[0], settings, message);
},
remove: function remove($element, settings) {
remove: function ($element, settings) {
this.wrapper(settings.wrapper).remove.call(this, $element[0], settings);
},
wrapper: function wrapper(name) {
wrapper: function (name) {
return this.wrappers[name] || this.wrappers.default;
},
wrappers: {
default: {
add: function add(element, settings, message) {
var wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
add(element, settings, message) {
const wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
let errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
if (!errorElement) {
errorElement = document.createElement(settings.error_tag);
addClass(errorElement, settings.error_class);
Expand All @@ -68,9 +41,9 @@ ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
addClass(wrapperElement, settings.wrapper_error_class);
errorElement.textContent = message;
},
remove: function remove(element, settings) {
var wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
var errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
remove(element, settings) {
const wrapperElement = element.closest("".concat(settings.wrapper_tag, ".").concat(settings.wrapper_class.replace(/ /g, '.')));
const errorElement = wrapperElement.querySelector("".concat(settings.error_tag, ".").concat(settings.error_class.replace(/ /g, '.')));
removeClass(wrapperElement, settings.wrapper_error_class);
if (errorElement) {
errorElement.remove();
Expand Down
Loading

0 comments on commit 1b7acd2

Please sign in to comment.