foundation-rails 6.6.1.0 → 6.9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -0
- data/Appraisals +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +199 -146
- data/bower.json +3 -3
- data/foundation-rails.gemspec +4 -4
- data/gemfiles/rails_7.1.gemfile +10 -0
- data/gemfiles/rails_7.1.gemfile.lock +261 -0
- data/lib/foundation/rails/version.rb +1 -1
- data/lib/generators/foundation/templates/_settings.scss +32 -28
- data/vendor/assets/js/foundation.cjs.js +2101 -3230
- data/vendor/assets/js/foundation.cjs.js.map +1 -1
- data/vendor/assets/js/foundation.es6.js +505 -379
- data/vendor/assets/js/foundation.es6.js.map +1 -1
- data/vendor/assets/js/foundation.esm.js +1779 -2911
- data/vendor/assets/js/foundation.esm.js.map +1 -1
- data/vendor/assets/js/foundation.js +2544 -3970
- data/vendor/assets/js/foundation.js.map +1 -1
- data/vendor/assets/js/foundation.min.js +1 -1
- data/vendor/assets/js/foundation.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.abide.js +277 -367
- data/vendor/assets/js/plugins/foundation.abide.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.abide.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.abide.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.accordion.js +205 -277
- data/vendor/assets/js/plugins/foundation.accordion.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.accordion.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.accordion.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.accordionMenu.js +174 -262
- data/vendor/assets/js/plugins/foundation.accordionMenu.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.accordionMenu.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.accordionMenu.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.core.js +314 -457
- data/vendor/assets/js/plugins/foundation.core.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.core.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.core.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.drilldown.js +259 -359
- data/vendor/assets/js/plugins/foundation.drilldown.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.drilldown.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.drilldown.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.dropdown.js +291 -462
- data/vendor/assets/js/plugins/foundation.dropdown.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.dropdown.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.dropdown.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.dropdownMenu.js +251 -349
- data/vendor/assets/js/plugins/foundation.dropdownMenu.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.equalizer.js +178 -261
- data/vendor/assets/js/plugins/foundation.equalizer.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.equalizer.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.equalizer.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.interchange.js +455 -240
- data/vendor/assets/js/plugins/foundation.interchange.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.interchange.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.interchange.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.magellan.js +226 -342
- data/vendor/assets/js/plugins/foundation.magellan.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.magellan.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.magellan.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.offcanvas.js +326 -471
- data/vendor/assets/js/plugins/foundation.offcanvas.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.offcanvas.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.offcanvas.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.orbit.js +244 -347
- data/vendor/assets/js/plugins/foundation.orbit.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.orbit.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.orbit.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js +203 -288
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveMenu.js +205 -255
- data/vendor/assets/js/plugins/foundation.responsiveMenu.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveToggle.js +170 -226
- data/vendor/assets/js/plugins/foundation.responsiveToggle.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.reveal.js +285 -445
- data/vendor/assets/js/plugins/foundation.reveal.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.reveal.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.reveal.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.slider.js +321 -486
- data/vendor/assets/js/plugins/foundation.slider.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.slider.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.slider.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.smoothScroll.js +138 -188
- data/vendor/assets/js/plugins/foundation.smoothScroll.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.smoothScroll.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.smoothScroll.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.sticky.js +253 -395
- data/vendor/assets/js/plugins/foundation.sticky.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.sticky.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.sticky.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.tabs.js +228 -317
- data/vendor/assets/js/plugins/foundation.tabs.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.tabs.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.tabs.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.toggler.js +207 -294
- data/vendor/assets/js/plugins/foundation.toggler.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.toggler.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.toggler.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.tooltip.js +276 -437
- data/vendor/assets/js/plugins/foundation.tooltip.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.tooltip.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.tooltip.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.box.js +176 -234
- data/vendor/assets/js/plugins/foundation.util.box.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.box.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.box.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.imageLoader.js +110 -150
- data/vendor/assets/js/plugins/foundation.util.imageLoader.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.keyboard.js +157 -172
- data/vendor/assets/js/plugins/foundation.util.keyboard.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.keyboard.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.keyboard.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.js +167 -233
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.motion.js +127 -161
- data/vendor/assets/js/plugins/foundation.util.motion.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.motion.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.motion.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.nest.js +126 -160
- data/vendor/assets/js/plugins/foundation.util.nest.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.nest.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.nest.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.timer.js +116 -171
- data/vendor/assets/js/plugins/foundation.util.timer.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.timer.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.timer.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.touch.js +172 -228
- data/vendor/assets/js/plugins/foundation.util.touch.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.touch.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.touch.min.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.triggers.js +158 -222
- data/vendor/assets/js/plugins/foundation.util.triggers.js.map +1 -1
- data/vendor/assets/js/plugins/foundation.util.triggers.min.js +1 -1
- data/vendor/assets/js/plugins/foundation.util.triggers.min.js.map +1 -1
- data/vendor/assets/scss/_global.scss +20 -7
- data/vendor/assets/scss/components/_accordion-menu.scss +2 -2
- data/vendor/assets/scss/components/_accordion.scss +2 -2
- data/vendor/assets/scss/components/_badge.scss +3 -3
- data/vendor/assets/scss/components/_breadcrumbs.scss +4 -3
- data/vendor/assets/scss/components/_button-group.scss +23 -13
- data/vendor/assets/scss/components/_button.scss +15 -15
- data/vendor/assets/scss/components/_callout.scss +4 -4
- data/vendor/assets/scss/components/_card.scss +2 -2
- data/vendor/assets/scss/components/_close-button.scss +7 -6
- data/vendor/assets/scss/components/_drilldown.scss +2 -2
- data/vendor/assets/scss/components/_dropdown-menu.scss +3 -3
- data/vendor/assets/scss/components/_dropdown.scss +2 -2
- data/vendor/assets/scss/components/_flex.scss +2 -2
- data/vendor/assets/scss/components/_float.scss +2 -2
- data/vendor/assets/scss/components/_label.scss +3 -3
- data/vendor/assets/scss/components/_media-object.scss +2 -2
- data/vendor/assets/scss/components/_menu.scss +56 -21
- data/vendor/assets/scss/components/_off-canvas.scss +20 -18
- data/vendor/assets/scss/components/_orbit.scss +5 -5
- data/vendor/assets/scss/components/_pagination.scss +3 -3
- data/vendor/assets/scss/components/_progress-bar.scss +3 -3
- data/vendor/assets/scss/components/_responsive-embed.scss +3 -3
- data/vendor/assets/scss/components/_reveal.scss +10 -5
- data/vendor/assets/scss/components/_slider.scss +7 -4
- data/vendor/assets/scss/components/_sticky.scss +2 -2
- data/vendor/assets/scss/components/_switch.scss +27 -4
- data/vendor/assets/scss/components/_table.scss +10 -9
- data/vendor/assets/scss/components/_tabs.scss +4 -4
- data/vendor/assets/scss/components/_thumbnail.scss +2 -2
- data/vendor/assets/scss/components/_title-bar.scss +2 -2
- data/vendor/assets/scss/components/_tooltip.scss +2 -2
- data/vendor/assets/scss/components/_top-bar.scss +9 -7
- data/vendor/assets/scss/components/_visibility.scss +48 -5
- data/vendor/assets/scss/forms/_checkbox.scss +2 -2
- data/vendor/assets/scss/forms/_error.scss +2 -2
- data/vendor/assets/scss/forms/_fieldset.scss +2 -2
- data/vendor/assets/scss/forms/_forms.scss +2 -2
- data/vendor/assets/scss/forms/_help-text.scss +2 -2
- data/vendor/assets/scss/forms/_input-group.scss +2 -2
- data/vendor/assets/scss/forms/_label.scss +4 -3
- data/vendor/assets/scss/forms/_meter.scss +2 -2
- data/vendor/assets/scss/forms/_progress.scss +3 -3
- data/vendor/assets/scss/forms/_range.scss +3 -3
- data/vendor/assets/scss/forms/_select.scss +7 -6
- data/vendor/assets/scss/forms/_text.scss +4 -4
- data/vendor/assets/scss/foundation.scss +3 -3
- data/vendor/assets/scss/grid/_classes.scss +3 -3
- data/vendor/assets/scss/grid/_column.scss +5 -4
- data/vendor/assets/scss/grid/_flex-grid.scss +9 -8
- data/vendor/assets/scss/grid/_grid.scss +2 -2
- data/vendor/assets/scss/grid/_gutter.scss +3 -3
- data/vendor/assets/scss/grid/_layout.scss +7 -7
- data/vendor/assets/scss/grid/_position.scss +6 -6
- data/vendor/assets/scss/grid/_row.scss +3 -3
- data/vendor/assets/scss/grid/_size.scss +2 -2
- data/vendor/assets/scss/motion-ui/util/_animation.scss +1 -1
- data/vendor/assets/scss/motion-ui/util/_series.scss +1 -1
- data/vendor/assets/scss/motion-ui/util/_unit.scss +54 -1
- data/vendor/assets/scss/prototype/_arrow.scss +2 -2
- data/vendor/assets/scss/prototype/_border-box.scss +2 -2
- data/vendor/assets/scss/prototype/_border-none.scss +3 -3
- data/vendor/assets/scss/prototype/_bordered.scss +2 -2
- data/vendor/assets/scss/prototype/_box.scss +2 -2
- data/vendor/assets/scss/prototype/_display.scss +2 -2
- data/vendor/assets/scss/prototype/_font-styling.scss +4 -4
- data/vendor/assets/scss/prototype/_list-style-type.scss +2 -2
- data/vendor/assets/scss/prototype/_overflow.scss +11 -2
- data/vendor/assets/scss/prototype/_position.scss +2 -2
- data/vendor/assets/scss/prototype/_prototype.scss +2 -2
- data/vendor/assets/scss/prototype/_rotate.scss +9 -7
- data/vendor/assets/scss/prototype/_rounded.scss +2 -2
- data/vendor/assets/scss/prototype/_separator.scss +7 -7
- data/vendor/assets/scss/prototype/_shadow.scss +3 -4
- data/vendor/assets/scss/prototype/_sizing.scss +2 -2
- data/vendor/assets/scss/prototype/_spacing.scss +35 -35
- data/vendor/assets/scss/prototype/_text-decoration.scss +2 -2
- data/vendor/assets/scss/prototype/_text-transformation.scss +5 -5
- data/vendor/assets/scss/prototype/_text-utilities.scss +2 -2
- data/vendor/assets/scss/settings/_settings.scss +32 -28
- data/vendor/assets/scss/typography/_alignment.scss +2 -2
- data/vendor/assets/scss/typography/_base.scss +8 -8
- data/vendor/assets/scss/typography/_helpers.scss +12 -4
- data/vendor/assets/scss/typography/_print.scss +4 -4
- data/vendor/assets/scss/typography/_typography.scss +2 -2
- data/vendor/assets/scss/util/_breakpoint.scss +24 -21
- data/vendor/assets/scss/util/_color.scss +22 -10
- data/vendor/assets/scss/util/_direction.scss +3 -3
- data/vendor/assets/scss/util/_flex.scss +1 -1
- data/vendor/assets/scss/util/_math.scss +63 -11
- data/vendor/assets/scss/util/_mixins.scss +20 -16
- data/vendor/assets/scss/util/_selector.scss +3 -17
- data/vendor/assets/scss/util/_typography.scss +8 -8
- data/vendor/assets/scss/util/_unit.scss +16 -10
- data/vendor/assets/scss/util/_util.scss +2 -2
- data/vendor/assets/scss/util/_value.scss +5 -20
- data/vendor/assets/scss/vendor/normalize.scss +19 -2
- data/vendor/assets/scss/xy-grid/_cell.scss +18 -7
- data/vendor/assets/scss/xy-grid/_classes.scss +16 -16
- data/vendor/assets/scss/xy-grid/_collapse.scss +2 -2
- data/vendor/assets/scss/xy-grid/_frame.scss +12 -0
- data/vendor/assets/scss/xy-grid/_grid.scss +4 -4
- data/vendor/assets/scss/xy-grid/_gutters.scss +4 -4
- data/vendor/assets/scss/xy-grid/_layout.scss +3 -3
- data/vendor/assets/scss/xy-grid/_position.scss +14 -9
- data/vendor/assets/scss/xy-grid/_xy-grid.scss +4 -4
- metadata +21 -19
@@ -4,165 +4,41 @@
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
5
5
|
define(["./foundation.core", "jquery"], factory);
|
6
6
|
else if(typeof exports === 'object')
|
7
|
-
exports["
|
7
|
+
exports["__FOUNDATION_EXTERNAL__"] = factory(require("./foundation.core"), require("jquery"));
|
8
8
|
else
|
9
9
|
root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.abide"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
|
10
|
-
})(
|
11
|
-
return /******/ (function(
|
12
|
-
/******/
|
13
|
-
/******/ var
|
14
|
-
/******/
|
15
|
-
/******/ // The require function
|
16
|
-
/******/ function __webpack_require__(moduleId) {
|
17
|
-
/******/
|
18
|
-
/******/ // Check if module is in cache
|
19
|
-
/******/ if(installedModules[moduleId]) {
|
20
|
-
/******/ return installedModules[moduleId].exports;
|
21
|
-
/******/ }
|
22
|
-
/******/ // Create a new module (and put it into the cache)
|
23
|
-
/******/ var module = installedModules[moduleId] = {
|
24
|
-
/******/ i: moduleId,
|
25
|
-
/******/ l: false,
|
26
|
-
/******/ exports: {}
|
27
|
-
/******/ };
|
28
|
-
/******/
|
29
|
-
/******/ // Execute the module function
|
30
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31
|
-
/******/
|
32
|
-
/******/ // Flag the module as loaded
|
33
|
-
/******/ module.l = true;
|
34
|
-
/******/
|
35
|
-
/******/ // Return the exports of the module
|
36
|
-
/******/ return module.exports;
|
37
|
-
/******/ }
|
38
|
-
/******/
|
39
|
-
/******/
|
40
|
-
/******/ // expose the modules object (__webpack_modules__)
|
41
|
-
/******/ __webpack_require__.m = modules;
|
42
|
-
/******/
|
43
|
-
/******/ // expose the module cache
|
44
|
-
/******/ __webpack_require__.c = installedModules;
|
45
|
-
/******/
|
46
|
-
/******/ // define getter function for harmony exports
|
47
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
48
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
49
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50
|
-
/******/ }
|
51
|
-
/******/ };
|
52
|
-
/******/
|
53
|
-
/******/ // define __esModule on exports
|
54
|
-
/******/ __webpack_require__.r = function(exports) {
|
55
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57
|
-
/******/ }
|
58
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
59
|
-
/******/ };
|
60
|
-
/******/
|
61
|
-
/******/ // create a fake namespace object
|
62
|
-
/******/ // mode & 1: value is a module id, require it
|
63
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
64
|
-
/******/ // mode & 4: return value when already ns object
|
65
|
-
/******/ // mode & 8|1: behave like require
|
66
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
67
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
68
|
-
/******/ if(mode & 8) return value;
|
69
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70
|
-
/******/ var ns = Object.create(null);
|
71
|
-
/******/ __webpack_require__.r(ns);
|
72
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74
|
-
/******/ return ns;
|
75
|
-
/******/ };
|
76
|
-
/******/
|
77
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
78
|
-
/******/ __webpack_require__.n = function(module) {
|
79
|
-
/******/ var getter = module && module.__esModule ?
|
80
|
-
/******/ function getDefault() { return module['default']; } :
|
81
|
-
/******/ function getModuleExports() { return module; };
|
82
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
83
|
-
/******/ return getter;
|
84
|
-
/******/ };
|
85
|
-
/******/
|
86
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
87
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88
|
-
/******/
|
89
|
-
/******/ // __webpack_public_path__
|
90
|
-
/******/ __webpack_require__.p = "";
|
91
|
-
/******/
|
92
|
-
/******/
|
93
|
-
/******/ // Load entry module and return exports
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
95
|
-
/******/ })
|
96
|
-
/************************************************************************/
|
97
|
-
/******/ ({
|
98
|
-
|
99
|
-
/***/ "./foundation.core":
|
100
|
-
/*!****************************************************************************************************************************************************************!*\
|
101
|
-
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.core"],"amd":"./foundation.core","commonjs":"./foundation.core","commonjs2":"./foundation.core"} ***!
|
102
|
-
\****************************************************************************************************************************************************************/
|
103
|
-
/*! no static exports found */
|
104
|
-
/***/ (function(module, exports) {
|
105
|
-
|
106
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
|
107
|
-
|
108
|
-
/***/ }),
|
109
|
-
|
110
|
-
/***/ "./js/entries/plugins/foundation.abide.js":
|
111
|
-
/*!************************************************!*\
|
112
|
-
!*** ./js/entries/plugins/foundation.abide.js ***!
|
113
|
-
\************************************************/
|
114
|
-
/*! exports provided: Foundation, Abide */
|
115
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
116
|
-
|
117
|
-
"use strict";
|
118
|
-
__webpack_require__.r(__webpack_exports__);
|
119
|
-
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
|
120
|
-
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
|
121
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
|
122
|
-
|
123
|
-
/* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.abide */ "./js/foundation.abide.js");
|
124
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return _foundation_abide__WEBPACK_IMPORTED_MODULE_1__["Abide"]; });
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_1__["Abide"], 'Abide');
|
129
|
-
|
130
|
-
|
131
|
-
/***/ }),
|
10
|
+
})(self, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
|
11
|
+
return /******/ (function() { // webpackBootstrap
|
12
|
+
/******/ "use strict";
|
13
|
+
/******/ var __webpack_modules__ = ({
|
132
14
|
|
133
15
|
/***/ "./js/foundation.abide.js":
|
134
16
|
/*!********************************!*\
|
135
17
|
!*** ./js/foundation.abide.js ***!
|
136
18
|
\********************************/
|
137
|
-
|
138
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
19
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
139
20
|
|
140
|
-
"use strict";
|
141
21
|
__webpack_require__.r(__webpack_exports__);
|
142
|
-
/* harmony export
|
22
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
23
|
+
/* harmony export */ Abide: function() { return /* binding */ Abide; }
|
24
|
+
/* harmony export */ });
|
143
25
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
|
144
26
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
145
|
-
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.
|
27
|
+
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
|
146
28
|
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__);
|
147
|
-
|
148
|
-
|
149
|
-
function
|
150
|
-
|
151
|
-
function
|
152
|
-
|
153
|
-
function
|
154
|
-
|
155
|
-
function
|
156
|
-
|
157
|
-
function
|
158
|
-
|
159
|
-
function
|
160
|
-
|
161
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
162
|
-
|
163
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
164
|
-
|
165
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
29
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
30
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
31
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
32
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
33
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
34
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
35
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
36
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
37
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
38
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
39
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
40
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
41
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
166
42
|
|
167
43
|
|
168
44
|
|
@@ -171,21 +47,15 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
171
47
|
* Abide module.
|
172
48
|
* @module foundation.abide
|
173
49
|
*/
|
174
|
-
|
175
|
-
var Abide =
|
176
|
-
/*#__PURE__*/
|
177
|
-
function (_Plugin) {
|
178
|
-
_inherits(Abide, _Plugin);
|
179
|
-
|
50
|
+
var Abide = /*#__PURE__*/function (_Plugin) {
|
180
51
|
function Abide() {
|
181
52
|
_classCallCheck(this, Abide);
|
182
|
-
|
183
|
-
return _possibleConstructorReturn(this, _getPrototypeOf(Abide).apply(this, arguments));
|
53
|
+
return _callSuper(this, Abide, arguments);
|
184
54
|
}
|
185
|
-
|
186
|
-
_createClass(Abide, [{
|
55
|
+
_inherits(Abide, _Plugin);
|
56
|
+
return _createClass(Abide, [{
|
187
57
|
key: "_setup",
|
188
|
-
|
58
|
+
value:
|
189
59
|
/**
|
190
60
|
* Creates a new instance of Abide.
|
191
61
|
* @class
|
@@ -194,33 +64,34 @@ function (_Plugin) {
|
|
194
64
|
* @param {Object} element - jQuery object to add the trigger to.
|
195
65
|
* @param {Object} options - Overrides to the default plugin settings.
|
196
66
|
*/
|
197
|
-
|
67
|
+
function _setup(element) {
|
198
68
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
199
69
|
this.$element = element;
|
200
|
-
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.
|
70
|
+
this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default().extend(true, {}, Abide.defaults, this.$element.data(), options);
|
201
71
|
this.isEnabled = true;
|
202
72
|
this.formnovalidate = null;
|
203
73
|
this.className = 'Abide'; // ie9 back compat
|
204
|
-
|
205
74
|
this._init();
|
206
75
|
}
|
76
|
+
|
207
77
|
/**
|
208
78
|
* Initializes the Abide plugin and calls functions to get Abide functioning on load.
|
209
79
|
* @private
|
210
80
|
*/
|
211
|
-
|
212
81
|
}, {
|
213
82
|
key: "_init",
|
214
83
|
value: function _init() {
|
215
84
|
var _this2 = this;
|
216
|
-
|
217
|
-
|
218
|
-
this.$element.find('input').not('[type="submit"]'),
|
85
|
+
this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default().merge(
|
86
|
+
// Consider as input to validate:
|
87
|
+
this.$element.find('input').not('[type="submit"]'),
|
88
|
+
// * all input fields expect submit
|
219
89
|
this.$element.find('textarea, select') // * all textareas and select fields
|
220
90
|
);
|
221
91
|
this.$submits = this.$element.find('[type="submit"]');
|
222
|
-
var $globalErrors = this.$element.find('[data-abide-error]');
|
92
|
+
var $globalErrors = this.$element.find('[data-abide-error]');
|
223
93
|
|
94
|
+
// Add a11y attributes to all fields
|
224
95
|
if (this.options.a11yAttributes) {
|
225
96
|
this.$inputs.each(function (i, input) {
|
226
97
|
return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input));
|
@@ -229,19 +100,17 @@ function (_Plugin) {
|
|
229
100
|
return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error));
|
230
101
|
});
|
231
102
|
}
|
232
|
-
|
233
103
|
this._events();
|
234
104
|
}
|
105
|
+
|
235
106
|
/**
|
236
107
|
* Initializes events for Abide.
|
237
108
|
* @private
|
238
109
|
*/
|
239
|
-
|
240
110
|
}, {
|
241
111
|
key: "_events",
|
242
112
|
value: function _events() {
|
243
113
|
var _this3 = this;
|
244
|
-
|
245
114
|
this.$element.off('.abide').on('reset.zf.abide', function () {
|
246
115
|
_this3.resetForm();
|
247
116
|
}).on('submit.zf.abide', function () {
|
@@ -251,45 +120,41 @@ function (_Plugin) {
|
|
251
120
|
if (!e.key || e.key === ' ' || e.key === 'Enter') {
|
252
121
|
e.preventDefault();
|
253
122
|
_this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null;
|
254
|
-
|
255
123
|
_this3.$element.submit();
|
256
124
|
}
|
257
125
|
});
|
258
|
-
|
259
126
|
if (this.options.validateOn === 'fieldChange') {
|
260
127
|
this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {
|
261
128
|
_this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
|
262
129
|
});
|
263
130
|
}
|
264
|
-
|
265
131
|
if (this.options.liveValidate) {
|
266
132
|
this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {
|
267
133
|
_this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
|
268
134
|
});
|
269
135
|
}
|
270
|
-
|
271
136
|
if (this.options.validateOnBlur) {
|
272
137
|
this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {
|
273
138
|
_this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
|
274
139
|
});
|
275
140
|
}
|
276
141
|
}
|
142
|
+
|
277
143
|
/**
|
278
144
|
* Calls necessary functions to update Abide upon DOM change
|
279
145
|
* @private
|
280
146
|
*/
|
281
|
-
|
282
147
|
}, {
|
283
148
|
key: "_reflow",
|
284
149
|
value: function _reflow() {
|
285
150
|
this._init();
|
286
151
|
}
|
152
|
+
|
287
153
|
/**
|
288
154
|
* Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled
|
289
155
|
* @returns {Boolean}
|
290
156
|
* @private
|
291
157
|
*/
|
292
|
-
|
293
158
|
}, {
|
294
159
|
key: "_validationIsDisabled",
|
295
160
|
value: function _validationIsDisabled() {
|
@@ -299,59 +164,55 @@ function (_Plugin) {
|
|
299
164
|
} else if (typeof this.formnovalidate === 'boolean') {
|
300
165
|
// triggered by $submit
|
301
166
|
return this.formnovalidate;
|
302
|
-
} else {
|
303
|
-
// triggered by Enter in non-submit input
|
304
|
-
return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;
|
305
167
|
}
|
168
|
+
// triggered by Enter in non-submit input
|
169
|
+
return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;
|
306
170
|
}
|
171
|
+
|
307
172
|
/**
|
308
173
|
* Enables the whole validation
|
309
174
|
*/
|
310
|
-
|
311
175
|
}, {
|
312
176
|
key: "enableValidation",
|
313
177
|
value: function enableValidation() {
|
314
178
|
this.isEnabled = true;
|
315
179
|
}
|
180
|
+
|
316
181
|
/**
|
317
182
|
* Disables the whole validation
|
318
183
|
*/
|
319
|
-
|
320
184
|
}, {
|
321
185
|
key: "disableValidation",
|
322
186
|
value: function disableValidation() {
|
323
187
|
this.isEnabled = false;
|
324
188
|
}
|
189
|
+
|
325
190
|
/**
|
326
191
|
* Checks whether or not a form element has the required attribute and if it's checked or not
|
327
192
|
* @param {Object} element - jQuery object to check for required attribute
|
328
193
|
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
329
194
|
*/
|
330
|
-
|
331
195
|
}, {
|
332
196
|
key: "requiredCheck",
|
333
197
|
value: function requiredCheck($el) {
|
334
198
|
if (!$el.attr('required')) return true;
|
335
199
|
var isGood = true;
|
336
|
-
|
337
200
|
switch ($el[0].type) {
|
338
201
|
case 'checkbox':
|
339
202
|
isGood = $el[0].checked;
|
340
203
|
break;
|
341
|
-
|
342
204
|
case 'select':
|
343
205
|
case 'select-one':
|
344
206
|
case 'select-multiple':
|
345
207
|
var opt = $el.find('option:selected');
|
346
208
|
if (!opt.length || !opt.val()) isGood = false;
|
347
209
|
break;
|
348
|
-
|
349
210
|
default:
|
350
211
|
if (!$el.val() || !$el.val().length) isGood = false;
|
351
212
|
}
|
352
|
-
|
353
213
|
return isGood;
|
354
214
|
}
|
215
|
+
|
355
216
|
/**
|
356
217
|
* Get:
|
357
218
|
* - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
|
@@ -362,25 +223,31 @@ function (_Plugin) {
|
|
362
223
|
* This allows for multiple form errors per input, though if none are found, no form errors will be shown.
|
363
224
|
*
|
364
225
|
* @param {Object} $el - jQuery object to use as reference to find the form error selector.
|
226
|
+
* @param {String[]} [failedValidators] - List of failed validators.
|
365
227
|
* @returns {Object} jQuery object with the selector.
|
366
228
|
*/
|
367
|
-
|
368
229
|
}, {
|
369
230
|
key: "findFormError",
|
370
|
-
value: function findFormError($el) {
|
231
|
+
value: function findFormError($el, failedValidators) {
|
232
|
+
var _this4 = this;
|
371
233
|
var id = $el.length ? $el[0].id : '';
|
372
234
|
var $error = $el.siblings(this.options.formErrorSelector);
|
373
|
-
|
374
235
|
if (!$error.length) {
|
375
236
|
$error = $el.parent().find(this.options.formErrorSelector);
|
376
237
|
}
|
377
|
-
|
378
238
|
if (id) {
|
379
239
|
$error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]")));
|
380
240
|
}
|
381
|
-
|
241
|
+
if (!!failedValidators) {
|
242
|
+
$error = $error.not('[data-form-error-on]');
|
243
|
+
failedValidators.forEach(function (v) {
|
244
|
+
$error = $error.add($el.siblings("[data-form-error-on=\"".concat(v, "\"]")));
|
245
|
+
$error = $error.add(_this4.$element.find("[data-form-error-for=\"".concat(id, "\"][data-form-error-on=\"").concat(v, "\"]")));
|
246
|
+
});
|
247
|
+
}
|
382
248
|
return $error;
|
383
249
|
}
|
250
|
+
|
384
251
|
/**
|
385
252
|
* Get the first element in this order:
|
386
253
|
* 2. The <label> with the attribute `[for="someInputId"]`
|
@@ -389,19 +256,17 @@ function (_Plugin) {
|
|
389
256
|
* @param {Object} $el - jQuery object to check for required attribute
|
390
257
|
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
391
258
|
*/
|
392
|
-
|
393
259
|
}, {
|
394
260
|
key: "findLabel",
|
395
261
|
value: function findLabel($el) {
|
396
262
|
var id = $el[0].id;
|
397
263
|
var $label = this.$element.find("label[for=\"".concat(id, "\"]"));
|
398
|
-
|
399
264
|
if (!$label.length) {
|
400
265
|
return $el.closest('label');
|
401
266
|
}
|
402
|
-
|
403
267
|
return $label;
|
404
268
|
}
|
269
|
+
|
405
270
|
/**
|
406
271
|
* Get the set of labels associated with a set of radio els in this order
|
407
272
|
* 2. The <label> with the attribute `[for="someInputId"]`
|
@@ -410,25 +275,21 @@ function (_Plugin) {
|
|
410
275
|
* @param {Object} $el - jQuery object to check for required attribute
|
411
276
|
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
412
277
|
*/
|
413
|
-
|
414
278
|
}, {
|
415
279
|
key: "findRadioLabels",
|
416
280
|
value: function findRadioLabels($els) {
|
417
|
-
var
|
418
|
-
|
281
|
+
var _this5 = this;
|
419
282
|
var labels = $els.map(function (i, el) {
|
420
283
|
var id = el.id;
|
421
|
-
|
422
|
-
var $label = _this4.$element.find("label[for=\"".concat(id, "\"]"));
|
423
|
-
|
284
|
+
var $label = _this5.$element.find("label[for=\"".concat(id, "\"]"));
|
424
285
|
if (!$label.length) {
|
425
286
|
$label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
|
426
287
|
}
|
427
|
-
|
428
288
|
return $label[0];
|
429
289
|
});
|
430
290
|
return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
|
431
291
|
}
|
292
|
+
|
432
293
|
/**
|
433
294
|
* Get the set of labels associated with a set of checkbox els in this order
|
434
295
|
* 2. The <label> with the attribute `[for="someInputId"]`
|
@@ -437,193 +298,186 @@ function (_Plugin) {
|
|
437
298
|
* @param {Object} $el - jQuery object to check for required attribute
|
438
299
|
* @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
|
439
300
|
*/
|
440
|
-
|
441
301
|
}, {
|
442
302
|
key: "findCheckboxLabels",
|
443
303
|
value: function findCheckboxLabels($els) {
|
444
|
-
var
|
445
|
-
|
304
|
+
var _this6 = this;
|
446
305
|
var labels = $els.map(function (i, el) {
|
447
306
|
var id = el.id;
|
448
|
-
|
449
|
-
var $label = _this5.$element.find("label[for=\"".concat(id, "\"]"));
|
450
|
-
|
307
|
+
var $label = _this6.$element.find("label[for=\"".concat(id, "\"]"));
|
451
308
|
if (!$label.length) {
|
452
309
|
$label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
|
453
310
|
}
|
454
|
-
|
455
311
|
return $label[0];
|
456
312
|
});
|
457
313
|
return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
|
458
314
|
}
|
315
|
+
|
459
316
|
/**
|
460
317
|
* Adds the CSS error class as specified by the Abide settings to the label, input, and the form
|
461
318
|
* @param {Object} $el - jQuery object to add the class to
|
319
|
+
* @param {String[]} [failedValidators] - List of failed validators.
|
462
320
|
*/
|
463
|
-
|
464
321
|
}, {
|
465
322
|
key: "addErrorClasses",
|
466
|
-
value: function addErrorClasses($el) {
|
323
|
+
value: function addErrorClasses($el, failedValidators) {
|
467
324
|
var $label = this.findLabel($el);
|
468
|
-
var $formError = this.findFormError($el);
|
469
|
-
|
325
|
+
var $formError = this.findFormError($el, failedValidators);
|
470
326
|
if ($label.length) {
|
471
327
|
$label.addClass(this.options.labelErrorClass);
|
472
328
|
}
|
473
|
-
|
474
329
|
if ($formError.length) {
|
475
330
|
$formError.addClass(this.options.formErrorClass);
|
476
331
|
}
|
477
|
-
|
478
332
|
$el.addClass(this.options.inputErrorClass).attr({
|
479
333
|
'data-invalid': '',
|
480
334
|
'aria-invalid': true
|
481
335
|
});
|
336
|
+
if ($formError.filter(':visible').length) {
|
337
|
+
this.addA11yErrorDescribe($el, $formError);
|
338
|
+
}
|
482
339
|
}
|
340
|
+
|
483
341
|
/**
|
484
342
|
* Adds [for] and [role=alert] attributes to all form error targetting $el,
|
485
343
|
* and [aria-describedby] attribute to $el toward the first form error.
|
486
344
|
* @param {Object} $el - jQuery object
|
487
345
|
*/
|
488
|
-
|
489
346
|
}, {
|
490
347
|
key: "addA11yAttributes",
|
491
348
|
value: function addA11yAttributes($el) {
|
492
349
|
var $errors = this.findFormError($el);
|
493
350
|
var $labels = $errors.filter('label');
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
// Get the first error ID or create one
|
499
|
-
var errorId = $error.attr('id');
|
500
|
-
|
501
|
-
if (typeof errorId === 'undefined') {
|
502
|
-
errorId = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'abide-error');
|
503
|
-
$error.attr('id', errorId);
|
504
|
-
}
|
505
|
-
|
506
|
-
;
|
507
|
-
$el.attr('aria-describedby', errorId);
|
351
|
+
if (!$errors.length) return;
|
352
|
+
var $error = $errors.filter(':visible').first();
|
353
|
+
if ($error.length) {
|
354
|
+
this.addA11yErrorDescribe($el, $error);
|
508
355
|
}
|
509
|
-
|
510
356
|
if ($labels.filter('[for]').length < $labels.length) {
|
511
357
|
// Get the input ID or create one
|
512
358
|
var elemId = $el.attr('id');
|
513
|
-
|
514
359
|
if (typeof elemId === 'undefined') {
|
515
|
-
elemId =
|
360
|
+
elemId = (0,_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__.GetYoDigits)(6, 'abide-input');
|
516
361
|
$el.attr('id', elemId);
|
517
362
|
}
|
518
363
|
|
519
|
-
|
520
|
-
|
364
|
+
// For each label targeting $el, set [for] if it is not set.
|
521
365
|
$labels.each(function (i, label) {
|
522
366
|
var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
|
523
367
|
if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId);
|
524
368
|
});
|
525
|
-
}
|
526
|
-
|
369
|
+
}
|
527
370
|
|
371
|
+
// For each error targeting $el, set [role=alert] if it is not set.
|
528
372
|
$errors.each(function (i, label) {
|
529
373
|
var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
|
530
374
|
if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert');
|
531
375
|
}).end();
|
532
376
|
}
|
377
|
+
}, {
|
378
|
+
key: "addA11yErrorDescribe",
|
379
|
+
value: function addA11yErrorDescribe($el, $error) {
|
380
|
+
if ($el.attr('type') === 'hidden') return;
|
381
|
+
if (typeof $el.attr('aria-describedby') !== 'undefined') return;
|
382
|
+
|
383
|
+
// Set [aria-describedby] on the input toward the first form error if it is not set
|
384
|
+
// Get the first error ID or create one
|
385
|
+
var errorId = $error.attr('id');
|
386
|
+
if (typeof errorId === 'undefined') {
|
387
|
+
errorId = (0,_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__.GetYoDigits)(6, 'abide-error');
|
388
|
+
$error.attr('id', errorId);
|
389
|
+
}
|
390
|
+
$el.attr('aria-describedby', errorId).data('abide-describedby', true);
|
391
|
+
}
|
392
|
+
|
533
393
|
/**
|
534
394
|
* Adds [aria-live] attribute to the given global form error $el.
|
535
395
|
* @param {Object} $el - jQuery object to add the attribute to
|
536
396
|
*/
|
537
|
-
|
538
397
|
}, {
|
539
398
|
key: "addGlobalErrorA11yAttributes",
|
540
399
|
value: function addGlobalErrorA11yAttributes($el) {
|
541
400
|
if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel);
|
542
401
|
}
|
402
|
+
|
543
403
|
/**
|
544
404
|
* Remove CSS error classes etc from an entire radio button group
|
545
405
|
* @param {String} groupName - A string that specifies the name of a radio button group
|
546
406
|
*
|
547
407
|
*/
|
548
|
-
|
549
408
|
}, {
|
550
409
|
key: "removeRadioErrorClasses",
|
551
410
|
value: function removeRadioErrorClasses(groupName) {
|
552
411
|
var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
|
553
412
|
var $labels = this.findRadioLabels($els);
|
554
413
|
var $formErrors = this.findFormError($els);
|
555
|
-
|
556
414
|
if ($labels.length) {
|
557
415
|
$labels.removeClass(this.options.labelErrorClass);
|
558
416
|
}
|
559
|
-
|
560
417
|
if ($formErrors.length) {
|
561
418
|
$formErrors.removeClass(this.options.formErrorClass);
|
562
419
|
}
|
563
|
-
|
564
420
|
$els.removeClass(this.options.inputErrorClass).attr({
|
565
421
|
'data-invalid': null,
|
566
422
|
'aria-invalid': null
|
567
423
|
});
|
568
424
|
}
|
425
|
+
|
569
426
|
/**
|
570
427
|
* Remove CSS error classes etc from an entire checkbox group
|
571
428
|
* @param {String} groupName - A string that specifies the name of a checkbox group
|
572
429
|
*
|
573
430
|
*/
|
574
|
-
|
575
431
|
}, {
|
576
432
|
key: "removeCheckboxErrorClasses",
|
577
433
|
value: function removeCheckboxErrorClasses(groupName) {
|
578
434
|
var $els = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
|
579
435
|
var $labels = this.findCheckboxLabels($els);
|
580
436
|
var $formErrors = this.findFormError($els);
|
581
|
-
|
582
437
|
if ($labels.length) {
|
583
438
|
$labels.removeClass(this.options.labelErrorClass);
|
584
439
|
}
|
585
|
-
|
586
440
|
if ($formErrors.length) {
|
587
441
|
$formErrors.removeClass(this.options.formErrorClass);
|
588
442
|
}
|
589
|
-
|
590
443
|
$els.removeClass(this.options.inputErrorClass).attr({
|
591
444
|
'data-invalid': null,
|
592
445
|
'aria-invalid': null
|
593
446
|
});
|
594
447
|
}
|
448
|
+
|
595
449
|
/**
|
596
450
|
* Removes CSS error class as specified by the Abide settings from the label, input, and the form
|
597
451
|
* @param {Object} $el - jQuery object to remove the class from
|
598
452
|
*/
|
599
|
-
|
600
453
|
}, {
|
601
454
|
key: "removeErrorClasses",
|
602
455
|
value: function removeErrorClasses($el) {
|
603
456
|
// radios need to clear all of the els
|
604
|
-
if ($el[0].type
|
457
|
+
if ($el[0].type === 'radio') {
|
605
458
|
return this.removeRadioErrorClasses($el.attr('name'));
|
606
|
-
}
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
459
|
+
}
|
460
|
+
// checkboxes need to clear all of the els
|
461
|
+
else if ($el[0].type === 'checkbox') {
|
462
|
+
return this.removeCheckboxErrorClasses($el.attr('name'));
|
463
|
+
}
|
611
464
|
var $label = this.findLabel($el);
|
612
465
|
var $formError = this.findFormError($el);
|
613
|
-
|
614
466
|
if ($label.length) {
|
615
467
|
$label.removeClass(this.options.labelErrorClass);
|
616
468
|
}
|
617
|
-
|
618
469
|
if ($formError.length) {
|
619
470
|
$formError.removeClass(this.options.formErrorClass);
|
620
471
|
}
|
621
|
-
|
622
472
|
$el.removeClass(this.options.inputErrorClass).attr({
|
623
473
|
'data-invalid': null,
|
624
474
|
'aria-invalid': null
|
625
475
|
});
|
476
|
+
if ($el.data('abide-describedby')) {
|
477
|
+
$el.removeAttr('aria-describedby').removeData('abide-describedby');
|
478
|
+
}
|
626
479
|
}
|
480
|
+
|
627
481
|
/**
|
628
482
|
* Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
|
629
483
|
* Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
|
@@ -632,63 +486,58 @@ function (_Plugin) {
|
|
632
486
|
* @param {Object} element - jQuery object to validate, should be an HTML input
|
633
487
|
* @returns {Boolean} goodToGo - If the input is valid or not.
|
634
488
|
*/
|
635
|
-
|
636
489
|
}, {
|
637
490
|
key: "validateInput",
|
638
491
|
value: function validateInput($el) {
|
492
|
+
var _this7 = this;
|
639
493
|
var clearRequire = this.requiredCheck($el),
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
equalTo = true; // skip validation if disabled
|
494
|
+
validator = $el.attr('data-validator'),
|
495
|
+
failedValidators = [],
|
496
|
+
manageErrorClasses = true;
|
644
497
|
|
498
|
+
// skip validation if disabled
|
645
499
|
if (this._validationIsDisabled()) {
|
646
500
|
return true;
|
647
|
-
}
|
648
|
-
|
501
|
+
}
|
649
502
|
|
503
|
+
// don't validate ignored inputs or hidden inputs or disabled inputs
|
650
504
|
if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
|
651
505
|
return true;
|
652
506
|
}
|
653
|
-
|
654
507
|
switch ($el[0].type) {
|
655
508
|
case 'radio':
|
656
|
-
|
509
|
+
this.validateRadio($el.attr('name')) || failedValidators.push('required');
|
657
510
|
break;
|
658
|
-
|
659
511
|
case 'checkbox':
|
660
|
-
|
661
|
-
|
512
|
+
this.validateCheckbox($el.attr('name')) || failedValidators.push('required');
|
513
|
+
// validateCheckbox() adds/removes error classes
|
514
|
+
manageErrorClasses = false;
|
662
515
|
break;
|
663
|
-
|
664
516
|
case 'select':
|
665
517
|
case 'select-one':
|
666
518
|
case 'select-multiple':
|
667
|
-
|
519
|
+
clearRequire || failedValidators.push('required');
|
668
520
|
break;
|
669
|
-
|
670
521
|
default:
|
671
|
-
|
522
|
+
clearRequire || failedValidators.push('required');
|
523
|
+
this.validateText($el) || failedValidators.push('pattern');
|
672
524
|
}
|
673
|
-
|
674
525
|
if (validator) {
|
675
|
-
|
526
|
+
var required = $el.attr('required') ? true : false;
|
527
|
+
validator.split(' ').forEach(function (v) {
|
528
|
+
_this7.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v);
|
529
|
+
});
|
676
530
|
}
|
677
|
-
|
678
531
|
if ($el.attr('data-equalto')) {
|
679
|
-
|
532
|
+
this.options.validators.equalTo($el) || failedValidators.push('equalTo');
|
680
533
|
}
|
681
|
-
|
682
|
-
var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1;
|
534
|
+
var goodToGo = failedValidators.length === 0;
|
683
535
|
var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';
|
684
|
-
|
685
536
|
if (goodToGo) {
|
686
537
|
// Re-validate inputs that depend on this one with equalto
|
687
538
|
var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]"));
|
688
|
-
|
689
539
|
if (dependentElements.length) {
|
690
540
|
var _this = this;
|
691
|
-
|
692
541
|
dependentElements.each(function () {
|
693
542
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) {
|
694
543
|
_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
@@ -696,111 +545,105 @@ function (_Plugin) {
|
|
696
545
|
});
|
697
546
|
}
|
698
547
|
}
|
548
|
+
if (manageErrorClasses) {
|
549
|
+
this.removeErrorClasses($el);
|
550
|
+
if (!goodToGo) {
|
551
|
+
this.addErrorClasses($el, failedValidators);
|
552
|
+
}
|
553
|
+
}
|
699
554
|
|
700
|
-
this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el);
|
701
555
|
/**
|
702
556
|
* Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`
|
703
557
|
* Trigger includes the DOM element of the input.
|
704
558
|
* @event Abide#valid
|
705
559
|
* @event Abide#invalid
|
706
560
|
*/
|
707
|
-
|
708
561
|
$el.trigger(message, [$el]);
|
709
562
|
return goodToGo;
|
710
563
|
}
|
564
|
+
|
711
565
|
/**
|
712
566
|
* Goes through a form and if there are any invalid inputs, it will display the form error element
|
713
567
|
* @returns {Boolean} noError - true if no errors were detected...
|
714
568
|
* @fires Abide#formvalid
|
715
569
|
* @fires Abide#forminvalid
|
716
570
|
*/
|
717
|
-
|
718
571
|
}, {
|
719
572
|
key: "validateForm",
|
720
573
|
value: function validateForm() {
|
721
|
-
var
|
722
|
-
|
574
|
+
var _this8 = this;
|
723
575
|
var acc = [];
|
724
|
-
|
725
576
|
var _this = this;
|
577
|
+
var checkboxGroupName;
|
726
578
|
|
727
|
-
|
728
|
-
|
579
|
+
// Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted
|
729
580
|
if (!this.initialized) {
|
730
581
|
this.initialized = true;
|
731
|
-
}
|
732
|
-
|
582
|
+
}
|
733
583
|
|
584
|
+
// skip validation if disabled
|
734
585
|
if (this._validationIsDisabled()) {
|
735
586
|
this.formnovalidate = null;
|
736
587
|
return true;
|
737
588
|
}
|
738
|
-
|
739
589
|
this.$inputs.each(function () {
|
740
590
|
// Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes
|
741
591
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].type === 'checkbox') {
|
742
592
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name') === checkboxGroupName) return true;
|
743
593
|
checkboxGroupName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name');
|
744
594
|
}
|
745
|
-
|
746
595
|
acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)));
|
747
596
|
});
|
748
597
|
var noError = acc.indexOf(false) === -1;
|
749
598
|
this.$element.find('[data-abide-error]').each(function (i, elem) {
|
750
|
-
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem);
|
751
|
-
|
752
|
-
if (
|
753
|
-
|
599
|
+
var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem);
|
600
|
+
// Ensure a11y attributes are set
|
601
|
+
if (_this8.options.a11yAttributes) _this8.addGlobalErrorA11yAttributes($elem);
|
602
|
+
// Show or hide the error
|
754
603
|
$elem.css('display', noError ? 'none' : 'block');
|
755
604
|
});
|
605
|
+
|
756
606
|
/**
|
757
607
|
* Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.
|
758
608
|
* Trigger includes the element of the form.
|
759
609
|
* @event Abide#formvalid
|
760
610
|
* @event Abide#forminvalid
|
761
611
|
*/
|
762
|
-
|
763
612
|
this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);
|
764
613
|
return noError;
|
765
614
|
}
|
615
|
+
|
766
616
|
/**
|
767
617
|
* Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true.
|
768
618
|
* @param {Object} $el - jQuery object to validate, should be a text input HTML element
|
769
619
|
* @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns
|
770
620
|
* @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified
|
771
621
|
*/
|
772
|
-
|
773
622
|
}, {
|
774
623
|
key: "validateText",
|
775
624
|
value: function validateText($el, pattern) {
|
776
625
|
// A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute
|
777
626
|
pattern = pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type');
|
778
627
|
var inputText = $el.val();
|
779
|
-
var valid =
|
780
|
-
|
628
|
+
var valid = true;
|
781
629
|
if (inputText.length) {
|
782
630
|
// If the pattern attribute on the element is in Abide's list of patterns, then test that regexp
|
783
631
|
if (this.options.patterns.hasOwnProperty(pattern)) {
|
784
632
|
valid = this.options.patterns[pattern].test(inputText);
|
785
|
-
}
|
633
|
+
}
|
634
|
+
// If the pattern name isn't also the type attribute of the field, then test it as a regexp
|
786
635
|
else if (pattern !== $el.attr('type')) {
|
787
|
-
|
788
|
-
} else {
|
789
|
-
valid = true;
|
790
|
-
}
|
791
|
-
} // An empty field is valid if it's not required
|
792
|
-
else if (!$el.prop('required')) {
|
793
|
-
valid = true;
|
636
|
+
valid = new RegExp(pattern).test(inputText);
|
794
637
|
}
|
795
|
-
|
638
|
+
}
|
796
639
|
return valid;
|
797
640
|
}
|
641
|
+
|
798
642
|
/**
|
799
643
|
* Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group.
|
800
644
|
* @param {String} groupName - A string that specifies the name of a radio button group
|
801
645
|
* @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)
|
802
646
|
*/
|
803
|
-
|
804
647
|
}, {
|
805
648
|
key: "validateRadio",
|
806
649
|
value: function validateRadio(groupName) {
|
@@ -808,15 +651,15 @@ function (_Plugin) {
|
|
808
651
|
// Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
|
809
652
|
var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
|
810
653
|
var valid = false,
|
811
|
-
|
654
|
+
required = false;
|
812
655
|
|
656
|
+
// For the group to be required, at least one radio needs to be required
|
813
657
|
$group.each(function (i, e) {
|
814
658
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
|
815
659
|
required = true;
|
816
660
|
}
|
817
661
|
});
|
818
662
|
if (!required) valid = true;
|
819
|
-
|
820
663
|
if (!valid) {
|
821
664
|
// For the group to be valid, at least one radio needs to be checked
|
822
665
|
$group.each(function (i, e) {
|
@@ -825,36 +668,33 @@ function (_Plugin) {
|
|
825
668
|
}
|
826
669
|
});
|
827
670
|
}
|
828
|
-
|
829
|
-
;
|
830
671
|
return valid;
|
831
672
|
}
|
673
|
+
|
832
674
|
/**
|
833
675
|
* Determines whether or a not a checkbox input is valid based on whether or not it is required and checked. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all checkboxes in its group.
|
834
676
|
* @param {String} groupName - A string that specifies the name of a checkbox group
|
835
677
|
* @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required)
|
836
678
|
*/
|
837
|
-
|
838
679
|
}, {
|
839
680
|
key: "validateCheckbox",
|
840
681
|
value: function validateCheckbox(groupName) {
|
841
|
-
var
|
842
|
-
|
682
|
+
var _this9 = this;
|
843
683
|
// If at least one checkbox in the group has the `required` attribute, the group is considered required
|
844
684
|
// Per W3C spec, all checkboxes in a group should have `required`, but we're being nice
|
845
685
|
var $group = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
|
846
686
|
var valid = false,
|
847
|
-
|
848
|
-
|
849
|
-
|
687
|
+
required = false,
|
688
|
+
minRequired = 1,
|
689
|
+
checked = 0;
|
850
690
|
|
691
|
+
// For the group to be required, at least one checkbox needs to be required
|
851
692
|
$group.each(function (i, e) {
|
852
693
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
|
853
694
|
required = true;
|
854
695
|
}
|
855
696
|
});
|
856
697
|
if (!required) valid = true;
|
857
|
-
|
858
698
|
if (!valid) {
|
859
699
|
// Count checked checkboxes within the group
|
860
700
|
// Use data-min-required if available (default: 1)
|
@@ -862,33 +702,33 @@ function (_Plugin) {
|
|
862
702
|
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
|
863
703
|
checked++;
|
864
704
|
}
|
865
|
-
|
866
705
|
if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required') !== 'undefined') {
|
867
|
-
minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required'));
|
706
|
+
minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required'), 10);
|
868
707
|
}
|
869
|
-
});
|
708
|
+
});
|
870
709
|
|
710
|
+
// For the group to be valid, the minRequired amount of checkboxes have to be checked
|
871
711
|
if (checked >= minRequired) {
|
872
712
|
valid = true;
|
873
713
|
}
|
874
714
|
}
|
875
715
|
|
876
|
-
|
877
|
-
|
716
|
+
// Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in)
|
878
717
|
if (this.initialized !== true && minRequired > 1) {
|
879
718
|
return true;
|
880
|
-
}
|
881
|
-
|
719
|
+
}
|
882
720
|
|
721
|
+
// Refresh error class for all input
|
883
722
|
$group.each(function (i, e) {
|
884
723
|
if (!valid) {
|
885
|
-
|
724
|
+
_this9.addErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e), ['required']);
|
886
725
|
} else {
|
887
|
-
|
726
|
+
_this9.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e));
|
888
727
|
}
|
889
728
|
});
|
890
729
|
return valid;
|
891
730
|
}
|
731
|
+
|
892
732
|
/**
|
893
733
|
* Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed.
|
894
734
|
* @param {Object} $el - jQuery input element.
|
@@ -896,28 +736,26 @@ function (_Plugin) {
|
|
896
736
|
* @param {Boolean} required - self explanatory?
|
897
737
|
* @returns {Boolean} - true if validations passed.
|
898
738
|
*/
|
899
|
-
|
900
739
|
}, {
|
901
740
|
key: "matchValidation",
|
902
741
|
value: function matchValidation($el, validators, required) {
|
903
|
-
var
|
904
|
-
|
742
|
+
var _this10 = this;
|
905
743
|
required = required ? true : false;
|
906
744
|
var clear = validators.split(' ').map(function (v) {
|
907
|
-
return
|
745
|
+
return _this10.options.validators[v]($el, required, $el.parent());
|
908
746
|
});
|
909
747
|
return clear.indexOf(false) === -1;
|
910
748
|
}
|
749
|
+
|
911
750
|
/**
|
912
751
|
* Resets form inputs and styles
|
913
752
|
* @fires Abide#formreset
|
914
753
|
*/
|
915
|
-
|
916
754
|
}, {
|
917
755
|
key: "resetForm",
|
918
756
|
value: function resetForm() {
|
919
757
|
var $form = this.$element,
|
920
|
-
|
758
|
+
opts = this.options;
|
921
759
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass);
|
922
760
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass);
|
923
761
|
jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass);
|
@@ -938,19 +776,17 @@ function (_Plugin) {
|
|
938
776
|
* Fires when the form has been reset.
|
939
777
|
* @event Abide#formreset
|
940
778
|
*/
|
941
|
-
|
942
779
|
$form.trigger('formreset.zf.abide', [$form]);
|
943
780
|
}
|
781
|
+
|
944
782
|
/**
|
945
783
|
* Destroys an instance of Abide.
|
946
784
|
* Removes error styles and classes from elements, without resetting their values.
|
947
785
|
*/
|
948
|
-
|
949
786
|
}, {
|
950
787
|
key: "_destroy",
|
951
788
|
value: function _destroy() {
|
952
789
|
var _this = this;
|
953
|
-
|
954
790
|
this.$element.off('.abide').find('[data-abide-error]').css('display', 'none');
|
955
791
|
this.$inputs.off('.abide').each(function () {
|
956
792
|
_this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
@@ -958,14 +794,10 @@ function (_Plugin) {
|
|
958
794
|
this.$submits.off('.abide');
|
959
795
|
}
|
960
796
|
}]);
|
961
|
-
|
962
|
-
return Abide;
|
963
|
-
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
|
797
|
+
}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__.Plugin);
|
964
798
|
/**
|
965
799
|
* Default settings for plugin
|
966
800
|
*/
|
967
|
-
|
968
|
-
|
969
801
|
Abide.defaults = {
|
970
802
|
/**
|
971
803
|
* The default event to validate inputs. Checkboxes and radios validate immediately.
|
@@ -975,7 +807,6 @@ Abide.defaults = {
|
|
975
807
|
* @default 'fieldChange'
|
976
808
|
*/
|
977
809
|
validateOn: 'fieldChange',
|
978
|
-
|
979
810
|
/**
|
980
811
|
* Class to be applied to input labels on failed validation.
|
981
812
|
* @option
|
@@ -983,7 +814,6 @@ Abide.defaults = {
|
|
983
814
|
* @default 'is-invalid-label'
|
984
815
|
*/
|
985
816
|
labelErrorClass: 'is-invalid-label',
|
986
|
-
|
987
817
|
/**
|
988
818
|
* Class to be applied to inputs on failed validation.
|
989
819
|
* @option
|
@@ -991,7 +821,6 @@ Abide.defaults = {
|
|
991
821
|
* @default 'is-invalid-input'
|
992
822
|
*/
|
993
823
|
inputErrorClass: 'is-invalid-input',
|
994
|
-
|
995
824
|
/**
|
996
825
|
* Class selector to use to target Form Errors for show/hide.
|
997
826
|
* @option
|
@@ -999,7 +828,6 @@ Abide.defaults = {
|
|
999
828
|
* @default '.form-error'
|
1000
829
|
*/
|
1001
830
|
formErrorSelector: '.form-error',
|
1002
|
-
|
1003
831
|
/**
|
1004
832
|
* Class added to Form Errors on failed validation.
|
1005
833
|
* @option
|
@@ -1007,7 +835,6 @@ Abide.defaults = {
|
|
1007
835
|
* @default 'is-visible'
|
1008
836
|
*/
|
1009
837
|
formErrorClass: 'is-visible',
|
1010
|
-
|
1011
838
|
/**
|
1012
839
|
* If true, automatically insert when possible:
|
1013
840
|
* - `[aria-describedby]` on fields
|
@@ -1018,7 +845,6 @@ Abide.defaults = {
|
|
1018
845
|
* @default true
|
1019
846
|
*/
|
1020
847
|
a11yAttributes: true,
|
1021
|
-
|
1022
848
|
/**
|
1023
849
|
* [aria-live] attribute value to be applied on global errors `[data-abide-error]`.
|
1024
850
|
* Options are: 'assertive', 'polite' and 'off'/null
|
@@ -1028,7 +854,6 @@ Abide.defaults = {
|
|
1028
854
|
* @default 'assertive'
|
1029
855
|
*/
|
1030
856
|
a11yErrorLevel: 'assertive',
|
1031
|
-
|
1032
857
|
/**
|
1033
858
|
* Set to true to validate text inputs on any value change.
|
1034
859
|
* @option
|
@@ -1036,7 +861,6 @@ Abide.defaults = {
|
|
1036
861
|
* @default false
|
1037
862
|
*/
|
1038
863
|
liveValidate: false,
|
1039
|
-
|
1040
864
|
/**
|
1041
865
|
* Set to true to validate inputs on blur.
|
1042
866
|
* @option
|
@@ -1046,6 +870,7 @@ Abide.defaults = {
|
|
1046
870
|
validateOnBlur: false,
|
1047
871
|
patterns: {
|
1048
872
|
alpha: /^[a-zA-Z]+$/,
|
873
|
+
// eslint-disable-next-line camelcase
|
1049
874
|
alpha_numeric: /^[a-zA-Z0-9]+$/,
|
1050
875
|
integer: /^[-+]?\d+$/,
|
1051
876
|
number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
@@ -1067,29 +892,28 @@ Abide.defaults = {
|
|
1067
892
|
time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
|
1068
893
|
dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
1069
894
|
// MM/DD/YYYY
|
895
|
+
// eslint-disable-next-line camelcase
|
1070
896
|
month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
|
1071
897
|
// DD/MM/YYYY
|
898
|
+
// eslint-disable-next-line camelcase
|
1072
899
|
day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
|
1073
900
|
// #FFF or #FFFFFF
|
1074
901
|
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
|
1075
902
|
// Domain || URL
|
1076
903
|
website: {
|
1077
904
|
test: function test(text) {
|
1078
|
-
return Abide.defaults.patterns
|
905
|
+
return Abide.defaults.patterns.domain.test(text) || Abide.defaults.patterns.url.test(text);
|
1079
906
|
}
|
1080
907
|
}
|
1081
908
|
},
|
1082
|
-
|
1083
909
|
/**
|
1084
910
|
* Optional validation functions to be used. `equalTo` being the only default included function.
|
1085
911
|
* Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
|
1086
912
|
* el : The jQuery element to validate.
|
1087
|
-
* required : Boolean value of the required attribute be present or not.
|
1088
|
-
* parent : The direct parent of the input.
|
1089
913
|
* @option
|
1090
914
|
*/
|
1091
915
|
validators: {
|
1092
|
-
equalTo: function equalTo(el
|
916
|
+
equalTo: function equalTo(el) {
|
1093
917
|
return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val();
|
1094
918
|
}
|
1095
919
|
}
|
@@ -1098,15 +922,13 @@ Abide.defaults = {
|
|
1098
922
|
|
1099
923
|
/***/ }),
|
1100
924
|
|
1101
|
-
/***/
|
1102
|
-
|
1103
|
-
!***
|
1104
|
-
|
1105
|
-
|
1106
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1107
|
-
|
1108
|
-
module.exports = __webpack_require__(/*! /Volumes/Data/Development/Foundation/foundation-sites/js/entries/plugins/foundation.abide.js */"./js/entries/plugins/foundation.abide.js");
|
925
|
+
/***/ "./foundation.core":
|
926
|
+
/*!****************************************************************************************************************************************************************!*\
|
927
|
+
!*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.core"],"amd":"./foundation.core","commonjs":"./foundation.core","commonjs2":"./foundation.core"} ***!
|
928
|
+
\****************************************************************************************************************************************************************/
|
929
|
+
/***/ (function(module) {
|
1109
930
|
|
931
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
|
1110
932
|
|
1111
933
|
/***/ }),
|
1112
934
|
|
@@ -1114,13 +936,101 @@ module.exports = __webpack_require__(/*! /Volumes/Data/Development/Foundation/fo
|
|
1114
936
|
/*!********************************************************************************************!*\
|
1115
937
|
!*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
|
1116
938
|
\********************************************************************************************/
|
1117
|
-
|
1118
|
-
/***/ (function(module, exports) {
|
939
|
+
/***/ (function(module) {
|
1119
940
|
|
1120
941
|
module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
|
1121
942
|
|
1122
943
|
/***/ })
|
1123
944
|
|
1124
|
-
/******/
|
945
|
+
/******/ });
|
946
|
+
/************************************************************************/
|
947
|
+
/******/ // The module cache
|
948
|
+
/******/ var __webpack_module_cache__ = {};
|
949
|
+
/******/
|
950
|
+
/******/ // The require function
|
951
|
+
/******/ function __webpack_require__(moduleId) {
|
952
|
+
/******/ // Check if module is in cache
|
953
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
954
|
+
/******/ if (cachedModule !== undefined) {
|
955
|
+
/******/ return cachedModule.exports;
|
956
|
+
/******/ }
|
957
|
+
/******/ // Create a new module (and put it into the cache)
|
958
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
959
|
+
/******/ // no module.id needed
|
960
|
+
/******/ // no module.loaded needed
|
961
|
+
/******/ exports: {}
|
962
|
+
/******/ };
|
963
|
+
/******/
|
964
|
+
/******/ // Execute the module function
|
965
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
966
|
+
/******/
|
967
|
+
/******/ // Return the exports of the module
|
968
|
+
/******/ return module.exports;
|
969
|
+
/******/ }
|
970
|
+
/******/
|
971
|
+
/************************************************************************/
|
972
|
+
/******/ /* webpack/runtime/compat get default export */
|
973
|
+
/******/ !function() {
|
974
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
975
|
+
/******/ __webpack_require__.n = function(module) {
|
976
|
+
/******/ var getter = module && module.__esModule ?
|
977
|
+
/******/ function() { return module['default']; } :
|
978
|
+
/******/ function() { return module; };
|
979
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
980
|
+
/******/ return getter;
|
981
|
+
/******/ };
|
982
|
+
/******/ }();
|
983
|
+
/******/
|
984
|
+
/******/ /* webpack/runtime/define property getters */
|
985
|
+
/******/ !function() {
|
986
|
+
/******/ // define getter functions for harmony exports
|
987
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
988
|
+
/******/ for(var key in definition) {
|
989
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
990
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
991
|
+
/******/ }
|
992
|
+
/******/ }
|
993
|
+
/******/ };
|
994
|
+
/******/ }();
|
995
|
+
/******/
|
996
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
997
|
+
/******/ !function() {
|
998
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
999
|
+
/******/ }();
|
1000
|
+
/******/
|
1001
|
+
/******/ /* webpack/runtime/make namespace object */
|
1002
|
+
/******/ !function() {
|
1003
|
+
/******/ // define __esModule on exports
|
1004
|
+
/******/ __webpack_require__.r = function(exports) {
|
1005
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
1006
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
1007
|
+
/******/ }
|
1008
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
1009
|
+
/******/ };
|
1010
|
+
/******/ }();
|
1011
|
+
/******/
|
1012
|
+
/************************************************************************/
|
1013
|
+
var __webpack_exports__ = {};
|
1014
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
1015
|
+
!function() {
|
1016
|
+
/*!************************************************!*\
|
1017
|
+
!*** ./js/entries/plugins/foundation.abide.js ***!
|
1018
|
+
\************************************************/
|
1019
|
+
__webpack_require__.r(__webpack_exports__);
|
1020
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1021
|
+
/* harmony export */ Abide: function() { return /* reexport safe */ _foundation_abide__WEBPACK_IMPORTED_MODULE_1__.Abide; },
|
1022
|
+
/* harmony export */ Foundation: function() { return /* reexport safe */ _foundation_core__WEBPACK_IMPORTED_MODULE_0__.Foundation; }
|
1023
|
+
/* harmony export */ });
|
1024
|
+
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
|
1025
|
+
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
|
1026
|
+
/* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.abide */ "./js/foundation.abide.js");
|
1027
|
+
|
1028
|
+
|
1029
|
+
_foundation_core__WEBPACK_IMPORTED_MODULE_0__.Foundation.plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_1__.Abide, 'Abide');
|
1030
|
+
|
1031
|
+
}();
|
1032
|
+
/******/ return __webpack_exports__;
|
1033
|
+
/******/ })()
|
1034
|
+
;
|
1125
1035
|
});
|
1126
1036
|
//# sourceMappingURL=foundation.abide.js.map
|