Skip to content

Commit f9d24f4

Browse files
committed
build: bundle 3.2.0
1 parent 588220c commit f9d24f4

6 files changed

+84
-40
lines changed

Diff for: dist/vue-router.common.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.1.6
2+
* vue-router v3.2.0
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -606,7 +606,7 @@ function parse (str, options) {
606606
* @return {!function(Object=, Object=)}
607607
*/
608608
function compile (str, options) {
609-
return tokensToFunction(parse(str, options))
609+
return tokensToFunction(parse(str, options), options)
610610
}
611611

612612
/**
@@ -636,14 +636,14 @@ function encodeAsterisk (str) {
636636
/**
637637
* Expose a method for transforming tokens into the path function.
638638
*/
639-
function tokensToFunction (tokens) {
639+
function tokensToFunction (tokens, options) {
640640
// Compile all the tokens into regexps.
641641
var matches = new Array(tokens.length);
642642

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

@@ -756,7 +756,7 @@ function attachKeys (re, keys) {
756756
* @return {string}
757757
*/
758758
function flags (options) {
759-
return options.sensitive ? '' : 'i'
759+
return options && options.sensitive ? '' : 'i'
760760
}
761761

762762
/**
@@ -1047,6 +1047,10 @@ var Link = {
10471047
replace: Boolean,
10481048
activeClass: String,
10491049
exactActiveClass: String,
1050+
ariaCurrentValue: {
1051+
type: String,
1052+
default: 'page'
1053+
},
10501054
event: {
10511055
type: eventTypes,
10521056
default: 'click'
@@ -1092,6 +1096,8 @@ var Link = {
10921096
? classes[exactActiveClass]
10931097
: isIncludedRoute(current, compareTarget);
10941098

1099+
var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;
1100+
10951101
var handler = function (e) {
10961102
if (guardEvent(e)) {
10971103
if (this$1.replace) {
@@ -1140,7 +1146,7 @@ var Link = {
11401146

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

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

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

1852-
return window.history && 'pushState' in window.history
1863+
return window.history && typeof window.history.pushState === 'function'
18531864
})();
18541865

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

24382449
function getLocation (base) {
24392450
var path = decodeURI(window.location.pathname);
2440-
if (base && path.indexOf(base) === 0) {
2451+
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
24412452
path = path.slice(base.length);
24422453
}
24432454
return (path || '/') + window.location.search + window.location.hash
@@ -2911,7 +2922,7 @@ function createHref (base, fullPath, mode) {
29112922
}
29122923

29132924
VueRouter.install = install;
2914-
VueRouter.version = '3.1.6';
2925+
VueRouter.version = '3.2.0';
29152926

29162927
if (inBrowser && window.Vue) {
29172928
window.Vue.use(VueRouter);

Diff for: dist/vue-router.esm.browser.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.1.6
2+
* vue-router v3.2.0
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -590,7 +590,7 @@ function parse (str, options) {
590590
* @return {!function(Object=, Object=)}
591591
*/
592592
function compile (str, options) {
593-
return tokensToFunction(parse(str, options))
593+
return tokensToFunction(parse(str, options), options)
594594
}
595595

596596
/**
@@ -620,14 +620,14 @@ function encodeAsterisk (str) {
620620
/**
621621
* Expose a method for transforming tokens into the path function.
622622
*/
623-
function tokensToFunction (tokens) {
623+
function tokensToFunction (tokens, options) {
624624
// Compile all the tokens into regexps.
625625
var matches = new Array(tokens.length);
626626

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

@@ -740,7 +740,7 @@ function attachKeys (re, keys) {
740740
* @return {string}
741741
*/
742742
function flags (options) {
743-
return options.sensitive ? '' : 'i'
743+
return options && options.sensitive ? '' : 'i'
744744
}
745745

746746
/**
@@ -1031,6 +1031,10 @@ var Link = {
10311031
replace: Boolean,
10321032
activeClass: String,
10331033
exactActiveClass: String,
1034+
ariaCurrentValue: {
1035+
type: String,
1036+
default: 'page'
1037+
},
10341038
event: {
10351039
type: eventTypes,
10361040
default: 'click'
@@ -1071,6 +1075,8 @@ var Link = {
10711075
? classes[exactActiveClass]
10721076
: isIncludedRoute(current, compareTarget);
10731077

1078+
const ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;
1079+
10741080
const handler = e => {
10751081
if (guardEvent(e)) {
10761082
if (this.replace) {
@@ -1121,7 +1127,7 @@ var Link = {
11211127

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

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

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

1828-
return window.history && 'pushState' in window.history
1839+
return window.history && typeof window.history.pushState === 'function'
18291840
})();
18301841

18311842
function pushState (url, replace) {
@@ -2404,7 +2415,7 @@ class HTML5History extends History {
24042415

24052416
function getLocation (base) {
24062417
let path = decodeURI(window.location.pathname);
2407-
if (base && path.indexOf(base) === 0) {
2418+
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
24082419
path = path.slice(base.length);
24092420
}
24102421
return (path || '/') + window.location.search + window.location.hash
@@ -2861,7 +2872,7 @@ function createHref (base, fullPath, mode) {
28612872
}
28622873

28632874
VueRouter.install = install;
2864-
VueRouter.version = '3.1.6';
2875+
VueRouter.version = '3.2.0';
28652876

28662877
if (inBrowser && window.Vue) {
28672878
window.Vue.use(VueRouter);

Diff for: dist/vue-router.esm.browser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue-router.esm.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.1.6
2+
* vue-router v3.2.0
33
* (c) 2020 Evan You
44
* @license MIT
55
*/
@@ -604,7 +604,7 @@ function parse (str, options) {
604604
* @return {!function(Object=, Object=)}
605605
*/
606606
function compile (str, options) {
607-
return tokensToFunction(parse(str, options))
607+
return tokensToFunction(parse(str, options), options)
608608
}
609609

610610
/**
@@ -634,14 +634,14 @@ function encodeAsterisk (str) {
634634
/**
635635
* Expose a method for transforming tokens into the path function.
636636
*/
637-
function tokensToFunction (tokens) {
637+
function tokensToFunction (tokens, options) {
638638
// Compile all the tokens into regexps.
639639
var matches = new Array(tokens.length);
640640

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

@@ -754,7 +754,7 @@ function attachKeys (re, keys) {
754754
* @return {string}
755755
*/
756756
function flags (options) {
757-
return options.sensitive ? '' : 'i'
757+
return options && options.sensitive ? '' : 'i'
758758
}
759759

760760
/**
@@ -1045,6 +1045,10 @@ var Link = {
10451045
replace: Boolean,
10461046
activeClass: String,
10471047
exactActiveClass: String,
1048+
ariaCurrentValue: {
1049+
type: String,
1050+
default: 'page'
1051+
},
10481052
event: {
10491053
type: eventTypes,
10501054
default: 'click'
@@ -1090,6 +1094,8 @@ var Link = {
10901094
? classes[exactActiveClass]
10911095
: isIncludedRoute(current, compareTarget);
10921096

1097+
var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;
1098+
10931099
var handler = function (e) {
10941100
if (guardEvent(e)) {
10951101
if (this$1.replace) {
@@ -1138,7 +1144,7 @@ var Link = {
11381144

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

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

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

1850-
return window.history && 'pushState' in window.history
1861+
return window.history && typeof window.history.pushState === 'function'
18511862
})();
18521863

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

24362447
function getLocation (base) {
24372448
var path = decodeURI(window.location.pathname);
2438-
if (base && path.indexOf(base) === 0) {
2449+
if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {
24392450
path = path.slice(base.length);
24402451
}
24412452
return (path || '/') + window.location.search + window.location.hash
@@ -2909,7 +2920,7 @@ function createHref (base, fullPath, mode) {
29092920
}
29102921

29112922
VueRouter.install = install;
2912-
VueRouter.version = '3.1.6';
2923+
VueRouter.version = '3.2.0';
29132924

29142925
if (inBrowser && window.Vue) {
29152926
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)