Skip to content

Commit

Permalink
Drop older browsers support
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Dec 22, 2024
1 parent d318027 commit 09171e3
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 270 deletions.
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
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
55 changes: 14 additions & 41 deletions dist/simple-form.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* 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)
*/
Expand All @@ -10,59 +10,32 @@
(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.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 @@ -72,9 +45,9 @@
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
10 changes: 6 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import neostandard from 'neostandard'
import compat from 'eslint-plugin-compat'

export default [
{
ignores: [
'coverage/**/*.js',
'dist/**/*.js',
'test/**/*.js',
'vendor/**/*.js',
'coverage/*',
'dist/*',
'test/*',
'vendor/*',
]
},
compat.configs['flat/recommended'],
...neostandard()
]
Loading

0 comments on commit 09171e3

Please sign in to comment.