foundation.abide.js 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("./foundation.core"), require("jquery"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["./foundation.core", "jquery"], factory);
  6. else if(typeof exports === 'object')
  7. exports["foundation.abide"] = factory(require("./foundation.core"), require("jquery"));
  8. else
  9. root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.abide"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["jQuery"]);
  10. })(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  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. /***/ "./foundation.core":
  99. /*!****************************************************************************************************************************************************************!*\
  100. !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.core"],"amd":"./foundation.core","commonjs":"./foundation.core","commonjs2":"./foundation.core"} ***!
  101. \****************************************************************************************************************************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports) {
  104. module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;
  105. /***/ }),
  106. /***/ "./js/entries/plugins/foundation.abide.js":
  107. /*!************************************************!*\
  108. !*** ./js/entries/plugins/foundation.abide.js ***!
  109. \************************************************/
  110. /*! exports provided: Foundation, Abide */
  111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112. "use strict";
  113. __webpack_require__.r(__webpack_exports__);
  114. /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
  115. /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
  116. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });
  117. /* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.abide */ "./js/foundation.abide.js");
  118. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return _foundation_abide__WEBPACK_IMPORTED_MODULE_1__["Abide"]; });
  119. _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_1__["Abide"], 'Abide');
  120. /***/ }),
  121. /***/ "./js/foundation.abide.js":
  122. /*!********************************!*\
  123. !*** ./js/foundation.abide.js ***!
  124. \********************************/
  125. /*! exports provided: Abide */
  126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127. "use strict";
  128. __webpack_require__.r(__webpack_exports__);
  129. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return Abide; });
  130. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  131. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  132. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./foundation.core");
  133. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__);
  134. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  135. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  136. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  137. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  138. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  139. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  140. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  141. 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); }
  142. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  143. /**
  144. * Abide module.
  145. * @module foundation.abide
  146. */
  147. var Abide =
  148. /*#__PURE__*/
  149. function (_Plugin) {
  150. _inherits(Abide, _Plugin);
  151. function Abide() {
  152. _classCallCheck(this, Abide);
  153. return _possibleConstructorReturn(this, _getPrototypeOf(Abide).apply(this, arguments));
  154. }
  155. _createClass(Abide, [{
  156. key: "_setup",
  157. /**
  158. * Creates a new instance of Abide.
  159. * @class
  160. * @name Abide
  161. * @fires Abide#init
  162. * @param {Object} element - jQuery object to add the trigger to.
  163. * @param {Object} options - Overrides to the default plugin settings.
  164. */
  165. value: function _setup(element) {
  166. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  167. this.$element = element;
  168. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options);
  169. this.isEnabled = true;
  170. this.formnovalidate = null;
  171. this.className = 'Abide'; // ie9 back compat
  172. this._init();
  173. }
  174. /**
  175. * Initializes the Abide plugin and calls functions to get Abide functioning on load.
  176. * @private
  177. */
  178. }, {
  179. key: "_init",
  180. value: function _init() {
  181. var _this2 = this;
  182. this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge( // Consider as input to validate:
  183. this.$element.find('input').not('[type="submit"]'), // * all input fields expect submit
  184. this.$element.find('textarea, select') // * all textareas and select fields
  185. );
  186. this.$submits = this.$element.find('[type="submit"]');
  187. var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields
  188. if (this.options.a11yAttributes) {
  189. this.$inputs.each(function (i, input) {
  190. return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input));
  191. });
  192. $globalErrors.each(function (i, error) {
  193. return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error));
  194. });
  195. }
  196. this._events();
  197. }
  198. /**
  199. * Initializes events for Abide.
  200. * @private
  201. */
  202. }, {
  203. key: "_events",
  204. value: function _events() {
  205. var _this3 = this;
  206. this.$element.off('.abide').on('reset.zf.abide', function () {
  207. _this3.resetForm();
  208. }).on('submit.zf.abide', function () {
  209. return _this3.validateForm();
  210. });
  211. this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) {
  212. if (!e.key || e.key === ' ' || e.key === 'Enter') {
  213. e.preventDefault();
  214. _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null;
  215. _this3.$element.submit();
  216. }
  217. });
  218. if (this.options.validateOn === 'fieldChange') {
  219. this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {
  220. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  221. });
  222. }
  223. if (this.options.liveValidate) {
  224. this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {
  225. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  226. });
  227. }
  228. if (this.options.validateOnBlur) {
  229. this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {
  230. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  231. });
  232. }
  233. }
  234. /**
  235. * Calls necessary functions to update Abide upon DOM change
  236. * @private
  237. */
  238. }, {
  239. key: "_reflow",
  240. value: function _reflow() {
  241. this._init();
  242. }
  243. /**
  244. * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled
  245. * @returns {Boolean}
  246. * @private
  247. */
  248. }, {
  249. key: "_validationIsDisabled",
  250. value: function _validationIsDisabled() {
  251. if (this.isEnabled === false) {
  252. // whole validation disabled
  253. return true;
  254. } else if (typeof this.formnovalidate === 'boolean') {
  255. // triggered by $submit
  256. return this.formnovalidate;
  257. } // triggered by Enter in non-submit input
  258. return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;
  259. }
  260. /**
  261. * Enables the whole validation
  262. */
  263. }, {
  264. key: "enableValidation",
  265. value: function enableValidation() {
  266. this.isEnabled = true;
  267. }
  268. /**
  269. * Disables the whole validation
  270. */
  271. }, {
  272. key: "disableValidation",
  273. value: function disableValidation() {
  274. this.isEnabled = false;
  275. }
  276. /**
  277. * Checks whether or not a form element has the required attribute and if it's checked or not
  278. * @param {Object} element - jQuery object to check for required attribute
  279. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  280. */
  281. }, {
  282. key: "requiredCheck",
  283. value: function requiredCheck($el) {
  284. if (!$el.attr('required')) return true;
  285. var isGood = true;
  286. switch ($el[0].type) {
  287. case 'checkbox':
  288. isGood = $el[0].checked;
  289. break;
  290. case 'select':
  291. case 'select-one':
  292. case 'select-multiple':
  293. var opt = $el.find('option:selected');
  294. if (!opt.length || !opt.val()) isGood = false;
  295. break;
  296. default:
  297. if (!$el.val() || !$el.val().length) isGood = false;
  298. }
  299. return isGood;
  300. }
  301. /**
  302. * Get:
  303. * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
  304. * 1. The element's direct sibling('s).
  305. * 2. The element's parent's children.
  306. * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.
  307. *
  308. * This allows for multiple form errors per input, though if none are found, no form errors will be shown.
  309. *
  310. * @param {Object} $el - jQuery object to use as reference to find the form error selector.
  311. * @param {String[]} [failedValidators] - List of failed validators.
  312. * @returns {Object} jQuery object with the selector.
  313. */
  314. }, {
  315. key: "findFormError",
  316. value: function findFormError($el, failedValidators) {
  317. var _this4 = this;
  318. var id = $el.length ? $el[0].id : '';
  319. var $error = $el.siblings(this.options.formErrorSelector);
  320. if (!$error.length) {
  321. $error = $el.parent().find(this.options.formErrorSelector);
  322. }
  323. if (id) {
  324. $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]")));
  325. }
  326. if (!!failedValidators) {
  327. $error = $error.not('[data-form-error-on]');
  328. failedValidators.forEach(function (v) {
  329. $error = $error.add($el.siblings("[data-form-error-on=\"".concat(v, "\"]")));
  330. $error = $error.add(_this4.$element.find("[data-form-error-for=\"".concat(id, "\"][data-form-error-on=\"").concat(v, "\"]")));
  331. });
  332. }
  333. return $error;
  334. }
  335. /**
  336. * Get the first element in this order:
  337. * 2. The <label> with the attribute `[for="someInputId"]`
  338. * 3. The `.closest()` <label>
  339. *
  340. * @param {Object} $el - jQuery object to check for required attribute
  341. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  342. */
  343. }, {
  344. key: "findLabel",
  345. value: function findLabel($el) {
  346. var id = $el[0].id;
  347. var $label = this.$element.find("label[for=\"".concat(id, "\"]"));
  348. if (!$label.length) {
  349. return $el.closest('label');
  350. }
  351. return $label;
  352. }
  353. /**
  354. * Get the set of labels associated with a set of radio els in this order
  355. * 2. The <label> with the attribute `[for="someInputId"]`
  356. * 3. The `.closest()` <label>
  357. *
  358. * @param {Object} $el - jQuery object to check for required attribute
  359. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  360. */
  361. }, {
  362. key: "findRadioLabels",
  363. value: function findRadioLabels($els) {
  364. var _this5 = this;
  365. var labels = $els.map(function (i, el) {
  366. var id = el.id;
  367. var $label = _this5.$element.find("label[for=\"".concat(id, "\"]"));
  368. if (!$label.length) {
  369. $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
  370. }
  371. return $label[0];
  372. });
  373. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
  374. }
  375. /**
  376. * Get the set of labels associated with a set of checkbox els in this order
  377. * 2. The <label> with the attribute `[for="someInputId"]`
  378. * 3. The `.closest()` <label>
  379. *
  380. * @param {Object} $el - jQuery object to check for required attribute
  381. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  382. */
  383. }, {
  384. key: "findCheckboxLabels",
  385. value: function findCheckboxLabels($els) {
  386. var _this6 = this;
  387. var labels = $els.map(function (i, el) {
  388. var id = el.id;
  389. var $label = _this6.$element.find("label[for=\"".concat(id, "\"]"));
  390. if (!$label.length) {
  391. $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
  392. }
  393. return $label[0];
  394. });
  395. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
  396. }
  397. /**
  398. * Adds the CSS error class as specified by the Abide settings to the label, input, and the form
  399. * @param {Object} $el - jQuery object to add the class to
  400. * @param {String[]} [failedValidators] - List of failed validators.
  401. */
  402. }, {
  403. key: "addErrorClasses",
  404. value: function addErrorClasses($el, failedValidators) {
  405. var $label = this.findLabel($el);
  406. var $formError = this.findFormError($el, failedValidators);
  407. if ($label.length) {
  408. $label.addClass(this.options.labelErrorClass);
  409. }
  410. if ($formError.length) {
  411. $formError.addClass(this.options.formErrorClass);
  412. }
  413. $el.addClass(this.options.inputErrorClass).attr({
  414. 'data-invalid': '',
  415. 'aria-invalid': true
  416. });
  417. }
  418. /**
  419. * Adds [for] and [role=alert] attributes to all form error targetting $el,
  420. * and [aria-describedby] attribute to $el toward the first form error.
  421. * @param {Object} $el - jQuery object
  422. */
  423. }, {
  424. key: "addA11yAttributes",
  425. value: function addA11yAttributes($el) {
  426. var $errors = this.findFormError($el);
  427. var $labels = $errors.filter('label');
  428. var $error = $errors.first();
  429. if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set
  430. if (typeof $el.attr('aria-describedby') === 'undefined') {
  431. // Get the first error ID or create one
  432. var errorId = $error.attr('id');
  433. if (typeof errorId === 'undefined') {
  434. errorId = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'abide-error');
  435. $error.attr('id', errorId);
  436. }
  437. $el.attr('aria-describedby', errorId);
  438. }
  439. if ($labels.filter('[for]').length < $labels.length) {
  440. // Get the input ID or create one
  441. var elemId = $el.attr('id');
  442. if (typeof elemId === 'undefined') {
  443. elemId = Object(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'abide-input');
  444. $el.attr('id', elemId);
  445. } // For each label targeting $el, set [for] if it is not set.
  446. $labels.each(function (i, label) {
  447. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  448. if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId);
  449. });
  450. } // For each error targeting $el, set [role=alert] if it is not set.
  451. $errors.each(function (i, label) {
  452. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  453. if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert');
  454. }).end();
  455. }
  456. /**
  457. * Adds [aria-live] attribute to the given global form error $el.
  458. * @param {Object} $el - jQuery object to add the attribute to
  459. */
  460. }, {
  461. key: "addGlobalErrorA11yAttributes",
  462. value: function addGlobalErrorA11yAttributes($el) {
  463. if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel);
  464. }
  465. /**
  466. * Remove CSS error classes etc from an entire radio button group
  467. * @param {String} groupName - A string that specifies the name of a radio button group
  468. *
  469. */
  470. }, {
  471. key: "removeRadioErrorClasses",
  472. value: function removeRadioErrorClasses(groupName) {
  473. var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  474. var $labels = this.findRadioLabels($els);
  475. var $formErrors = this.findFormError($els);
  476. if ($labels.length) {
  477. $labels.removeClass(this.options.labelErrorClass);
  478. }
  479. if ($formErrors.length) {
  480. $formErrors.removeClass(this.options.formErrorClass);
  481. }
  482. $els.removeClass(this.options.inputErrorClass).attr({
  483. 'data-invalid': null,
  484. 'aria-invalid': null
  485. });
  486. }
  487. /**
  488. * Remove CSS error classes etc from an entire checkbox group
  489. * @param {String} groupName - A string that specifies the name of a checkbox group
  490. *
  491. */
  492. }, {
  493. key: "removeCheckboxErrorClasses",
  494. value: function removeCheckboxErrorClasses(groupName) {
  495. var $els = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
  496. var $labels = this.findCheckboxLabels($els);
  497. var $formErrors = this.findFormError($els);
  498. if ($labels.length) {
  499. $labels.removeClass(this.options.labelErrorClass);
  500. }
  501. if ($formErrors.length) {
  502. $formErrors.removeClass(this.options.formErrorClass);
  503. }
  504. $els.removeClass(this.options.inputErrorClass).attr({
  505. 'data-invalid': null,
  506. 'aria-invalid': null
  507. });
  508. }
  509. /**
  510. * Removes CSS error class as specified by the Abide settings from the label, input, and the form
  511. * @param {Object} $el - jQuery object to remove the class from
  512. */
  513. }, {
  514. key: "removeErrorClasses",
  515. value: function removeErrorClasses($el) {
  516. // radios need to clear all of the els
  517. if ($el[0].type == 'radio') {
  518. return this.removeRadioErrorClasses($el.attr('name'));
  519. } // checkboxes need to clear all of the els
  520. else if ($el[0].type == 'checkbox') {
  521. return this.removeCheckboxErrorClasses($el.attr('name'));
  522. }
  523. var $label = this.findLabel($el);
  524. var $formError = this.findFormError($el);
  525. if ($label.length) {
  526. $label.removeClass(this.options.labelErrorClass);
  527. }
  528. if ($formError.length) {
  529. $formError.removeClass(this.options.formErrorClass);
  530. }
  531. $el.removeClass(this.options.inputErrorClass).attr({
  532. 'data-invalid': null,
  533. 'aria-invalid': null
  534. });
  535. }
  536. /**
  537. * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
  538. * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
  539. * @fires Abide#invalid
  540. * @fires Abide#valid
  541. * @param {Object} element - jQuery object to validate, should be an HTML input
  542. * @returns {Boolean} goodToGo - If the input is valid or not.
  543. */
  544. }, {
  545. key: "validateInput",
  546. value: function validateInput($el) {
  547. var _this7 = this;
  548. var clearRequire = this.requiredCheck($el),
  549. validator = $el.attr('data-validator'),
  550. failedValidators = [],
  551. manageErrorClasses = true; // skip validation if disabled
  552. if (this._validationIsDisabled()) {
  553. return true;
  554. } // don't validate ignored inputs or hidden inputs or disabled inputs
  555. if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
  556. return true;
  557. }
  558. switch ($el[0].type) {
  559. case 'radio':
  560. this.validateRadio($el.attr('name')) || failedValidators.push('required');
  561. break;
  562. case 'checkbox':
  563. this.validateCheckbox($el.attr('name')) || failedValidators.push('required'); // validateCheckbox() adds/removes error classes
  564. manageErrorClasses = false;
  565. break;
  566. case 'select':
  567. case 'select-one':
  568. case 'select-multiple':
  569. clearRequire || failedValidators.push('required');
  570. break;
  571. default:
  572. clearRequire || failedValidators.push('required');
  573. this.validateText($el) || failedValidators.push('pattern');
  574. }
  575. if (validator) {
  576. var required = $el.attr('required') ? true : false;
  577. validator.split(' ').forEach(function (v) {
  578. _this7.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v);
  579. });
  580. }
  581. if ($el.attr('data-equalto')) {
  582. this.options.validators.equalTo($el) || failedValidators.push('equalTo');
  583. }
  584. var goodToGo = failedValidators.length === 0;
  585. var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';
  586. if (goodToGo) {
  587. // Re-validate inputs that depend on this one with equalto
  588. var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]"));
  589. if (dependentElements.length) {
  590. var _this = this;
  591. dependentElements.each(function () {
  592. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) {
  593. _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  594. }
  595. });
  596. }
  597. }
  598. if (manageErrorClasses) {
  599. this.removeErrorClasses($el);
  600. if (!goodToGo) {
  601. this.addErrorClasses($el, failedValidators);
  602. }
  603. }
  604. /**
  605. * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`
  606. * Trigger includes the DOM element of the input.
  607. * @event Abide#valid
  608. * @event Abide#invalid
  609. */
  610. $el.trigger(message, [$el]);
  611. return goodToGo;
  612. }
  613. /**
  614. * Goes through a form and if there are any invalid inputs, it will display the form error element
  615. * @returns {Boolean} noError - true if no errors were detected...
  616. * @fires Abide#formvalid
  617. * @fires Abide#forminvalid
  618. */
  619. }, {
  620. key: "validateForm",
  621. value: function validateForm() {
  622. var _this8 = this;
  623. var acc = [];
  624. var _this = this;
  625. var checkboxGroupName; // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted
  626. if (!this.initialized) {
  627. this.initialized = true;
  628. } // skip validation if disabled
  629. if (this._validationIsDisabled()) {
  630. this.formnovalidate = null;
  631. return true;
  632. }
  633. this.$inputs.each(function () {
  634. // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes
  635. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].type === 'checkbox') {
  636. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name') === checkboxGroupName) return true;
  637. checkboxGroupName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name');
  638. }
  639. acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)));
  640. });
  641. var noError = acc.indexOf(false) === -1;
  642. this.$element.find('[data-abide-error]').each(function (i, elem) {
  643. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set
  644. if (_this8.options.a11yAttributes) _this8.addGlobalErrorA11yAttributes($elem); // Show or hide the error
  645. $elem.css('display', noError ? 'none' : 'block');
  646. });
  647. /**
  648. * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.
  649. * Trigger includes the element of the form.
  650. * @event Abide#formvalid
  651. * @event Abide#forminvalid
  652. */
  653. this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);
  654. return noError;
  655. }
  656. /**
  657. * 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.
  658. * @param {Object} $el - jQuery object to validate, should be a text input HTML element
  659. * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns
  660. * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified
  661. */
  662. }, {
  663. key: "validateText",
  664. value: function validateText($el, pattern) {
  665. // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute
  666. pattern = pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type');
  667. var inputText = $el.val();
  668. var valid = true;
  669. if (inputText.length) {
  670. // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp
  671. if (this.options.patterns.hasOwnProperty(pattern)) {
  672. valid = this.options.patterns[pattern].test(inputText);
  673. } // If the pattern name isn't also the type attribute of the field, then test it as a regexp
  674. else if (pattern !== $el.attr('type')) {
  675. valid = new RegExp(pattern).test(inputText);
  676. }
  677. }
  678. return valid;
  679. }
  680. /**
  681. * 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.
  682. * @param {String} groupName - A string that specifies the name of a radio button group
  683. * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)
  684. */
  685. }, {
  686. key: "validateRadio",
  687. value: function validateRadio(groupName) {
  688. // If at least one radio in the group has the `required` attribute, the group is considered required
  689. // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
  690. var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  691. var valid = false,
  692. required = false; // For the group to be required, at least one radio needs to be required
  693. $group.each(function (i, e) {
  694. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
  695. required = true;
  696. }
  697. });
  698. if (!required) valid = true;
  699. if (!valid) {
  700. // For the group to be valid, at least one radio needs to be checked
  701. $group.each(function (i, e) {
  702. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
  703. valid = true;
  704. }
  705. });
  706. }
  707. return valid;
  708. }
  709. /**
  710. * 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.
  711. * @param {String} groupName - A string that specifies the name of a checkbox group
  712. * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required)
  713. */
  714. }, {
  715. key: "validateCheckbox",
  716. value: function validateCheckbox(groupName) {
  717. var _this9 = this;
  718. // If at least one checkbox in the group has the `required` attribute, the group is considered required
  719. // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice
  720. var $group = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]"));
  721. var valid = false,
  722. required = false,
  723. minRequired = 1,
  724. checked = 0; // For the group to be required, at least one checkbox needs to be required
  725. $group.each(function (i, e) {
  726. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
  727. required = true;
  728. }
  729. });
  730. if (!required) valid = true;
  731. if (!valid) {
  732. // Count checked checkboxes within the group
  733. // Use data-min-required if available (default: 1)
  734. $group.each(function (i, e) {
  735. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
  736. checked++;
  737. }
  738. if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required') !== 'undefined') {
  739. minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required'));
  740. }
  741. }); // For the group to be valid, the minRequired amount of checkboxes have to be checked
  742. if (checked >= minRequired) {
  743. valid = true;
  744. }
  745. } // 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)
  746. if (this.initialized !== true && minRequired > 1) {
  747. return true;
  748. } // Refresh error class for all input
  749. $group.each(function (i, e) {
  750. if (!valid) {
  751. _this9.addErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e), ['required']);
  752. } else {
  753. _this9.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e));
  754. }
  755. });
  756. return valid;
  757. }
  758. /**
  759. * 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.
  760. * @param {Object} $el - jQuery input element.
  761. * @param {String} validators - a string of function names matching functions in the Abide.options.validators object.
  762. * @param {Boolean} required - self explanatory?
  763. * @returns {Boolean} - true if validations passed.
  764. */
  765. }, {
  766. key: "matchValidation",
  767. value: function matchValidation($el, validators, required) {
  768. var _this10 = this;
  769. required = required ? true : false;
  770. var clear = validators.split(' ').map(function (v) {
  771. return _this10.options.validators[v]($el, required, $el.parent());
  772. });
  773. return clear.indexOf(false) === -1;
  774. }
  775. /**
  776. * Resets form inputs and styles
  777. * @fires Abide#formreset
  778. */
  779. }, {
  780. key: "resetForm",
  781. value: function resetForm() {
  782. var $form = this.$element,
  783. opts = this.options;
  784. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass);
  785. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass);
  786. jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass);
  787. $form.find('[data-abide-error]').css('display', 'none');
  788. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({
  789. 'data-invalid': null,
  790. 'aria-invalid': null
  791. });
  792. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  793. 'data-invalid': null,
  794. 'aria-invalid': null
  795. });
  796. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  797. 'data-invalid': null,
  798. 'aria-invalid': null
  799. });
  800. /**
  801. * Fires when the form has been reset.
  802. * @event Abide#formreset
  803. */
  804. $form.trigger('formreset.zf.abide', [$form]);
  805. }
  806. /**
  807. * Destroys an instance of Abide.
  808. * Removes error styles and classes from elements, without resetting their values.
  809. */
  810. }, {
  811. key: "_destroy",
  812. value: function _destroy() {
  813. var _this = this;
  814. this.$element.off('.abide').find('[data-abide-error]').css('display', 'none');
  815. this.$inputs.off('.abide').each(function () {
  816. _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  817. });
  818. this.$submits.off('.abide');
  819. }
  820. }]);
  821. return Abide;
  822. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  823. /**
  824. * Default settings for plugin
  825. */
  826. Abide.defaults = {
  827. /**
  828. * The default event to validate inputs. Checkboxes and radios validate immediately.
  829. * Remove or change this value for manual validation.
  830. * @option
  831. * @type {?string}
  832. * @default 'fieldChange'
  833. */
  834. validateOn: 'fieldChange',
  835. /**
  836. * Class to be applied to input labels on failed validation.
  837. * @option
  838. * @type {string}
  839. * @default 'is-invalid-label'
  840. */
  841. labelErrorClass: 'is-invalid-label',
  842. /**
  843. * Class to be applied to inputs on failed validation.
  844. * @option
  845. * @type {string}
  846. * @default 'is-invalid-input'
  847. */
  848. inputErrorClass: 'is-invalid-input',
  849. /**
  850. * Class selector to use to target Form Errors for show/hide.
  851. * @option
  852. * @type {string}
  853. * @default '.form-error'
  854. */
  855. formErrorSelector: '.form-error',
  856. /**
  857. * Class added to Form Errors on failed validation.
  858. * @option
  859. * @type {string}
  860. * @default 'is-visible'
  861. */
  862. formErrorClass: 'is-visible',
  863. /**
  864. * If true, automatically insert when possible:
  865. * - `[aria-describedby]` on fields
  866. * - `[role=alert]` on form errors and `[for]` on form error labels
  867. * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`).
  868. * @option
  869. * @type {boolean}
  870. * @default true
  871. */
  872. a11yAttributes: true,
  873. /**
  874. * [aria-live] attribute value to be applied on global errors `[data-abide-error]`.
  875. * Options are: 'assertive', 'polite' and 'off'/null
  876. * @option
  877. * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
  878. * @type {string}
  879. * @default 'assertive'
  880. */
  881. a11yErrorLevel: 'assertive',
  882. /**
  883. * Set to true to validate text inputs on any value change.
  884. * @option
  885. * @type {boolean}
  886. * @default false
  887. */
  888. liveValidate: false,
  889. /**
  890. * Set to true to validate inputs on blur.
  891. * @option
  892. * @type {boolean}
  893. * @default false
  894. */
  895. validateOnBlur: false,
  896. patterns: {
  897. alpha: /^[a-zA-Z]+$/,
  898. alpha_numeric: /^[a-zA-Z0-9]+$/,
  899. integer: /^[-+]?\d+$/,
  900. number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
  901. // amex, visa, diners
  902. card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
  903. cvv: /^([0-9]){3,4}$/,
  904. // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
  905. email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
  906. // From CommonRegexJS (@talyssonoc)
  907. // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76
  908. // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex.
  909. url: /^((?:(https?|ftps?|file|ssh|sftp):\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))$/,
  910. // abc.de
  911. domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
  912. datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
  913. // YYYY-MM-DD
  914. date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
  915. // HH:MM:SS
  916. time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
  917. dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
  918. // MM/DD/YYYY
  919. month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
  920. // DD/MM/YYYY
  921. day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
  922. // #FFF or #FFFFFF
  923. color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
  924. // Domain || URL
  925. website: {
  926. test: function test(text) {
  927. return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);
  928. }
  929. }
  930. },
  931. /**
  932. * Optional validation functions to be used. `equalTo` being the only default included function.
  933. * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
  934. * el : The jQuery element to validate.
  935. * required : Boolean value of the required attribute be present or not.
  936. * parent : The direct parent of the input.
  937. * @option
  938. */
  939. validators: {
  940. equalTo: function equalTo(el, required, parent) {
  941. return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val();
  942. }
  943. }
  944. };
  945. /***/ }),
  946. /***/ 0:
  947. /*!******************************************************!*\
  948. !*** multi ./js/entries/plugins/foundation.abide.js ***!
  949. \******************************************************/
  950. /*! no static exports found */
  951. /***/ (function(module, exports, __webpack_require__) {
  952. module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/plugins/foundation.abide.js */"./js/entries/plugins/foundation.abide.js");
  953. /***/ }),
  954. /***/ "jquery":
  955. /*!********************************************************************************************!*\
  956. !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
  957. \********************************************************************************************/
  958. /*! no static exports found */
  959. /***/ (function(module, exports) {
  960. module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
  961. /***/ })
  962. /******/ });
  963. });
  964. //# sourceMappingURL=foundation.abide.js.map