Skip to content

Commit

Permalink
build: bundle 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 19, 2020
1 parent 588220c commit f9d24f4
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 40 deletions.
29 changes: 20 additions & 9 deletions dist/vue-router.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.1.6
* vue-router v3.2.0
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -606,7 +606,7 @@ function parse (str, options) {
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options))
return tokensToFunction(parse(str, options), options)
}

/**
Expand Down Expand Up @@ -636,14 +636,14 @@ function encodeAsterisk (str) {
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens) {
function tokensToFunction (tokens, options) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);

// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
}
}

Expand Down Expand Up @@ -756,7 +756,7 @@ function attachKeys (re, keys) {
* @return {string}
*/
function flags (options) {
return options.sensitive ? '' : 'i'
return options && options.sensitive ? '' : 'i'
}

/**
Expand Down Expand Up @@ -1047,6 +1047,10 @@ var Link = {
replace: Boolean,
activeClass: String,
exactActiveClass: String,
ariaCurrentValue: {
type: String,
default: 'page'
},
event: {
type: eventTypes,
default: 'click'
Expand Down Expand Up @@ -1092,6 +1096,8 @@ var Link = {
? classes[exactActiveClass]
: isIncludedRoute(current, compareTarget);

var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;

var handler = function (e) {
if (guardEvent(e)) {
if (this$1.replace) {
Expand Down Expand Up @@ -1140,7 +1146,7 @@ var Link = {

if (this.tag === 'a') {
data.on = on;
data.attrs = { href: href };
data.attrs = { href: href, 'aria-current': ariaCurrentValue };
} else {
// find the first <a> child and apply listener and href
var a = findAnchor(this.$slots.default);
Expand Down Expand Up @@ -1168,6 +1174,7 @@ var Link = {

var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
aAttrs.href = href;
aAttrs['aria-current'] = ariaCurrentValue;
} else {
// doesn't have <a> child, apply listener to self
data.on = on;
Expand Down Expand Up @@ -1686,6 +1693,10 @@ function setStateKey (key) {
var positionStore = Object.create(null);

function setupScroll () {
// Prevent browser scroll behavior on History popstate
if ('scrollRestoration' in window.history) {
window.history.scrollRestoration = 'manual';
}
// Fix for #1585 for Firefox
// Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
// Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
Expand Down Expand Up @@ -1849,7 +1860,7 @@ var supportsPushState =
return false
}

return window.history && 'pushState' in window.history
return window.history && typeof window.history.pushState === 'function'
})();

function pushState (url, replace) {
Expand Down Expand Up @@ -2437,7 +2448,7 @@ var HTML5History = /*@__PURE__*/(function (History) {

function getLocation (base) {
var path = decodeURI(window.location.pathname);
if (base && path.indexOf(base) === 0) {
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
path = path.slice(base.length);
}
return (path || '/') + window.location.search + window.location.hash
Expand Down Expand Up @@ -2911,7 +2922,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.1.6';
VueRouter.version = '3.2.0';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
29 changes: 20 additions & 9 deletions dist/vue-router.esm.browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.1.6
* vue-router v3.2.0
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -590,7 +590,7 @@ function parse (str, options) {
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options))
return tokensToFunction(parse(str, options), options)
}

/**
Expand Down Expand Up @@ -620,14 +620,14 @@ function encodeAsterisk (str) {
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens) {
function tokensToFunction (tokens, options) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);

// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
}
}

Expand Down Expand Up @@ -740,7 +740,7 @@ function attachKeys (re, keys) {
* @return {string}
*/
function flags (options) {
return options.sensitive ? '' : 'i'
return options && options.sensitive ? '' : 'i'
}

/**
Expand Down Expand Up @@ -1031,6 +1031,10 @@ var Link = {
replace: Boolean,
activeClass: String,
exactActiveClass: String,
ariaCurrentValue: {
type: String,
default: 'page'
},
event: {
type: eventTypes,
default: 'click'
Expand Down Expand Up @@ -1071,6 +1075,8 @@ var Link = {
? classes[exactActiveClass]
: isIncludedRoute(current, compareTarget);

const ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;

const handler = e => {
if (guardEvent(e)) {
if (this.replace) {
Expand Down Expand Up @@ -1121,7 +1127,7 @@ var Link = {

if (this.tag === 'a') {
data.on = on;
data.attrs = { href };
data.attrs = { href, 'aria-current': ariaCurrentValue };
} else {
// find the first <a> child and apply listener and href
const a = findAnchor(this.$slots.default);
Expand Down Expand Up @@ -1149,6 +1155,7 @@ var Link = {

const aAttrs = (a.data.attrs = extend({}, a.data.attrs));
aAttrs.href = href;
aAttrs['aria-current'] = ariaCurrentValue;
} else {
// doesn't have <a> child, apply listener to self
data.on = on;
Expand Down Expand Up @@ -1662,6 +1669,10 @@ function setStateKey (key) {
const positionStore = Object.create(null);

function setupScroll () {
// Prevent browser scroll behavior on History popstate
if ('scrollRestoration' in window.history) {
window.history.scrollRestoration = 'manual';
}
// Fix for #1585 for Firefox
// Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
// Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
Expand Down Expand Up @@ -1825,7 +1836,7 @@ const supportsPushState =
return false
}

return window.history && 'pushState' in window.history
return window.history && typeof window.history.pushState === 'function'
})();

function pushState (url, replace) {
Expand Down Expand Up @@ -2404,7 +2415,7 @@ class HTML5History extends History {

function getLocation (base) {
let path = decodeURI(window.location.pathname);
if (base && path.indexOf(base) === 0) {
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
path = path.slice(base.length);
}
return (path || '/') + window.location.search + window.location.hash
Expand Down Expand Up @@ -2861,7 +2872,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.1.6';
VueRouter.version = '3.2.0';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-router.esm.browser.min.js

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions dist/vue-router.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.1.6
* vue-router v3.2.0
* (c) 2020 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -604,7 +604,7 @@ function parse (str, options) {
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options))
return tokensToFunction(parse(str, options), options)
}

/**
Expand Down Expand Up @@ -634,14 +634,14 @@ function encodeAsterisk (str) {
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens) {
function tokensToFunction (tokens, options) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);

// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
}
}

Expand Down Expand Up @@ -754,7 +754,7 @@ function attachKeys (re, keys) {
* @return {string}
*/
function flags (options) {
return options.sensitive ? '' : 'i'
return options && options.sensitive ? '' : 'i'
}

/**
Expand Down Expand Up @@ -1045,6 +1045,10 @@ var Link = {
replace: Boolean,
activeClass: String,
exactActiveClass: String,
ariaCurrentValue: {
type: String,
default: 'page'
},
event: {
type: eventTypes,
default: 'click'
Expand Down Expand Up @@ -1090,6 +1094,8 @@ var Link = {
? classes[exactActiveClass]
: isIncludedRoute(current, compareTarget);

var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;

var handler = function (e) {
if (guardEvent(e)) {
if (this$1.replace) {
Expand Down Expand Up @@ -1138,7 +1144,7 @@ var Link = {

if (this.tag === 'a') {
data.on = on;
data.attrs = { href: href };
data.attrs = { href: href, 'aria-current': ariaCurrentValue };
} else {
// find the first <a> child and apply listener and href
var a = findAnchor(this.$slots.default);
Expand Down Expand Up @@ -1166,6 +1172,7 @@ var Link = {

var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
aAttrs.href = href;
aAttrs['aria-current'] = ariaCurrentValue;
} else {
// doesn't have <a> child, apply listener to self
data.on = on;
Expand Down Expand Up @@ -1684,6 +1691,10 @@ function setStateKey (key) {
var positionStore = Object.create(null);

function setupScroll () {
// Prevent browser scroll behavior on History popstate
if ('scrollRestoration' in window.history) {
window.history.scrollRestoration = 'manual';
}
// Fix for #1585 for Firefox
// Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
// Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
Expand Down Expand Up @@ -1847,7 +1858,7 @@ var supportsPushState =
return false
}

return window.history && 'pushState' in window.history
return window.history && typeof window.history.pushState === 'function'
})();

function pushState (url, replace) {
Expand Down Expand Up @@ -2435,7 +2446,7 @@ var HTML5History = /*@__PURE__*/(function (History) {

function getLocation (base) {
var path = decodeURI(window.location.pathname);
if (base && path.indexOf(base) === 0) {
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
path = path.slice(base.length);
}
return (path || '/') + window.location.search + window.location.hash
Expand Down Expand Up @@ -2909,7 +2920,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.1.6';
VueRouter.version = '3.2.0';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
Loading

0 comments on commit f9d24f4

Please sign in to comment.