inputmask.dependencyLib.jqlite.js 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*!
  2. * dependencyLibs/inputmask.dependencyLib.jqlite.js
  3. * https://github.com/RobinHerbots/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.11
  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);
  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. target !== (copy = options[name]) && (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 i = 0;
  43. if (isArraylike(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;
  44. return obj;
  45. }, $.map = function(elems, callback) {
  46. var value, i = 0, length = elems.length, ret = [];
  47. if (isArraylike(elems)) for (;i < length; i++) null != (value = callback(elems[i], i)) && ret.push(value); else for (i in elems) null != (value = callback(elems[i], i)) && ret.push(value);
  48. return [].concat(ret);
  49. }, $.data = function(elem, name, data) {
  50. return $(elem).data(name, data);
  51. }, $.Event = $.Event || function(event, params) {
  52. params = params || {
  53. bubbles: !1,
  54. cancelable: !1,
  55. detail: void 0
  56. };
  57. var evt = document.createEvent("CustomEvent");
  58. return evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail),
  59. evt;
  60. }, $.Event.prototype = window.Event.prototype, $;
  61. });