{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/component/iconfont.js","webpack:///./src/component/element.js","webpack:///./src/component/icon.js","webpack:///./src/config.js","webpack:///./src/component/msheader.js","webpack:///./src/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","e","a","document","getElementsByTagName","length","getAttribute","__iconfont__svg__cssinject__","write","console","log","addEventListener","indexOf","readyState","setTimeout","removeEventListener","attachEvent","documentElement","doScroll","onreadystatechange","createElement","innerHTML","setAttribute","style","position","width","height","overflow","body","firstChild","parentNode","insertBefore","appendChild","window","Element","el","className","this","opt","keys","forEach","setCss","display","arg","ele","createTextNode","eles","child","content","undefined","eventNames","handler","split","fen","oen","eventName","test","navigator","userAgent","evt","k","button","stopPropagation","h","Icon","title","setHtml","setAttr","on","iconClickHandler","MsHeader","data","icon","delay","children","message","replace","defaultOptions","offset","placement","direction","timingFunction","closeNotify","hide","Notify","selector","contentEl","options","Error","showCss","hideCss","querySelector","assign","rootel","initCss","init","header","bottom","right","left","top","setTitle","clearInterval","TimeId","timeDelay","setInterval","tid","clearTimeout","notify","ms_notify"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CA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EAAUE,IAC3DtD,SACFA,OAAO4E,UAAYD,GAGNxB","file":"notify.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","!function(d){var e,a='',t=(e=document.getElementsByTagName(\"script\"))[e.length-1].getAttribute(\"data-injectcss\");if(t&&!d.__iconfont__svg__cssinject__){d.__iconfont__svg__cssinject__=!0;try{document.write(\"\")}catch(e){console&&console.log(e)}}!function(e){if(document.addEventListener)if(~[\"complete\",\"loaded\",\"interactive\"].indexOf(document.readyState))setTimeout(e,0);else{var t=function(){document.removeEventListener(\"DOMContentLoaded\",t,!1),e()};document.addEventListener(\"DOMContentLoaded\",t,!1)}else document.attachEvent&&(o=e,i=d.document,c=!1,(a=function(){try{i.documentElement.doScroll(\"left\")}catch(e){return void setTimeout(a,50)}n()})(),i.onreadystatechange=function(){\"complete\"==i.readyState&&(i.onreadystatechange=null,n())});function n(){c||(c=!0,o())}var o,i,c,a}(function(){var e,t,n,o,i,c;(e=document.createElement(\"div\")).innerHTML=a,a=null,(t=e.getElementsByTagName(\"svg\")[0])&&(t.setAttribute(\"aria-hidden\",\"true\"),t.style.position=\"absolute\",t.style.width=0,t.style.height=0,t.style.overflow=\"hidden\",n=t,(o=document.body).firstChild?(i=n,(c=o.firstChild).parentNode.insertBefore(i,c)):o.appendChild(n))})}(window);","class Element {\r\n\tconstructor (el, className = ''){\r\n\t\tif (typeof el === 'string') {\r\n\t\t\tthis.el = document.createElement(el);\r\n\t\t\tthis.el.className = className;\r\n\t\t} else {\r\n\t\t\tthis.el = el;\r\n\t\t}\r\n\t}\r\n\r\n\tsetCss(opt = {}) {\r\n\t\tObject.keys(opt).forEach(key => {\r\n\t\t\tthis.el.style[key] = opt[key]\r\n\t\t});\r\n\t\treturn this;\r\n\t}\r\n\tsetAttr(opt = {}) {\r\n\t\t\tObject.keys(opt).forEach(key => {\r\n\t\t\tthis.el.setAttribute(key, opt[key])\r\n\t\t});\r\n\t\treturn this;\r\n\t}\r\n\tshow(){\r\n\t\tthis.setCss({display: 'block'});\r\n\t\treturn this;\r\n\t}\r\n\thide(){\r\n\t\tthis.setCss({display: 'none'});\r\n\t\treturn this;\r\n\t}\r\n\r\n\tchild(arg) {\r\n let ele;\r\n if (typeof arg === 'string') {\r\n ele = document.createTextNode(arg);\r\n } else if (arg instanceof Element) {\r\n ele = arg.el;\r\n } else {\r\n ele = document.createTextNode('');\r\n }\r\n this.el.appendChild(ele);\r\n return this;\r\n }\r\n\r\n\t\r\n children(...eles) {\r\n eles.forEach(ele => this.child(ele));\r\n return this;\r\n }\r\n\r\n\tsetHtml(content) {\r\n if (content !== undefined) {\r\n this.el.innerHTML = content;\r\n }\r\n return this;\r\n }\r\n\r\n\ton(eventNames, handler) {\r\n const [fen, ...oen] = eventNames.split('.');\r\n let eventName = fen;\r\n if (\r\n eventName === 'mousewheel' &&\r\n /Firefox/i.test(window.navigator.userAgent)\r\n ) {\r\n eventName = 'DOMMouseScroll';\r\n }\r\n this.el.addEventListener(\r\n eventName,\r\n (evt) => {\r\n handler(evt);\r\n for (let i = 0; i < oen.length; i += 1) {\r\n const k = oen[i];\r\n if (k === 'left' && evt.button !== 0) {\r\n return;\r\n }\r\n if (k === 'right' && evt.button !== 2) {\r\n return;\r\n }\r\n if (k === 'stop') {\r\n evt.stopPropagation();\r\n }\r\n }\r\n },\r\n false\r\n );\r\n return this;\r\n }\r\n}\r\n\r\nconst h = (el, className) => {\r\n\treturn new Element(el, className)\r\n}\r\n\r\nexport {\r\n\tElement,\r\n\th\r\n}","import {cssPrefix} from '@src/config';\r\nimport {h} from '@component/element';\r\n\r\nexport default class Icon {\r\n\tconstructor(className = '', title = ''){\r\n\t\tthis.el = h('i', `${cssPrefix}-icon iconfont ${className}`)\r\n\t\tthis.el.setHtml(`\r\n\t\t\r\n\t\t\t\r\n\t\t`).setAttr({\r\n\t\t\ttitle\r\n\t\t}).on('click', () => {\r\n\t\t\tthis.iconClickHandler()\r\n\t\t})\r\n\t}\r\n\r\n\ticonClickHandler(){}\r\n}","export const cssPrefix = \"ms-notify\"","import {h, Element} from './element';\r\nimport {cssPrefix} from '@src/config'\r\nimport Icon from '@component/icon';\r\n\r\nexport default class MsHeader extends Element {\r\n\tconstructor(data){\r\n\t\tsuper('div', `${cssPrefix}-header`)\r\n\t\tthis.data = data;\r\n\t\tthis.icon = new Icon('iconsearchclose', '关闭');\r\n\t\tthis.title = h('div', `${cssPrefix}-title`);\r\n\t\tconst {delay} = this.data;\r\n\t\tthis.children(this.title, this.icon.el);\r\n\t}\r\n\r\n\tsetTitle(delay){\r\n\t\tconst {message} = this.data;\r\n\t\tthis.title.setHtml(message.replace(/\\#\\{delay\\}/, delay));\r\n\t}\r\n}","\r\nimport {h} from '@component/element';\r\nimport {cssPrefix} from '@src/config';\r\nimport MsHeader from '@component/msheader'\r\nimport '@component/iconfont';\r\nimport './index.scss';\r\n\r\nconst defaultOptions = {\r\n\twidth: 320,\r\n\theight: 188,\r\n\toffset: 20,\r\n\tdelay: 5000,\r\n\tplacement: 'bottom-right', // bottom-right bottom-left top-right top-left\r\n\tdirection: 'toTop', // toTop toLeft toBottom toRight\r\n\ttimingFunction: 'ease', // linear ease ease-in ease-in-out ease-out step-start step-end\r\n\tmessage: '还有 #{delay}S 关闭'\r\n}\r\n\r\nconst HeaderHeight = 40;\r\n\r\nfunction closeNotify() {\r\n\treturn this.hide()\r\n}\r\n\r\nclass Notify {\r\n\r\n\tconstructor(selector, options = {}){\r\n\t\tif (!selector) {\r\n\t\t\tthrow new Error('selector is a required parameter')\r\n\t\t}\r\n\t\tthis.showCss = {};\r\n\t\tthis.hideCss = {};\r\n\r\n\t\tlet contentEl;\r\n\r\n\t\tif(typeof selector === 'string') {\r\n\t\t\tcontentEl = h(document.querySelector(selector))\r\n\t\t} else {\r\n\t\t\tcontentEl = h(selector)\r\n\t\t}\r\n\t\tthis.data = Object.assign({}, defaultOptions, options)\r\n\t\tconst {width, height, placement, direction, timingFunction} = this.data;\r\n\t\tthis.rootel = h('div', `${cssPrefix} ${placement} ${direction}`);\r\n\t\tconst initCss = {\r\n\t\t\twidth: `${width}px`,\r\n\t\t\theight: `${height}px`,\r\n\t\t\t'transition-timing-function': timingFunction\r\n\t\t}\r\n\r\n\t\tthis.init()\r\n\r\n\t\t\r\n\t\tthis.rootel.setCss(Object.assign({}, initCss, this.hideCss)).children(this.header = new MsHeader(this.data), contentEl)\r\n\t\tthis.header.icon.iconClickHandler = () => {\r\n\t\t\tcloseNotify.call(this)\r\n\t\t};\r\n\t\tdocument.body.appendChild(this.rootel.el);\r\n\t}\r\n\r\n\tinit(){\r\n\t\tconst {width, height, placement, direction, offset} = this.data;\r\n\t\tif (placement === 'bottom-right') {\r\n\t\t\tif (direction === 'toTop') {\r\n\t\t\t\tthis.showCss.bottom = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.bottom = `-${height + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.right = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t\tif (direction === 'toLeft') {\r\n\t\t\t\tthis.showCss.right = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.right = `-${width + offset}px`;\r\n\t\t\t\tthis.hideCss.bottom = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (placement === 'bottom-left') {\r\n\t\t\tif (direction === 'toTop') {\r\n\t\t\t\tthis.showCss.bottom = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.bottom = `-${height + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.left = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t\tif (direction === 'toRight') {\r\n\t\t\t\tthis.showCss.left = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.left = `-${width + offset}px`;\r\n\t\t\t\tthis.hideCss.bottom = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (placement === 'top-right') {\r\n\t\t\tif (direction === 'toBottom') {\r\n\t\t\t\tthis.showCss.top = `${0 + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.top = `-${height + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.right = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t\tif (direction === 'toLeft') {\r\n\t\t\t\tthis.showCss.right = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.right = `-${width + offset}px`;\r\n\t\t\t\tthis.hideCss.top = `${0 + offset + HeaderHeight}px`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (placement === 'top-left') {\r\n\t\t\tif (direction === 'toBottom') {\r\n\t\t\t\tthis.showCss.top = `${0 + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.top = `-${height + offset + HeaderHeight}px`;\r\n\t\t\t\tthis.hideCss.left = `${0 + offset}px`;\r\n\t\t\t}\r\n\t\t\tif (direction === 'toRight') {\r\n\t\t\t\tthis.showCss.left = `${0 + offset}px`;\r\n\t\t\t\tthis.hideCss.left = `-${width + offset}px`;\r\n\t\t\t\tthis.hideCss.top = `${0 + offset + HeaderHeight}px`;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshow(){\r\n\t\tconst {delay} = this.data;\r\n\r\n\t\tthis.header.setTitle(delay/1000)\r\n\t\t\r\n\t\tthis.rootel.setCss(this.showCss)\r\n\t\tclearInterval(this.TimeId)\r\n\t\tif (delay) {\r\n\t\t\tlet timeDelay = delay / 1000;\r\n\t\t\tthis.TimeId = setInterval(() => {\r\n\t\t\t\ttimeDelay = timeDelay - 1;\r\n\t\t\t\tthis.header.setTitle(timeDelay)\r\n\t\t\t\tif (timeDelay <= 0) {\r\n\t\t\t\t\tthis.hide()\r\n\t\t\t\t\tclearInterval(this.TimeId)\r\n\t\t\t\t\t\r\n\t\t\t\t\tconst tid = setTimeout(() => {\r\n\t\t\t\t\t\tthis.header.setTitle(delay / 1000);\r\n\t\t\t\t\t\tclearTimeout(tid)\r\n\t\t\t\t\t}, 1000)\r\n\t\t\t\t}\r\n\t\t\t}, 1000);\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.rootel.setCss(this.hideCss)\r\n\t}\r\n}\r\n\r\nconst notify = (selector, options = {}) =>new Notify(selector, options);\r\nif (window) {\r\n window.ms_notify = notify;\r\n}\r\n\r\nexport default Notify;\r\nexport { notify };"],"sourceRoot":""}