Comparing version 0.4.2 to 0.4.3
@@ -9,3 +9,3 @@ { | ||
"main": "dist/style/weui.css", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"authors": [ | ||
@@ -12,0 +12,0 @@ "wechat ui team" |
@@ -0,1 +1,19 @@ | ||
#### v0.4.3 (2016-07-05) | ||
- [修复] 图片上传组件无法选中图片的缺陷 | ||
- [修复] 九宫格组件少于3个时出现多余线段的缺陷 | ||
- [修复] 解决某些组件的z-index冲突,标准化z-index | ||
- [修复] 解决`pannel`图标没有对齐的问题 | ||
- [增强] demo 更新 router | ||
- [增强] autoprefixer 指定浏览器范围 | ||
详情参考: | ||
- [60873c2](https://github.com/weui/weui/commit/60873c2) fix 某些android机不能选图片的bug (issues#388) | ||
- [46235c6](https://github.com/weui/weui/commit/46235c6) #376 Fix grids top line bug with less than 2 item | ||
- [715de0e](https://github.com/weui/weui/commit/715de0e) standard weui zindex (#415) | ||
- [07187f8](https://github.com/weui/weui/commit/07187f8) verticle mediabox appmsg thumb | ||
- [4c566dd](https://github.com/weui/weui/commit/4c566dd) #401 update demo router | ||
- [d8b504d](https://github.com/weui/weui/commit/d8b504d) #401 指定 autoprefixer 浏览器范围 | ||
#### v0.4.2 (2016-04-28) | ||
@@ -2,0 +20,0 @@ |
@@ -33,2 +33,10 @@ $(function () { | ||
return $('#tpl_cell').html(); | ||
}, | ||
bind: function (){ | ||
$('.container').on('click', '#showTooltips', function (){ | ||
$('.js_tooltips').show(); | ||
setTimeout(function (){ | ||
$('.js_tooltips').hide(); | ||
}, 3000); | ||
}); | ||
} | ||
@@ -35,0 +43,0 @@ }; |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Router",[],t):"object"==typeof exports?exports.Router=t():e.Router=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(1),a=o(s),u=function(){function e(t){r(this,e),this._options={container:"#container",enter:"enter",enterTimeout:0,leave:"leave",leaveTimeout:0},this._index=1,this._$container=null,this._routes=[],this._default=null,this._options=a.extend(this._options,t),this._$container=document.querySelector(this._options.container)}return i(e,[{key:"init",value:function(){var e=this;window.addEventListener("hashchange",function(t){var n=a.getHash(t.newURL),o=history.state||{};e.go(n,o._index<=e._index)},!1),history.state&&history.state._index&&(this._index=history.state._index),this._index--;var t=a.getHash(location.href),n=this._getRoute(t);return this.go(n?t:this._default),this}},{key:"push",value:function(e){return e=a.extend({url:"*",className:"",render:a.noop,bind:a.noop},e),this._routes.push(e),this}},{key:"setDefault",value:function(e){return this._default=e,this}},{key:"go",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this._getRoute(e);if(!o)throw new Error("url "+e+" was not found");return!function(){var r="function"==typeof o.render?o.render(o.params):"",i=t._$container.hasChildNodes();i&&!function(){var e=t._$container.childNodes[0];n&&e.classList.add(t._options.leave),t._options.leaveTimeout>0?setTimeout(function(){e.parentNode.removeChild(e)},t._options.leaveTimeout):e.parentNode.removeChild(e)}();var s=document.createElement("div");o.className&&s.classList.add(o.className),s.innerHTML=r,t._$container.appendChild(s),!n&&t._options.enter&&i&&s.classList.add(t._options.enter),t._options.enterTimeout>0?setTimeout(function(){s.classList.remove(t._options.enter)},t._options.enterTimeout):s.classList.remove(t._options.enter),location.hash="#"+e;try{n?t._index--:t._index++,history.replaceState&&history.replaceState({_index:t._index},"",location.href)}catch(a){}"function"!=typeof o.bind||o.__isBind||(o.bind.call(s),o.__isBind=!0)}(),this}},{key:"_getRoute",value:function(e){for(var t=0,n=this._routes.length;n>t;t++){var o=this._routes[t],r=a.getRegExp(o.url),i=a.getParams(o.url),s=r.exec(e);if(s){o.params={};for(var u=0,c=i.length;c>u;u++){var l=i[u];o.params[l]=s[u+1]}return o}}return null}}]),e}();t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e){return-1!==e.indexOf("#")?e.substring(e.indexOf("#")+1):"/"}function r(){}function i(e){var t=/\((.*?)\)/g,n=/(\(\?)?:\w+/g,o=/\*\w+/g,r=/[\-{}\[\]+?.,\\\^$|#\s]/g;return e=e.replace(r,"\\$&").replace(t,"(?:$1)?").replace(n,function(e,t){return t?e:"([^/?]+)"}).replace(o,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")}function s(e){for(var t=/:(\w+)/g,n=[],o=void 0;null!==(o=t.exec(e));)n.push(o[1]);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.extend=n,t.getHash=o,t.noop=r,t.getRegExp=i,t.getParams=s}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Router",[],t):"object"==typeof exports?exports.Router=t():e.Router=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),s=r(u),l=function(){function e(t){o(this,e),this._options={container:"#container",enter:"enter",enterTimeout:0,leave:"leave",leaveTimeout:0},this._index=1,this._$container=null,this._routes=[],this._default=null,this._options=i({},this._options,t),this._$container=document.querySelector(this._options.container)}return a(e,[{key:"init",value:function(){var e=this;window.addEventListener("hashchange",function(t){var n=s.getHash(t.newURL),r=history.state||{};e.go(n,r._index<=e._index)},!1),history.state&&history.state._index&&(this._index=history.state._index),this._index--;var t=s.getHash(location.href),n=s.getRoute(this._routes,t);return this.go(n?t:this._default),this}},{key:"push",value:function(e){var t=this._routes.filter(function(t){return t.url===e.url})[0];if(t)throw new Error("route "+e.url+" is existed");return e=i({},{url:"*",className:"",render:s.noop,bind:s.noop},e),this._routes.push(e),this}},{key:"setDefault",value:function(e){return this._default=e,this}},{key:"go",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=s.getRoute(this._routes,e);if(!r)throw new Error("url "+e+" was not found");return!function(){var o=function(e){e&&!function(){var e=t._$container.children[0];n&&e.classList.add(t._options.leave),t._options.leaveTimeout>0?setTimeout(function(){e.parentNode.removeChild(e)},t._options.leaveTimeout):e.parentNode.removeChild(e)}()},i=function(o,i){var a=document.createElement("div");r.className&&a.classList.add(r.className),a.innerHTML=i,t._$container.appendChild(a),!n&&t._options.enter&&o&&a.classList.add(t._options.enter),t._options.enterTimeout>0?setTimeout(function(){a.classList.remove(t._options.enter)},t._options.enterTimeout):a.classList.remove(t._options.enter),location.hash="#"+e;try{n?t._index--:t._index++,history.replaceState&&history.replaceState({_index:t._index},"",location.href)}catch(u){}"function"==typeof r.bind&&r.bind.call(a)},a=s.hasChildren(t._$container);o(a);var u=function(e){var t=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(e)throw e;i(a,t)},l=r.render(u);l&&"function"==typeof l.then?l.then(function(e){u(null,e)},u):0===r.render.length&&u(null,l)}(),this}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return-1!==e.indexOf("#")?e.substring(e.indexOf("#")+1):"/"}function i(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n],i=[],a=(0,l["default"])(o.url,i),u=a.exec(t);if(u){o.params={};for(var s=0,c=i.length;c>s;s++){var f=i[s],p=f.name;o.params[p]=u[s+1]}return o}}return null}function a(e){var t=e.children;return t.length>0}function u(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=o,t.getRoute=i,t.hasChildren=a,t.noop=u;var s=n(2),l=r(s)},function(e,t,n){function r(e){for(var t,n=[],r=0,o=0,i="";null!=(t=x.exec(e));){var a=t[0],u=t[1],l=t.index;if(i+=e.slice(o,l),o=l+a.length,u)i+=u[1];else{var c=e[o],f=t[2],p=t[3],h=t[4],d=t[5],v=t[6],g=t[7];null!=f&&null!=c&&c!==f&&(i+=f,f=null),i&&(n.push(i),i="");var y="+"===v||"*"===v,_="?"===v||"*"===v,m=t[2]||"/",w=h||d||(g?".*":"[^"+m+"]+?");n.push({name:p||r++,prefix:f||"",delimiter:m,optional:_,repeat:y,pattern:s(w)})}}return o<e.length&&(i+=e.substr(o)),i&&n.push(i),n}function o(e){return a(r(e))}function i(e){return encodeURI(e).replace(/[\/?#'"]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function a(e){for(var t=new Array(e.length),n=0;n<e.length;n++)"object"==typeof e[n]&&(t[n]=new RegExp("^"+e[n].pattern+"$"));return function(n,r){for(var o="",a=n||{},u=r||{},s=u.pretty?i:encodeURIComponent,l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var f,p=a[c.name];if(null==p){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to be defined')}if(g(p)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received "'+p+'"');if(0===p.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var h=0;h<p.length;h++){if(f=s(p[h]),!t[l].test(f))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');o+=(0===h?c.prefix:c.delimiter)+f}}else{if(f=s(p),!t[l].test(f))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');o+=c.prefix+f}}else o+=c}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function s(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function c(e){return e.sensitive?"":"i"}function f(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return l(e,t)}function p(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(v(e[o],t,n).source);var i=new RegExp("(?:"+r.join("|")+")",c(n));return l(i,t)}function h(e,t,n){for(var o=r(e),i=d(o,n),a=0;a<o.length;a++)"string"!=typeof o[a]&&t.push(o[a]);return l(i,t)}function d(e,t){t=t||{};for(var n=t.strict,r=t.end!==!1,o="",i=e[e.length-1],a="string"==typeof i&&/\/$/.test(i),s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)o+=u(l);else{var f=u(l.prefix),p=l.pattern;l.repeat&&(p+="(?:"+f+p+")*"),p=l.optional?f?"(?:"+f+"("+p+"))?":"("+p+")?":f+"("+p+")",o+=p}}return n||(o=(a?o.slice(0,-2):o)+"(?:\\/(?=$))?"),o+=r?"$":n&&a?"":"(?=\\/|$)",new RegExp("^"+o,c(t))}function v(e,t,n){return t=t||[],g(t)?n||(n={}):(n=t,t=[]),e instanceof RegExp?f(e,t):g(e)?p(e,t,n):h(e,t,n)}var g=n(3);e.exports=v,e.exports.parse=r,e.exports.compile=o,e.exports.tokensToFunction=a,e.exports.tokensToRegExp=d;var x=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g")},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}}])}); |
@@ -34,3 +34,3 @@ | ||
})) | ||
.pipe(postcss([autoprefixer])) | ||
.pipe(postcss([autoprefixer(['iOS >= 7', 'Android >= 4.1'])])) | ||
.pipe(header(banner, { pkg : pkg } )) | ||
@@ -41,3 +41,4 @@ .pipe(sourcemaps.write()) | ||
.pipe(nano({ | ||
zindex: false | ||
zindex: false, | ||
autoprefixer: false | ||
})) | ||
@@ -62,5 +63,6 @@ .pipe(rename(function (path) { | ||
})) | ||
.pipe(postcss([autoprefixer])) | ||
.pipe(postcss([autoprefixer(['iOS >= 7', 'Android >= 4.1'])])) | ||
.pipe(nano({ | ||
zindex: false | ||
zindex: false, | ||
autoprefixer: false | ||
})) | ||
@@ -128,2 +130,2 @@ .pipe(gulp.dest(dist)) | ||
} | ||
}); | ||
}); |
{ | ||
"name": "weui", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,4 +0,8 @@ | ||
WeUI 为微信 Web 服务量身设计 [![Build Status](https://travis-ci.org/weui/weui.svg?branch=master)](https://travis-ci.org/weui/weui) [![npm version](https://img.shields.io/npm/v/weui.svg)](https://www.npmjs.org/package/weui) | ||
WeUI 为微信 Web 服务量身设计 | ||
==== | ||
[![Build Status](https://travis-ci.org/weui/weui.svg?branch=master)](https://travis-ci.org/weui/weui) | ||
[![npm version](https://img.shields.io/npm/v/weui.svg)](https://www.npmjs.org/package/weui) | ||
[![Gitter](https://badges.gitter.im/weui/weui.svg)](https://gitter.im/weui/weui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
## 概述 | ||
@@ -16,5 +20,5 @@ | ||
![](./dist/example/snapshot/qrcode.png) | ||
![https://weui.io](https://cloud.githubusercontent.com/assets/4652816/15662614/178efd46-2725-11e6-8952-09d7836e968d.png) | ||
[http://weui.github.io/weui/](http://weui.github.io/weui) | ||
[https://weui.io](https://weui.io) | ||
@@ -21,0 +25,0 @@ ## 文档 |
@@ -33,2 +33,10 @@ $(function () { | ||
return $('#tpl_cell').html(); | ||
}, | ||
bind: function (){ | ||
$('.container').on('click', '#showTooltips', function (){ | ||
$('.js_tooltips').show(); | ||
setTimeout(function (){ | ||
$('.js_tooltips').hide(); | ||
}, 3000); | ||
}); | ||
} | ||
@@ -35,0 +43,0 @@ }; |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Router",[],t):"object"==typeof exports?exports.Router=t():e.Router=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=n(1),a=o(s),u=function(){function e(t){r(this,e),this._options={container:"#container",enter:"enter",enterTimeout:0,leave:"leave",leaveTimeout:0},this._index=1,this._$container=null,this._routes=[],this._default=null,this._options=a.extend(this._options,t),this._$container=document.querySelector(this._options.container)}return i(e,[{key:"init",value:function(){var e=this;window.addEventListener("hashchange",function(t){var n=a.getHash(t.newURL),o=history.state||{};e.go(n,o._index<=e._index)},!1),history.state&&history.state._index&&(this._index=history.state._index),this._index--;var t=a.getHash(location.href),n=this._getRoute(t);return this.go(n?t:this._default),this}},{key:"push",value:function(e){return e=a.extend({url:"*",className:"",render:a.noop,bind:a.noop},e),this._routes.push(e),this}},{key:"setDefault",value:function(e){return this._default=e,this}},{key:"go",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this._getRoute(e);if(!o)throw new Error("url "+e+" was not found");return!function(){var r="function"==typeof o.render?o.render(o.params):"",i=t._$container.hasChildNodes();i&&!function(){var e=t._$container.childNodes[0];n&&e.classList.add(t._options.leave),t._options.leaveTimeout>0?setTimeout(function(){e.parentNode.removeChild(e)},t._options.leaveTimeout):e.parentNode.removeChild(e)}();var s=document.createElement("div");o.className&&s.classList.add(o.className),s.innerHTML=r,t._$container.appendChild(s),!n&&t._options.enter&&i&&s.classList.add(t._options.enter),t._options.enterTimeout>0?setTimeout(function(){s.classList.remove(t._options.enter)},t._options.enterTimeout):s.classList.remove(t._options.enter),location.hash="#"+e;try{n?t._index--:t._index++,history.replaceState&&history.replaceState({_index:t._index},"",location.href)}catch(a){}"function"!=typeof o.bind||o.__isBind||(o.bind.call(s),o.__isBind=!0)}(),this}},{key:"_getRoute",value:function(e){for(var t=0,n=this._routes.length;n>t;t++){var o=this._routes[t],r=a.getRegExp(o.url),i=a.getParams(o.url),s=r.exec(e);if(s){o.params={};for(var u=0,c=i.length;c>u;u++){var l=i[u];o.params[l]=s[u+1]}return o}}return null}}]),e}();t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e){return-1!==e.indexOf("#")?e.substring(e.indexOf("#")+1):"/"}function r(){}function i(e){var t=/\((.*?)\)/g,n=/(\(\?)?:\w+/g,o=/\*\w+/g,r=/[\-{}\[\]+?.,\\\^$|#\s]/g;return e=e.replace(r,"\\$&").replace(t,"(?:$1)?").replace(n,function(e,t){return t?e:"([^/?]+)"}).replace(o,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")}function s(e){for(var t=/:(\w+)/g,n=[],o=void 0;null!==(o=t.exec(e));)n.push(o[1]);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.extend=n,t.getHash=o,t.noop=r,t.getRegExp=i,t.getParams=s}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Router",[],t):"object"==typeof exports?exports.Router=t():e.Router=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),s=r(u),l=function(){function e(t){o(this,e),this._options={container:"#container",enter:"enter",enterTimeout:0,leave:"leave",leaveTimeout:0},this._index=1,this._$container=null,this._routes=[],this._default=null,this._options=i({},this._options,t),this._$container=document.querySelector(this._options.container)}return a(e,[{key:"init",value:function(){var e=this;window.addEventListener("hashchange",function(t){var n=s.getHash(t.newURL),r=history.state||{};e.go(n,r._index<=e._index)},!1),history.state&&history.state._index&&(this._index=history.state._index),this._index--;var t=s.getHash(location.href),n=s.getRoute(this._routes,t);return this.go(n?t:this._default),this}},{key:"push",value:function(e){var t=this._routes.filter(function(t){return t.url===e.url})[0];if(t)throw new Error("route "+e.url+" is existed");return e=i({},{url:"*",className:"",render:s.noop,bind:s.noop},e),this._routes.push(e),this}},{key:"setDefault",value:function(e){return this._default=e,this}},{key:"go",value:function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=s.getRoute(this._routes,e);if(!r)throw new Error("url "+e+" was not found");return!function(){var o=function(e){e&&!function(){var e=t._$container.children[0];n&&e.classList.add(t._options.leave),t._options.leaveTimeout>0?setTimeout(function(){e.parentNode.removeChild(e)},t._options.leaveTimeout):e.parentNode.removeChild(e)}()},i=function(o,i){var a=document.createElement("div");r.className&&a.classList.add(r.className),a.innerHTML=i,t._$container.appendChild(a),!n&&t._options.enter&&o&&a.classList.add(t._options.enter),t._options.enterTimeout>0?setTimeout(function(){a.classList.remove(t._options.enter)},t._options.enterTimeout):a.classList.remove(t._options.enter),location.hash="#"+e;try{n?t._index--:t._index++,history.replaceState&&history.replaceState({_index:t._index},"",location.href)}catch(u){}"function"==typeof r.bind&&r.bind.call(a)},a=s.hasChildren(t._$container);o(a);var u=function(e){var t=arguments.length<=1||void 0===arguments[1]?"":arguments[1];if(e)throw e;i(a,t)},l=r.render(u);l&&"function"==typeof l.then?l.then(function(e){u(null,e)},u):0===r.render.length&&u(null,l)}(),this}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return-1!==e.indexOf("#")?e.substring(e.indexOf("#")+1):"/"}function i(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n],i=[],a=(0,l["default"])(o.url,i),u=a.exec(t);if(u){o.params={};for(var s=0,c=i.length;c>s;s++){var f=i[s],p=f.name;o.params[p]=u[s+1]}return o}}return null}function a(e){var t=e.children;return t.length>0}function u(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=o,t.getRoute=i,t.hasChildren=a,t.noop=u;var s=n(2),l=r(s)},function(e,t,n){function r(e){for(var t,n=[],r=0,o=0,i="";null!=(t=x.exec(e));){var a=t[0],u=t[1],l=t.index;if(i+=e.slice(o,l),o=l+a.length,u)i+=u[1];else{var c=e[o],f=t[2],p=t[3],h=t[4],d=t[5],v=t[6],g=t[7];null!=f&&null!=c&&c!==f&&(i+=f,f=null),i&&(n.push(i),i="");var y="+"===v||"*"===v,_="?"===v||"*"===v,m=t[2]||"/",w=h||d||(g?".*":"[^"+m+"]+?");n.push({name:p||r++,prefix:f||"",delimiter:m,optional:_,repeat:y,pattern:s(w)})}}return o<e.length&&(i+=e.substr(o)),i&&n.push(i),n}function o(e){return a(r(e))}function i(e){return encodeURI(e).replace(/[\/?#'"]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function a(e){for(var t=new Array(e.length),n=0;n<e.length;n++)"object"==typeof e[n]&&(t[n]=new RegExp("^"+e[n].pattern+"$"));return function(n,r){for(var o="",a=n||{},u=r||{},s=u.pretty?i:encodeURIComponent,l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var f,p=a[c.name];if(null==p){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to be defined')}if(g(p)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received "'+p+'"');if(0===p.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var h=0;h<p.length;h++){if(f=s(p[h]),!t[l].test(f))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');o+=(0===h?c.prefix:c.delimiter)+f}}else{if(f=s(p),!t[l].test(f))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');o+=c.prefix+f}}else o+=c}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function s(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function c(e){return e.sensitive?"":"i"}function f(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return l(e,t)}function p(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(v(e[o],t,n).source);var i=new RegExp("(?:"+r.join("|")+")",c(n));return l(i,t)}function h(e,t,n){for(var o=r(e),i=d(o,n),a=0;a<o.length;a++)"string"!=typeof o[a]&&t.push(o[a]);return l(i,t)}function d(e,t){t=t||{};for(var n=t.strict,r=t.end!==!1,o="",i=e[e.length-1],a="string"==typeof i&&/\/$/.test(i),s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)o+=u(l);else{var f=u(l.prefix),p=l.pattern;l.repeat&&(p+="(?:"+f+p+")*"),p=l.optional?f?"(?:"+f+"("+p+"))?":"("+p+")?":f+"("+p+")",o+=p}}return n||(o=(a?o.slice(0,-2):o)+"(?:\\/(?=$))?"),o+=r?"$":n&&a?"":"(?=\\/|$)",new RegExp("^"+o,c(t))}function v(e,t,n){return t=t||[],g(t)?n||(n={}):(n=t,t=[]),e instanceof RegExp?f(e,t):g(e)?p(e,t,n):h(e,t,n)}var g=n(3);e.exports=v,e.exports.parse=r,e.exports.compile=o,e.exports.tokensToFunction=a,e.exports.tokensToRegExp=d;var x=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g")},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}}])}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2148665
36