{"version":3,"file":"mdui.min.js","sources":["../../node_modules/mdn-polyfills/CustomEvent.js","../../node_modules/promise-polyfill/src/finally.js","../../node_modules/promise-polyfill/src/allSettled.js","../../node_modules/mdn-polyfills/MouseEvent.js","../../node_modules/promise-polyfill/src/index.js","../../node_modules/promise-polyfill/src/polyfill.js","../../node_modules/mdui.jq/es/utils.js","../../node_modules/mdui.jq/es/functions/each.js","../../node_modules/mdui.jq/es/JQ.js","../../node_modules/mdui.jq/es/$.js","../../src/mdui.ts","../../node_modules/mdui.jq/es/functions/contains.js","../../node_modules/mdui.jq/es/functions/merge.js","../../node_modules/mdui.jq/es/methods/each.js","../../node_modules/mdui.jq/es/methods/get.js","../../node_modules/mdui.jq/es/methods/find.js","../../node_modules/mdui.jq/es/methods/utils/event.js","../../node_modules/mdui.jq/es/functions/extend.js","../../node_modules/mdui.jq/es/functions/param.js","../../node_modules/mdui.jq/es/methods/trigger.js","../../node_modules/mdui.jq/es/functions/utils/ajax.js","../../node_modules/mdui.jq/es/functions/ajax.js","../../node_modules/mdui.jq/es/static/ajax.js","../../node_modules/mdui.jq/es/static/ajaxSetup.js","../../node_modules/mdui.jq/es/functions/ajaxSetup.js","../../node_modules/mdui.jq/es/static/contains.js","../../node_modules/mdui.jq/es/functions/utils/data.js","../../node_modules/mdui.jq/es/functions/data.js","../../node_modules/mdui.jq/es/functions/map.js","../../node_modules/mdui.jq/es/functions/removeData.js","../../node_modules/mdui.jq/es/functions/unique.js","../../node_modules/mdui.jq/es/methods/utils/dir.js","../../node_modules/mdui.jq/es/static/data.js","../../node_modules/mdui.jq/es/static/each.js","../../node_modules/mdui.jq/es/static/extend.js","../../node_modules/mdui.jq/es/static/map.js","../../node_modules/mdui.jq/es/static/merge.js","../../node_modules/mdui.jq/es/static/param.js","../../node_modules/mdui.jq/es/static/removeData.js","../../node_modules/mdui.jq/es/static/unique.js","../../node_modules/mdui.jq/es/methods/add.js","../../node_modules/mdui.jq/es/methods/addClass.js","../../node_modules/mdui.jq/es/methods/insertBefore.js","../../node_modules/mdui.jq/es/methods/before.js","../../node_modules/mdui.jq/es/methods/off.js","../../node_modules/mdui.jq/es/methods/on.js","../../node_modules/mdui.jq/es/methods/ajaxStart.js","../../node_modules/mdui.jq/es/methods/map.js","../../node_modules/mdui.jq/es/methods/clone.js","../../node_modules/mdui.jq/es/methods/is.js","../../node_modules/mdui.jq/es/methods/remove.js","../../node_modules/mdui.jq/es/methods/append.js","../../node_modules/mdui.jq/es/methods/appendTo.js","../../node_modules/mdui.jq/es/methods/attr.js","../../node_modules/mdui.jq/es/methods/children.js","../../node_modules/mdui.jq/es/methods/slice.js","../../node_modules/mdui.jq/es/methods/eq.js","../../node_modules/mdui.jq/es/methods/parent.js","../../node_modules/mdui.jq/es/methods/closest.js","../../node_modules/mdui.jq/es/methods/data.js","../../node_modules/mdui.jq/es/methods/width.js","../../node_modules/mdui.jq/es/methods/position.js","../../node_modules/mdui.jq/es/methods/offset.js","../../node_modules/mdui.jq/es/methods/empty.js","../../node_modules/mdui.jq/es/methods/extend.js","../../node_modules/mdui.jq/es/methods/filter.js","../../node_modules/mdui.jq/es/methods/first.js","../../node_modules/mdui.jq/es/methods/has.js","../../node_modules/mdui.jq/es/methods/hasClass.js","../../node_modules/mdui.jq/es/methods/hide.js","../../node_modules/mdui.jq/es/methods/val.js","../../node_modules/mdui.jq/es/methods/index.js","../../node_modules/mdui.jq/es/methods/last.js","../../node_modules/mdui.jq/es/methods/next.js","../../node_modules/mdui.jq/es/methods/not.js","../../node_modules/mdui.jq/es/methods/offsetParent.js","../../node_modules/mdui.jq/es/methods/one.js","../../node_modules/mdui.jq/es/methods/prev.js","../../node_modules/mdui.jq/es/methods/removeAttr.js","../../node_modules/mdui.jq/es/methods/removeData.js","../../node_modules/mdui.jq/es/methods/removeProp.js","../../node_modules/mdui.jq/es/methods/replaceWith.js","../../node_modules/mdui.jq/es/methods/replaceAll.js","../../node_modules/mdui.jq/es/methods/serializeArray.js","../../node_modules/mdui.jq/es/methods/serialize.js","../../node_modules/mdui.jq/es/methods/show.js","../../node_modules/mdui.jq/es/methods/siblings.js","../../node_modules/mdui.jq/es/methods/toggle.js","../../src/jq_extends/methods/reflow.ts","../../src/jq_extends/methods/transition.ts","../../src/jq_extends/methods/transitionEnd.ts","../../src/jq_extends/methods/transformOrigin.ts","../../src/jq_extends/methods/transform.ts","../../src/utils/mutation.ts","../../src/jq_extends/methods/mutation.ts","../../src/jq_extends/static/showOverlay.ts","../../src/jq_extends/static/hideOverlay.ts","../../src/jq_extends/static/lockScreen.ts","../../src/jq_extends/static/unlockScreen.ts","../../src/jq_extends/static/throttle.ts","../../src/jq_extends/static/guid.ts","../../src/utils/componentEvent.ts","../../src/global/mutation.ts","../../src/components/headroom/index.ts","../../src/utils/dom.ts","../../src/utils/parseOptions.ts","../../src/components/headroom/customAttr.ts","../../src/components/collapse/collapseAbstract.ts","../../src/components/collapse/index.ts","../../src/components/collapse/customAttr.ts","../../src/components/panel/index.ts","../../src/components/panel/customAttr.ts","../../src/components/table/index.ts","../../src/utils/touchHandler.ts","../../src/components/ripple/index.ts","../../src/components/textfield/index.ts","../../src/components/slider/index.ts","../../src/components/fab/index.ts","../../src/components/fab/customAttr.ts","../../src/components/select/index.ts","../../src/components/select/customAttr.ts","../../src/components/appbar/index.ts","../../src/components/tab/index.ts","../../src/components/tab/customAttr.ts","../../src/components/drawer/index.ts","../../src/components/drawer/customAttr.ts","../../src/utils/queue.ts","../../src/components/dialog/class.ts","../../src/components/dialog/index.ts","../../src/components/dialog/customAttr.ts","../../src/components/dialog/dialog.ts","../../src/components/dialog/alert.ts","../../src/components/dialog/confirm.ts","../../src/components/dialog/prompt.ts","../../src/components/tooltip/index.ts","../../src/components/tooltip/customAttr.ts","../../src/components/snackbar/index.ts","../../src/components/progress/spinner.ts","../../src/components/bottom_nav/index.ts","../../src/components/menu/index.ts","../../src/components/menu/customAttr.ts"],"sourcesContent":["!function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent(\"CustomEvent\");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}\"function\"!=typeof window.CustomEvent&&(t.prototype=window.Event.prototype,window.CustomEvent=t)}();\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","!function(){try{return new MouseEvent(\"test\")}catch(e){}var e=function(e,t){t=t||{bubbles:!1,cancelable:!1};var n=document.createEvent(\"MouseEvent\");return n.initMouseEvent(e,t.bubbles,t.cancelable,window,0,t.screenX||0,t.screenY||0,t.clientX||0,t.clientY||0,t.ctrlKey||!1,t.altKey||!1,t.shiftKey||!1,t.metaKey||!1,t.button||0,t.relatedTarget||null),n};e.prototype=Event.prototype,window.MouseEvent=e}();\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","import Promise from './index';\nimport promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n/** @suppress {undefinedVars} */\nvar globalNS = (function() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n})();\n\n// Expose the polyfill if Promise is undefined or set to a\n// non-function value. The latter can be due to a named HTMLElement\n// being exposed by browsers for legacy reasons.\n// https://github.com/taylorhakes/promise-polyfill/issues/114\nif (typeof globalNS['Promise'] !== 'function') {\n globalNS['Promise'] = Promise;\n} else if (!globalNS.Promise.prototype['finally']) {\n globalNS.Promise.prototype['finally'] = promiseFinally;\n} else if (!globalNS.Promise.allSettled) {\n globalNS.Promise.allSettled = allSettled;\n}\n","function isNodeName(element, name) {\n return element.nodeName.toLowerCase() === name.toLowerCase();\n}\nfunction isFunction(target) {\n return typeof target === 'function';\n}\nfunction isString(target) {\n return typeof target === 'string';\n}\nfunction isNumber(target) {\n return typeof target === 'number';\n}\nfunction isBoolean(target) {\n return typeof target === 'boolean';\n}\nfunction isUndefined(target) {\n return typeof target === 'undefined';\n}\nfunction isNull(target) {\n return target === null;\n}\nfunction isWindow(target) {\n return target instanceof Window;\n}\nfunction isDocument(target) {\n return target instanceof Document;\n}\nfunction isElement(target) {\n return target instanceof Element;\n}\nfunction isNode(target) {\n return target instanceof Node;\n}\n/**\n * 是否是 IE 浏览器\n */\nfunction isIE() {\n // @ts-ignore\n return !!window.document.documentMode;\n}\nfunction isArrayLike(target) {\n if (isFunction(target) || isWindow(target)) {\n return false;\n }\n return isNumber(target.length);\n}\nfunction isObjectLike(target) {\n return typeof target === 'object' && target !== null;\n}\nfunction toElement(target) {\n return isDocument(target) ? target.documentElement : target;\n}\n/**\n * 把用 - 分隔的字符串转为驼峰(如 box-sizing 转换为 boxSizing)\n * @param string\n */\nfunction toCamelCase(string) {\n return string\n .replace(/^-ms-/, 'ms-')\n .replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n}\n/**\n * 把驼峰法转为用 - 分隔的字符串(如 boxSizing 转换为 box-sizing)\n * @param string\n */\nfunction toKebabCase(string) {\n return string.replace(/[A-Z]/g, (replacer) => '-' + replacer.toLowerCase());\n}\n/**\n * 获取元素的样式值\n * @param element\n * @param name\n */\nfunction getComputedStyleValue(element, name) {\n return window.getComputedStyle(element).getPropertyValue(toKebabCase(name));\n}\n/**\n * 检查元素的 box-sizing 是否是 border-box\n * @param element\n */\nfunction isBorderBox(element) {\n return getComputedStyleValue(element, 'box-sizing') === 'border-box';\n}\n/**\n * 获取元素的 padding, border, margin 宽度(两侧宽度的和,单位为px)\n * @param element\n * @param direction\n * @param extra\n */\nfunction getExtraWidth(element, direction, extra) {\n const position = direction === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n return [0, 1].reduce((prev, _, index) => {\n let prop = extra + position[index];\n if (extra === 'border') {\n prop += 'Width';\n }\n return prev + parseFloat(getComputedStyleValue(element, prop) || '0');\n }, 0);\n}\n/**\n * 获取元素的样式值,对 width 和 height 进行过处理\n * @param element\n * @param name\n */\nfunction getStyle(element, name) {\n // width、height 属性使用 getComputedStyle 得到的值不准确,需要使用 getBoundingClientRect 获取\n if (name === 'width' || name === 'height') {\n const valueNumber = element.getBoundingClientRect()[name];\n if (isBorderBox(element)) {\n return `${valueNumber}px`;\n }\n return `${valueNumber -\n getExtraWidth(element, name, 'border') -\n getExtraWidth(element, name, 'padding')}px`;\n }\n return getComputedStyleValue(element, name);\n}\n/**\n * 获取子节点组成的数组\n * @param target\n * @param parent\n */\nfunction getChildNodesArray(target, parent) {\n const tempParent = document.createElement(parent);\n tempParent.innerHTML = target;\n return [].slice.call(tempParent.childNodes);\n}\n/**\n * 始终返回 false 的函数\n */\nfunction returnFalse() {\n return false;\n}\n/**\n * 数值单位的 CSS 属性\n */\nconst cssNumber = [\n 'animationIterationCount',\n 'columnCount',\n 'fillOpacity',\n 'flexGrow',\n 'flexShrink',\n 'fontWeight',\n 'gridArea',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnStart',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowStart',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'widows',\n 'zIndex',\n 'zoom',\n];\nexport { isNodeName, isArrayLike, isObjectLike, isFunction, isString, isNumber, isBoolean, isUndefined, isNull, isWindow, isDocument, isElement, isNode, isIE, toElement, toCamelCase, toKebabCase, getComputedStyleValue, isBorderBox, getExtraWidth, getStyle, getChildNodesArray, returnFalse, cssNumber, };\n","import { isArrayLike } from '../utils';\nfunction each(target, callback) {\n if (isArrayLike(target)) {\n for (let i = 0; i < target.length; i += 1) {\n if (callback.call(target[i], i, target[i]) === false) {\n return target;\n }\n }\n }\n else {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i += 1) {\n if (callback.call(target[keys[i]], keys[i], target[keys[i]]) === false) {\n return target;\n }\n }\n }\n return target;\n}\nexport default each;\n","import each from './functions/each';\n/**\n * 为了使用模块扩充,这里不能使用默认导出\n */\nexport class JQ {\n constructor(arr) {\n this.length = 0;\n if (!arr) {\n return this;\n }\n each(arr, (i, item) => {\n // @ts-ignore\n this[i] = item;\n });\n this.length = arr.length;\n return this;\n }\n}\n","import each from './functions/each';\nimport { JQ } from './JQ';\nimport { getChildNodesArray, isArrayLike, isFunction, isNode, isString, } from './utils';\nfunction get$() {\n const $ = function (selector) {\n if (!selector) {\n return new JQ();\n }\n // JQ\n if (selector instanceof JQ) {\n return selector;\n }\n // function\n if (isFunction(selector)) {\n if (/complete|loaded|interactive/.test(document.readyState) &&\n document.body) {\n selector.call(document, $);\n }\n else {\n document.addEventListener('DOMContentLoaded', () => selector.call(document, $), false);\n }\n return new JQ([document]);\n }\n // String\n if (isString(selector)) {\n const html = selector.trim();\n // 根据 HTML 字符串创建 JQ 对象\n if (html[0] === '<' && html[html.length - 1] === '>') {\n let toCreate = 'div';\n const tags = {\n li: 'ul',\n tr: 'tbody',\n td: 'tr',\n th: 'tr',\n tbody: 'table',\n option: 'select',\n };\n each(tags, (childTag, parentTag) => {\n if (html.indexOf(`<${childTag}`) === 0) {\n toCreate = parentTag;\n return false;\n }\n return;\n });\n return new JQ(getChildNodesArray(html, toCreate));\n }\n // 根据 CSS 选择器创建 JQ 对象\n const isIdSelector = selector[0] === '#' && !selector.match(/[ .<>:~]/);\n if (!isIdSelector) {\n return new JQ(document.querySelectorAll(selector));\n }\n const element = document.getElementById(selector.slice(1));\n if (element) {\n return new JQ([element]);\n }\n return new JQ();\n }\n if (isArrayLike(selector) && !isNode(selector)) {\n return new JQ(selector);\n }\n return new JQ([selector]);\n };\n $.fn = JQ.prototype;\n return $;\n}\nconst $ = get$();\nexport default $;\n","import { MduiStatic } from './interfaces/MduiStatic';\nimport $ from 'mdui.jq/es/$';\n\n// 避免页面加载完后直接执行css动画\n// https://css-tricks.com/transitions-only-after-page-load/\nsetTimeout(() => $('body').addClass('mdui-loaded'));\n\nconst mdui = {\n $: $,\n} as MduiStatic;\n\nexport default mdui;\n","import { toElement } from '../utils';\n/**\n * 检查 container 元素内是否包含 contains 元素\n * @param container 父元素\n * @param contains 子元素\n * @example\n```js\ncontains( document, document.body ); // true\ncontains( document.getElementById('test'), document ); // false\ncontains( $('.container').get(0), $('.contains').get(0) ); // false\n```\n */\nfunction contains(container, contains) {\n return container !== contains && toElement(container).contains(contains);\n}\nexport default contains;\n","import each from './each';\n/**\n * 把第二个数组的元素追加到第一个数组中,并返回合并后的数组\n * @param first 第一个数组\n * @param second 该数组的元素将被追加到第一个数组中\n * @example\n```js\nmerge( [ 0, 1, 2 ], [ 2, 3, 4 ] )\n// [ 0, 1, 2, 2, 3, 4 ]\n```\n */\nfunction merge(first, second) {\n each(second, (_, value) => {\n first.push(value);\n });\n return first;\n}\nexport default merge;\n","import $ from '../$';\nimport each from '../functions/each';\n$.fn.each = function (callback) {\n return each(this, callback);\n};\n","import $ from '../$';\n$.fn.get = function (index) {\n return index === undefined\n ? [].slice.call(this)\n : this[index >= 0 ? index : index + this.length];\n};\n","import $ from '../$';\nimport merge from '../functions/merge';\nimport { JQ } from '../JQ';\nimport './each';\nimport './get';\n$.fn.find = function (selector) {\n const foundElements = [];\n this.each((_, element) => {\n merge(foundElements, $(element.querySelectorAll(selector)).get());\n });\n return new JQ(foundElements);\n};\n","import $ from '../../$';\nimport contains from '../../functions/contains';\nimport { isObjectLike } from '../../utils';\nimport '../find';\n// 存储事件\nconst handlers = {};\n// 元素ID\nlet mduiElementId = 1;\n/**\n * 为元素赋予一个唯一的ID\n */\nfunction getElementId(element) {\n const key = '_mduiEventId';\n // @ts-ignore\n if (!element[key]) {\n // @ts-ignore\n element[key] = ++mduiElementId;\n }\n // @ts-ignore\n return element[key];\n}\n/**\n * 解析事件名中的命名空间\n */\nfunction parse(type) {\n const parts = type.split('.');\n return {\n type: parts[0],\n ns: parts.slice(1).sort().join(' '),\n };\n}\n/**\n * 命名空间匹配规则\n */\nfunction matcherFor(ns) {\n return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)');\n}\n/**\n * 获取匹配的事件\n * @param element\n * @param type\n * @param func\n * @param selector\n */\nfunction getHandlers(element, type, func, selector) {\n const event = parse(type);\n return (handlers[getElementId(element)] || []).filter((handler) => handler &&\n (!event.type || handler.type === event.type) &&\n (!event.ns || matcherFor(event.ns).test(handler.ns)) &&\n (!func || getElementId(handler.func) === getElementId(func)) &&\n (!selector || handler.selector === selector));\n}\n/**\n * 添加事件监听\n * @param element\n * @param types\n * @param func\n * @param data\n * @param selector\n */\nfunction add(element, types, func, data, selector) {\n const elementId = getElementId(element);\n if (!handlers[elementId]) {\n handlers[elementId] = [];\n }\n // 传入 data.useCapture 来设置 useCapture: true\n let useCapture = false;\n if (isObjectLike(data) && data.useCapture) {\n useCapture = true;\n }\n types.split(' ').forEach((type) => {\n if (!type) {\n return;\n }\n const event = parse(type);\n function callFn(e, elem) {\n // 因为鼠标事件模拟事件的 detail 属性是只读的,因此在 e._detail 中存储参数\n const result = func.apply(elem, \n // @ts-ignore\n e._detail === undefined ? [e] : [e].concat(e._detail));\n if (result === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n function proxyFn(e) {\n // @ts-ignore\n if (e._ns && !matcherFor(e._ns).test(event.ns)) {\n return;\n }\n // @ts-ignore\n e._data = data;\n if (selector) {\n // 事件代理\n $(element)\n .find(selector)\n .get()\n .reverse()\n .forEach((elem) => {\n if (elem === e.target ||\n contains(elem, e.target)) {\n callFn(e, elem);\n }\n });\n }\n else {\n // 不使用事件代理\n callFn(e, element);\n }\n }\n const handler = {\n type: event.type,\n ns: event.ns,\n func,\n selector,\n id: handlers[elementId].length,\n proxy: proxyFn,\n };\n handlers[elementId].push(handler);\n element.addEventListener(handler.type, proxyFn, useCapture);\n });\n}\n/**\n * 移除事件监听\n * @param element\n * @param types\n * @param func\n * @param selector\n */\nfunction remove(element, types, func, selector) {\n const handlersInElement = handlers[getElementId(element)] || [];\n const removeEvent = (handler) => {\n delete handlersInElement[handler.id];\n element.removeEventListener(handler.type, handler.proxy, false);\n };\n if (!types) {\n handlersInElement.forEach((handler) => removeEvent(handler));\n }\n else {\n types.split(' ').forEach((type) => {\n if (type) {\n getHandlers(element, type, func, selector).forEach((handler) => removeEvent(handler));\n }\n });\n }\n}\nexport { parse, add, remove };\n","import each from '../functions/each';\nimport { isUndefined } from '../utils';\nfunction extend(target, object1, ...objectN) {\n objectN.unshift(object1);\n each(objectN, (_, object) => {\n each(object, (prop, value) => {\n if (!isUndefined(value)) {\n target[prop] = value;\n }\n });\n });\n return target;\n}\nexport default extend;\n","import { isObjectLike } from '../utils';\nimport each from './each';\n/**\n * 将数组或对象序列化,序列化后的字符串可作为 URL 查询字符串使用\n *\n * 若传入数组,则格式必须和 serializeArray 方法的返回值一样\n * @param obj 对象或数组\n * @example\n```js\nparam({ width: 1680, height: 1050 });\n// width=1680&height=1050\n```\n * @example\n```js\nparam({ foo: { one: 1, two: 2 }})\n// foo[one]=1&foo[two]=2\n```\n * @example\n```js\nparam({ids: [1, 2, 3]})\n// ids[]=1&ids[]=2&ids[]=3\n```\n * @example\n```js\nparam([\n {\"name\":\"name\",\"value\":\"mdui\"},\n {\"name\":\"password\",\"value\":\"123456\"}\n])\n// name=mdui&password=123456\n```\n */\nfunction param(obj) {\n if (!isObjectLike(obj) && !Array.isArray(obj)) {\n return '';\n }\n const args = [];\n function destructure(key, value) {\n let keyTmp;\n if (isObjectLike(value)) {\n each(value, (i, v) => {\n if (Array.isArray(value) && !isObjectLike(v)) {\n keyTmp = '';\n }\n else {\n keyTmp = i;\n }\n destructure(`${key}[${keyTmp}]`, v);\n });\n }\n else {\n if (value == null || value === '') {\n keyTmp = '=';\n }\n else {\n keyTmp = `=${encodeURIComponent(value)}`;\n }\n args.push(encodeURIComponent(key) + keyTmp);\n }\n }\n if (Array.isArray(obj)) {\n each(obj, function () {\n destructure(this.name, this.value);\n });\n }\n else {\n each(obj, destructure);\n }\n return args.join('&');\n}\nexport default param;\n","import $ from '../$';\nimport './each';\nimport { parse } from './utils/event';\n$.fn.trigger = function (type, extraParameters) {\n const event = parse(type);\n let eventObject;\n const eventParams = {\n bubbles: true,\n cancelable: true,\n };\n const isMouseEvent = ['click', 'mousedown', 'mouseup', 'mousemove'].indexOf(event.type) > -1;\n if (isMouseEvent) {\n // Note: MouseEvent 无法传入 detail 参数\n eventObject = new MouseEvent(event.type, eventParams);\n }\n else {\n eventParams.detail = extraParameters;\n eventObject = new CustomEvent(event.type, eventParams);\n }\n // @ts-ignore\n eventObject._detail = extraParameters;\n // @ts-ignore\n eventObject._ns = event.ns;\n return this.each(function () {\n this.dispatchEvent(eventObject);\n });\n};\n","// 全局配置参数\nconst globalOptions = {};\n// 全局事件名\nconst ajaxEvents = {\n ajaxStart: 'start.mdui.ajax',\n ajaxSuccess: 'success.mdui.ajax',\n ajaxError: 'error.mdui.ajax',\n ajaxComplete: 'complete.mdui.ajax',\n};\nexport { globalOptions, ajaxEvents };\n","import $ from '../$';\nimport '../methods/trigger';\nimport { isString, isUndefined } from '../utils';\nimport each from './each';\nimport extend from './extend';\nimport param from './param';\nimport { ajaxEvents, globalOptions } from './utils/ajax';\n/**\n * 判断此请求方法是否通过查询字符串提交参数\n * @param method 请求方法,大写\n */\nfunction isQueryStringData(method) {\n return ['GET', 'HEAD'].indexOf(method) >= 0;\n}\n/**\n * 添加参数到 URL 上,且 URL 中不存在 ? 时,自动把第一个 & 替换为 ?\n * @param url\n * @param query\n */\nfunction appendQuery(url, query) {\n return `${url}&${query}`.replace(/[&?]{1,2}/, '?');\n}\n/**\n * 合并请求参数,参数优先级:options > globalOptions > defaults\n * @param options\n */\nfunction mergeOptions(options) {\n // 默认参数\n const defaults = {\n url: '',\n method: 'GET',\n data: '',\n processData: true,\n async: true,\n cache: true,\n username: '',\n password: '',\n headers: {},\n xhrFields: {},\n statusCode: {},\n dataType: 'text',\n contentType: 'application/x-www-form-urlencoded',\n timeout: 0,\n global: true,\n };\n // globalOptions 中的回调函数不合并\n each(globalOptions, (key, value) => {\n const callbacks = [\n 'beforeSend',\n 'success',\n 'error',\n 'complete',\n 'statusCode',\n ];\n // @ts-ignore\n if (callbacks.indexOf(key) < 0 && !isUndefined(value)) {\n defaults[key] = value;\n }\n });\n return extend({}, defaults, options);\n}\n/**\n * 发送 ajax 请求\n * @param options\n * @example\n```js\najax({\n method: \"POST\",\n url: \"some.php\",\n data: { name: \"John\", location: \"Boston\" }\n}).then(function( msg ) {\n alert( \"Data Saved: \" + msg );\n});\n```\n */\nfunction ajax(options) {\n // 是否已取消请求\n let isCanceled = false;\n // 事件参数\n const eventParams = {};\n // 参数合并\n const mergedOptions = mergeOptions(options);\n let url = mergedOptions.url || window.location.toString();\n const method = mergedOptions.method.toUpperCase();\n let data = mergedOptions.data;\n const processData = mergedOptions.processData;\n const async = mergedOptions.async;\n const cache = mergedOptions.cache;\n const username = mergedOptions.username;\n const password = mergedOptions.password;\n const headers = mergedOptions.headers;\n const xhrFields = mergedOptions.xhrFields;\n const statusCode = mergedOptions.statusCode;\n const dataType = mergedOptions.dataType;\n const contentType = mergedOptions.contentType;\n const timeout = mergedOptions.timeout;\n const global = mergedOptions.global;\n // 需要发送的数据\n // GET/HEAD 请求和 processData 为 true 时,转换为查询字符串格式,特殊格式不转换\n if (data &&\n (isQueryStringData(method) || processData) &&\n !isString(data) &&\n !(data instanceof ArrayBuffer) &&\n !(data instanceof Blob) &&\n !(data instanceof Document) &&\n !(data instanceof FormData)) {\n data = param(data);\n }\n // 对于 GET、HEAD 类型的请求,把 data 数据添加到 URL 中\n if (data && isQueryStringData(method)) {\n // 查询字符串拼接到 URL 中\n url = appendQuery(url, data);\n data = null;\n }\n /**\n * 触发事件和回调函数\n * @param event\n * @param params\n * @param callback\n * @param args\n */\n function trigger(event, params, callback, ...args) {\n // 触发全局事件\n if (global) {\n $(document).trigger(event, params);\n }\n // 触发 ajax 回调和事件\n let result1;\n let result2;\n if (callback) {\n // 全局回调\n if (callback in globalOptions) {\n // @ts-ignore\n result1 = globalOptions[callback](...args);\n }\n // 自定义回调\n if (mergedOptions[callback]) {\n // @ts-ignore\n result2 = mergedOptions[callback](...args);\n }\n // beforeSend 回调返回 false 时取消 ajax 请求\n if (callback === 'beforeSend' &&\n (result1 === false || result2 === false)) {\n isCanceled = true;\n }\n }\n }\n // XMLHttpRequest 请求\n function XHR() {\n let textStatus;\n return new Promise((resolve, reject) => {\n // GET/HEAD 请求的缓存处理\n if (isQueryStringData(method) && !cache) {\n url = appendQuery(url, `_=${Date.now()}`);\n }\n // 创建 XHR\n const xhr = new XMLHttpRequest();\n xhr.open(method, url, async, username, password);\n if (contentType ||\n (data && !isQueryStringData(method) && contentType !== false)) {\n xhr.setRequestHeader('Content-Type', contentType);\n }\n // 设置 Accept\n if (dataType === 'json') {\n xhr.setRequestHeader('Accept', 'application/json, text/javascript');\n }\n // 添加 headers\n if (headers) {\n each(headers, (key, value) => {\n // undefined 值不发送,string 和 null 需要发送\n if (!isUndefined(value)) {\n xhr.setRequestHeader(key, value + ''); // 把 null 转换成字符串\n }\n });\n }\n // 检查是否是跨域请求,跨域请求时不添加 X-Requested-With\n const crossDomain = /^([\\w-]+:)?\\/\\/([^/]+)/.test(url) &&\n RegExp.$2 !== window.location.host;\n if (!crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n if (xhrFields) {\n each(xhrFields, (key, value) => {\n // @ts-ignore\n xhr[key] = value;\n });\n }\n eventParams.xhr = xhr;\n eventParams.options = mergedOptions;\n let xhrTimeout;\n xhr.onload = function () {\n if (xhrTimeout) {\n clearTimeout(xhrTimeout);\n }\n // AJAX 返回的 HTTP 响应码是否表示成功\n const isHttpStatusSuccess = (xhr.status >= 200 && xhr.status < 300) ||\n xhr.status === 304 ||\n xhr.status === 0;\n let responseData;\n if (isHttpStatusSuccess) {\n if (xhr.status === 204 || method === 'HEAD') {\n textStatus = 'nocontent';\n }\n else if (xhr.status === 304) {\n textStatus = 'notmodified';\n }\n else {\n textStatus = 'success';\n }\n if (dataType === 'json') {\n try {\n responseData =\n method === 'HEAD' ? undefined : JSON.parse(xhr.responseText);\n eventParams.data = responseData;\n }\n catch (err) {\n textStatus = 'parsererror';\n trigger(ajaxEvents.ajaxError, eventParams, 'error', xhr, textStatus);\n reject(new Error(textStatus));\n }\n if (textStatus !== 'parsererror') {\n trigger(ajaxEvents.ajaxSuccess, eventParams, 'success', responseData, textStatus, xhr);\n resolve(responseData);\n }\n }\n else {\n responseData =\n method === 'HEAD'\n ? undefined\n : xhr.responseType === 'text' || xhr.responseType === ''\n ? xhr.responseText\n : xhr.response;\n eventParams.data = responseData;\n trigger(ajaxEvents.ajaxSuccess, eventParams, 'success', responseData, textStatus, xhr);\n resolve(responseData);\n }\n }\n else {\n textStatus = 'error';\n trigger(ajaxEvents.ajaxError, eventParams, 'error', xhr, textStatus);\n reject(new Error(textStatus));\n }\n // statusCode\n each([globalOptions.statusCode, statusCode], (_, func) => {\n if (func && func[xhr.status]) {\n if (isHttpStatusSuccess) {\n func[xhr.status](responseData, textStatus, xhr);\n }\n else {\n func[xhr.status](xhr, textStatus);\n }\n }\n });\n trigger(ajaxEvents.ajaxComplete, eventParams, 'complete', xhr, textStatus);\n };\n xhr.onerror = function () {\n if (xhrTimeout) {\n clearTimeout(xhrTimeout);\n }\n trigger(ajaxEvents.ajaxError, eventParams, 'error', xhr, xhr.statusText);\n trigger(ajaxEvents.ajaxComplete, eventParams, 'complete', xhr, 'error');\n reject(new Error(xhr.statusText));\n };\n xhr.onabort = function () {\n let statusText = 'abort';\n if (xhrTimeout) {\n statusText = 'timeout';\n clearTimeout(xhrTimeout);\n }\n trigger(ajaxEvents.ajaxError, eventParams, 'error', xhr, statusText);\n trigger(ajaxEvents.ajaxComplete, eventParams, 'complete', xhr, statusText);\n reject(new Error(statusText));\n };\n // ajax start 回调\n trigger(ajaxEvents.ajaxStart, eventParams, 'beforeSend', xhr);\n if (isCanceled) {\n reject(new Error('cancel'));\n return;\n }\n // Timeout\n if (timeout > 0) {\n xhrTimeout = setTimeout(() => {\n xhr.abort();\n }, timeout);\n }\n // 发送 XHR\n xhr.send(data);\n });\n }\n return XHR();\n}\nexport default ajax;\n","import $ from '../$';\nimport ajax from '../functions/ajax';\n$.ajax = ajax;\n","import $ from '../$';\nimport ajaxSetup from '../functions/ajaxSetup';\n$.ajaxSetup = ajaxSetup;\n","import extend from '../functions/extend';\nimport { globalOptions } from './utils/ajax';\n/**\n * 为 Ajax 请求设置全局配置参数\n * @param options 键值对参数\n * @example\n```js\najaxSetup({\n dataType: 'json',\n method: 'POST',\n});\n```\n */\nfunction ajaxSetup(options) {\n return extend(globalOptions, options);\n}\nexport default ajaxSetup;\n","import $ from '../$';\nimport contains from '../functions/contains';\n$.contains = contains;\n","const dataNS = '_mduiElementDataStorage';\nexport default dataNS;\n","import { isObjectLike, isUndefined, toCamelCase } from '../utils';\nimport each from './each';\nimport dataNS from './utils/data';\n/**\n * 在元素上设置键值对数据\n * @param element\n * @param object\n */\nfunction setObjectToElement(element, object) {\n // @ts-ignore\n if (!element[dataNS]) {\n // @ts-ignore\n element[dataNS] = {};\n }\n each(object, (key, value) => {\n // @ts-ignore\n element[dataNS][toCamelCase(key)] = value;\n });\n}\nfunction data(element, key, value) {\n // 根据键值对设置值\n // data(element, { 'key' : 'value' })\n if (isObjectLike(key)) {\n setObjectToElement(element, key);\n return key;\n }\n // 根据 key、value 设置值\n // data(element, 'key', 'value')\n if (!isUndefined(value)) {\n setObjectToElement(element, { [key]: value });\n return value;\n }\n // 获取所有值\n // data(element)\n if (isUndefined(key)) {\n // @ts-ignore\n return element[dataNS] ? element[dataNS] : {};\n }\n // 从 dataNS 中获取指定值\n // data(element, 'key')\n key = toCamelCase(key);\n // @ts-ignore\n if (element[dataNS] && key in element[dataNS]) {\n // @ts-ignore\n return element[dataNS][key];\n }\n return undefined;\n}\nexport default data;\n","import each from './each';\nfunction map(elements, callback) {\n let value;\n const ret = [];\n each(elements, (i, element) => {\n value = callback.call(window, element, i);\n if (value != null) {\n ret.push(value);\n }\n });\n return [].concat(...ret);\n}\nexport default map;\n","import each from '../functions/each';\nimport { isUndefined, isString, toCamelCase } from '../utils';\nimport dataNS from './utils/data';\n/**\n * 移除指定元素上存放的数据\n * @param element 存放数据的元素\n * @param name\n * 数据键名\n *\n * 若未指定键名,将移除元素上所有数据\n *\n * 多个键名可以用空格分隔,或者用数组表示多个键名\n @example\n```js\n// 移除元素上键名为 name 的数据\nremoveData(document.body, 'name');\n```\n * @example\n```js\n// 移除元素上键名为 name1 和 name2 的数据\nremoveData(document.body, 'name1 name2');\n```\n * @example\n```js\n// 移除元素上键名为 name1 和 name2 的数据\nremoveData(document.body, ['name1', 'name2']);\n```\n * @example\n```js\n// 移除元素上所有数据\nremoveData(document.body);\n```\n */\nfunction removeData(element, name) {\n // @ts-ignore\n if (!element[dataNS]) {\n return;\n }\n const remove = (nameItem) => {\n nameItem = toCamelCase(nameItem);\n // @ts-ignore\n if (element[dataNS][nameItem]) {\n // @ts-ignore\n element[dataNS][nameItem] = null;\n // @ts-ignore\n delete element[dataNS][nameItem];\n }\n };\n if (isUndefined(name)) {\n // @ts-ignore\n element[dataNS] = null;\n // @ts-ignore\n delete element[dataNS];\n // @ts-ignore\n }\n else if (isString(name)) {\n name\n .split(' ')\n .filter((nameItem) => nameItem)\n .forEach((nameItem) => remove(nameItem));\n }\n else {\n each(name, (_, nameItem) => remove(nameItem));\n }\n}\nexport default removeData;\n","import each from './each';\n/**\n * 过滤掉数组中的重复元素\n * @param arr 数组\n * @example\n```js\nunique([1, 2, 12, 3, 2, 1, 2, 1, 1]);\n// [1, 2, 12, 3]\n```\n */\nfunction unique(arr) {\n const result = [];\n each(arr, (_, val) => {\n if (result.indexOf(val) === -1) {\n result.push(val);\n }\n });\n return result;\n}\nexport default unique;\n","import $ from '../../$';\nimport unique from '../../functions/unique';\nimport { JQ } from '../../JQ';\nimport { isElement } from '../../utils';\nimport '../each';\nimport '../is';\nexport default function dir($elements, nameIndex, node, selector, filter) {\n const ret = [];\n let target;\n $elements.each((_, element) => {\n target = element[node];\n // 不能包含最顶层的 document 元素\n while (target && isElement(target)) {\n // prevUntil, nextUntil, parentsUntil\n if (nameIndex === 2) {\n if (selector && $(target).is(selector)) {\n break;\n }\n if (!filter || $(target).is(filter)) {\n ret.push(target);\n }\n }\n // prev, next, parent\n else if (nameIndex === 0) {\n if (!selector || $(target).is(selector)) {\n ret.push(target);\n }\n break;\n }\n // prevAll, nextAll, parents\n else {\n if (!selector || $(target).is(selector)) {\n ret.push(target);\n }\n }\n // @ts-ignore\n target = target[node];\n }\n });\n return new JQ(unique(ret));\n}\n","import $ from '../$';\nimport data from '../functions/data';\n$.data = data;\n","import $ from '../$';\nimport each from '../functions/each';\n$.each = each;\n","import $ from '../$';\nimport each from '../functions/each';\nimport extend from '../functions/extend';\n$.extend = function (...objectN) {\n if (objectN.length === 1) {\n each(objectN[0], (prop, value) => {\n this[prop] = value;\n });\n return this;\n }\n return extend(objectN.shift(), objectN.shift(), ...objectN);\n};\n","import $ from '../$';\nimport map from '../functions/map';\n$.map = map;\n","import $ from '../$';\nimport merge from '../functions/merge';\n$.merge = merge;\n","import $ from '../$';\nimport param from '../functions/param';\n$.param = param;\n","import $ from '../$';\nimport removeData from '../functions/removeData';\n$.removeData = removeData;\n","import $ from '../$';\nimport unique from '../functions/unique';\n$.unique = unique;\n","import $ from '../$';\nimport merge from '../functions/merge';\nimport unique from '../functions/unique';\nimport { JQ } from '../JQ';\nimport './get';\n$.fn.add = function (selector) {\n return new JQ(unique(merge(this.get(), $(selector).get())));\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport { isElement, isFunction } from '../utils';\nimport './each';\neach(['add', 'remove', 'toggle'], (_, name) => {\n $.fn[`${name}Class`] = function (className) {\n if (name === 'remove' && !arguments.length) {\n return this.each((_, element) => {\n element.setAttribute('class', '');\n });\n }\n return this.each((i, element) => {\n if (!isElement(element)) {\n return;\n }\n const classes = (isFunction(className)\n ? className.call(element, i, element.getAttribute('class') || '')\n : className)\n .split(' ')\n .filter((name) => name);\n each(classes, (_, cls) => {\n element.classList[name](cls);\n });\n });\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport './each';\neach(['insertBefore', 'insertAfter'], (nameIndex, name) => {\n $.fn[name] = function (target) {\n const $element = nameIndex ? $(this.get().reverse()) : this; // 顺序和 jQuery 保持一致\n const $target = $(target);\n const result = [];\n $target.each((index, target) => {\n if (!target.parentNode) {\n return;\n }\n $element.each((_, element) => {\n const newItem = index\n ? element.cloneNode(true)\n : element;\n const existingItem = nameIndex ? target.nextSibling : target;\n result.push(newItem);\n target.parentNode.insertBefore(newItem, existingItem);\n });\n });\n return $(nameIndex ? result.reverse() : result);\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport { getChildNodesArray, isFunction, isString, isElement } from '../utils';\nimport './each';\nimport './insertAfter';\nimport './insertBefore';\n/**\n * 是否不是 HTML 字符串(包裹在 <> 中)\n * @param target\n */\nfunction isPlainText(target) {\n return (isString(target) && (target[0] !== '<' || target[target.length - 1] !== '>'));\n}\neach(['before', 'after'], (nameIndex, name) => {\n $.fn[name] = function (...args) {\n // after 方法,多个参数需要按参数顺序添加到元素后面,所以需要将参数顺序反向处理\n if (nameIndex === 1) {\n args = args.reverse();\n }\n return this.each((index, element) => {\n const targets = isFunction(args[0])\n ? [args[0].call(element, index, element.innerHTML)]\n : args;\n each(targets, (_, target) => {\n let $target;\n if (isPlainText(target)) {\n $target = $(getChildNodesArray(target, 'div'));\n }\n else if (index && isElement(target)) {\n $target = $(target.cloneNode(true));\n }\n else {\n $target = $(target);\n }\n $target[nameIndex ? 'insertAfter' : 'insertBefore'](element);\n });\n });\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport { isFunction, isObjectLike, returnFalse } from '../utils';\nimport './each';\nimport { remove } from './utils/event';\n$.fn.off = function (types, selector, callback) {\n // types 是对象\n if (isObjectLike(types)) {\n each(types, (type, fn) => {\n // this.off('click', undefined, function () {})\n // this.off('click', '.box', function () {})\n this.off(type, selector, fn);\n });\n return this;\n }\n // selector 不存在\n if (selector === false || isFunction(selector)) {\n callback = selector;\n selector = undefined;\n // this.off('click', undefined, function () {})\n }\n // callback 传入 `false`,相当于 `return false`\n if (callback === false) {\n callback = returnFalse;\n }\n return this.each(function () {\n remove(this, types, callback, selector);\n });\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport { isObjectLike, isString, returnFalse } from '../utils';\nimport './each';\nimport './off';\nimport { add } from './utils/event';\n$.fn.on = function (types, selector, data, callback, one) {\n // types 可以是 type/func 对象\n if (isObjectLike(types)) {\n // (types-Object, selector, data)\n if (!isString(selector)) {\n // (types-Object, data)\n data = data || selector;\n selector = undefined;\n }\n each(types, (type, fn) => {\n // selector 和 data 都可能是 undefined\n // @ts-ignore\n this.on(type, selector, data, fn, one);\n });\n return this;\n }\n if (data == null && callback == null) {\n // (types, fn)\n callback = selector;\n data = selector = undefined;\n }\n else if (callback == null) {\n if (isString(selector)) {\n // (types, selector, fn)\n callback = data;\n data = undefined;\n }\n else {\n // (types, data, fn)\n callback = data;\n data = selector;\n selector = undefined;\n }\n }\n if (callback === false) {\n callback = returnFalse;\n }\n else if (!callback) {\n return this;\n }\n // $().one()\n if (one) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n const origCallback = callback;\n callback = function (event) {\n _this.off(event.type, selector, callback);\n // eslint-disable-next-line prefer-rest-params\n return origCallback.apply(this, arguments);\n };\n }\n return this.each(function () {\n add(this, types, callback, data, selector);\n });\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport { ajaxEvents } from '../functions/utils/ajax';\nimport './on';\neach(ajaxEvents, (name, eventName) => {\n $.fn[name] = function (fn) {\n return this.on(eventName, (e, params) => {\n fn(e, params.xhr, params.options, params.data);\n });\n };\n});\n","import $ from '../$';\nimport map from '../functions/map';\nimport { JQ } from '../JQ';\n$.fn.map = function (callback) {\n return new JQ(map(this, (element, i) => callback.call(element, i, element)));\n};\n","import $ from '../$';\nimport './map';\n$.fn.clone = function () {\n return this.map(function () {\n return this.cloneNode(true);\n });\n};\n","import $ from '../$';\nimport { isDocument, isFunction, isString, isWindow } from '../utils';\nimport './each';\n$.fn.is = function (selector) {\n let isMatched = false;\n if (isFunction(selector)) {\n this.each((index, element) => {\n if (selector.call(element, index, element)) {\n isMatched = true;\n }\n });\n return isMatched;\n }\n if (isString(selector)) {\n this.each((_, element) => {\n if (isDocument(element) || isWindow(element)) {\n return;\n }\n // @ts-ignore\n const matches = element.matches || element.msMatchesSelector;\n if (matches.call(element, selector)) {\n isMatched = true;\n }\n });\n return isMatched;\n }\n const $compareWith = $(selector);\n this.each((_, element) => {\n $compareWith.each((_, compare) => {\n if (element === compare) {\n isMatched = true;\n }\n });\n });\n return isMatched;\n};\n","import $ from '../$';\nimport './each';\nimport './is';\n$.fn.remove = function (selector) {\n return this.each((_, element) => {\n if (element.parentNode && (!selector || $(element).is(selector))) {\n element.parentNode.removeChild(element);\n }\n });\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport { isFunction, isString } from '../utils';\nimport './after';\nimport './before';\nimport './clone';\nimport './each';\nimport './map';\nimport './remove';\neach(['prepend', 'append'], (nameIndex, name) => {\n $.fn[name] = function (...args) {\n return this.each((index, element) => {\n const childNodes = element.childNodes;\n const childLength = childNodes.length;\n const child = childLength\n ? childNodes[nameIndex ? childLength - 1 : 0]\n : document.createElement('div');\n if (!childLength) {\n element.appendChild(child);\n }\n let contents = isFunction(args[0])\n ? [args[0].call(element, index, element.innerHTML)]\n : args;\n // 如果不是字符串,则仅第一个元素使用原始元素,其他的都克隆自第一个元素\n if (index) {\n contents = contents.map((content) => {\n return isString(content) ? content : $(content).clone();\n });\n }\n $(child)[nameIndex ? 'after' : 'before'](...contents);\n if (!childLength) {\n element.removeChild(child);\n }\n });\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport './insertAfter';\nimport './insertBefore';\nimport './map';\nimport './remove';\neach(['appendTo', 'prependTo'], (nameIndex, name) => {\n $.fn[name] = function (target) {\n const extraChilds = [];\n const $target = $(target).map((_, element) => {\n const childNodes = element.childNodes;\n const childLength = childNodes.length;\n if (childLength) {\n return childNodes[nameIndex ? 0 : childLength - 1];\n }\n const child = document.createElement('div');\n element.appendChild(child);\n extraChilds.push(child);\n return child;\n });\n const $result = this[nameIndex ? 'insertBefore' : 'insertAfter']($target);\n $(extraChilds).remove();\n return $result;\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport { cssNumber, getStyle, isElement, isFunction, isNull, isNumber, isObjectLike, isUndefined, toCamelCase, } from '../utils';\nimport './each';\neach(['attr', 'prop', 'css'], (nameIndex, name) => {\n function set(element, key, value) {\n // 值为 undefined 时,不修改\n if (isUndefined(value)) {\n return;\n }\n switch (nameIndex) {\n // attr\n case 0:\n if (isNull(value)) {\n element.removeAttribute(key);\n }\n else {\n element.setAttribute(key, value);\n }\n break;\n // prop\n case 1:\n // @ts-ignore\n element[key] = value;\n break;\n // css\n default:\n key = toCamelCase(key);\n // @ts-ignore\n element.style[key] = isNumber(value)\n ? `${value}${cssNumber.indexOf(key) > -1 ? '' : 'px'}`\n : value;\n break;\n }\n }\n function get(element, key) {\n switch (nameIndex) {\n // attr\n case 0:\n // 属性不存在时,原生 getAttribute 方法返回 null,而 jquery 返回 undefined。这里和 jquery 保持一致\n const value = element.getAttribute(key);\n return isNull(value) ? undefined : value;\n // prop\n case 1:\n // @ts-ignore\n return element[key];\n // css\n default:\n return getStyle(element, key);\n }\n }\n $.fn[name] = function (key, value) {\n if (isObjectLike(key)) {\n each(key, (k, v) => {\n // @ts-ignore\n this[name](k, v);\n });\n return this;\n }\n if (arguments.length === 1) {\n const element = this[0];\n return isElement(element) ? get(element, key) : undefined;\n }\n return this.each((i, element) => {\n set(element, key, isFunction(value) ? value.call(element, i, get(element, key)) : value);\n });\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport unique from '../functions/unique';\nimport { JQ } from '../JQ';\nimport { isElement } from '../utils';\nimport './each';\nimport './is';\n$.fn.children = function (selector) {\n const children = [];\n this.each((_, element) => {\n each(element.childNodes, (__, childNode) => {\n if (!isElement(childNode)) {\n return;\n }\n if (!selector || $(childNode).is(selector)) {\n children.push(childNode);\n }\n });\n });\n return new JQ(unique(children));\n};\n","import $ from '../$';\nimport { JQ } from '../JQ';\n$.fn.slice = function (...args) {\n return new JQ([].slice.apply(this, args));\n};\n","import $ from '../$';\nimport { JQ } from '../JQ';\nimport './slice';\n$.fn.eq = function (index) {\n const ret = index === -1 ? this.slice(index) : this.slice(index, +index + 1);\n return new JQ(ret);\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport './get';\nimport dir from './utils/dir';\neach(['', 's', 'sUntil'], (nameIndex, name) => {\n $.fn[`parent${name}`] = function (selector, filter) {\n // parents、parentsUntil 需要把元素的顺序反向处理,以便和 jQuery 的结果一致\n const $nodes = !nameIndex ? this : $(this.get().reverse());\n return dir($nodes, nameIndex, 'parentNode', selector, filter);\n };\n});\n","import $ from '../$';\nimport { JQ } from '../JQ';\nimport './eq';\nimport './is';\nimport './parents';\n$.fn.closest = function (selector) {\n if (this.is(selector)) {\n return this;\n }\n const matched = [];\n this.parents().each((_, element) => {\n if ($(element).is(selector)) {\n matched.push(element);\n return false;\n }\n });\n return new JQ(matched);\n};\n","import $ from '../$';\nimport data from '../functions/data';\nimport { isObjectLike, isString, isUndefined, toCamelCase, toKebabCase, } from '../utils';\nimport './each';\nconst rbrace = /^(?:{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/;\n// 从 `data-*` 中获取的值,需要经过该函数转换\nfunction getData(value) {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n if (value === 'null') {\n return null;\n }\n if (value === +value + '') {\n return +value;\n }\n if (rbrace.test(value)) {\n return JSON.parse(value);\n }\n return value;\n}\n// 若 value 不存在,则从 `data-*` 中获取值\nfunction dataAttr(element, key, value) {\n if (isUndefined(value) && element.nodeType === 1) {\n const name = 'data-' + toKebabCase(key);\n value = element.getAttribute(name);\n if (isString(value)) {\n try {\n value = getData(value);\n }\n catch (e) { }\n }\n else {\n value = undefined;\n }\n }\n return value;\n}\n$.fn.data = function (key, value) {\n // 获取所有值\n if (isUndefined(key)) {\n if (!this.length) {\n return undefined;\n }\n const element = this[0];\n const resultData = data(element);\n // window, document 上不存在 `data-*` 属性\n if (element.nodeType !== 1) {\n return resultData;\n }\n // 从 `data-*` 中获取值\n const attrs = element.attributes;\n let i = attrs.length;\n while (i--) {\n if (attrs[i]) {\n let name = attrs[i].name;\n if (name.indexOf('data-') === 0) {\n name = toCamelCase(name.slice(5));\n resultData[name] = dataAttr(element, name, resultData[name]);\n }\n }\n }\n return resultData;\n }\n // 同时设置多个值\n if (isObjectLike(key)) {\n return this.each(function () {\n data(this, key);\n });\n }\n // value 传入了 undefined\n if (arguments.length === 2 && isUndefined(value)) {\n return this;\n }\n // 设置值\n if (!isUndefined(value)) {\n return this.each(function () {\n data(this, key, value);\n });\n }\n // 获取值\n if (!this.length) {\n return undefined;\n }\n return dataAttr(this[0], key, data(this[0], key));\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport { isBoolean, isDocument, isFunction, isWindow, toElement, isBorderBox, getExtraWidth, getComputedStyleValue, isIE, } from '../utils';\nimport './css';\nimport './each';\n/**\n * 值上面的 padding、border、margin 处理\n * @param element\n * @param name\n * @param value\n * @param funcIndex\n * @param includeMargin\n * @param multiply\n */\nfunction handleExtraWidth(element, name, value, funcIndex, includeMargin, multiply) {\n // 获取元素的 padding, border, margin 宽度(两侧宽度的和)\n const getExtraWidthValue = (extra) => {\n return (getExtraWidth(element, name.toLowerCase(), extra) *\n multiply);\n };\n if (funcIndex === 2 && includeMargin) {\n value += getExtraWidthValue('margin');\n }\n if (isBorderBox(element)) {\n // IE 为 box-sizing: border-box 时,得到的值不含 border 和 padding,这里先修复\n // 仅获取时需要处理,multiply === 1 为 get\n if (isIE() && multiply === 1) {\n value += getExtraWidthValue('border');\n value += getExtraWidthValue('padding');\n }\n if (funcIndex === 0) {\n value -= getExtraWidthValue('border');\n }\n if (funcIndex === 1) {\n value -= getExtraWidthValue('border');\n value -= getExtraWidthValue('padding');\n }\n }\n else {\n if (funcIndex === 0) {\n value += getExtraWidthValue('padding');\n }\n if (funcIndex === 2) {\n value += getExtraWidthValue('border');\n value += getExtraWidthValue('padding');\n }\n }\n return value;\n}\n/**\n * 获取元素的样式值\n * @param element\n * @param name\n * @param funcIndex 0: innerWidth, innerHeight; 1: width, height; 2: outerWidth, outerHeight\n * @param includeMargin\n */\nfunction get(element, name, funcIndex, includeMargin) {\n const clientProp = `client${name}`;\n const scrollProp = `scroll${name}`;\n const offsetProp = `offset${name}`;\n const innerProp = `inner${name}`;\n // $(window).width()\n if (isWindow(element)) {\n // outerWidth, outerHeight 需要包含滚动条的宽度\n return funcIndex === 2\n ? element[innerProp]\n : toElement(document)[clientProp];\n }\n // $(document).width()\n if (isDocument(element)) {\n const doc = toElement(element);\n return Math.max(\n // @ts-ignore\n element.body[scrollProp], doc[scrollProp], \n // @ts-ignore\n element.body[offsetProp], doc[offsetProp], doc[clientProp]);\n }\n const value = parseFloat(getComputedStyleValue(element, name.toLowerCase()) || '0');\n return handleExtraWidth(element, name, value, funcIndex, includeMargin, 1);\n}\n/**\n * 设置元素的样式值\n * @param element\n * @param elementIndex\n * @param name\n * @param funcIndex 0: innerWidth, innerHeight; 1: width, height; 2: outerWidth, outerHeight\n * @param includeMargin\n * @param value\n */\nfunction set(element, elementIndex, name, funcIndex, includeMargin, value) {\n let computedValue = isFunction(value)\n ? value.call(element, elementIndex, get(element, name, funcIndex, includeMargin))\n : value;\n if (computedValue == null) {\n return;\n }\n const $element = $(element);\n const dimension = name.toLowerCase();\n // 特殊的值,不需要计算 padding、border、margin\n if (['auto', 'inherit', ''].indexOf(computedValue) > -1) {\n $element.css(dimension, computedValue);\n return;\n }\n // 其他值保留原始单位。注意:如果不使用 px 作为单位,则算出的值一般是不准确的\n const suffix = computedValue.toString().replace(/\\b[0-9.]*/, '');\n const numerical = parseFloat(computedValue);\n computedValue =\n handleExtraWidth(element, name, numerical, funcIndex, includeMargin, -1) +\n (suffix || 'px');\n $element.css(dimension, computedValue);\n}\neach(['Width', 'Height'], (_, name) => {\n each([`inner${name}`, name.toLowerCase(), `outer${name}`], (funcIndex, funcName) => {\n $.fn[funcName] = function (margin, value) {\n // 是否是赋值操作\n const isSet = arguments.length && (funcIndex < 2 || !isBoolean(margin));\n const includeMargin = margin === true || value === true;\n // 获取第一个元素的值\n if (!isSet) {\n return this.length\n ? get(this[0], name, funcIndex, includeMargin)\n : undefined;\n }\n // 设置每个元素的值\n return this.each((index, element) => set(element, index, name, funcIndex, includeMargin, margin));\n };\n });\n});\n","import $ from '../$';\nimport './css';\nimport './eq';\nimport './offset';\nimport './offsetParent';\nfunction floatStyle($element, name) {\n return parseFloat($element.css(name));\n}\n$.fn.position = function () {\n if (!this.length) {\n return undefined;\n }\n const $element = this.eq(0);\n let currentOffset;\n let parentOffset = {\n left: 0,\n top: 0,\n };\n if ($element.css('position') === 'fixed') {\n currentOffset = $element[0].getBoundingClientRect();\n }\n else {\n currentOffset = $element.offset();\n const $offsetParent = $element.offsetParent();\n parentOffset = $offsetParent.offset();\n parentOffset.top += floatStyle($offsetParent, 'border-top-width');\n parentOffset.left += floatStyle($offsetParent, 'border-left-width');\n }\n return {\n top: currentOffset.top - parentOffset.top - floatStyle($element, 'margin-top'),\n left: currentOffset.left -\n parentOffset.left -\n floatStyle($element, 'margin-left'),\n };\n};\n","import $ from '../$';\nimport extend from '../functions/extend';\nimport { isFunction } from '../utils';\nimport './css';\nimport './each';\nimport './position';\nfunction get(element) {\n if (!element.getClientRects().length) {\n return { top: 0, left: 0 };\n }\n const rect = element.getBoundingClientRect();\n const win = element.ownerDocument.defaultView;\n return {\n top: rect.top + win.pageYOffset,\n left: rect.left + win.pageXOffset,\n };\n}\nfunction set(element, value, index) {\n const $element = $(element);\n const position = $element.css('position');\n if (position === 'static') {\n $element.css('position', 'relative');\n }\n const currentOffset = get(element);\n const currentTopString = $element.css('top');\n const currentLeftString = $element.css('left');\n let currentTop;\n let currentLeft;\n const calculatePosition = (position === 'absolute' || position === 'fixed') &&\n (currentTopString + currentLeftString).indexOf('auto') > -1;\n if (calculatePosition) {\n const currentPosition = $element.position();\n currentTop = currentPosition.top;\n currentLeft = currentPosition.left;\n }\n else {\n currentTop = parseFloat(currentTopString);\n currentLeft = parseFloat(currentLeftString);\n }\n const computedValue = isFunction(value)\n ? value.call(element, index, extend({}, currentOffset))\n : value;\n $element.css({\n top: computedValue.top != null\n ? computedValue.top - currentOffset.top + currentTop\n : undefined,\n left: computedValue.left != null\n ? computedValue.left - currentOffset.left + currentLeft\n : undefined,\n });\n}\n$.fn.offset = function (value) {\n // 获取坐标\n if (!arguments.length) {\n if (!this.length) {\n return undefined;\n }\n return get(this[0]);\n }\n // 设置坐标\n return this.each(function (index) {\n set(this, value, index);\n });\n};\n","import $ from '../$';\nimport './each';\n$.fn.empty = function () {\n return this.each(function () {\n this.innerHTML = '';\n });\n};\n","import $ from '../$';\nimport each from '../functions/each';\n$.fn.extend = function (obj) {\n each(obj, (prop, value) => {\n // 在 JQ 对象上扩展方法时,需要自己添加 typescript 的类型定义\n $.fn[prop] = value;\n });\n return this;\n};\n","import $ from '../$';\nimport { isFunction, isString } from '../utils';\nimport './is';\nimport './map';\n$.fn.filter = function (selector) {\n if (isFunction(selector)) {\n return this.map((index, element) => selector.call(element, index, element) ? element : undefined);\n }\n if (isString(selector)) {\n return this.map((_, element) => $(element).is(selector) ? element : undefined);\n }\n const $selector = $(selector);\n return this.map((_, element) => $selector.get().indexOf(element) > -1 ? element : undefined);\n};\n","import $ from '../$';\nimport './eq';\n$.fn.first = function () {\n return this.eq(0);\n};\n","import $ from '../$';\nimport contains from '../functions/contains';\nimport { isString } from '../utils';\nimport './find';\n$.fn.has = function (selector) {\n const $targets = isString(selector) ? this.find(selector) : $(selector);\n const { length } = $targets;\n return this.map(function () {\n for (let i = 0; i < length; i += 1) {\n if (contains(this, $targets[i])) {\n return this;\n }\n }\n return;\n });\n};\n","import $ from '../$';\n$.fn.hasClass = function (className) {\n return this[0].classList.contains(className);\n};\n","import $ from '../$';\nimport './each';\n$.fn.hide = function () {\n return this.each(function () {\n this.style.display = 'none';\n });\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport map from '../functions/map';\nimport { isElement, isFunction, isUndefined, toElement } from '../utils';\nimport './each';\nimport './is';\neach(['val', 'html', 'text'], (nameIndex, name) => {\n const props = {\n 0: 'value',\n 1: 'innerHTML',\n 2: 'textContent',\n };\n const propName = props[nameIndex];\n function get($elements) {\n // text() 获取所有元素的文本\n if (nameIndex === 2) {\n // @ts-ignore\n return map($elements, (element) => toElement(element)[propName]).join('');\n }\n // 空集合时,val() 和 html() 返回 undefined\n if (!$elements.length) {\n return undefined;\n }\n // val() 和 html() 仅获取第一个元素的内容\n const firstElement = $elements[0];\n // select multiple 返回数组\n if (nameIndex === 0 && $(firstElement).is('select[multiple]')) {\n return map($(firstElement).find('option:checked'), (element) => element.value);\n }\n // @ts-ignore\n return firstElement[propName];\n }\n function set(element, value) {\n // text() 和 html() 赋值为 undefined,则保持原内容不变\n // val() 赋值为 undefined 则赋值为空\n if (isUndefined(value)) {\n if (nameIndex !== 0) {\n return;\n }\n value = '';\n }\n if (nameIndex === 1 && isElement(value)) {\n value = value.outerHTML;\n }\n // @ts-ignore\n element[propName] = value;\n }\n $.fn[name] = function (value) {\n // 获取值\n if (!arguments.length) {\n return get(this);\n }\n // 设置值\n return this.each((i, element) => {\n const computedValue = isFunction(value)\n ? value.call(element, i, get($(element)))\n : value;\n // value 是数组,则选中数组中的元素,反选不在数组中的元素\n if (nameIndex === 0 && Array.isArray(computedValue)) {\n // select[multiple]\n if ($(element).is('select[multiple]')) {\n map($(element).find('option'), (option) => (option.selected =\n computedValue.indexOf(option.value) >\n -1));\n }\n // 其他 checkbox, radio 等元素\n else {\n element.checked =\n computedValue.indexOf(element.value) > -1;\n }\n }\n else {\n set(element, computedValue);\n }\n });\n };\n});\n","import $ from '../$';\nimport { isString } from '../utils';\nimport './children';\nimport './eq';\nimport './get';\nimport './parent';\n$.fn.index = function (selector) {\n if (!arguments.length) {\n return this.eq(0).parent().children().get().indexOf(this[0]);\n }\n if (isString(selector)) {\n return $(selector).get().indexOf(this[0]);\n }\n return this.get().indexOf($(selector)[0]);\n};\n","import $ from '../$';\nimport './eq';\n$.fn.last = function () {\n return this.eq(-1);\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport dir from './utils/dir';\neach(['', 'All', 'Until'], (nameIndex, name) => {\n $.fn[`next${name}`] = function (selector, filter) {\n return dir(this, nameIndex, 'nextElementSibling', selector, filter);\n };\n});\n","import $ from '../$';\nimport './filter';\nimport './map';\n$.fn.not = function (selector) {\n const $excludes = this.filter(selector);\n return this.map((_, element) => $excludes.index(element) > -1 ? undefined : element);\n};\n","import $ from '../$';\nimport './css';\nimport './map';\n/**\n * 返回最近的用于定位的父元素\n */\n$.fn.offsetParent = function () {\n return this.map(function () {\n let offsetParent = this.offsetParent;\n while (offsetParent && $(offsetParent).css('position') === 'static') {\n offsetParent = offsetParent.offsetParent;\n }\n return offsetParent || document.documentElement;\n });\n};\n","import $ from '../$';\nimport './on';\n$.fn.one = function (types, selector, data, callback) {\n // @ts-ignore\n return this.on(types, selector, data, callback, true);\n};\n","import $ from '../$';\nimport each from '../functions/each';\nimport './get';\nimport dir from './utils/dir';\neach(['', 'All', 'Until'], (nameIndex, name) => {\n $.fn[`prev${name}`] = function (selector, filter) {\n // prevAll、prevUntil 需要把元素的顺序倒序处理,以便和 jQuery 的结果一致\n const $nodes = !nameIndex ? this : $(this.get().reverse());\n return dir($nodes, nameIndex, 'previousElementSibling', selector, filter);\n };\n});\n","import $ from '../$';\nimport each from '../functions/each';\nimport './each';\n$.fn.removeAttr = function (attributeName) {\n const names = attributeName.split(' ').filter((name) => name);\n return this.each(function () {\n each(names, (_, name) => {\n this.removeAttribute(name);\n });\n });\n};\n","import $ from '../$';\nimport removeData from '../functions/removeData';\nimport './each';\n$.fn.removeData = function (name) {\n return this.each(function () {\n removeData(this, name);\n });\n};\n","import $ from '../$';\nimport './each';\n$.fn.removeProp = function (name) {\n return this.each(function () {\n try {\n // @ts-ignore\n delete this[name];\n }\n catch (e) { }\n });\n};\n","import $ from '../$';\nimport './before';\nimport './clone';\nimport './each';\nimport './remove';\nimport { isFunction, isString } from '../utils';\n$.fn.replaceWith = function (newContent) {\n this.each((index, element) => {\n let content = newContent;\n if (isFunction(content)) {\n content = content.call(element, index, element.innerHTML);\n }\n else if (index && !isString(content)) {\n content = $(content).clone();\n }\n $(element).before(content);\n });\n return this.remove();\n};\n","import $ from '../$';\nimport './clone';\nimport './get';\nimport './map';\nimport './replaceWith';\n$.fn.replaceAll = function (target) {\n return $(target).map((index, element) => {\n $(element).replaceWith(index ? this.clone() : this);\n return this.get();\n });\n};\n","import $ from '../$';\nimport './each';\nimport './val';\n/**\n * 将表单元素的值组合成键值对数组\n * @returns {Array}\n */\n$.fn.serializeArray = function () {\n const result = [];\n this.each((_, element) => {\n const elements = element instanceof HTMLFormElement ? element.elements : [element];\n $(elements).each((_, element) => {\n const $element = $(element);\n const type = element.type;\n const nodeName = element.nodeName.toLowerCase();\n if (nodeName !== 'fieldset' &&\n element.name &&\n !element.disabled &&\n ['input', 'select', 'textarea', 'keygen'].indexOf(nodeName) > -1 &&\n ['submit', 'button', 'image', 'reset', 'file'].indexOf(type) === -1 &&\n (['radio', 'checkbox'].indexOf(type) === -1 ||\n element.checked)) {\n const value = $element.val();\n const valueArr = Array.isArray(value) ? value : [value];\n valueArr.forEach((value) => {\n result.push({\n name: element.name,\n value,\n });\n });\n }\n });\n });\n return result;\n};\n","import $ from '../$';\nimport param from '../functions/param';\nimport './serializeArray';\n$.fn.serialize = function () {\n return param(this.serializeArray());\n};\n","import $ from '../$';\nimport { getStyle } from '../utils';\nimport './each';\nconst elementDisplay = {};\n/**\n * 获取元素的初始 display 值,用于 .show() 方法\n * @param nodeName\n */\nfunction defaultDisplay(nodeName) {\n let element;\n let display;\n if (!elementDisplay[nodeName]) {\n element = document.createElement(nodeName);\n document.body.appendChild(element);\n display = getStyle(element, 'display');\n element.parentNode.removeChild(element);\n if (display === 'none') {\n display = 'block';\n }\n elementDisplay[nodeName] = display;\n }\n return elementDisplay[nodeName];\n}\n/**\n * 显示指定元素\n * @returns {JQ}\n */\n$.fn.show = function () {\n return this.each(function () {\n if (this.style.display === 'none') {\n this.style.display = '';\n }\n if (getStyle(this, 'display') === 'none') {\n this.style.display = defaultDisplay(this.nodeName);\n }\n });\n};\n","import $ from '../$';\nimport './add';\nimport './nextAll';\nimport './prevAll';\n/**\n * 取得同辈元素的集合\n * @param selector {String=}\n * @returns {JQ}\n */\n$.fn.siblings = function (selector) {\n return this.prevAll(selector).add(this.nextAll(selector));\n};\n","import $ from '../$';\nimport { getStyle } from '../utils';\nimport './each';\nimport './hide';\nimport './show';\n/**\n * 切换元素的显示状态\n */\n$.fn.toggle = function () {\n return this.each(function () {\n getStyle(this, 'display') === 'none' ? $(this).show() : $(this).hide();\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/each';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 强制重绘当前元素\n *\n * @example\n```js\n$('.box').reflow();\n```\n */\n reflow(): this;\n }\n}\n\n$.fn.reflow = function (this: JQ): JQ {\n return this.each(function () {\n return this.clientLeft;\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport { isNumber } from 'mdui.jq/es/utils';\nimport 'mdui.jq/es/methods/each';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 设置当前元素的 transition-duration 属性\n * @param duration 可以是带单位的值;若不带单位,则自动添加 `ms` 作为单位\n * @example\n```js\n$('.box').transition('300ms');\n$('.box').transition(300);\n```\n */\n transition(duration: string | number): this;\n }\n}\n\n$.fn.transition = function (this: JQ, duration: string | number): JQ {\n if (isNumber(duration)) {\n duration = `${duration}ms`;\n }\n\n return this.each(function () {\n this.style.webkitTransitionDuration = duration as string;\n this.style.transitionDuration = duration as string;\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport each from 'mdui.jq/es/functions/each';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/off';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 在当前元素上添加 transitionend 事件回调\n * @param callback 回调函数的参数为 `transitionend` 事件对象;`this` 指向当前元素\n * @example\n```js\n$('.box').transitionEnd(function() {\n alert('.box 元素的 transitionend 事件已触发');\n});\n```\n */\n transitionEnd(callback: (this: T, e: Event) => void): this;\n }\n}\n\n$.fn.transitionEnd = function (\n this: JQ,\n callback: (this: HTMLElement, e: Event) => void,\n): JQ {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const events = ['webkitTransitionEnd', 'transitionend'];\n\n function fireCallback(this: Element | Document | Window, e: Event): void {\n if (e.target !== this) {\n return;\n }\n\n // @ts-ignore\n callback.call(this, e);\n\n each(events, (_, event) => {\n that.off(event, fireCallback);\n });\n }\n\n each(events, (_, event) => {\n that.on(event, fireCallback);\n });\n\n return this;\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/each';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 设置当前元素的 transform-origin 属性\n * @param transformOrigin\n * @example\n```js\n$('.box').transformOrigin('top center');\n```\n */\n transformOrigin(transformOrigin: string): this;\n }\n}\n\n$.fn.transformOrigin = function (this: JQ, transformOrigin: string): JQ {\n return this.each(function () {\n this.style.webkitTransformOrigin = transformOrigin;\n this.style.transformOrigin = transformOrigin;\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/each';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 设置当前元素的 transform 属性\n * @param transform\n * @example\n```js\n$('.box').transform('rotate(90deg)');\n```\n */\n transform(transform: string): this;\n }\n}\n\n$.fn.transform = function (this: JQ, transform: string): JQ {\n return this.each(function () {\n this.style.webkitTransform = transform;\n this.style.transform = transform;\n });\n};\n","import PlainObject from 'mdui.jq/es/interfaces/PlainObject';\nimport data from 'mdui.jq/es/functions/data';\n\ntype TYPE_API_INIT = (\n this: HTMLElement,\n i: number,\n element: HTMLElement,\n) => void;\n\n/**\n * CSS 选择器和初始化函数组成的对象\n */\nconst entries: PlainObject = {};\n\n/**\n * 注册并执行初始化函数\n * @param selector CSS 选择器\n * @param apiInit 初始化函数\n * @param i 元素索引\n * @param element 元素\n */\nfunction mutation(\n selector: string,\n apiInit: TYPE_API_INIT,\n i: number,\n element: HTMLElement,\n): void {\n let selectors = data(element, '_mdui_mutation');\n\n if (!selectors) {\n selectors = [];\n data(element, '_mdui_mutation', selectors);\n }\n\n if (selectors.indexOf(selector) === -1) {\n selectors.push(selector);\n apiInit.call(element, i, element);\n }\n}\n\nexport { TYPE_API_INIT, entries, mutation };\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport each from 'mdui.jq/es/functions/each';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/is';\nimport { entries, mutation } from '../../utils/mutation';\n\ndeclare module 'mdui.jq/es/JQ' {\n interface JQ {\n /**\n * 执行在当前元素及其子元素内注册的初始化函数\n */\n mutation(): this;\n }\n}\n\n$.fn.mutation = function (this: JQ): JQ {\n return this.each((i, element) => {\n const $this = $(element);\n\n each(entries, (selector: string, apiInit) => {\n if ($this.is(selector)) {\n mutation(selector, apiInit, i, element);\n }\n\n $this.find(selector).each((i, element) => {\n mutation(selector, apiInit, i, element);\n });\n });\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/appendTo';\nimport 'mdui.jq/es/methods/addClass';\nimport '../methods/reflow';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 创建并显示遮罩,返回遮罩层的 JQ 对象\n * @param zIndex 遮罩层的 `z-index` 值,默认为 `2000`\n * @example\n```js\n$.showOverlay();\n```\n * @example\n```js\n$.showOverlay(3000);\n```\n */\n showOverlay(zIndex?: number): JQ;\n }\n}\n\n$.showOverlay = function (zIndex?: number): JQ {\n let $overlay = $('.mdui-overlay');\n\n if ($overlay.length) {\n $overlay.data('_overlay_is_deleted', false);\n\n if (!isUndefined(zIndex)) {\n $overlay.css('z-index', zIndex);\n }\n } else {\n if (isUndefined(zIndex)) {\n zIndex = 2000;\n }\n\n $overlay = $('
')\n .appendTo(document.body)\n .reflow()\n .css('z-index', zIndex);\n }\n\n let level = $overlay.data('_overlay_level') || 0;\n\n return $overlay.data('_overlay_level', ++level).addClass('mdui-overlay-show');\n};\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/remove';\nimport '../methods/transitionEnd';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 隐藏遮罩层\n *\n * 如果调用了多次 $.showOverlay() 来显示遮罩层,则也需要调用相同次数的 $.hideOverlay() 才能隐藏遮罩层。可以通过传入参数 true 来强制隐藏遮罩层。\n * @param force 是否强制隐藏遮罩\n * @example\n```js\n$.hideOverlay();\n```\n * @example\n```js\n$.hideOverlay(true);\n```\n */\n hideOverlay(force?: boolean): void;\n }\n}\n\n$.hideOverlay = function (force = false): void {\n const $overlay = $('.mdui-overlay');\n\n if (!$overlay.length) {\n return;\n }\n\n let level = force ? 1 : $overlay.data('_overlay_level');\n\n if (level > 1) {\n $overlay.data('_overlay_level', --level);\n return;\n }\n\n $overlay\n .data('_overlay_level', 0)\n .removeClass('mdui-overlay-show')\n .data('_overlay_is_deleted', true)\n .transitionEnd(() => {\n if ($overlay.data('_overlay_is_deleted')) {\n $overlay.remove();\n }\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/width';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 锁定屏页面,禁止页面滚动\n * @example\n```js\n$.lockScreen();\n```\n */\n lockScreen(): void;\n }\n}\n\n$.lockScreen = function (): void {\n const $body = $('body');\n\n // 不直接把 body 设为 box-sizing: border-box,避免污染全局样式\n const newBodyWidth = $body.width();\n let level = $body.data('_lockscreen_level') || 0;\n\n $body\n .addClass('mdui-locked')\n .width(newBodyWidth)\n .data('_lockscreen_level', ++level);\n};\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/width';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 解除页面锁定\n *\n * 如果调用了多次 $.lockScreen() 来显示遮罩层,则也需要调用相同次数的 $.unlockScreen() 才能隐藏遮罩层。可以通过传入参数 true 来强制隐藏遮罩层。\n * @param force 是否强制解除锁定\n * @example\n```js\n$.unlockScreen();\n```\n * @example\n```js\n$.unlockScreen(true);\n```\n */\n unlockScreen(force?: boolean): void;\n }\n}\n\n$.unlockScreen = function (force = false): void {\n const $body = $('body');\n let level = force ? 1 : $body.data('_lockscreen_level');\n\n if (level > 1) {\n $body.data('_lockscreen_level', --level);\n return;\n }\n\n $body.data('_lockscreen_level', 0).removeClass('mdui-locked').width('');\n};\n","import $ from 'mdui.jq/es/$';\nimport { isNull } from 'mdui.jq/es/utils';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 函数节流\n * @param fn 执行的函数\n * @param delay 最多多少毫秒执行一次\n * @example\n```js\n$.throttle(function () {\n console.log('这个函数最多 100ms 执行一次');\n}, 100)\n```\n */\n throttle(fn: () => void, delay: number): () => void;\n }\n}\n\n$.throttle = function (fn: () => void, delay = 16): () => void {\n let timer: any = null;\n\n return function (this: any, ...args: any): void {\n if (isNull(timer)) {\n timer = setTimeout(() => {\n fn.apply(this, args);\n timer = null;\n }, delay);\n }\n };\n};\n","import $ from 'mdui.jq/es/$';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport PlainObject from 'mdui.jq/es/interfaces/PlainObject';\n\ndeclare module 'mdui.jq/es/interfaces/JQStatic' {\n interface JQStatic {\n /**\n * 生成一个全局唯一的 ID\n * @param name 当该参数值对应的 guid 不存在时,会生成一个新的 guid,并返回;当该参数对应的 guid 已存在,则直接返回已有 guid\n * @example\n```js\n$.guid();\n```\n * @example\n```js\n$.guid('test');\n```\n */\n guid(name?: string): string;\n }\n}\n\nconst GUID: PlainObject = {};\n\n$.guid = function (name?: string): string {\n if (!isUndefined(name) && !isUndefined(GUID[name])) {\n return GUID[name];\n }\n\n function s4(): string {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n const guid =\n '_' +\n s4() +\n s4() +\n '-' +\n s4() +\n '-' +\n s4() +\n '-' +\n s4() +\n '-' +\n s4() +\n s4() +\n s4();\n\n if (!isUndefined(name)) {\n GUID[name] = guid;\n }\n\n return guid;\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport PlainObject from 'mdui.jq/es/interfaces/PlainObject';\nimport 'mdui.jq/es/methods/trigger';\n\n/**\n * 触发组件上的事件\n * @param eventName 事件名\n * @param componentName 组件名\n * @param target 在该元素上触发事件\n * @param instance 组件实例\n * @param parameters 事件参数\n */\nfunction componentEvent(\n eventName: string,\n componentName: string,\n target: HTMLElement | HTMLElement[] | JQ,\n instance?: any,\n parameters?: PlainObject,\n): void {\n if (!parameters) {\n parameters = {};\n }\n\n // @ts-ignore\n parameters.inst = instance;\n\n const fullEventName = `${eventName}.mdui.${componentName}`;\n\n // jQuery 事件\n // @ts-ignore\n if (typeof jQuery !== 'undefined') {\n // @ts-ignore\n jQuery(target).trigger(fullEventName, parameters);\n }\n\n const $target = $(target);\n\n // mdui.jq 事件\n $target.trigger(fullEventName, parameters);\n\n // 原生事件,供使用 addEventListener 监听\n type EventParams = {\n detail?: any;\n bubbles: boolean;\n cancelable: boolean;\n };\n\n const eventParams: EventParams = {\n bubbles: true,\n cancelable: true,\n detail: parameters,\n };\n\n const eventObject: CustomEvent = new CustomEvent(fullEventName, eventParams);\n\n // @ts-ignore\n eventObject._detail = parameters;\n\n $target[0].dispatchEvent(eventObject);\n}\n\nexport { componentEvent };\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/each';\nimport mdui from '../mdui';\nimport '../jq_extends/methods/mutation';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport { TYPE_API_INIT, entries, mutation } from '../utils/mutation';\n\ndeclare module '../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 传入了两个参数时,注册并执行初始化函数\n *\n * 没有传入参数时,执行初始化\n * @param selector CSS 选择器\n * @param apiInit 初始化函数\n * @example\n```js\nmdui.mutation();\n```\n * @example\n```js\nmdui.mutation();\n```\n */\n mutation(selector?: string, apiInit?: TYPE_API_INIT): void;\n }\n}\n\nmdui.mutation = function (selector?: string, apiInit?: TYPE_API_INIT): void {\n if (isUndefined(selector) || isUndefined(apiInit)) {\n $(document).mutation();\n return;\n }\n\n entries[selector] = apiInit!;\n $(selector).each((i, element) => mutation(selector, apiInit, i, element));\n};\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/removeClass';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isNumber } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/transitionEnd';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $window } from '../../utils/dom';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * Headroom 插件\n *\n * 请通过 `new mdui.Headroom()` 调用\n */\n Headroom: {\n /**\n * 实例化 Headroom 组件\n * @param selector CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Headroom;\n };\n }\n}\n\ntype TOLERANCE = {\n /**\n * 滚动条向下滚动多少距离开始隐藏或显示元素\n */\n down: number;\n\n /**\n * 滚动条向上滚动多少距离开始隐藏或显示元素\n */\n up: number;\n};\n\ntype OPTIONS = {\n /**\n * 滚动条滚动多少距离开始隐藏或显示元素\n */\n tolerance?: TOLERANCE | number;\n\n /**\n * 在页面顶部多少距离内滚动不会隐藏元素\n */\n offset?: number;\n\n /**\n * 初始化时添加的类\n */\n initialClass?: string;\n\n /**\n * 元素固定时添加的类\n */\n pinnedClass?: string;\n\n /**\n * 元素隐藏时添加的类\n */\n unpinnedClass?: string;\n};\n\ntype STATE = 'pinning' | 'pinned' | 'unpinning' | 'unpinned';\ntype EVENT = 'pin' | 'pinned' | 'unpin' | 'unpinned';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n tolerance: 5,\n offset: 0,\n initialClass: 'mdui-headroom',\n pinnedClass: 'mdui-headroom-pinned-top',\n unpinnedClass: 'mdui-headroom-unpinned-top',\n};\n\nclass Headroom {\n /**\n * headroom 元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * 当前 headroom 的状态\n */\n private state: STATE = 'pinned';\n\n /**\n * 当前是否启用\n */\n private isEnable = false;\n\n /**\n * 上次滚动后,垂直方向的距离\n */\n private lastScrollY = 0;\n\n /**\n * AnimationFrame ID\n */\n private rafId = 0;\n\n public constructor(\n selector: Selector | HTMLElement | ArrayLike,\n options: OPTIONS = {},\n ) {\n this.$element = $(selector).first();\n\n extend(this.options, options);\n\n // tolerance 参数若为数值,转换为对象\n const tolerance = this.options.tolerance;\n if (isNumber(tolerance)) {\n this.options.tolerance = {\n down: tolerance,\n up: tolerance,\n };\n }\n\n this.enable();\n }\n\n /**\n * 滚动时的处理\n */\n private onScroll(): void {\n this.rafId = window.requestAnimationFrame(() => {\n const currentScrollY = window.pageYOffset;\n const direction = currentScrollY > this.lastScrollY ? 'down' : 'up';\n const tolerance = (this.options.tolerance as TOLERANCE)[direction];\n const scrolled = Math.abs(currentScrollY - this.lastScrollY);\n const toleranceExceeded = scrolled >= tolerance;\n\n if (\n currentScrollY > this.lastScrollY &&\n currentScrollY >= this.options.offset! &&\n toleranceExceeded\n ) {\n this.unpin();\n } else if (\n (currentScrollY < this.lastScrollY && toleranceExceeded) ||\n currentScrollY <= this.options.offset!\n ) {\n this.pin();\n }\n\n this.lastScrollY = currentScrollY;\n });\n }\n\n /**\n * 触发组件事件\n * @param name\n */\n private triggerEvent(name: EVENT): void {\n componentEvent(name, 'headroom', this.$element, this);\n }\n\n /**\n * 动画结束的回调\n */\n private transitionEnd(): void {\n if (this.state === 'pinning') {\n this.state = 'pinned';\n this.triggerEvent('pinned');\n }\n\n if (this.state === 'unpinning') {\n this.state = 'unpinned';\n this.triggerEvent('unpinned');\n }\n }\n\n /**\n * 使元素固定住\n */\n public pin(): void {\n if (\n this.state === 'pinning' ||\n this.state === 'pinned' ||\n !this.$element.hasClass(this.options.initialClass!)\n ) {\n return;\n }\n\n this.triggerEvent('pin');\n this.state = 'pinning';\n this.$element\n .removeClass(this.options.unpinnedClass)\n .addClass(this.options.pinnedClass!)\n .transitionEnd(() => this.transitionEnd());\n }\n\n /**\n * 使元素隐藏\n */\n public unpin(): void {\n if (\n this.state === 'unpinning' ||\n this.state === 'unpinned' ||\n !this.$element.hasClass(this.options.initialClass!)\n ) {\n return;\n }\n\n this.triggerEvent('unpin');\n this.state = 'unpinning';\n this.$element\n .removeClass(this.options.pinnedClass)\n .addClass(this.options.unpinnedClass!)\n .transitionEnd(() => this.transitionEnd());\n }\n\n /**\n * 启用 headroom 插件\n */\n public enable(): void {\n if (this.isEnable) {\n return;\n }\n\n this.isEnable = true;\n this.state = 'pinned';\n this.$element\n .addClass(this.options.initialClass!)\n .removeClass(this.options.pinnedClass)\n .removeClass(this.options.unpinnedClass);\n this.lastScrollY = window.pageYOffset;\n\n $window.on('scroll', () => this.onScroll());\n }\n\n /**\n * 禁用 headroom 插件\n */\n public disable(): void {\n if (!this.isEnable) {\n return;\n }\n\n this.isEnable = false;\n this.$element\n .removeClass(this.options.initialClass)\n .removeClass(this.options.pinnedClass)\n .removeClass(this.options.unpinnedClass);\n\n $window.off('scroll', () => this.onScroll());\n window.cancelAnimationFrame(this.rafId);\n }\n\n /**\n * 获取当前状态。共包含四种状态:`pinning`、`pinned`、`unpinning`、`unpinned`\n */\n public getState(): STATE {\n return this.state;\n }\n}\n\nmdui.Headroom = Headroom;\n","import $ from 'mdui.jq/es/$';\n\nconst $document = $(document);\nconst $window = $(window);\nconst $body = $('body');\n\nexport { $document, $window, $body };\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/attr';\nimport PlainObject from 'mdui.jq/es/interfaces/PlainObject';\n\n/**\n * 解析 DATA API 参数\n * @param element 元素\n * @param name 属性名\n */\nfunction parseOptions(element: HTMLElement, name: string): PlainObject {\n const attr = $(element).attr(name);\n\n if (!attr) {\n return {};\n }\n\n return new Function(\n '',\n `var json = ${attr}; return JSON.parse(JSON.stringify(json));`,\n )();\n}\n\nexport { parseOptions };\n","import $ from 'mdui.jq/es/$';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-headroom';\n\n$(() => {\n mdui.mutation(`[${customAttr}]`, function () {\n new mdui.Headroom(this, parseOptions(this, customAttr));\n });\n});\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/children';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/eq';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/height';\nimport 'mdui.jq/es/methods/is';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parent';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/removeClass';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isNumber } from 'mdui.jq/es/utils';\nimport '../../jq_extends/methods/reflow';\nimport '../../jq_extends/methods/transition';\nimport '../../jq_extends/methods/transitionEnd';\nimport { componentEvent } from '../../utils/componentEvent';\n\ntype OPTIONS = {\n /**\n * 是否启用手风琴效果\n * 为 `true` 时,最多只能有一个面板项处于打开状态,打开一个面板项时会关闭其他面板项\n * 为 `false` 时,可同时打开多个面板项\n */\n accordion?: boolean;\n};\n\ntype EVENT = 'open' | 'opened' | 'close' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n accordion: false,\n};\n\nabstract class CollapseAbstract {\n /**\n * collapse 元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * item 的 class 名\n */\n private classItem: string;\n\n /**\n * 打开状态的 item 的 class 名\n */\n private classItemOpen: string;\n\n /**\n * item-header 的 class 名\n */\n private classHeader: string;\n\n /**\n * item-body 的 class 名\n */\n private classBody: string;\n\n /**\n * 获取继承的组件名称\n */\n protected abstract getNamespace(): string;\n\n public constructor(\n selector: Selector | HTMLElement | ArrayLike,\n options: OPTIONS = {},\n ) {\n // CSS 类名\n const classPrefix = `mdui-${this.getNamespace()}-item`;\n this.classItem = classPrefix;\n this.classItemOpen = `${classPrefix}-open`;\n this.classHeader = `${classPrefix}-header`;\n this.classBody = `${classPrefix}-body`;\n\n this.$element = $(selector).first();\n\n extend(this.options, options);\n\n this.bindEvent();\n }\n\n /**\n * 绑定事件\n */\n private bindEvent(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n\n // 点击 header 时,打开/关闭 item\n this.$element.on('click', `.${this.classHeader}`, function () {\n const $header = $(this as HTMLElement);\n const $item = $header.parent();\n const $items = that.getItems();\n\n $items.each((_, item) => {\n if ($item.is(item)) {\n that.toggle(item);\n }\n });\n });\n\n // 点击关闭按钮时,关闭 item\n this.$element.on(\n 'click',\n `[mdui-${this.getNamespace()}-item-close]`,\n function () {\n const $target = $(this as HTMLElement);\n const $item = $target.parents(`.${that.classItem}`).first();\n\n that.close($item);\n },\n );\n }\n\n /**\n * 指定 item 是否处于打开状态\n * @param $item\n */\n private isOpen($item: JQ): boolean {\n return $item.hasClass(this.classItemOpen);\n }\n\n /**\n * 获取所有 item\n */\n private getItems(): JQ {\n return this.$element.children(`.${this.classItem}`);\n }\n\n /**\n * 获取指定 item\n * @param item\n */\n private getItem(\n item: number | Selector | HTMLElement | ArrayLike,\n ): JQ {\n if (isNumber(item)) {\n return this.getItems().eq(item);\n }\n\n return $(item).first();\n }\n\n /**\n * 触发组件事件\n * @param name 事件名\n * @param $item 事件触发的目标 item\n */\n private triggerEvent(name: EVENT, $item: JQ): void {\n componentEvent(name, this.getNamespace(), $item, this);\n }\n\n /**\n * 动画结束回调\n * @param $content body 元素\n * @param $item item 元素\n */\n private transitionEnd($content: JQ, $item: JQ): void {\n if (this.isOpen($item)) {\n $content.transition(0).height('auto').reflow().transition('');\n\n this.triggerEvent('opened', $item);\n } else {\n $content.height('');\n\n this.triggerEvent('closed', $item);\n }\n }\n\n /**\n * 打开指定面板项\n * @param item 面板项的索引号、或 CSS 选择器、或 DOM 元素、或 JQ 对象\n */\n public open(\n item: number | Selector | HTMLElement | ArrayLike,\n ): void {\n const $item = this.getItem(item);\n\n if (this.isOpen($item)) {\n return;\n }\n\n // 关闭其他项\n if (this.options.accordion) {\n this.$element.children(`.${this.classItemOpen}`).each((_, element) => {\n const $element = $(element);\n\n if (!$element.is($item)) {\n this.close($element);\n }\n });\n }\n\n const $content = $item.children(`.${this.classBody}`);\n\n $content\n .height($content[0].scrollHeight)\n .transitionEnd(() => this.transitionEnd($content, $item));\n\n this.triggerEvent('open', $item);\n\n $item.addClass(this.classItemOpen);\n }\n\n /**\n * 关闭指定面板项\n * @param item 面板项的索引号、或 CSS 选择器、或 DOM 元素、或 JQ 对象\n */\n public close(\n item: number | Selector | HTMLElement | ArrayLike,\n ): void {\n const $item = this.getItem(item);\n\n if (!this.isOpen($item)) {\n return;\n }\n\n const $content = $item.children(`.${this.classBody}`);\n\n this.triggerEvent('close', $item);\n\n $item.removeClass(this.classItemOpen);\n\n $content\n .transition(0)\n .height($content[0].scrollHeight)\n .reflow()\n .transition('')\n .height('')\n .transitionEnd(() => this.transitionEnd($content, $item));\n }\n\n /**\n * 切换指定面板项的打开状态\n * @param item 面板项的索引号、或 CSS 选择器、或 DOM 元素、或 JQ 对象\n */\n public toggle(\n item: number | Selector | HTMLElement | ArrayLike,\n ): void {\n const $item = this.getItem(item);\n\n this.isOpen($item) ? this.close($item) : this.open($item);\n }\n\n /**\n * 打开所有面板项\n */\n public openAll(): void {\n this.getItems().each((_, element) => this.open(element));\n }\n\n /**\n * 关闭所有面板项\n */\n public closeAll(): void {\n this.getItems().each((_, element) => this.close(element));\n }\n}\n\nexport { OPTIONS, CollapseAbstract };\n","import Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport { CollapseAbstract, OPTIONS } from './collapseAbstract';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 折叠内容块组件\n *\n * 请通过 `new mdui.Collapse()` 调用\n */\n Collapse: {\n /**\n * 实例化 Collapse 组件\n * @param selector CSS 选择器或 DOM 元素\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Collapse;\n };\n }\n}\n\nclass Collapse extends CollapseAbstract {\n protected getNamespace(): string {\n return 'collapse';\n }\n}\n\nmdui.Collapse = Collapse;\n","import $ from 'mdui.jq/es/$';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-collapse';\n\n$(() => {\n mdui.mutation(`[${customAttr}]`, function () {\n new mdui.Collapse(this, parseOptions(this, customAttr));\n });\n});\n","import Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport { CollapseAbstract, OPTIONS } from '../collapse/collapseAbstract';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 可扩展面板组件\n *\n * 请通过 `new mdui.Panel()` 调用\n */\n Panel: {\n /**\n * 实例化 Panel 组件\n * @param selector CSS 选择器或 DOM 元素\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Panel;\n };\n }\n}\n\nclass Panel extends CollapseAbstract {\n protected getNamespace(): string {\n return 'panel';\n }\n}\n\nmdui.Panel = Panel;\n","import $ from 'mdui.jq/es/$';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-panel';\n\n$(() => {\n mdui.mutation(`[${customAttr}]`, function () {\n new mdui.Panel(this, parseOptions(this, customAttr));\n });\n});\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/add';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/eq';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/prependTo';\nimport 'mdui.jq/es/methods/remove';\nimport 'mdui.jq/es/methods/removeClass';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 动态修改了表格后,需要调用该方法重新初始化表格。\n *\n * 若传入了参数,则只初始化该参数对应的表格。若没有传入参数,则重新初始化所有表格。\n * @param selector CSS 选择器、或 DOM 元素、或 DOM 元素组成的数组、或 JQ 对象\n */\n updateTables(\n selector?: Selector | HTMLElement | ArrayLike,\n ): void;\n }\n}\n\nclass Table {\n /**\n * table 元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 表头 tr 元素\n */\n private $thRow: JQ = $();\n\n /**\n * 表格 body 中的 tr 元素\n */\n private $tdRows: JQ = $();\n\n /**\n * 表头的 checkbox 元素\n */\n private $thCheckbox: JQ = $();\n\n /**\n * 表格 body 中的 checkbox 元素\n */\n private $tdCheckboxs: JQ = $();\n\n /**\n * 表格行是否可选择\n */\n private selectable = false;\n\n /**\n * 已选中的行数\n */\n private selectedRow = 0;\n\n public constructor(\n selector: Selector | HTMLElement | ArrayLike,\n ) {\n this.$element = $(selector).first();\n this.init();\n }\n\n /**\n * 初始化表格\n */\n public init(): void {\n this.$thRow = this.$element.find('thead tr');\n this.$tdRows = this.$element.find('tbody tr');\n this.selectable = this.$element.hasClass('mdui-table-selectable');\n\n this.updateThCheckbox();\n this.updateTdCheckbox();\n this.updateNumericCol();\n }\n\n /**\n * 生成 checkbox 的 HTML 结构\n * @param tag 标签名\n */\n private createCheckboxHTML(tag: string): string {\n return (\n `<${tag} class=\"mdui-table-cell-checkbox\">` +\n '' +\n ``\n );\n }\n\n /**\n * 更新表头 checkbox 的状态\n */\n private updateThCheckboxStatus(): void {\n const checkbox = this.$thCheckbox[0];\n const selectedRow = this.selectedRow;\n const tdRowsLength = this.$tdRows.length;\n\n checkbox.checked = selectedRow === tdRowsLength;\n checkbox.indeterminate = !!selectedRow && selectedRow !== tdRowsLength;\n }\n\n /**\n * 更新表格行的 checkbox\n */\n private updateTdCheckbox(): void {\n const rowSelectedClass = 'mdui-table-row-selected';\n\n this.$tdRows.each((_, row) => {\n const $row = $(row);\n\n // 移除旧的 checkbox\n $row.find('.mdui-table-cell-checkbox').remove();\n\n if (!this.selectable) {\n return;\n }\n\n // 创建 DOM\n const $checkbox = $(this.createCheckboxHTML('td'))\n .prependTo($row)\n .find('input[type=\"checkbox\"]') as JQ;\n\n // 默认选中的行\n if ($row.hasClass(rowSelectedClass)) {\n $checkbox[0].checked = true;\n this.selectedRow++;\n }\n\n this.updateThCheckboxStatus();\n\n // 绑定事件\n $checkbox.on('change', () => {\n if ($checkbox[0].checked) {\n $row.addClass(rowSelectedClass);\n this.selectedRow++;\n } else {\n $row.removeClass(rowSelectedClass);\n this.selectedRow--;\n }\n\n this.updateThCheckboxStatus();\n });\n\n this.$tdCheckboxs = this.$tdCheckboxs.add($checkbox);\n });\n }\n\n /**\n * 更新表头的 checkbox\n */\n private updateThCheckbox(): void {\n // 移除旧的 checkbox\n this.$thRow.find('.mdui-table-cell-checkbox').remove();\n\n if (!this.selectable) {\n return;\n }\n\n this.$thCheckbox = $(this.createCheckboxHTML('th'))\n .prependTo(this.$thRow)\n .find('input[type=\"checkbox\"]')\n .on('change', () => {\n const isCheckedAll = this.$thCheckbox[0].checked;\n this.selectedRow = isCheckedAll ? this.$tdRows.length : 0;\n\n this.$tdCheckboxs.each((_, checkbox) => {\n checkbox.checked = isCheckedAll;\n });\n\n this.$tdRows.each((_, row) => {\n isCheckedAll\n ? $(row).addClass('mdui-table-row-selected')\n : $(row).removeClass('mdui-table-row-selected');\n });\n }) as JQ;\n }\n\n /**\n * 更新数值列\n */\n private updateNumericCol(): void {\n const numericClass = 'mdui-table-col-numeric';\n\n this.$thRow.find('th').each((i, th) => {\n const isNumericCol = $(th).hasClass(numericClass);\n\n this.$tdRows.each((_, row) => {\n const $td = $(row).find('td').eq(i);\n\n isNumericCol\n ? $td.addClass(numericClass)\n : $td.removeClass(numericClass);\n });\n });\n }\n}\n\nconst dataName = '_mdui_table';\n\n$(() => {\n mdui.mutation('.mdui-table', function () {\n const $element = $(this);\n\n if (!$element.data(dataName)) {\n $element.data(dataName, new Table($element));\n }\n });\n});\n\nmdui.updateTables = function (\n selector?: Selector | HTMLElement | ArrayLike,\n): void {\n const $elements = isUndefined(selector) ? $('.mdui-table') : $(selector);\n\n $elements.each((_, element) => {\n const $element = $(element);\n const instance = $element.data(dataName);\n\n if (instance) {\n instance.init();\n } else {\n $element.data(dataName, new Table($element));\n }\n });\n};\n","/**\n * touch 事件后的 500ms 内禁用 mousedown 事件\n *\n * 不支持触控的屏幕上事件顺序为 mousedown -> mouseup -> click\n * 支持触控的屏幕上事件顺序为 touchstart -> touchend -> mousedown -> mouseup -> click\n *\n * 在每一个事件中都使用 TouchHandler.isAllow(event) 判断事件是否可执行\n * 在 touchstart 和 touchmove、touchend、touchcancel\n *\n * (function () {\n * $document\n * .on(start, function (e) {\n * if (!isAllow(e)) {\n * return;\n * }\n * register(e);\n * console.log(e.type);\n * })\n * .on(move, function (e) {\n * if (!isAllow(e)) {\n * return;\n * }\n * console.log(e.type);\n * })\n * .on(end, function (e) {\n * if (!isAllow(e)) {\n * return;\n * }\n * console.log(e.type);\n * })\n * .on(unlock, register);\n * })();\n */\n\nconst startEvent = 'touchstart mousedown';\nconst moveEvent = 'touchmove mousemove';\nconst endEvent = 'touchend mouseup';\nconst cancelEvent = 'touchcancel mouseleave';\nconst unlockEvent = 'touchend touchmove touchcancel';\n\nlet touches = 0;\n\n/**\n * 该事件是否被允许,在执行事件前调用该方法判断事件是否可以执行\n * 若已触发 touch 事件,则阻止之后的鼠标事件\n * @param event\n */\nfunction isAllow(event: Event): boolean {\n return !(\n touches &&\n [\n 'mousedown',\n 'mouseup',\n 'mousemove',\n 'click',\n 'mouseover',\n 'mouseout',\n 'mouseenter',\n 'mouseleave',\n ].indexOf(event.type) > -1\n );\n}\n\n/**\n * 在 touchstart 和 touchmove、touchend、touchcancel 事件中调用该方法注册事件\n * @param event\n */\nfunction register(event: Event): void {\n if (event.type === 'touchstart') {\n // 触发了 touch 事件\n touches += 1;\n } else if (\n ['touchmove', 'touchend', 'touchcancel'].indexOf(event.type) > -1\n ) {\n // touch 事件结束 500ms 后解除对鼠标事件的阻止\n setTimeout(function () {\n if (touches) {\n touches -= 1;\n }\n }, 500);\n }\n}\n\nexport {\n startEvent,\n moveEvent,\n endEvent,\n cancelEvent,\n unlockEvent,\n isAllow,\n register,\n};\n","/**\n * Inspired by https://github.com/nolimits4web/Framework7/blob/master/src/js/fast-clicks.js\n * https://github.com/nolimits4web/Framework7/blob/master/LICENSE\n *\n * Inspired by https://github.com/fians/Waves\n */\n\nimport $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/children';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/innerHeight';\nimport 'mdui.jq/es/methods/innerWidth';\nimport 'mdui.jq/es/methods/off';\nimport 'mdui.jq/es/methods/offset';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/prependTo';\nimport 'mdui.jq/es/methods/prop';\nimport 'mdui.jq/es/methods/remove';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport '../../jq_extends/methods/reflow';\nimport '../../jq_extends/methods/transform';\nimport '../../jq_extends/methods/transitionEnd';\nimport { $document } from '../../utils/dom';\nimport {\n cancelEvent,\n endEvent,\n isAllow,\n moveEvent,\n register,\n startEvent,\n unlockEvent,\n} from '../../utils/touchHandler';\n\n/**\n * 显示涟漪动画\n * @param event\n * @param $ripple\n */\nfunction show(event: Event, $ripple: JQ): void {\n // 鼠标右键不产生涟漪\n if (event instanceof MouseEvent && event.button === 2) {\n return;\n }\n\n // 点击位置坐标\n const touchPosition =\n typeof TouchEvent !== 'undefined' &&\n event instanceof TouchEvent &&\n event.touches.length\n ? event.touches[0]\n : (event as MouseEvent);\n\n const touchStartX = touchPosition.pageX;\n const touchStartY = touchPosition.pageY;\n\n // 涟漪位置\n const offset = $ripple.offset();\n const height = $ripple.innerHeight();\n const width = $ripple.innerWidth();\n const center = {\n x: touchStartX - offset.left,\n y: touchStartY - offset.top,\n };\n const diameter = Math.max(\n Math.pow(Math.pow(height, 2) + Math.pow(width, 2), 0.5),\n 48,\n );\n\n // 涟漪扩散动画\n const translate =\n `translate3d(${-center.x + width / 2}px,` +\n `${-center.y + height / 2}px, 0) scale(1)`;\n\n // 涟漪的 DOM 结构,并缓存动画效果\n $(\n `
`,\n )\n .data('_ripple_wave_translate', translate)\n .prependTo($ripple)\n .reflow()\n .transform(translate);\n}\n\n/**\n * 隐藏并移除涟漪\n * @param $wave\n */\nfunction removeRipple($wave: JQ): void {\n if (!$wave.length || $wave.data('_ripple_wave_removed')) {\n return;\n }\n\n $wave.data('_ripple_wave_removed', true);\n\n let removeTimer = setTimeout(() => $wave.remove(), 400);\n const translate = $wave.data('_ripple_wave_translate');\n\n $wave\n .addClass('mdui-ripple-wave-fill')\n .transform(translate.replace('scale(1)', 'scale(1.01)'))\n .transitionEnd(() => {\n clearTimeout(removeTimer);\n\n $wave\n .addClass('mdui-ripple-wave-out')\n .transform(translate.replace('scale(1)', 'scale(1.01)'));\n\n removeTimer = setTimeout(() => $wave.remove(), 700);\n\n setTimeout(() => {\n $wave.transitionEnd(() => {\n clearTimeout(removeTimer);\n $wave.remove();\n });\n }, 0);\n });\n}\n\n/**\n * 隐藏涟漪动画\n * @param this\n */\nfunction hide(this: any): void {\n const $ripple = $(this as HTMLElement);\n\n $ripple.children('.mdui-ripple-wave').each((_, wave) => {\n removeRipple($(wave));\n });\n\n $ripple.off(`${moveEvent} ${endEvent} ${cancelEvent}`, hide);\n}\n\n/**\n * 显示涟漪,并绑定 touchend 等事件\n * @param event\n */\nfunction showRipple(event: Event): void {\n if (!isAllow(event)) {\n return;\n }\n\n register(event);\n\n // Chrome 59 点击滚动条时,会在 document 上触发事件\n if (event.target === document) {\n return;\n }\n\n const $target = $(event.target as HTMLElement);\n\n // 获取含 .mdui-ripple 类的元素\n const $ripple = $target.hasClass('mdui-ripple')\n ? $target\n : $target.parents('.mdui-ripple').first();\n\n if (!$ripple.length) {\n return;\n }\n\n // 禁用状态的元素上不产生涟漪效果\n if ($ripple.prop('disabled') || !isUndefined($ripple.attr('disabled'))) {\n return;\n }\n\n if (event.type === 'touchstart') {\n let hidden = false;\n\n // touchstart 触发指定时间后开始涟漪动画,避免手指滑动时也触发涟漪\n let timer = setTimeout(() => {\n timer = 0;\n show(event, $ripple);\n }, 200);\n\n const hideRipple = (): void => {\n // 如果手指没有移动,且涟漪动画还没有开始,则开始涟漪动画\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n show(event, $ripple);\n }\n\n if (!hidden) {\n hidden = true;\n hide.call($ripple);\n }\n };\n\n // 手指移动后,移除涟漪动画\n const touchMove = (): void => {\n if (timer) {\n clearTimeout(timer);\n timer = 0;\n }\n\n hideRipple();\n };\n\n $ripple.on('touchmove', touchMove).on('touchend touchcancel', hideRipple);\n } else {\n show(event, $ripple);\n $ripple.on(`${moveEvent} ${endEvent} ${cancelEvent}`, hide);\n }\n}\n\n$(() => {\n $document.on(startEvent, showRipple).on(unlockEvent, register);\n});\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/appendTo';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/is';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/outerHeight';\nimport 'mdui.jq/es/methods/parent';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/remove';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/text';\nimport 'mdui.jq/es/methods/trigger';\nimport 'mdui.jq/es/methods/val';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\nimport { $document } from '../../utils/dom';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 动态修改了文本框后,需要调用该方法重新初始化文本框。\n *\n * 若传入了参数,则只初始化该参数对应的文本框。若没有传入参数,则重新初始化所有文本框。\n * @param selector CSS 选择器、或 DOM 元素、或 DOM 元素组成的数组、或 JQ 对象\n */\n updateTextFields(\n selector?: Selector | HTMLElement | ArrayLike,\n ): void;\n }\n}\n\ntype INPUT_EVENT_DATA = {\n reInit?: boolean;\n domLoadedEvent?: boolean;\n};\n\nconst defaultData: INPUT_EVENT_DATA = {\n reInit: false,\n domLoadedEvent: false,\n};\n\n/**\n * 输入框事件\n * @param event\n * @param data\n */\nfunction inputEvent(event: Event, data: INPUT_EVENT_DATA = {}): void {\n data = extend({}, defaultData, data);\n\n const input = event.target as HTMLInputElement;\n const $input = $(input);\n const eventType = event.type;\n const value = $input.val() as string;\n\n // 文本框类型\n const inputType = $input.attr('type') || '';\n if (\n ['checkbox', 'button', 'submit', 'range', 'radio', 'image'].indexOf(\n inputType,\n ) > -1\n ) {\n return;\n }\n\n const $textfield = $input.parent('.mdui-textfield');\n\n // 输入框是否聚焦\n if (eventType === 'focus') {\n $textfield.addClass('mdui-textfield-focus');\n }\n\n if (eventType === 'blur') {\n $textfield.removeClass('mdui-textfield-focus');\n }\n\n // 输入框是否为空\n if (eventType === 'blur' || eventType === 'input') {\n value\n ? $textfield.addClass('mdui-textfield-not-empty')\n : $textfield.removeClass('mdui-textfield-not-empty');\n }\n\n // 输入框是否禁用\n input.disabled\n ? $textfield.addClass('mdui-textfield-disabled')\n : $textfield.removeClass('mdui-textfield-disabled');\n\n // 表单验证\n if (\n (eventType === 'input' || eventType === 'blur') &&\n !data.domLoadedEvent &&\n input.validity\n ) {\n input.validity.valid\n ? $textfield.removeClass('mdui-textfield-invalid-html5')\n : $textfield.addClass('mdui-textfield-invalid-html5');\n }\n\n // textarea 高度自动调整\n if ($input.is('textarea')) {\n // IE bug:textarea 的值仅为多个换行,不含其他内容时,textarea 的高度不准确\n // 此时,在计算高度前,在值的开头加入一个空格,计算完后,移除空格\n const inputValue = value;\n let hasExtraSpace = false;\n\n if (inputValue.replace(/[\\r\\n]/g, '') === '') {\n $input.val(' ' + inputValue);\n hasExtraSpace = true;\n }\n\n // 设置 textarea 高度\n $input.outerHeight('');\n const height = $input.outerHeight();\n const scrollHeight = input.scrollHeight;\n\n if (scrollHeight > height) {\n $input.outerHeight(scrollHeight);\n }\n\n // 计算完,还原 textarea 的值\n if (hasExtraSpace) {\n $input.val(inputValue);\n }\n }\n\n // 实时字数统计\n if (data.reInit) {\n $textfield.find('.mdui-textfield-counter').remove();\n }\n\n const maxLength = $input.attr('maxlength');\n if (maxLength) {\n if (data.reInit || data.domLoadedEvent) {\n $(\n '
' +\n ` / ${maxLength}` +\n '
',\n ).appendTo($textfield);\n }\n\n $textfield\n .find('.mdui-textfield-counter-inputed')\n .text(value.length.toString());\n }\n\n // 含 帮助文本、错误提示、字数统计 时,增加文本框底部内边距\n if (\n $textfield.find('.mdui-textfield-helper').length ||\n $textfield.find('.mdui-textfield-error').length ||\n maxLength\n ) {\n $textfield.addClass('mdui-textfield-has-bottom');\n }\n}\n\n$(() => {\n // 绑定事件\n $document.on(\n 'input focus blur',\n '.mdui-textfield-input',\n { useCapture: true },\n inputEvent,\n );\n\n // 可展开文本框展开\n $document.on(\n 'click',\n '.mdui-textfield-expandable .mdui-textfield-icon',\n function () {\n $(this as HTMLElement)\n .parents('.mdui-textfield')\n .addClass('mdui-textfield-expanded')\n .find('.mdui-textfield-input')[0]\n .focus();\n },\n );\n\n // 可展开文本框关闭\n $document.on(\n 'click',\n '.mdui-textfield-expanded .mdui-textfield-close',\n function () {\n $(this)\n .parents('.mdui-textfield')\n .removeClass('mdui-textfield-expanded')\n .find('.mdui-textfield-input')\n .val('');\n },\n );\n\n /**\n * 初始化文本框\n */\n mdui.mutation('.mdui-textfield', function () {\n $(this).find('.mdui-textfield-input').trigger('input', {\n domLoadedEvent: true,\n });\n });\n});\n\nmdui.updateTextFields = function (\n selector?: Selector | HTMLElement | ArrayLike,\n): void {\n const $elements = isUndefined(selector) ? $('.mdui-textfield') : $(selector);\n\n $elements.each((_, element) => {\n $(element).find('.mdui-textfield-input').trigger('input', {\n reInit: true,\n });\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/append';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/empty';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parent';\nimport 'mdui.jq/es/methods/remove';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/text';\nimport 'mdui.jq/es/methods/val';\nimport 'mdui.jq/es/methods/width';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport { $document } from '../../utils/dom';\nimport {\n endEvent,\n isAllow,\n register,\n startEvent,\n unlockEvent,\n} from '../../utils/touchHandler';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 动态修改了滑块后,需要调用该方法重新初始化滑块\n *\n * 若传入了参数,则只初始化该参数对应的滑块。若没有传入参数,则重新初始化所有滑块。\n * @param selector CSS 选择器、或 DOM 元素、或 DOM 元素组成的数组、或 JQ 对象\n */\n updateSliders(\n selector?: Selector | HTMLElement | ArrayLike,\n ): void;\n }\n}\n\n/**\n * 滑块的值改变后修改滑块样式\n * @param $slider\n */\nfunction updateValueStyle($slider: JQ): void {\n const data = $slider.data();\n\n const $track = data._slider_$track;\n const $fill = data._slider_$fill;\n const $thumb = data._slider_$thumb;\n const $input = data._slider_$input;\n const min = data._slider_min;\n const max = data._slider_max;\n const isDisabled = data._slider_disabled;\n const isDiscrete = data._slider_discrete;\n const $thumbText = data._slider_$thumbText;\n const value = $input.val();\n const percent = ((value - min) / (max - min)) * 100;\n\n $fill.width(`${percent}%`);\n $track.width(`${100 - percent}%`);\n\n if (isDisabled) {\n $fill.css('padding-right', '6px');\n $track.css('padding-left', '6px');\n }\n\n $thumb.css('left', `${percent}%`);\n\n if (isDiscrete) {\n $thumbText.text(value);\n }\n\n percent === 0\n ? $slider.addClass('mdui-slider-zero')\n : $slider.removeClass('mdui-slider-zero');\n}\n\n/**\n * 重新初始化滑块\n * @param $slider\n */\nfunction reInit($slider: JQ): void {\n const $track = $('
');\n const $fill = $('
');\n const $thumb = $('
');\n const $input = $slider.find('input[type=\"range\"]') as JQ;\n const isDisabled = $input[0].disabled;\n const isDiscrete = $slider.hasClass('mdui-slider-discrete');\n\n // 禁用状态\n isDisabled\n ? $slider.addClass('mdui-slider-disabled')\n : $slider.removeClass('mdui-slider-disabled');\n\n // 重新填充 HTML\n $slider.find('.mdui-slider-track').remove();\n $slider.find('.mdui-slider-fill').remove();\n $slider.find('.mdui-slider-thumb').remove();\n $slider.append($track).append($fill).append($thumb);\n\n // 间续型滑块\n let $thumbText = $();\n if (isDiscrete) {\n $thumbText = $('');\n $thumb.empty().append($thumbText);\n }\n\n $slider.data('_slider_$track', $track);\n $slider.data('_slider_$fill', $fill);\n $slider.data('_slider_$thumb', $thumb);\n $slider.data('_slider_$input', $input);\n $slider.data('_slider_min', $input.attr('min'));\n $slider.data('_slider_max', $input.attr('max'));\n $slider.data('_slider_disabled', isDisabled);\n $slider.data('_slider_discrete', isDiscrete);\n $slider.data('_slider_$thumbText', $thumbText);\n\n // 设置默认值\n updateValueStyle($slider);\n}\n\nconst rangeSelector = '.mdui-slider input[type=\"range\"]';\n\n$(() => {\n // 滑块滑动事件\n $document.on('input change', rangeSelector, function () {\n const $slider = $(this).parent() as JQ;\n\n updateValueStyle($slider);\n });\n\n // 开始触摸滑块事件\n $document.on(startEvent, rangeSelector, function (event: Event) {\n if (!isAllow(event)) {\n return;\n }\n\n register(event);\n\n if ((this as HTMLInputElement).disabled) {\n return;\n }\n\n const $slider = $(this).parent() as JQ;\n\n $slider.addClass('mdui-slider-focus');\n });\n\n // 结束触摸滑块事件\n $document.on(endEvent, rangeSelector, function (event: Event) {\n if (!isAllow(event)) {\n return;\n }\n\n if ((this as HTMLInputElement).disabled) {\n return;\n }\n\n const $slider = $(this).parent() as JQ;\n\n $slider.removeClass('mdui-slider-focus');\n });\n\n $document.on(unlockEvent, rangeSelector, register);\n\n /**\n * 初始化滑块\n */\n mdui.mutation('.mdui-slider', function () {\n reInit($(this));\n });\n});\n\nmdui.updateSliders = function (\n selector?: Selector | HTMLElement | ArrayLike,\n): void {\n const $elements = isUndefined(selector) ? $('.mdui-slider') : $(selector);\n\n $elements.each((_, element) => {\n reInit($(element));\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/last';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/removeClass';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/transitionEnd';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $document } from '../../utils/dom';\nimport { startEvent } from '../../utils/touchHandler';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 浮动操作按钮组件\n *\n * 请通过 `new mdui.Fab()` 调用\n */\n Fab: {\n /**\n * 实例化 Fab 组件\n * @param selector CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Fab;\n };\n }\n}\n\ntype OPTIONS = {\n /**\n * 触发方式。`hover`: 鼠标悬浮触发;`click`: 点击触发\n *\n * 默认为 `hover`\n */\n trigger?: 'click' | 'hover';\n};\n\ntype STATE = 'opening' | 'opened' | 'closing' | 'closed';\ntype EVENT = 'open' | 'opened' | 'close' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n trigger: 'hover',\n};\n\nclass Fab {\n /**\n * Fab 元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * 当前 fab 的状态\n */\n private state: STATE = 'closed';\n\n /**\n * 按钮元素\n */\n private $btn: JQ;\n\n /**\n * 拨号菜单元素\n */\n private $dial: JQ;\n\n /**\n * 拨号菜单内的按钮\n */\n private $dialBtns: JQ;\n\n public constructor(\n selector: Selector | HTMLElement | ArrayLike,\n options: OPTIONS = {},\n ) {\n this.$element = $(selector).first();\n\n extend(this.options, options);\n\n this.$btn = this.$element.find('.mdui-fab');\n this.$dial = this.$element.find('.mdui-fab-dial');\n this.$dialBtns = this.$dial.find('.mdui-fab');\n\n if (this.options.trigger === 'hover') {\n this.$btn.on('touchstart mouseenter', () => this.open());\n this.$element.on('mouseleave', () => this.close());\n }\n\n if (this.options.trigger === 'click') {\n this.$btn.on(startEvent, () => this.open());\n }\n\n // 触摸屏幕其他地方关闭快速拨号\n $document.on(startEvent, (event) => {\n if ($(event.target as HTMLElement).parents('.mdui-fab-wrapper').length) {\n return;\n }\n\n this.close();\n });\n }\n\n /**\n * 触发组件事件\n * @param name\n */\n private triggerEvent(name: EVENT): void {\n componentEvent(name, 'fab', this.$element, this);\n }\n\n /**\n * 当前是否为打开状态\n */\n private isOpen(): boolean {\n return this.state === 'opening' || this.state === 'opened';\n }\n\n /**\n * 打开快速拨号菜单\n */\n public open(): void {\n if (this.isOpen()) {\n return;\n }\n\n // 为菜单中的按钮添加不同的 transition-delay\n this.$dialBtns.each((index, btn) => {\n const delay = `${15 * (this.$dialBtns.length - index)}ms`;\n\n btn.style.transitionDelay = delay;\n btn.style.webkitTransitionDelay = delay;\n });\n\n this.$dial.css('height', 'auto').addClass('mdui-fab-dial-show');\n\n // 如果按钮中存在 .mdui-fab-opened 的图标,则进行图标切换\n if (this.$btn.find('.mdui-fab-opened').length) {\n this.$btn.addClass('mdui-fab-opened');\n }\n\n this.state = 'opening';\n this.triggerEvent('open');\n\n // 打开顺序为从下到上逐个打开,最上面的打开后才表示动画完成\n this.$dialBtns.first().transitionEnd(() => {\n if (this.$btn.hasClass('mdui-fab-opened')) {\n this.state = 'opened';\n this.triggerEvent('opened');\n }\n });\n }\n\n /**\n * 关闭快速拨号菜单\n */\n public close(): void {\n if (!this.isOpen()) {\n return;\n }\n\n // 为菜单中的按钮添加不同的 transition-delay\n this.$dialBtns.each((index, btn) => {\n const delay = `${15 * index}ms`;\n\n btn.style.transitionDelay = delay;\n btn.style.webkitTransitionDelay = delay;\n });\n\n this.$dial.removeClass('mdui-fab-dial-show');\n this.$btn.removeClass('mdui-fab-opened');\n this.state = 'closing';\n this.triggerEvent('close');\n\n // 从上往下依次关闭,最后一个关闭后才表示动画完成\n this.$dialBtns.last().transitionEnd(() => {\n if (this.$btn.hasClass('mdui-fab-opened')) {\n return;\n }\n\n this.state = 'closed';\n this.triggerEvent('closed');\n this.$dial.css('height', 0);\n });\n }\n\n /**\n * 切换快速拨号菜单的打开状态\n */\n public toggle(): void {\n this.isOpen() ? this.close() : this.open();\n }\n\n /**\n * 以动画的形式显示整个浮动操作按钮\n */\n public show(): void {\n this.$element.removeClass('mdui-fab-hide');\n }\n\n /**\n * 以动画的形式隐藏整个浮动操作按钮\n */\n public hide(): void {\n this.$element.addClass('mdui-fab-hide');\n }\n\n /**\n * 返回当前快速拨号菜单的打开状态。共包含四种状态:`opening`、`opened`、`closing`、`closed`\n */\n public getState(): STATE {\n return this.state;\n }\n}\n\nmdui.Fab = Fab;\n","import $ from 'mdui.jq/es/$';\nimport mdui from '../../mdui';\nimport { $document } from '../../utils/dom';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-fab';\n\n$(() => {\n // mouseenter 不冒泡,无法进行事件委托,这里用 mouseover 代替。\n // 不管是 click 、 mouseover 还是 touchstart ,都先初始化。\n\n $document.on(\n 'touchstart mousedown mouseover',\n `[${customAttr}]`,\n function () {\n new mdui.Fab(\n this as HTMLElement,\n parseOptions(this as HTMLElement, customAttr),\n );\n },\n );\n});\n","/**\n * 最终生成的元素结构为:\n * \n *
// $element\n * State 1 // $selected\n *
// $menu\n *
State 1
// $items\n *
State 2
\n *
State 3
\n *
\n *
\n */\n\nimport $ from 'mdui.jq/es/$';\nimport contains from 'mdui.jq/es/functions/contains';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/add';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/after';\nimport 'mdui.jq/es/methods/append';\nimport 'mdui.jq/es/methods/appendTo';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/height';\nimport 'mdui.jq/es/methods/hide';\nimport 'mdui.jq/es/methods/index';\nimport 'mdui.jq/es/methods/innerWidth';\nimport 'mdui.jq/es/methods/is';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/remove';\nimport 'mdui.jq/es/methods/removeAttr';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/show';\nimport 'mdui.jq/es/methods/text';\nimport 'mdui.jq/es/methods/trigger';\nimport 'mdui.jq/es/methods/val';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/transitionEnd';\nimport '../../jq_extends/static/guid';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $document, $window } from '../../utils/dom';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 下拉选择组件\n *\n * 请通过 `new mdui.Select()` 调用\n */\n Select: {\n /**\n * 实例化 Select 组件\n * @param selector CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Select;\n };\n }\n}\n\ntype OPTIONS = {\n /**\n * 下拉框位置:`auto`、`top`、`bottom`\n */\n position?: 'auto' | 'top' | 'bottom';\n\n /**\n * 菜单与窗口上下边框至少保持多少间距\n */\n gutter?: number;\n};\n\ntype STATE = 'closing' | 'closed' | 'opening' | 'opened';\ntype EVENT = 'open' | 'opened' | 'close' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n position: 'auto',\n gutter: 16,\n};\n\nclass Select {\n /**\n * 原生 ``\n : '') +\n (options.type === 'textarea'\n ? ``\n : '') +\n '
';\n\n const onCancelClick = (dialog: Dialog): void => {\n const value = dialog.$element.find('.mdui-textfield-input').val();\n onCancel(value, dialog);\n };\n\n const onConfirmClick = (dialog: Dialog): void => {\n const value = dialog.$element.find('.mdui-textfield-input').val();\n onConfirm(value, dialog);\n };\n\n return mdui.dialog({\n title,\n content,\n buttons: [\n {\n text: options.cancelText,\n bold: false,\n close: options.closeOnCancel,\n onClick: onCancelClick,\n },\n {\n text: options.confirmText,\n bold: false,\n close: options.closeOnConfirm,\n onClick: onConfirmClick,\n },\n ],\n cssClass: 'mdui-dialog-prompt',\n history: options.history,\n modal: options.modal,\n closeOnEsc: options.closeOnEsc,\n onOpen: (dialog) => {\n // 初始化输入框\n const $input = dialog.$element.find('.mdui-textfield-input');\n mdui.updateTextFields($input);\n\n // 聚焦到输入框\n $input[0].focus();\n\n // 捕捉文本框回车键,在单行文本框的情况下触发回调\n if (options.type !== 'textarea' && options.confirmOnEnter === true) {\n $input.on('keydown', (event) => {\n if ((event as KeyboardEvent).keyCode === 13) {\n const value = dialog.$element.find('.mdui-textfield-input').val();\n onConfirm(value, dialog);\n\n if (options.closeOnConfirm) {\n dialog.close();\n }\n\n return false;\n }\n\n return;\n });\n }\n\n // 如果是多行输入框,监听输入框的 input 事件,更新对话框高度\n if (options.type === 'textarea') {\n $input.on('input', () => dialog.handleUpdate());\n }\n\n // 有字符数限制时,加载完文本框后 DOM 会变化,需要更新对话框高度\n if (options.maxlength) {\n dialog.handleUpdate();\n }\n },\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/appendTo';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/height';\nimport 'mdui.jq/es/methods/html';\nimport 'mdui.jq/es/methods/offset';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/width';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/transformOrigin';\nimport '../../jq_extends/methods/transitionEnd';\nimport '../../jq_extends/static/guid';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $window } from '../../utils/dom';\nimport { isAllow, register, unlockEvent } from '../../utils/touchHandler';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * Tooltip 组件\n *\n * 请通过 `new mdui.Tooltip()` 调用\n */\n Tooltip: {\n /**\n * 实例化 Tooltip 组件\n * @param selector CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param options 配置参数\n */\n new (\n selector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Tooltip;\n };\n }\n}\n\ntype POSITION = 'auto' | 'bottom' | 'top' | 'left' | 'right';\n\ntype OPTIONS = {\n /**\n * Tooltip 的位置。取值范围包括 `auto`、`bottom`、`top`、`left`、`right`。\n * 为 `auto` 时,会自动判断位置。默认在下方。优先级为 `bottom` > `top` > `left` > `right`。\n * 默认为 `auto`\n */\n position?: POSITION;\n\n /**\n * 延时触发,单位毫秒。默认为 `0`,即没有延时。\n */\n delay?: number;\n\n /**\n * Tooltip 的内容\n */\n content?: string;\n};\n\ntype STATE = 'opening' | 'opened' | 'closing' | 'closed';\ntype EVENT = 'open' | 'opened' | 'close' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n position: 'auto',\n delay: 0,\n content: '',\n};\n\nclass Tooltip {\n /**\n * 触发 tooltip 元素的 JQ 对象\n */\n public $target: JQ;\n\n /**\n * tooltip 元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * 当前 tooltip 的状态\n */\n private state: STATE = 'closed';\n\n /**\n * setTimeout 的返回值\n */\n private timeoutId: any = null;\n\n public constructor(\n selector: Selector | HTMLElement | ArrayLike,\n options: OPTIONS = {},\n ) {\n this.$target = $(selector).first();\n\n extend(this.options, options);\n\n // 创建 Tooltip HTML\n this.$element = $(\n `
${\n this.options.content\n }
`,\n ).appendTo(document.body);\n\n // 绑定事件。元素处于 disabled 状态时无法触发鼠标事件,为了统一,把 touch 事件也禁用\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n this.$target\n .on('touchstart mouseenter', function (event) {\n if (that.isDisabled(this as HTMLElement)) {\n return;\n }\n\n if (!isAllow(event)) {\n return;\n }\n\n register(event);\n\n that.open();\n })\n .on('touchend mouseleave', function (event) {\n if (that.isDisabled(this as HTMLElement)) {\n return;\n }\n\n if (!isAllow(event)) {\n return;\n }\n\n that.close();\n })\n .on(unlockEvent, function (event) {\n if (that.isDisabled(this as HTMLElement)) {\n return;\n }\n\n register(event);\n });\n }\n\n /**\n * 元素是否已禁用\n * @param element\n */\n private isDisabled(element: HTMLElement): boolean {\n return (\n (element as HTMLInputElement).disabled ||\n $(element).attr('disabled') !== undefined\n );\n }\n\n /**\n * 是否是桌面设备\n */\n private isDesktop(): boolean {\n return $window.width() > 1024;\n }\n\n /**\n * 设置 Tooltip 的位置\n */\n private setPosition(): void {\n let marginLeft: number;\n let marginTop: number;\n\n // 触发的元素\n const targetProps = this.$target[0].getBoundingClientRect();\n\n // 触发的元素和 Tooltip 之间的距离\n const targetMargin = this.isDesktop() ? 14 : 24;\n\n // Tooltip 的宽度和高度\n const tooltipWidth = this.$element[0].offsetWidth;\n const tooltipHeight = this.$element[0].offsetHeight;\n\n // Tooltip 的方向\n let position: POSITION = this.options.position!;\n\n // 自动判断位置,加 2px,使 Tooltip 距离窗口边框至少有 2px 的间距\n if (position === 'auto') {\n if (\n targetProps.top +\n targetProps.height +\n targetMargin +\n tooltipHeight +\n 2 <\n $window.height()\n ) {\n position = 'bottom';\n } else if (targetMargin + tooltipHeight + 2 < targetProps.top) {\n position = 'top';\n } else if (targetMargin + tooltipWidth + 2 < targetProps.left) {\n position = 'left';\n } else if (\n targetProps.width + targetMargin + tooltipWidth + 2 <\n $window.width() - targetProps.left\n ) {\n position = 'right';\n } else {\n position = 'bottom';\n }\n }\n\n // 设置位置\n switch (position) {\n case 'bottom':\n marginLeft = -1 * (tooltipWidth / 2);\n marginTop = targetProps.height / 2 + targetMargin;\n this.$element.transformOrigin('top center');\n break;\n\n case 'top':\n marginLeft = -1 * (tooltipWidth / 2);\n marginTop =\n -1 * (tooltipHeight + targetProps.height / 2 + targetMargin);\n this.$element.transformOrigin('bottom center');\n break;\n\n case 'left':\n marginLeft = -1 * (tooltipWidth + targetProps.width / 2 + targetMargin);\n marginTop = -1 * (tooltipHeight / 2);\n this.$element.transformOrigin('center right');\n break;\n\n case 'right':\n marginLeft = targetProps.width / 2 + targetMargin;\n marginTop = -1 * (tooltipHeight / 2);\n this.$element.transformOrigin('center left');\n break;\n }\n\n const targetOffset = this.$target.offset();\n\n this.$element.css({\n top: `${targetOffset.top + targetProps.height / 2}px`,\n left: `${targetOffset.left + targetProps.width / 2}px`,\n 'margin-left': `${marginLeft}px`,\n 'margin-top': `${marginTop}px`,\n });\n }\n\n /**\n * 触发组件事件\n * @param name\n */\n private triggerEvent(name: EVENT): void {\n componentEvent(name, 'tooltip', this.$target, this);\n }\n\n /**\n * 动画结束回调\n */\n private transitionEnd(): void {\n if (this.$element.hasClass('mdui-tooltip-open')) {\n this.state = 'opened';\n this.triggerEvent('opened');\n } else {\n this.state = 'closed';\n this.triggerEvent('closed');\n }\n }\n\n /**\n * 当前 tooltip 是否为打开状态\n */\n private isOpen(): boolean {\n return this.state === 'opening' || this.state === 'opened';\n }\n\n /**\n * 执行打开 tooltip\n */\n private doOpen(): void {\n this.state = 'opening';\n this.triggerEvent('open');\n\n this.$element\n .addClass('mdui-tooltip-open')\n .transitionEnd(() => this.transitionEnd());\n }\n\n /**\n * 打开 Tooltip\n * @param options 允许每次打开时设置不同的参数\n */\n public open(options?: OPTIONS): void {\n if (this.isOpen()) {\n return;\n }\n\n const oldOptions = extend({}, this.options);\n\n if (options) {\n extend(this.options, options);\n }\n\n // tooltip 的内容有更新\n if (oldOptions.content !== this.options.content) {\n this.$element.html(this.options.content);\n }\n\n this.setPosition();\n\n if (this.options.delay) {\n this.timeoutId = setTimeout(() => this.doOpen(), this.options.delay);\n } else {\n this.timeoutId = null;\n this.doOpen();\n }\n }\n\n /**\n * 关闭 Tooltip\n */\n public close(): void {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n\n if (!this.isOpen()) {\n return;\n }\n\n this.state = 'closing';\n this.triggerEvent('close');\n\n this.$element\n .removeClass('mdui-tooltip-open')\n .transitionEnd(() => this.transitionEnd());\n }\n\n /**\n * 切换 Tooltip 的打开状态\n */\n public toggle(): void {\n this.isOpen() ? this.close() : this.open();\n }\n\n /**\n * 获取 Tooltip 状态。共包含四种状态:`opening`、`opened`、`closing`、`closed`\n */\n public getState(): STATE {\n return this.state;\n }\n}\n\nmdui.Tooltip = Tooltip;\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/on';\nimport mdui from '../../mdui';\nimport { $document } from '../../utils/dom';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-tooltip';\nconst dataName = '_mdui_tooltip';\n\n$(() => {\n // mouseenter 不能冒泡,所以这里用 mouseover 代替\n $document.on('touchstart mouseover', `[${customAttr}]`, function () {\n const $target = $(this);\n let instance = $target.data(dataName);\n\n if (!instance) {\n instance = new mdui.Tooltip(\n this as HTMLElement,\n parseOptions(this as HTMLElement, customAttr),\n );\n $target.data(dataName, instance);\n }\n });\n});\n","import $ from 'mdui.jq/es/$';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/appendTo';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/off';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/remove';\nimport { isString } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/reflow';\nimport '../../jq_extends/methods/transform';\nimport '../../jq_extends/methods/transitionEnd';\nimport { $document } from '../../utils/dom';\nimport { dequeue, queue } from '../../utils/queue';\nimport { startEvent } from '../../utils/touchHandler';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 打开一个 Snackbar\n * @param message Snackbar 的文本\n * @param options 配置参数\n */\n snackbar(message: string, options?: OPTIONS): Snackbar;\n\n /**\n * 打开一个 Snackbar\n * @param options 配置参数\n */\n snackbar(options: OPTIONS): Snackbar;\n }\n}\n\ntype OPTIONS = {\n /**\n * Snackbar 的文本。通过 `mdui.snackbar(options)` 调用时,该参数不能为空\n */\n message?: string;\n\n /**\n * 在用户没有操作时多长时间自动隐藏,单位(毫秒)。为 `0` 时表示不自动关闭,默认为 `4000`\n */\n timeout?: number;\n\n /**\n * Snackbar 的位置,默认为 `bottom`。\n * 取值范围包括:\n * `bottom`: 下方\n * `top`: 上方\n * `left-top`: 左上角\n * `left-bottom`: 左下角\n * `right-top`: 右上角\n * `right-bottom`: 右下角\n */\n position?:\n | 'bottom'\n | 'top'\n | 'left-top'\n | 'left-bottom'\n | 'right-top'\n | 'right-bottom';\n\n /**\n * 按钮的文本\n */\n buttonText?: string;\n\n /**\n * 按钮的文本颜色,可以是颜色名或颜色值,如 `red`、`#ffffff`、`rgba(255, 255, 255, 0.3)` 等。默认为 `#90CAF9`\n */\n buttonColor?: string;\n\n /**\n * 点击按钮时是否关闭 Snackbar,默认为 `true`\n */\n closeOnButtonClick?: boolean;\n\n /**\n * 点击或触摸 Snackbar 以外的区域时是否关闭 Snackbar,默认为 `true`\n */\n closeOnOutsideClick?: boolean;\n\n /**\n * 在 Snackbar 上点击的回调函数,参数为 Snackbar 的实例\n */\n onClick?: (snackbar: Snackbar) => void;\n\n /**\n * 点击 Snackbar 上的按钮时的回调函数,参数为 Snackbar 的实例\n */\n onButtonClick?: (snackbar: Snackbar) => void;\n\n /**\n * Snackbar 开始打开时的回调函数,参数为 Snackbar 的实例\n */\n onOpen?: (snackbar: Snackbar) => void;\n\n /**\n * Snackbar 打开后的回调函数,参数为 Snackbar 的实例\n */\n onOpened?: (snackbar: Snackbar) => void;\n\n /**\n * Snackbar 开始关闭时的回调函数,参数为 Snackbar 的实例\n */\n onClose?: (snackbar: Snackbar) => void;\n\n /**\n * Snackbar 关闭后的回调函数,参数为 Snackbar 的实例\n */\n onClosed?: (snackbar: Snackbar) => void;\n};\n\ntype STATE = 'opening' | 'opened' | 'closing' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n message: '',\n timeout: 4000,\n position: 'bottom',\n buttonText: '',\n buttonColor: '',\n closeOnButtonClick: true,\n closeOnOutsideClick: true,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClick: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onButtonClick: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onOpen: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onOpened: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClose: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClosed: () => {},\n};\n\n/**\n * 当前打开着的 Snackbar\n */\nlet currentInst: null | Snackbar = null;\n\n/**\n * 队列名\n */\nconst queueName = '_mdui_snackbar';\n\nclass Snackbar {\n /**\n * Snackbar 元素\n */\n public $element: JQ;\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * 当前 Snackbar 的状态\n */\n private state: STATE = 'closed';\n\n /**\n * setTimeout 的 ID\n */\n private timeoutId: any = null;\n\n public constructor(options: OPTIONS) {\n extend(this.options, options);\n\n // 按钮颜色\n let buttonColorStyle = '';\n let buttonColorClass = '';\n\n if (\n this.options.buttonColor!.indexOf('#') === 0 ||\n this.options.buttonColor!.indexOf('rgb') === 0\n ) {\n buttonColorStyle = `style=\"color:${this.options.buttonColor}\"`;\n } else if (this.options.buttonColor !== '') {\n buttonColorClass = `mdui-text-color-${this.options.buttonColor}`;\n }\n\n // 添加 HTML\n this.$element = $(\n '
' +\n `
${this.options.message}
` +\n (this.options.buttonText\n ? `${this.options.buttonText}`\n : '') +\n '
',\n ).appendTo(document.body);\n\n // 设置位置\n this.setPosition('close');\n\n this.$element.reflow().addClass(`mdui-snackbar-${this.options.position}`);\n }\n\n /**\n * 点击 Snackbar 外面的区域关闭\n * @param event\n */\n private closeOnOutsideClick(event: Event): void {\n const $target = $(event.target as HTMLElement);\n\n if (\n !$target.hasClass('mdui-snackbar') &&\n !$target.parents('.mdui-snackbar').length\n ) {\n currentInst!.close();\n }\n }\n\n /**\n * 设置 Snackbar 的位置\n * @param state\n */\n private setPosition(state: 'open' | 'close'): void {\n const snackbarHeight = this.$element[0].clientHeight;\n const position = this.options.position;\n\n let translateX;\n let translateY;\n\n // translateX\n if (position === 'bottom' || position === 'top') {\n translateX = '-50%';\n } else {\n translateX = '0';\n }\n\n // translateY\n if (state === 'open') {\n translateY = '0';\n } else {\n if (position === 'bottom') {\n translateY = snackbarHeight;\n }\n\n if (position === 'top') {\n translateY = -snackbarHeight;\n }\n\n if (position === 'left-top' || position === 'right-top') {\n translateY = -snackbarHeight - 24;\n }\n\n if (position === 'left-bottom' || position === 'right-bottom') {\n translateY = snackbarHeight + 24;\n }\n }\n\n this.$element.transform(`translate(${translateX},${translateY}px`);\n }\n\n /**\n * 打开 Snackbar\n */\n public open(): void {\n if (this.state === 'opening' || this.state === 'opened') {\n return;\n }\n\n // 如果当前有正在显示的 Snackbar,则先加入队列,等旧 Snackbar 关闭后再打开\n if (currentInst) {\n queue(queueName, () => this.open());\n return;\n }\n\n currentInst = this;\n\n // 开始打开\n this.state = 'opening';\n this.options.onOpen!(this);\n\n this.setPosition('open');\n\n this.$element.transitionEnd(() => {\n if (this.state !== 'opening') {\n return;\n }\n\n this.state = 'opened';\n this.options.onOpened!(this);\n\n // 有按钮时绑定事件\n if (this.options.buttonText) {\n this.$element.find('.mdui-snackbar-action').on('click', () => {\n this.options.onButtonClick!(this);\n if (this.options.closeOnButtonClick) {\n this.close();\n }\n });\n }\n\n // 点击 snackbar 的事件\n this.$element.on('click', (event) => {\n if (!$(event.target as HTMLElement).hasClass('mdui-snackbar-action')) {\n this.options.onClick!(this);\n }\n });\n\n // 点击 Snackbar 外面的区域关闭\n if (this.options.closeOnOutsideClick) {\n $document.on(startEvent, this.closeOnOutsideClick);\n }\n\n // 超时后自动关闭\n if (this.options.timeout) {\n this.timeoutId = setTimeout(() => this.close(), this.options.timeout);\n }\n });\n }\n\n /**\n * 关闭 Snackbar\n */\n public close(): void {\n if (this.state === 'closing' || this.state === 'closed') {\n return;\n }\n\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n\n if (this.options.closeOnOutsideClick) {\n $document.off(startEvent, this.closeOnOutsideClick);\n }\n\n this.state = 'closing';\n this.options.onClose!(this);\n\n this.setPosition('close');\n\n this.$element.transitionEnd(() => {\n if (this.state !== 'closing') {\n return;\n }\n\n currentInst = null;\n this.state = 'closed';\n this.options.onClosed!(this);\n this.$element.remove();\n dequeue(queueName);\n });\n }\n}\n\nmdui.snackbar = function (message: any, options: any = {}): Snackbar {\n if (isString(message)) {\n options.message = message;\n } else {\n options = message;\n }\n\n const instance = new Snackbar(options);\n\n instance.open();\n\n return instance;\n};\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/html';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport { isUndefined } from 'mdui.jq/es/utils';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * 如果需要修改已有的圆形进度条组件,需要调用该方法来重新初始化组件。\n *\n * 若传入了参数,则只重新初始化该参数对应的圆形进度条。若没有传入参数,则重新初始化所有圆形进度条。\n * @param selector CSS 选择器、或 DOM 元素、或 DOM 元素组成的数组、或 JQ 对象\n */\n updateSpinners(\n selector?: Selector | HTMLElement | ArrayLike,\n ): void;\n }\n}\n\n/**\n * layer 的 HTML 结构\n * @param index\n */\nfunction layerHTML(index: number | false = false): string {\n return (\n `
` +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
'\n );\n}\n\n/**\n * 填充 HTML\n * @param spinner\n */\nfunction fillHTML(spinner: HTMLElement): void {\n const $spinner = $(spinner);\n\n const layer = $spinner.hasClass('mdui-spinner-colorful')\n ? layerHTML(1) + layerHTML(2) + layerHTML(3) + layerHTML(4)\n : layerHTML();\n\n $spinner.html(layer);\n}\n\n$(() => {\n // 页面加载完后自动填充 HTML 结构\n mdui.mutation('.mdui-spinner', function () {\n fillHTML(this);\n });\n});\n\nmdui.updateSpinners = function (\n selector?: Selector | HTMLElement | ArrayLike,\n): void {\n const $elements = isUndefined(selector) ? $('.mdui-spinner') : $(selector);\n\n $elements.each(function () {\n fillHTML(this);\n });\n};\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/children';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/is';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parent';\nimport 'mdui.jq/es/methods/removeClass';\nimport mdui from '../../mdui';\nimport '../../global/mutation';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $document } from '../../utils/dom';\nimport '../headroom';\n\n$(() => {\n // 切换导航项\n $document.on('click', '.mdui-bottom-nav>a', function () {\n const $item = $(this as HTMLElement);\n const $bottomNav = $item.parent();\n\n $bottomNav.children('a').each((index, item) => {\n const isThis = $item.is(item);\n\n if (isThis) {\n componentEvent('change', 'bottomNav', $bottomNav[0], undefined, {\n index,\n });\n }\n\n isThis\n ? $(item).addClass('mdui-bottom-nav-active')\n : $(item).removeClass('mdui-bottom-nav-active');\n });\n });\n\n // 滚动时隐藏 mdui-bottom-nav-scroll-hide\n mdui.mutation('.mdui-bottom-nav-scroll-hide', function () {\n new mdui.Headroom(this, {\n pinnedClass: 'mdui-headroom-pinned-down',\n unpinnedClass: 'mdui-headroom-unpinned-down',\n });\n });\n});\n","import $ from 'mdui.jq/es/$';\nimport contains from 'mdui.jq/es/functions/contains';\nimport extend from 'mdui.jq/es/functions/extend';\nimport { JQ } from 'mdui.jq/es/JQ';\nimport 'mdui.jq/es/methods/addClass';\nimport 'mdui.jq/es/methods/attr';\nimport 'mdui.jq/es/methods/children';\nimport 'mdui.jq/es/methods/css';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/each';\nimport 'mdui.jq/es/methods/find';\nimport 'mdui.jq/es/methods/first';\nimport 'mdui.jq/es/methods/hasClass';\nimport 'mdui.jq/es/methods/height';\nimport 'mdui.jq/es/methods/is';\nimport 'mdui.jq/es/methods/on';\nimport 'mdui.jq/es/methods/parent';\nimport 'mdui.jq/es/methods/parents';\nimport 'mdui.jq/es/methods/removeClass';\nimport 'mdui.jq/es/methods/width';\nimport Selector from 'mdui.jq/es/types/Selector';\nimport mdui from '../../mdui';\nimport '../../jq_extends/methods/transformOrigin';\nimport '../../jq_extends/methods/transitionEnd';\nimport '../../jq_extends/static/throttle';\nimport { componentEvent } from '../../utils/componentEvent';\nimport { $document, $window } from '../../utils/dom';\n\ndeclare module '../../interfaces/MduiStatic' {\n interface MduiStatic {\n /**\n * Menu 组件\n *\n * 请通过 `new mdui.Menu()` 调用\n */\n Menu: {\n /**\n * 实例化 Menu 组件\n * @param anchorSelector 触发菜单的元素的 CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param menuSelector 菜单的 CSS 选择器、或 DOM 元素、或 JQ 对象\n * @param options 配置参数\n */\n new (\n anchorSelector: Selector | HTMLElement | ArrayLike,\n menuSelector: Selector | HTMLElement | ArrayLike,\n options?: OPTIONS,\n ): Menu;\n };\n }\n}\n\ntype OPTIONS = {\n /**\n * 菜单相对于触发它的元素的位置,默认为 `auto`。\n * 取值范围包括:\n * `top`: 菜单在触发它的元素的上方\n * `bottom`: 菜单在触发它的元素的下方\n * `center`: 菜单在窗口中垂直居中\n * `auto`: 自动判断位置。优先级为:`bottom` > `top` > `center`\n */\n position?: 'auto' | 'top' | 'bottom' | 'center';\n\n /**\n * 菜单与触发它的元素的对其方式,默认为 `auto`。\n * 取值范围包括:\n * `left`: 菜单与触发它的元素左对齐\n * `right`: 菜单与触发它的元素右对齐\n * `center`: 菜单在窗口中水平居中\n * `auto`: 自动判断位置:优先级为:`left` > `right` > `center`\n */\n align?: 'auto' | 'left' | 'right' | 'center';\n\n /**\n * 菜单与窗口边框至少保持多少间距,单位为 px,默认为 `16`\n */\n gutter?: number;\n\n /**\n * 菜单的定位方式,默认为 `false`。\n * 为 `true` 时,菜单使用 fixed 定位。在页面滚动时,菜单将保持在窗口固定位置,不随滚动条滚动。\n * 为 `false` 时,菜单使用 absolute 定位。在页面滚动时,菜单将随着页面一起滚动。\n */\n fixed?: boolean;\n\n /**\n * 菜单是否覆盖在触发它的元素的上面,默认为 `auto`\n * 为 `true` 时,使菜单覆盖在触发它的元素的上面\n * 为 `false` 时,使菜单不覆盖触发它的元素\n * 为 `auto` 时,简单菜单覆盖触发它的元素。级联菜单不覆盖触发它的元素\n */\n covered?: boolean | 'auto';\n\n /**\n * 子菜单的触发方式,默认为 `hover`\n * 为 `click` 时,点击时触发子菜单\n * 为 `hover` 时,鼠标悬浮时触发子菜单\n */\n subMenuTrigger?: 'click' | 'hover';\n\n /**\n * 子菜单的触发延迟时间(单位:毫秒),只有在 `subMenuTrigger: hover` 时,这个参数才有效,默认为 `200`\n */\n subMenuDelay?: number;\n};\n\ntype EVENT = 'open' | 'opened' | 'close' | 'closed';\ntype STATE = 'opening' | 'opened' | 'closing' | 'closed';\n\nconst DEFAULT_OPTIONS: OPTIONS = {\n position: 'auto',\n align: 'auto',\n gutter: 16,\n fixed: false,\n covered: 'auto',\n subMenuTrigger: 'hover',\n subMenuDelay: 200,\n};\n\nclass Menu {\n /**\n * 触发菜单的元素的 JQ 对象\n */\n public $anchor: JQ;\n\n /**\n * 菜单元素的 JQ 对象\n */\n public $element: JQ;\n\n /**\n * 配置参数\n */\n public options: OPTIONS = extend({}, DEFAULT_OPTIONS);\n\n /**\n * 当前菜单状态\n */\n private state: STATE = 'closed';\n\n /**\n * 是否是级联菜单\n */\n private isCascade: boolean;\n\n /**\n * 菜单是否覆盖在触发它的元素的上面\n */\n private isCovered: boolean;\n\n public constructor(\n anchorSelector: Selector | HTMLElement | ArrayLike,\n menuSelector: Selector | HTMLElement | ArrayLike,\n options: OPTIONS = {},\n ) {\n this.$anchor = $(anchorSelector).first();\n this.$element = $(menuSelector).first();\n\n // 触发菜单的元素 和 菜单必须是同级的元素,否则菜单可能不能定位\n if (!this.$anchor.parent().is(this.$element.parent())) {\n throw new Error('anchorSelector and menuSelector must be siblings');\n }\n\n extend(this.options, options);\n\n // 是否是级联菜单\n this.isCascade = this.$element.hasClass('mdui-menu-cascade');\n\n // covered 参数处理\n this.isCovered =\n this.options.covered === 'auto' ? !this.isCascade : this.options.covered!;\n\n // 点击触发菜单切换\n this.$anchor.on('click', () => this.toggle());\n\n // 点击菜单外面区域关闭菜单\n $document.on('click touchstart', (event: Event) => {\n const $target = $(event.target as HTMLElement);\n\n if (\n this.isOpen() &&\n !$target.is(this.$element) &&\n !contains(this.$element[0], $target[0]) &&\n !$target.is(this.$anchor) &&\n !contains(this.$anchor[0], $target[0])\n ) {\n this.close();\n }\n });\n\n // 点击不含子菜单的菜单条目关闭菜单\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n $document.on('click', '.mdui-menu-item', function () {\n const $item = $(this);\n\n if (\n !$item.find('.mdui-menu').length &&\n $item.attr('disabled') === undefined\n ) {\n that.close();\n }\n });\n\n // 绑定点击或鼠标移入含子菜单的条目的事件\n this.bindSubMenuEvent();\n\n // 窗口大小变化时,重新调整菜单位置\n $window.on(\n 'resize',\n $.throttle(() => this.readjust(), 100),\n );\n }\n\n /**\n * 是否为打开状态\n */\n private isOpen(): boolean {\n return this.state === 'opening' || this.state === 'opened';\n }\n\n /**\n * 触发组件事件\n * @param name\n */\n private triggerEvent(name: EVENT): void {\n componentEvent(name, 'menu', this.$element, this);\n }\n\n /**\n * 调整主菜单位置\n */\n private readjust(): void {\n let menuLeft;\n let menuTop;\n\n // 菜单位置和方向\n let position: 'bottom' | 'top' | 'center';\n let align: 'left' | 'right' | 'center';\n\n // window 窗口的宽度和高度\n const windowHeight = $window.height();\n const windowWidth = $window.width();\n\n // 配置参数\n const gutter = this.options.gutter!;\n const isCovered = this.isCovered;\n const isFixed = this.options.fixed;\n\n // 动画方向参数\n let transformOriginX;\n let transformOriginY;\n\n // 菜单的原始宽度和高度\n const menuWidth = this.$element.width();\n const menuHeight = this.$element.height();\n\n // 触发菜单的元素在窗口中的位置\n const anchorRect = this.$anchor[0].getBoundingClientRect();\n const anchorTop = anchorRect.top;\n const anchorLeft = anchorRect.left;\n const anchorHeight = anchorRect.height;\n const anchorWidth = anchorRect.width;\n const anchorBottom = windowHeight - anchorTop - anchorHeight;\n const anchorRight = windowWidth - anchorLeft - anchorWidth;\n\n // 触发元素相对其拥有定位属性的父元素的位置\n const anchorOffsetTop = this.$anchor[0].offsetTop;\n const anchorOffsetLeft = this.$anchor[0].offsetLeft;\n\n // 自动判断菜单位置\n if (this.options.position === 'auto') {\n if (anchorBottom + (isCovered ? anchorHeight : 0) > menuHeight + gutter) {\n // 判断下方是否放得下菜单\n position = 'bottom';\n } else if (\n anchorTop + (isCovered ? anchorHeight : 0) >\n menuHeight + gutter\n ) {\n // 判断上方是否放得下菜单\n position = 'top';\n } else {\n // 上下都放不下,居中显示\n position = 'center';\n }\n } else {\n position = this.options.position!;\n }\n\n // 自动判断菜单对齐方式\n if (this.options.align === 'auto') {\n if (anchorRight + anchorWidth > menuWidth + gutter) {\n // 判断右侧是否放得下菜单\n align = 'left';\n } else if (anchorLeft + anchorWidth > menuWidth + gutter) {\n // 判断左侧是否放得下菜单\n align = 'right';\n } else {\n // 左右都放不下,居中显示\n align = 'center';\n }\n } else {\n align = this.options.align!;\n }\n\n // 设置菜单位置\n if (position === 'bottom') {\n transformOriginY = '0';\n menuTop =\n (isCovered ? 0 : anchorHeight) +\n (isFixed ? anchorTop : anchorOffsetTop);\n } else if (position === 'top') {\n transformOriginY = '100%';\n menuTop =\n (isCovered ? anchorHeight : 0) +\n (isFixed ? anchorTop - menuHeight : anchorOffsetTop - menuHeight);\n } else {\n transformOriginY = '50%';\n\n // =====================在窗口中居中\n // 显示的菜单的高度,简单菜单高度不超过窗口高度,若超过了则在菜单内部显示滚动条\n // 级联菜单内部不允许出现滚动条\n let menuHeightTemp = menuHeight;\n\n // 简单菜单比窗口高时,限制菜单高度\n if (!this.isCascade) {\n if (menuHeight + gutter * 2 > windowHeight) {\n menuHeightTemp = windowHeight - gutter * 2;\n this.$element.height(menuHeightTemp);\n }\n }\n\n menuTop =\n (windowHeight - menuHeightTemp) / 2 +\n (isFixed ? 0 : anchorOffsetTop - anchorTop);\n }\n\n this.$element.css('top', `${menuTop}px`);\n\n // 设置菜单对齐方式\n if (align === 'left') {\n transformOriginX = '0';\n menuLeft = isFixed ? anchorLeft : anchorOffsetLeft;\n } else if (align === 'right') {\n transformOriginX = '100%';\n menuLeft = isFixed\n ? anchorLeft + anchorWidth - menuWidth\n : anchorOffsetLeft + anchorWidth - menuWidth;\n } else {\n transformOriginX = '50%';\n\n //=======================在窗口中居中\n // 显示的菜单的宽度,菜单宽度不能超过窗口宽度\n let menuWidthTemp = menuWidth;\n\n // 菜单比窗口宽,限制菜单宽度\n if (menuWidth + gutter * 2 > windowWidth) {\n menuWidthTemp = windowWidth - gutter * 2;\n this.$element.width(menuWidthTemp);\n }\n\n menuLeft =\n (windowWidth - menuWidthTemp) / 2 +\n (isFixed ? 0 : anchorOffsetLeft - anchorLeft);\n }\n\n this.$element.css('left', `${menuLeft}px`);\n\n // 设置菜单动画方向\n this.$element.transformOrigin(`${transformOriginX} ${transformOriginY}`);\n }\n\n /**\n * 调整子菜单的位置\n * @param $submenu\n */\n private readjustSubmenu($submenu: JQ): void {\n const $item = $submenu.parent('.mdui-menu-item');\n\n let submenuTop;\n let submenuLeft;\n\n // 子菜单位置和方向\n let position: 'top' | 'bottom';\n let align: 'left' | 'right';\n\n // window 窗口的宽度和高度\n const windowHeight = $window.height();\n const windowWidth = $window.width();\n\n // 动画方向参数\n let transformOriginX;\n let transformOriginY;\n\n // 子菜单的原始宽度和高度\n const submenuWidth = $submenu.width();\n const submenuHeight = $submenu.height();\n\n // 触发子菜单的菜单项的宽度高度\n const itemRect = $item[0].getBoundingClientRect();\n const itemWidth = itemRect.width;\n const itemHeight = itemRect.height;\n const itemLeft = itemRect.left;\n const itemTop = itemRect.top;\n\n // 判断菜单上下位置\n if (windowHeight - itemTop > submenuHeight) {\n // 判断下方是否放得下菜单\n position = 'bottom';\n } else if (itemTop + itemHeight > submenuHeight) {\n // 判断上方是否放得下菜单\n position = 'top';\n } else {\n // 默认放在下方\n position = 'bottom';\n }\n\n // 判断菜单左右位置\n if (windowWidth - itemLeft - itemWidth > submenuWidth) {\n // 判断右侧是否放得下菜单\n align = 'left';\n } else if (itemLeft > submenuWidth) {\n // 判断左侧是否放得下菜单\n align = 'right';\n } else {\n // 默认放在右侧\n align = 'left';\n }\n\n // 设置菜单位置\n if (position === 'bottom') {\n transformOriginY = '0';\n submenuTop = '0';\n } else if (position === 'top') {\n transformOriginY = '100%';\n submenuTop = -submenuHeight + itemHeight;\n }\n\n $submenu.css('top', `${submenuTop}px`);\n\n // 设置菜单对齐方式\n if (align === 'left') {\n transformOriginX = '0';\n submenuLeft = itemWidth;\n } else if (align === 'right') {\n transformOriginX = '100%';\n submenuLeft = -submenuWidth;\n }\n\n $submenu.css('left', `${submenuLeft}px`);\n\n // 设置菜单动画方向\n $submenu.transformOrigin(`${transformOriginX} ${transformOriginY}`);\n }\n\n /**\n * 打开子菜单\n * @param $submenu\n */\n private openSubMenu($submenu: JQ): void {\n this.readjustSubmenu($submenu);\n\n $submenu\n .addClass('mdui-menu-open')\n .parent('.mdui-menu-item')\n .addClass('mdui-menu-item-active');\n }\n\n /**\n * 关闭子菜单,及其嵌套的子菜单\n * @param $submenu\n */\n private closeSubMenu($submenu: JQ): void {\n // 关闭子菜单\n $submenu\n .removeClass('mdui-menu-open')\n .addClass('mdui-menu-closing')\n .transitionEnd(() => $submenu.removeClass('mdui-menu-closing'))\n\n // 移除激活状态的样式\n .parent('.mdui-menu-item')\n .removeClass('mdui-menu-item-active');\n\n // 循环关闭嵌套的子菜单\n $submenu.find('.mdui-menu').each((_, menu) => {\n const $subSubmenu = $(menu);\n\n $subSubmenu\n .removeClass('mdui-menu-open')\n .addClass('mdui-menu-closing')\n .transitionEnd(() => $subSubmenu.removeClass('mdui-menu-closing'))\n .parent('.mdui-menu-item')\n .removeClass('mdui-menu-item-active');\n });\n }\n\n /**\n * 切换子菜单状态\n * @param $submenu\n */\n private toggleSubMenu($submenu: JQ): void {\n $submenu.hasClass('mdui-menu-open')\n ? this.closeSubMenu($submenu)\n : this.openSubMenu($submenu);\n }\n\n /**\n * 绑定子菜单事件\n */\n private bindSubMenuEvent(): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n\n // 点击打开子菜单\n this.$element.on('click', '.mdui-menu-item', function (event) {\n const $item = $(this as HTMLElement);\n const $target = $(event.target as HTMLElement);\n\n // 禁用状态菜单不操作\n if ($item.attr('disabled') !== undefined) {\n return;\n }\n\n // 没有点击在子菜单的菜单项上时,不操作(点在了子菜单的空白区域、或分隔线上)\n if ($target.is('.mdui-menu') || $target.is('.mdui-divider')) {\n return;\n }\n\n // 阻止冒泡,点击菜单项时只在最后一级的 mdui-menu-item 上生效,不向上冒泡\n if (!$target.parents('.mdui-menu-item').first().is($item)) {\n return;\n }\n\n // 当前菜单的子菜单\n const $submenu = $item.children('.mdui-menu');\n\n // 先关闭除当前子菜单外的所有同级子菜单\n $item\n .parent('.mdui-menu')\n .children('.mdui-menu-item')\n .each((_, item) => {\n const $tmpSubmenu = $(item).children('.mdui-menu');\n\n if (\n $tmpSubmenu.length &&\n (!$submenu.length || !$tmpSubmenu.is($submenu))\n ) {\n that.closeSubMenu($tmpSubmenu);\n }\n });\n\n // 切换当前子菜单\n if ($submenu.length) {\n that.toggleSubMenu($submenu);\n }\n });\n\n if (this.options.subMenuTrigger === 'hover') {\n // 临时存储 setTimeout 对象\n let timeout: any = null;\n let timeoutOpen: any = null;\n\n this.$element.on('mouseover mouseout', '.mdui-menu-item', function (\n event,\n ) {\n const $item = $(this as HTMLElement);\n const eventType = event.type;\n const $relatedTarget = $(\n (event as MouseEvent).relatedTarget as HTMLElement,\n );\n\n // 禁用状态的菜单不操作\n if ($item.attr('disabled') !== undefined) {\n return;\n }\n\n // 用 mouseover 模拟 mouseenter\n if (eventType === 'mouseover') {\n if (\n !$item.is($relatedTarget) &&\n contains($item[0], $relatedTarget[0])\n ) {\n return;\n }\n }\n\n // 用 mouseout 模拟 mouseleave\n else if (eventType === 'mouseout') {\n if (\n $item.is($relatedTarget) ||\n contains($item[0], $relatedTarget[0])\n ) {\n return;\n }\n }\n\n // 当前菜单项下的子菜单,未必存在\n const $submenu = $item.children('.mdui-menu');\n\n // 鼠标移入菜单项时,显示菜单项下的子菜单\n if (eventType === 'mouseover') {\n if ($submenu.length) {\n // 当前子菜单准备打开时,如果当前子菜单正准备着关闭,不用再关闭了\n const tmpClose = $submenu.data('timeoutClose.mdui.menu');\n if (tmpClose) {\n clearTimeout(tmpClose);\n }\n\n // 如果当前子菜单已经打开,不操作\n if ($submenu.hasClass('mdui-menu-open')) {\n return;\n }\n\n // 当前子菜单准备打开时,其他准备打开的子菜单不用再打开了\n clearTimeout(timeoutOpen);\n\n // 准备打开当前子菜单\n timeout = timeoutOpen = setTimeout(\n () => that.openSubMenu($submenu),\n that.options.subMenuDelay,\n );\n\n $submenu.data('timeoutOpen.mdui.menu', timeout);\n }\n }\n\n // 鼠标移出菜单项时,关闭菜单项下的子菜单\n else if (eventType === 'mouseout') {\n if ($submenu.length) {\n // 鼠标移出菜单项时,如果当前菜单项下的子菜单正准备打开,不用再打开了\n const tmpOpen = $submenu.data('timeoutOpen.mdui.menu');\n if (tmpOpen) {\n clearTimeout(tmpOpen);\n }\n\n // 准备关闭当前子菜单\n timeout = setTimeout(\n () => that.closeSubMenu($submenu),\n that.options.subMenuDelay,\n );\n\n $submenu.data('timeoutClose.mdui.menu', timeout);\n }\n }\n });\n }\n }\n\n /**\n * 动画结束回调\n */\n private transitionEnd(): void {\n this.$element.removeClass('mdui-menu-closing');\n\n if (this.state === 'opening') {\n this.state = 'opened';\n this.triggerEvent('opened');\n }\n\n if (this.state === 'closing') {\n this.state = 'closed';\n this.triggerEvent('closed');\n\n // 关闭后,恢复菜单样式到默认状态,并恢复 fixed 定位\n this.$element.css({\n top: '',\n left: '',\n width: '',\n position: 'fixed',\n });\n }\n }\n\n /**\n * 切换菜单状态\n */\n public toggle(): void {\n this.isOpen() ? this.close() : this.open();\n }\n\n /**\n * 打开菜单\n */\n public open(): void {\n if (this.isOpen()) {\n return;\n }\n\n this.state = 'opening';\n this.triggerEvent('open');\n\n this.readjust();\n\n this.$element\n // 菜单隐藏状态使用使用 fixed 定位。\n .css('position', this.options.fixed ? 'fixed' : 'absolute')\n .addClass('mdui-menu-open')\n .transitionEnd(() => this.transitionEnd());\n }\n\n /**\n * 关闭菜单\n */\n public close(): void {\n if (!this.isOpen()) {\n return;\n }\n\n this.state = 'closing';\n this.triggerEvent('close');\n\n // 菜单开始关闭时,关闭所有子菜单\n this.$element.find('.mdui-menu').each((_, submenu) => {\n this.closeSubMenu($(submenu));\n });\n\n this.$element\n .removeClass('mdui-menu-open')\n .addClass('mdui-menu-closing')\n .transitionEnd(() => this.transitionEnd());\n }\n}\n\nmdui.Menu = Menu;\n","import $ from 'mdui.jq/es/$';\nimport 'mdui.jq/es/methods/data';\nimport 'mdui.jq/es/methods/on';\nimport mdui from '../../mdui';\nimport { $document } from '../../utils/dom';\nimport { parseOptions } from '../../utils/parseOptions';\nimport './index';\n\nconst customAttr = 'mdui-menu';\nconst dataName = '_mdui_menu';\n\ntype OPTIONS = {\n target: string;\n position?: 'auto' | 'top' | 'bottom' | 'center';\n align?: 'auto' | 'left' | 'right' | 'center';\n gutter?: number;\n fixed?: boolean;\n covered?: boolean | 'auto';\n subMenuTrigger?: 'click' | 'hover';\n subMenuDelay?: number;\n};\n\n$(() => {\n $document.on('click', `[${customAttr}]`, function () {\n const $this = $(this as HTMLElement);\n let instance = $this.data(dataName);\n\n if (!instance) {\n const options = parseOptions(this as HTMLElement, customAttr) as OPTIONS;\n const menuSelector = options.target;\n // @ts-ignore\n delete options.target;\n\n instance = new mdui.Menu($this, menuSelector, options);\n $this.data(dataName, instance);\n\n instance.toggle();\n }\n });\n});\n"],"names":["t","e","bubbles","cancelable","detail","n","document","createEvent","initCustomEvent","finallyConstructor","callback","constructor","this","then","value","resolve","reason","reject","allSettled","arr","length","TypeError","args","Array","prototype","slice","call","remaining","res","i","val","status","MouseEvent","initMouseEvent","window","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","Event","CustomEvent","setTimeoutFunc","setTimeout","isArray","x","Boolean","noop","Promise","fn","_state","_handled","_value","undefined","_deferreds","doResolve","handle","self","deferred","_immediateFn","cb","onFulfilled","onRejected","ret","promise","push","newValue","finale","thisArg","apply","arguments","_unhandledRejectionFn","len","Handler","done","ex","prom","promiseFinally","all","race","setImmediate","err","console","warn","globalNS","global","Error","isFunction","target","isString","isNumber","isUndefined","isNull","isWindow","Window","isDocument","Document","isElement","Element","isArrayLike","isObjectLike","toElement","documentElement","toCamelCase","string","replace","_","letter","toUpperCase","toKebabCase","replacer","toLowerCase","getComputedStyleValue","element","name","getComputedStyle","getPropertyValue","isBorderBox","getExtraWidth","direction","extra","const","position","reduce","prev","index","let","prop","parseFloat","getStyle","valueNumber","getBoundingClientRect","getChildNodesArray","parent","tempParent","createElement","innerHTML","childNodes","returnFalse","cssNumber","each","keys","Object","JQ","item","$","selector","test","readyState","body","addEventListener","html","trim","toCreate","li","tr","td","th","tbody","option","childTag","parentTag","indexOf","match","querySelectorAll","getElementById","Node","addClass","mdui","contains","container","merge","first","second","get","find","foundElements","handlers","mduiElementId","getElementId","key","parse","type","parts","split","ns","sort","join","matcherFor","RegExp","remove","types","func","removeEvent","handler","handlersInElement","id","removeEventListener","proxy","forEach","event","filter","extend","object1","objectN","unshift","object","param","obj","destructure","keyTmp","v","encodeURIComponent","trigger","extraParameters","eventObject","eventParams","isMouseEvent","_detail","_ns","dispatchEvent","globalOptions","ajaxEvents","ajaxStart","ajaxSuccess","ajaxError","ajaxComplete","isQueryStringData","method","appendQuery","url","query","ajax","options","defaults","textStatus","isCanceled","mergedOptions","data","processData","async","cache","username","password","headers","xhrFields","statusCode","dataType","contentType","timeout","location","toString","params","result1","result2","ArrayBuffer","Blob","FormData","Date","now","xhrTimeout","xhr","XMLHttpRequest","open","setRequestHeader","$2","host","onload","clearTimeout","responseData","isHttpStatusSuccess","JSON","responseText","responseType","response","onerror","statusText","onabort","abort","send","ajaxSetup","dataNS","setObjectToElement","map","elements","concat","removeData","nameItem","unique","result","dir","$elements","nameIndex","node","is","shift","add","className","getAttribute","cls","classList","setAttribute","$element","reverse","$target","parentNode","newItem","cloneNode","existingItem","nextSibling","insertBefore","off","on","one","_this","origCallback","elementId","useCapture","proxyFn","callFn","elem","preventDefault","stopPropagation","_data","eventName","clone","isMatched","matches","msMatchesSelector","$compareWith","compare","removeChild","childLength","child","appendChild","contents","content","extraChilds","$result","k","removeAttribute","style","set","children","__","childNode","eq","closest","matched","parents","rbrace","dataAttr","nodeType","handleExtraWidth","funcIndex","includeMargin","multiply","getExtraWidthValue","documentMode","clientProp","scrollProp","offsetProp","innerProp","doc","Math","max","floatStyle","css","getClientRects","top","left","rect","win","ownerDocument","defaultView","pageYOffset","pageXOffset","resultData","attrs","attributes","empty","$selector","has","$targets","hasClass","funcName","margin","isSet","elementIndex","computedValue","dimension","suffix","hide","display","propName","0","1","2","firstElement","selected","checked","outerHTML","last","not","$excludes","offsetParent","currentOffset","parentOffset","offset","$offsetParent","currentTop","currentLeft","currentTopString","currentLeftString","currentPosition","removeAttr","attributeName","names","removeProp","replaceWith","newContent","before","replaceAll","serializeArray","HTMLFormElement","nodeName","disabled","serialize","elementDisplay","show","siblings","prevAll","nextAll","toggle","reflow","clientLeft","transition","duration","webkitTransitionDuration","transitionDuration","transitionEnd","that","events","fireCallback","transformOrigin","webkitTransformOrigin","transform","webkitTransform","entries","mutation","apiInit","selectors","$this","showOverlay","zIndex","$overlay","appendTo","level","hideOverlay","force","removeClass","lockScreen","$body","newBodyWidth","width","unlockScreen","throttle","delay","timer","GUID","componentEvent","componentName","instance","parameters","inst","fullEventName","jQuery","guid","s4","floor","random","substring","Headroom","DEFAULT_OPTIONS","tolerance","down","up","enable","$document","$window","initialClass","pinnedClass","unpinnedClass","parseOptions","attr","Function","onScroll","rafId","requestAnimationFrame","currentScrollY","lastScrollY","toleranceExceeded","abs","unpin","pin","triggerEvent","state","isEnable","disable","cancelAnimationFrame","getState","customAttr","CollapseAbstract","classPrefix","getNamespace","classItem","classItemOpen","classHeader","classBody","bindEvent","accordion","$item","getItems","close","isOpen","getItem","$content","height","scrollHeight","openAll","closeAll","Collapse","Panel","Table","init","$thRow","$tdRows","selectable","updateThCheckbox","updateTdCheckbox","updateNumericCol","createCheckboxHTML","tag","updateThCheckboxStatus","checkbox","$thCheckbox","selectedRow","tdRowsLength","indeterminate","rowSelectedClass","row","$row","$checkbox","prependTo","$tdCheckboxs","isCheckedAll","numericClass","isNumericCol","$td","dataName","updateTables","startEvent","moveEvent","endEvent","cancelEvent","unlockEvent","touches","isAllow","register","$ripple","touchPosition","TouchEvent","touchStartX","pageX","touchStartY","pageY","innerHeight","innerWidth","center","diameter","pow","translate","wave","$wave","removeTimer","removeRipple","showRipple","hidden","hideRipple","defaultData","reInit","domLoadedEvent","inputEvent","input","$input","eventType","inputType","$textfield","validity","valid","inputValue","hasExtraSpace","outerHeight","maxLength","text","updateValueStyle","$slider","$track","_slider_$track","$fill","_slider_$fill","$thumb","_slider_$thumb","_slider_$input","min","_slider_min","_slider_max","isDisabled","_slider_disabled","isDiscrete","_slider_discrete","$thumbText","_slider_$thumbText","percent","append","focus","updateTextFields","rangeSelector","updateSliders","Fab","$btn","$dial","$dialBtns","btn","transitionDelay","webkitTransitionDelay","Select","$native","uniqueID","handleUpdate","gutter","readjustMenu","transformOriginY","menuMarginTop","windowHeight","elementHeight","$itemFirst","$items","itemHeight","itemMargin","parseInt","menuWidth","menuHeight","size","elementTop","menuMaxHeight","selectedIndex","menuMaxMarginTop","menuTop","$menu","margin-top","transform-origin","selectedValue","itemsData","textContent","selectedText","$selected","after","Tab","$tabs","$indicator","hash","tab","activeIndex","setActive","setIndicatorPosition","bindTabEvent","loop","$tab","clickEvent","targetId","substr","$activeTab","activeTabOffset","scrollLeft","next","$oldTabs","$newTabs","oldTabsElement","newTabsElement","Drawer","isDesktop","overlay","swipeSupport","swipe","openNavEventHandler","swipeStartX","swiping","maybeSwiping","swipeAreaWidth","setPosition","translateX","transformCSS","cleanPosition","webkitTransition","getMaxTranslateX","getTranslateX","currentX","onBodyTouchEnd","touchX","changedTouches","translateRatio","swipingState","touchmove","onBodyTouchMove","touchend","touchcancel","touchY","dXAbs","dYAbs","onBodyTouchStart","$drawer","queue","dequeue","Dialog","cancel","closeOnCancel","confirm","closeOnConfirm","history","modal","closeOnEsc","destroyOnClosed","currentInst","queueName","isLockScreen","readjust","$title","$actions","hashchangeEvent","overlayClick","destroy","doOpen","historyBack","back","keyCode","$dialog","DEFAULT_BUTTON","bold","onClick","title","buttons","stackedButtons","cssClass","onOpen","onOpened","onClose","onClosed","confirmText","dialog","buttonsHTML","HTML","cancelText","alert","onConfirm","onCancel","maxlength","defaultValue","confirmOnEnter","prompt","label","Tooltip","marginLeft","marginTop","targetProps","targetMargin","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","targetOffset","margin-left","oldOptions","timeoutId","Snackbar","buttonColorStyle","buttonColorClass","buttonColor","buttonText","message","closeOnButtonClick","closeOnOutsideClick","onButtonClick","layerHTML","fillHTML","spinner","$spinner","layer","translateY","snackbarHeight","clientHeight","snackbar","$bottomNav","isThis","Menu","anchorSelector","menuSelector","$anchor","isCascade","isCovered","covered","bindSubMenuEvent","align","fixed","updateSpinners","subMenuTrigger","subMenuDelay","menuLeft","transformOriginX","windowWidth","isFixed","anchorRect","anchorTop","anchorLeft","anchorHeight","anchorWidth","anchorBottom","anchorRight","anchorOffsetTop","offsetTop","anchorOffsetLeft","offsetLeft","menuHeightTemp","menuWidthTemp","readjustSubmenu","$submenu","submenuTop","submenuLeft","submenuWidth","submenuHeight","itemRect","itemWidth","itemLeft","itemTop","openSubMenu","closeSubMenu","menu","$subSubmenu","toggleSubMenu","$tmpSubmenu","timeoutOpen","$relatedTarget","tmpClose","tmpOpen","submenu"],"mappings":";;;;;oOAAY,SAASA,EAAEA,EAAEC,GAAGA,EAAEA,GAAG,CAACC,SAAQ,EAAGC,YAAW,EAAGC,YAAO,GAAQ,IAAIC,EAAEC,SAASC,YAAY,eAAe,OAAOF,EAAEG,gBAAgBR,EAAEC,EAAEC,QAAQD,EAAEE,WAAWF,EAAEG,QAAQC,ECGhL,SAASI,EAAmBC,GAC1B,IAAIC,EAAcC,KAAKD,YACvB,OAAOC,KAAKC,KACV,SAASC,GAEP,OAAOH,EAAYI,QAAQL,KAAYG,KAAK,WAC1C,OAAOC,KAGX,SAASE,GAEP,OAAOL,EAAYI,QAAQL,KAAYG,KAAK,WAE1C,OAAOF,EAAYM,OAAOD,OChBlC,SAASE,EAAWC,GAElB,OAAO,IADCP,KACK,SAASG,EAASE,GAC7B,IAAME,QAA6B,IAAfA,EAAIC,OACtB,OAAOH,EACL,IAAII,iBACKF,EACL,IACAA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