@vue/runtime-dom
Advanced tools
Comparing version 3.4.21 to 3.4.22
/** | ||
* @vue/runtime-dom v3.4.21 | ||
* @vue/runtime-dom v3.4.22 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -599,7 +599,10 @@ * @license MIT | ||
if (nextValue && existingInvoker) { | ||
existingInvoker.value = nextValue; | ||
existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; | ||
} else { | ||
const [name, options] = parseName(rawName); | ||
if (nextValue) { | ||
const invoker = invokers[rawName] = createInvoker(nextValue, instance); | ||
const invoker = invokers[rawName] = createInvoker( | ||
sanitizeEventValue(nextValue, rawName) , | ||
instance | ||
); | ||
addEventListener(el, name, invoker, options); | ||
@@ -647,2 +650,12 @@ } else if (existingInvoker) { | ||
} | ||
function sanitizeEventValue(value, propName) { | ||
if (shared.isFunction(value) || shared.isArray(value)) { | ||
return value; | ||
} | ||
runtimeCore.warn( | ||
`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? | ||
Expected function or array of functions, received type ${typeof value}.` | ||
); | ||
return shared.NOOP; | ||
} | ||
function patchStopImmediatePropagation(e, value) { | ||
@@ -655,3 +668,5 @@ if (shared.isArray(value)) { | ||
}; | ||
return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); | ||
return value.map( | ||
(fn) => (e2) => !e2._stopped && fn && fn(e2) | ||
); | ||
} else { | ||
@@ -857,3 +872,3 @@ return value; | ||
_setAttr(key) { | ||
let value = this.getAttribute(key); | ||
let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0; | ||
const camelKey = shared.camelize(key); | ||
@@ -1024,3 +1039,24 @@ if (this._numberProps && this._numberProps[camelKey]) { | ||
let tag = rawProps.tag || runtimeCore.Fragment; | ||
prevChildren = children; | ||
prevChildren = []; | ||
if (children) { | ||
for (let i = 0; i < children.length; i++) { | ||
const child = children[i]; | ||
if (child.el && child.el instanceof Element) { | ||
prevChildren.push(child); | ||
runtimeCore.setTransitionHooks( | ||
child, | ||
runtimeCore.resolveTransitionHooks( | ||
child, | ||
cssTransitionProps, | ||
state, | ||
instance | ||
) | ||
); | ||
positionMap.set( | ||
child, | ||
child.el.getBoundingClientRect() | ||
); | ||
} | ||
} | ||
} | ||
children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : []; | ||
@@ -1038,12 +1074,2 @@ for (let i = 0; i < children.length; i++) { | ||
} | ||
if (prevChildren) { | ||
for (let i = 0; i < prevChildren.length; i++) { | ||
const child = prevChildren[i]; | ||
runtimeCore.setTransitionHooks( | ||
child, | ||
runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance) | ||
); | ||
positionMap.set(child, child.el.getBoundingClientRect()); | ||
} | ||
} | ||
return runtimeCore.createVNode(tag, null, children); | ||
@@ -1147,3 +1173,3 @@ }; | ||
return; | ||
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value; | ||
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value; | ||
const newValue = value == null ? "" : value; | ||
@@ -1251,3 +1277,3 @@ if (elValue === newValue) { | ||
mounted(el, { value, modifiers: { number } }) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
}, | ||
@@ -1259,3 +1285,3 @@ beforeUpdate(el, _binding, vnode) { | ||
if (!el._assigning) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
} | ||
@@ -1280,5 +1306,3 @@ } | ||
if (optionType === "string" || optionType === "number") { | ||
option.selected = value.includes( | ||
number ? shared.looseToNumber(optionValue) : optionValue | ||
); | ||
option.selected = value.some((v) => String(v) === String(optionValue)); | ||
} else { | ||
@@ -1285,0 +1309,0 @@ option.selected = shared.looseIndexOf(value, optionValue) > -1; |
/** | ||
* @vue/runtime-dom v3.4.21 | ||
* @vue/runtime-dom v3.4.22 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -583,3 +583,6 @@ * @license MIT | ||
if (nextValue) { | ||
const invoker = invokers[rawName] = createInvoker(nextValue, instance); | ||
const invoker = invokers[rawName] = createInvoker( | ||
nextValue, | ||
instance | ||
); | ||
addEventListener(el, name, invoker, options); | ||
@@ -634,3 +637,5 @@ } else if (existingInvoker) { | ||
}; | ||
return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); | ||
return value.map( | ||
(fn) => (e2) => !e2._stopped && fn && fn(e2) | ||
); | ||
} else { | ||
@@ -831,3 +836,3 @@ return value; | ||
_setAttr(key) { | ||
let value = this.getAttribute(key); | ||
let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0; | ||
const camelKey = shared.camelize(key); | ||
@@ -981,3 +986,24 @@ if (this._numberProps && this._numberProps[camelKey]) { | ||
let tag = rawProps.tag || runtimeCore.Fragment; | ||
prevChildren = children; | ||
prevChildren = []; | ||
if (children) { | ||
for (let i = 0; i < children.length; i++) { | ||
const child = children[i]; | ||
if (child.el && child.el instanceof Element) { | ||
prevChildren.push(child); | ||
runtimeCore.setTransitionHooks( | ||
child, | ||
runtimeCore.resolveTransitionHooks( | ||
child, | ||
cssTransitionProps, | ||
state, | ||
instance | ||
) | ||
); | ||
positionMap.set( | ||
child, | ||
child.el.getBoundingClientRect() | ||
); | ||
} | ||
} | ||
} | ||
children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : []; | ||
@@ -993,12 +1019,2 @@ for (let i = 0; i < children.length; i++) { | ||
} | ||
if (prevChildren) { | ||
for (let i = 0; i < prevChildren.length; i++) { | ||
const child = prevChildren[i]; | ||
runtimeCore.setTransitionHooks( | ||
child, | ||
runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance) | ||
); | ||
positionMap.set(child, child.el.getBoundingClientRect()); | ||
} | ||
} | ||
return runtimeCore.createVNode(tag, null, children); | ||
@@ -1102,3 +1118,3 @@ }; | ||
return; | ||
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value; | ||
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value; | ||
const newValue = value == null ? "" : value; | ||
@@ -1206,3 +1222,3 @@ if (elValue === newValue) { | ||
mounted(el, { value, modifiers: { number } }) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
}, | ||
@@ -1214,3 +1230,3 @@ beforeUpdate(el, _binding, vnode) { | ||
if (!el._assigning) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
} | ||
@@ -1232,5 +1248,3 @@ } | ||
if (optionType === "string" || optionType === "number") { | ||
option.selected = value.includes( | ||
number ? shared.looseToNumber(optionValue) : optionValue | ||
); | ||
option.selected = value.some((v) => String(v) === String(optionValue)); | ||
} else { | ||
@@ -1237,0 +1251,0 @@ option.selected = shared.looseIndexOf(value, optionValue) > -1; |
@@ -109,3 +109,3 @@ import { SetupContext, RenderFunction, ComputedOptions, MethodOptions, ComponentOptionsMixin, EmitsOptions, ComponentInjectOptions, SlotsType, ComponentOptionsWithoutProps, ComponentOptionsWithArrayProps, ComponentPropsOptions, ComponentOptionsWithObjectProps, ExtractPropTypes, DefineComponent, RootHydrateFunction, ConcreteComponent, BaseTransitionProps, FunctionalComponent, ObjectDirective, VNodeRef, RootRenderFunction, CreateAppFunction } from '@vue/runtime-core'; | ||
[key: string]: T; | ||
} | undefined; | ||
}; | ||
}, modifiers: string[]) => T; | ||
@@ -118,3 +118,3 @@ /** | ||
[k: string]: T; | ||
} | undefined; | ||
}; | ||
}, modifiers: string[]) => T; | ||
@@ -1272,3 +1272,4 @@ | ||
onSelect: Event; | ||
onScroll: UIEvent; | ||
onScroll: Event; | ||
onScrollend: Event; | ||
onTouchcancel: TouchEvent; | ||
@@ -1275,0 +1276,0 @@ onTouchend: TouchEvent; |
/** | ||
* @vue/runtime-dom v3.4.21 | ||
* @vue/runtime-dom v3.4.22 | ||
* (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
* @license MIT | ||
**/ | ||
import { h, BaseTransition, BaseTransitionPropsValidators, assertNumber, getCurrentInstance, warn, watchPostEffect, onMounted, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core'; | ||
import { h, BaseTransition, BaseTransitionPropsValidators, assertNumber, getCurrentInstance, warn, onMounted, watchPostEffect, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core'; | ||
export * from '@vue/runtime-core'; | ||
import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isOn, isModelListener, isFunction, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared'; | ||
import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isFunction, NOOP, isOn, isModelListener, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared'; | ||
@@ -433,4 +433,4 @@ const svgNS = "http://www.w3.org/2000/svg"; | ||
}; | ||
watchPostEffect(setVars); | ||
onMounted(() => { | ||
watchPostEffect(setVars); | ||
const ob = new MutationObserver(setVars); | ||
@@ -658,7 +658,10 @@ ob.observe(instance.subTree.el.parentNode, { childList: true }); | ||
if (nextValue && existingInvoker) { | ||
existingInvoker.value = nextValue; | ||
existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue; | ||
} else { | ||
const [name, options] = parseName(rawName); | ||
if (nextValue) { | ||
const invoker = invokers[rawName] = createInvoker(nextValue, instance); | ||
const invoker = invokers[rawName] = createInvoker( | ||
!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, | ||
instance | ||
); | ||
addEventListener(el, name, invoker, options); | ||
@@ -706,2 +709,12 @@ } else if (existingInvoker) { | ||
} | ||
function sanitizeEventValue(value, propName) { | ||
if (isFunction(value) || isArray(value)) { | ||
return value; | ||
} | ||
warn( | ||
`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? | ||
Expected function or array of functions, received type ${typeof value}.` | ||
); | ||
return NOOP; | ||
} | ||
function patchStopImmediatePropagation(e, value) { | ||
@@ -714,3 +727,5 @@ if (isArray(value)) { | ||
}; | ||
return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); | ||
return value.map( | ||
(fn) => (e2) => !e2._stopped && fn && fn(e2) | ||
); | ||
} else { | ||
@@ -916,3 +931,3 @@ return value; | ||
_setAttr(key) { | ||
let value = this.getAttribute(key); | ||
let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0; | ||
const camelKey = camelize$1(key); | ||
@@ -1083,3 +1098,24 @@ if (this._numberProps && this._numberProps[camelKey]) { | ||
let tag = rawProps.tag || Fragment; | ||
prevChildren = children; | ||
prevChildren = []; | ||
if (children) { | ||
for (let i = 0; i < children.length; i++) { | ||
const child = children[i]; | ||
if (child.el && child.el instanceof Element) { | ||
prevChildren.push(child); | ||
setTransitionHooks( | ||
child, | ||
resolveTransitionHooks( | ||
child, | ||
cssTransitionProps, | ||
state, | ||
instance | ||
) | ||
); | ||
positionMap.set( | ||
child, | ||
child.el.getBoundingClientRect() | ||
); | ||
} | ||
} | ||
} | ||
children = slots.default ? getTransitionRawChildren(slots.default()) : []; | ||
@@ -1097,12 +1133,2 @@ for (let i = 0; i < children.length; i++) { | ||
} | ||
if (prevChildren) { | ||
for (let i = 0; i < prevChildren.length; i++) { | ||
const child = prevChildren[i]; | ||
setTransitionHooks( | ||
child, | ||
resolveTransitionHooks(child, cssTransitionProps, state, instance) | ||
); | ||
positionMap.set(child, child.el.getBoundingClientRect()); | ||
} | ||
} | ||
return createVNode(tag, null, children); | ||
@@ -1206,3 +1232,3 @@ }; | ||
return; | ||
const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value; | ||
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; | ||
const newValue = value == null ? "" : value; | ||
@@ -1310,3 +1336,3 @@ if (elValue === newValue) { | ||
mounted(el, { value, modifiers: { number } }) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
}, | ||
@@ -1318,3 +1344,3 @@ beforeUpdate(el, _binding, vnode) { | ||
if (!el._assigning) { | ||
setSelected(el, value, number); | ||
setSelected(el, value); | ||
} | ||
@@ -1339,5 +1365,3 @@ } | ||
if (optionType === "string" || optionType === "number") { | ||
option.selected = value.includes( | ||
number ? looseToNumber(optionValue) : optionValue | ||
); | ||
option.selected = value.some((v) => String(v) === String(optionValue)); | ||
} else { | ||
@@ -1344,0 +1368,0 @@ option.selected = looseIndexOf(value, optionValue) > -1; |
{ | ||
"name": "@vue/runtime-dom", | ||
"version": "3.4.21", | ||
"version": "3.4.22", | ||
"description": "@vue/runtime-dom", | ||
@@ -53,5 +53,5 @@ "main": "index.js", | ||
"csstype": "^3.1.3", | ||
"@vue/shared": "3.4.21", | ||
"@vue/runtime-core": "3.4.21" | ||
"@vue/shared": "3.4.22", | ||
"@vue/runtime-core": "3.4.22" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1055430
28970
22
9
+ Added@vue/reactivity@3.4.22(transitive)
+ Added@vue/runtime-core@3.4.22(transitive)
+ Added@vue/shared@3.4.22(transitive)
- Removed@vue/reactivity@3.4.21(transitive)
- Removed@vue/runtime-core@3.4.21(transitive)
- Removed@vue/shared@3.4.21(transitive)
Updated@vue/runtime-core@3.4.22
Updated@vue/shared@3.4.22