11/*!
2- * Vue.js v2.6.0-beta.3
2+ * Vue.js v2.6.0
33 * (c) 2014-2019 Evan You
44 * Released under the MIT License.
55 */
@@ -2752,7 +2752,7 @@ function resolveScopedSlots (
27522752 var slot = fns [ i ] ;
27532753 if ( Array . isArray ( slot ) ) {
27542754 resolveScopedSlots ( slot , hasDynamicKeys , res ) ;
2755- } else {
2755+ } else if ( slot ) {
27562756 res [ slot . key ] = slot . fn ;
27572757 }
27582758 }
@@ -3899,7 +3899,7 @@ function normalizeScopedSlots (
38993899 }
39003900 }
39013901 res . _normalized = true ;
3902- res . $stable = slots && slots . $stable ;
3902+ res . $stable = slots ? slots . $stable : true ;
39033903 return res
39043904}
39053905
@@ -5319,7 +5319,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
53195319 value : FunctionalRenderContext
53205320} ) ;
53215321
5322- Vue . version = '2.6.0-beta.3 ' ;
5322+ Vue . version = '2.6.0' ;
53235323
53245324/* */
53255325
@@ -5340,6 +5340,17 @@ var mustUseProp = function (tag, type, attr) {
53405340
53415341var isEnumeratedAttr = makeMap ( 'contenteditable,draggable,spellcheck' ) ;
53425342
5343+ var isValidContentEditableValue = makeMap ( 'events,caret,typing,plaintext-only' ) ;
5344+
5345+ var convertEnumeratedValue = function ( key , value ) {
5346+ return isFalsyAttrValue ( value ) || value === 'false'
5347+ ? 'false'
5348+ // allow arbitrary string value for contenteditable
5349+ : key === 'contenteditable' && isValidContentEditableValue ( value )
5350+ ? value
5351+ : 'true'
5352+ } ;
5353+
53435354var isBooleanAttr = makeMap (
53445355 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
53455356 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
@@ -6607,7 +6618,7 @@ function setAttr (el, key, value) {
66076618 el . setAttribute ( key , value ) ;
66086619 }
66096620 } else if ( isEnumeratedAttr ( key ) ) {
6610- el . setAttribute ( key , isFalsyAttrValue ( value ) || value === 'false' ? 'false' : 'true' ) ;
6621+ el . setAttribute ( key , convertEnumeratedValue ( key , value ) ) ;
66116622 } else if ( isXlink ( key ) ) {
66126623 if ( isFalsyAttrValue ( value ) ) {
66136624 el . removeAttributeNS ( xlinkNS , getXlinkProp ( key ) ) ;
@@ -7622,7 +7633,7 @@ var setProp = function (el, name, val) {
76227633 if ( cssVarRE . test ( name ) ) {
76237634 el . style . setProperty ( name , val ) ;
76247635 } else if ( importantRE . test ( val ) ) {
7625- el . style . setProperty ( name , val . replace ( importantRE , '' ) , 'important' ) ;
7636+ el . style . setProperty ( hyphenate ( name ) , val . replace ( importantRE , '' ) , 'important' ) ;
76267637 } else {
76277638 var normalizedName = normalize ( name ) ;
76287639 if ( Array . isArray ( val ) ) {
@@ -9380,15 +9391,14 @@ function parseHTML (html, options) {
93809391/* */
93819392
93829393var onRE = / ^ @ | ^ v - o n : / ;
9383- var dirRE = / ^ v - | ^ @ | ^ : | ^ \. / ;
9394+ var dirRE = / ^ v - | ^ @ | ^ : / ;
93849395var forAliasRE = / ( [ \s \S ] * ?) \s + (?: i n | o f ) \s + ( [ \s \S ] * ) / ;
93859396var forIteratorRE = / , ( [ ^ , \} \] ] * ) (?: , ( [ ^ , \} \] ] * ) ) ? $ / ;
93869397var stripParensRE = / ^ \( | \) $ / g;
93879398var dynamicArgRE = / ^ \[ .* \] $ / ;
93889399
93899400var argRE = / : ( .* ) $ / ;
93909401var bindRE = / ^ : | ^ \. | ^ v - b i n d : / ;
9391- var propBindRE = / ^ \. / ;
93929402var modifierRE = / \. [ ^ . ] + / g;
93939403
93949404var slotRE = / ^ v - s l o t ( : | $ ) | ^ # / ;
@@ -9465,6 +9475,7 @@ function parse (
94659475 }
94669476
94679477 function closeElement ( element ) {
9478+ trimEndingWhitespace ( element ) ;
94689479 if ( ! inVPre && ! element . processed ) {
94699480 element = processElement ( element , options ) ;
94709481 }
@@ -9491,14 +9502,25 @@ function parse (
94919502 if ( currentParent && ! element . forbidden ) {
94929503 if ( element . elseif || element . else ) {
94939504 processIfConditions ( element , currentParent ) ;
9494- } else if ( element . slotScope ) { // scoped slot
9495- var name = element . slotTarget || '"default"'
9496- ; ( currentParent . scopedSlots || ( currentParent . scopedSlots = { } ) ) [ name ] = element ;
94979505 } else {
9506+ if ( element . slotScope ) {
9507+ // scoped slot
9508+ // keep it in the children list so that v-else(-if) conditions can
9509+ // find it as the prev node.
9510+ var name = element . slotTarget || '"default"'
9511+ ; ( currentParent . scopedSlots || ( currentParent . scopedSlots = { } ) ) [ name ] = element ;
9512+ }
94989513 currentParent . children . push ( element ) ;
94999514 element . parent = currentParent ;
95009515 }
95019516 }
9517+
9518+ // final children cleanup
9519+ // filter out scoped slots
9520+ element . children = element . children . filter ( function ( c ) { return ! ( c ) . slotScope ; } ) ;
9521+ // remove trailing whitespace node again
9522+ trimEndingWhitespace ( element ) ;
9523+
95029524 // check pre state
95039525 if ( element . pre ) {
95049526 inVPre = false ;
@@ -9512,6 +9534,20 @@ function parse (
95129534 }
95139535 }
95149536
9537+ function trimEndingWhitespace ( el ) {
9538+ // remove trailing whitespace node
9539+ if ( ! inPre ) {
9540+ var lastNode ;
9541+ while (
9542+ ( lastNode = el . children [ el . children . length - 1 ] ) &&
9543+ lastNode . type === 3 &&
9544+ lastNode . text === ' '
9545+ ) {
9546+ el . children . pop ( ) ;
9547+ }
9548+ }
9549+ }
9550+
95159551 function checkRootConstraints ( el ) {
95169552 if ( el . tag === 'slot' || el . tag === 'template' ) {
95179553 warnOnce (
@@ -9626,13 +9662,6 @@ function parse (
96269662
96279663 end : function end ( tag , start , end$1 ) {
96289664 var element = stack [ stack . length - 1 ] ;
9629- if ( ! inPre ) {
9630- // remove trailing whitespace node
9631- var lastNode = element . children [ element . children . length - 1 ] ;
9632- if ( lastNode && lastNode . type === 3 && lastNode . text === ' ' ) {
9633- element . children . pop ( ) ;
9634- }
9635- }
96369665 // pop stack
96379666 stack . length -= 1 ;
96389667 currentParent = stack [ stack . length - 1 ] ;
@@ -9976,6 +10005,13 @@ function processSlotContent (el) {
997610005 el
997710006 ) ;
997810007 }
10008+ if ( el . parent && ! maybeComponent ( el . parent ) ) {
10009+ warn$2 (
10010+ "<template v-slot> can only appear at the root level inside " +
10011+ "the receiving the component" ,
10012+ el
10013+ ) ;
10014+ }
997910015 }
998010016 var ref = getSlotName ( slotBinding ) ;
998110017 var name = ref . name ;
@@ -10015,8 +10051,9 @@ function processSlotContent (el) {
1001510051 var name$1 = ref$1 . name ;
1001610052 var dynamic$1 = ref$1 . dynamic ;
1001710053 var slotContainer = slots [ name$1 ] = createASTElement ( 'template' , [ ] , el ) ;
10054+ slotContainer . slotTarget = name$1 ;
1001810055 slotContainer . slotTargetDynamic = dynamic$1 ;
10019- slotContainer . children = el . children ;
10056+ slotContainer . children = el . children . filter ( function ( c ) { return ! ( c ) . slotScope ; } ) ;
1002010057 slotContainer . slotScope = slotBinding$1 . value || "_" ;
1002110058 // remove children as they are returned from scopedSlots now
1002210059 el . children = [ ] ;
@@ -10083,10 +10120,7 @@ function processAttrs (el) {
1008310120 // modifiers
1008410121 modifiers = parseModifiers ( name . replace ( dirRE , '' ) ) ;
1008510122 // support .foo shorthand syntax for the .prop modifier
10086- if ( propBindRE . test ( name ) ) {
10087- ( modifiers || ( modifiers = { } ) ) . prop = true ;
10088- name = "." + name . slice ( 1 ) . replace ( modifierRE , '' ) ;
10089- } else if ( modifiers ) {
10123+ if ( modifiers ) {
1009010124 name = name . replace ( modifierRE , '' ) ;
1009110125 }
1009210126 if ( bindRE . test ( name ) ) { // v-bind
@@ -11023,43 +11057,30 @@ function genScopedSlots (
1102311057 slots ,
1102411058 state
1102511059) {
11026- var hasDynamicKeys = Object . keys ( slots ) . some ( function ( key ) { return slots [ key ] . slotTargetDynamic ; } ) ;
11060+ var hasDynamicKeys = Object . keys ( slots ) . some ( function ( key ) {
11061+ var slot = slots [ key ] ;
11062+ return slot . slotTargetDynamic || slot . if || slot . for
11063+ } ) ;
1102711064 return ( "scopedSlots:_u([" + ( Object . keys ( slots ) . map ( function ( key ) {
11028- return genScopedSlot ( key , slots [ key ] , state )
11065+ return genScopedSlot ( slots [ key ] , state )
1102911066 } ) . join ( ',' ) ) + "]" + ( hasDynamicKeys ? ",true" : "" ) + ")" )
1103011067}
1103111068
1103211069function genScopedSlot (
11033- key ,
1103411070 el ,
1103511071 state
1103611072) {
11073+ if ( el . if && ! el . ifProcessed ) {
11074+ return genIf ( el , state , genScopedSlot , "null" )
11075+ }
1103711076 if ( el . for && ! el . forProcessed ) {
11038- return genForScopedSlot ( key , el , state )
11077+ return genFor ( el , state , genScopedSlot )
1103911078 }
1104011079 var fn = "function(" + ( String ( el . slotScope ) ) + "){" +
1104111080 "return " + ( el . tag === 'template'
11042- ? el . if
11043- ? ( "(" + ( el . if ) + ")?" + ( genChildren ( el , state ) || 'undefined' ) + ":undefined" )
11044- : genChildren ( el , state ) || 'undefined'
11081+ ? genChildren ( el , state ) || 'undefined'
1104511082 : genElement ( el , state ) ) + "}" ;
11046- return ( "{key:" + key + ",fn:" + fn + "}" )
11047- }
11048-
11049- function genForScopedSlot (
11050- key ,
11051- el ,
11052- state
11053- ) {
11054- var exp = el . for ;
11055- var alias = el . alias ;
11056- var iterator1 = el . iterator1 ? ( "," + ( el . iterator1 ) ) : '' ;
11057- var iterator2 = el . iterator2 ? ( "," + ( el . iterator2 ) ) : '' ;
11058- el . forProcessed = true ; // avoid recursion
11059- return "_l((" + exp + ")," +
11060- "function(" + alias + iterator1 + iterator2 + "){" +
11061- "return " + ( genScopedSlot ( key , el , state ) ) +
11062- '})'
11083+ return ( "{key:" + ( el . slotTarget || "\"default\"" ) + ",fn:" + fn + "}" )
1106311084}
1106411085
1106511086function genChildren (
0 commit comments