inputmask.dependencyLib.jqlite.js 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*!
  2. * dependencyLibs/inputmask.dependencyLib.jqlite.js
  3. * https://github.com/RobinHerbots/jquery.inputmask
  4. * Copyright (c) 2010 - 2017 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 3.3.5-174
  7. */
  8. !function(factory) {
  9. "function" == typeof define && define.amd ? define([ "jqlite", "../global/window", "../global/document]" ], factory) : "object" == typeof exports ? module.exports = factory(require("jqlite"), require("../global/window"), require("../global/document")) : window.dependencyLib = factory(jqlite, window, document);
  10. }(function($, window, document) {
  11. function indexOf(list, elem) {
  12. for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
  13. return -1;
  14. }
  15. function type(obj) {
  16. return null == obj ? obj + "" : "object" == typeof obj || "function" == typeof obj ? class2type[class2type.toString.call(obj)] || "object" : typeof obj;
  17. }
  18. function isWindow(obj) {
  19. return null != obj && obj === obj.window;
  20. }
  21. function isArraylike(obj) {
  22. var length = "length" in obj && obj.length, ltype = type(obj);
  23. return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || ("array" === ltype || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj));
  24. }
  25. for (var class2type = {}, classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" "), nameNdx = 0; nameNdx < classTypes.length; nameNdx++) class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
  26. return $.inArray = function(elem, arr, i) {
  27. return null == arr ? -1 : indexOf(arr, elem, i);
  28. }, $.isFunction = function(obj) {
  29. return "function" === type(obj);
  30. }, $.isArray = Array.isArray, $.isPlainObject = function(obj) {
  31. return "object" === type(obj) && !obj.nodeType && !isWindow(obj) && !(obj.constructor && !class2type.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf"));
  32. }, $.extend = function() {
  33. var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1;
  34. for ("boolean" == typeof target && (deep = target, target = arguments[i] || {},
  35. i++), "object" == typeof target || $.isFunction(target) || (target = {}), i === length && (target = this,
  36. i--); i < length; i++) if (null != (options = arguments[i])) for (name in options) src = target[name],
  37. copy = options[name], target !== copy && (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1,
  38. clone = src && $.isArray(src) ? src : []) : clone = src && $.isPlainObject(src) ? src : {},
  39. target[name] = $.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy));
  40. return target;
  41. }, $.each = function(obj, callback) {
  42. var value, i = 0;
  43. if (isArraylike(obj)) for (var length = obj.length; i < length && (value = callback.call(obj[i], i, obj[i]),
  44. value !== !1); i++) ; else for (i in obj) if (value = callback.call(obj[i], i, obj[i]),
  45. value === !1) break;
  46. return obj;
  47. }, $.map = function(elems, callback) {
  48. var value, i = 0, length = elems.length, isArray = isArraylike(elems), ret = [];
  49. if (isArray) for (;i < length; i++) value = callback(elems[i], i), null != value && ret.push(value); else for (i in elems) value = callback(elems[i], i),
  50. null != value && ret.push(value);
  51. return [].concat(ret);
  52. }, $.data = function(elem, name, data) {
  53. return $(elem).data(name, data);
  54. }, $.Event = $.Event || function(event, params) {
  55. params = params || {
  56. bubbles: !1,
  57. cancelable: !1,
  58. detail: void 0
  59. };
  60. var evt = document.createEvent("CustomEvent");
  61. return evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail),
  62. evt;
  63. }, $.Event.prototype = window.Event.prototype, $;
  64. });