🔧 npm update

This commit is contained in:
2025-04-15 20:50:11 +02:00
parent ce5b9ac0c8
commit 94a90edabd
828 changed files with 256807 additions and 197099 deletions

View File

@@ -1,5 +1,5 @@
/**
* @vue/runtime-dom v3.4.15
* @vue/runtime-dom v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
@@ -10,6 +10,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
var runtimeCore = require('@vue/runtime-core');
var shared = require('@vue/shared');
let policy = void 0;
const tt = typeof window !== "undefined" && window.trustedTypes;
if (tt) {
try {
policy = /* @__PURE__ */ tt.createPolicy("vue", {
createHTML: (val) => val
});
} catch (e) {
}
}
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
const svgNS = "http://www.w3.org/2000/svg";
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
const doc = typeof document !== "undefined" ? document : null;
@@ -25,7 +36,7 @@ const nodeOps = {
}
},
createElement: (tag, namespace, is, props) => {
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
if (tag === "select" && props && props.multiple != null) {
el.setAttribute("multiple", props.multiple);
}
@@ -54,11 +65,12 @@ const nodeOps = {
if (start && (start === end || start.nextSibling)) {
while (true) {
parent.insertBefore(start.cloneNode(true), anchor);
if (start === end || !(start = start.nextSibling))
break;
if (start === end || !(start = start.nextSibling)) break;
}
} else {
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
templateContainer.innerHTML = unsafeToTrustedHTML(
namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
);
const template = templateContainer.content;
if (namespace === "svg" || namespace === "mathml") {
const wrapper = template.firstChild;
@@ -81,8 +93,6 @@ const nodeOps = {
const TRANSITION = "transition";
const ANIMATION = "animation";
const vtcKey = Symbol("_vtc");
const Transition = (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots);
Transition.displayName = "Transition";
const DOMTransitionPropsValidators = {
name: String,
type: String,
@@ -101,11 +111,19 @@ const DOMTransitionPropsValidators = {
leaveActiveClass: String,
leaveToClass: String
};
const TransitionPropsValidators = Transition.props = /* @__PURE__ */ shared.extend(
const TransitionPropsValidators = /* @__PURE__ */ shared.extend(
{},
runtimeCore.BaseTransitionPropsValidators,
DOMTransitionPropsValidators
);
const decorate$1 = (t) => {
t.displayName = "Transition";
t.props = TransitionPropsValidators;
return t;
};
const Transition = /* @__PURE__ */ decorate$1(
(props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots)
);
const callHook = (hook, args = []) => {
if (shared.isArray(hook)) {
hook.forEach((h2) => h2(...args));
@@ -153,7 +171,8 @@ function resolveTransitionProps(rawProps) {
onAppear = onEnter,
onAppearCancelled = onEnterCancelled
} = baseProps;
const finishEnter = (el, isAppear, done) => {
const finishEnter = (el, isAppear, done, isCancelled) => {
el._enterCancelled = isCancelled;
removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
done && done();
@@ -196,8 +215,13 @@ function resolveTransitionProps(rawProps) {
el._isLeaving = true;
const resolve = () => finishLeave(el, done);
addTransitionClass(el, leaveFromClass);
forceReflow();
addTransitionClass(el, leaveActiveClass);
if (!el._enterCancelled) {
forceReflow();
addTransitionClass(el, leaveActiveClass);
} else {
addTransitionClass(el, leaveActiveClass);
forceReflow();
}
nextFrame(() => {
if (!el._isLeaving) {
return;
@@ -211,11 +235,11 @@ function resolveTransitionProps(rawProps) {
callHook(onLeave, [el, resolve]);
},
onEnterCancelled(el) {
finishEnter(el, false);
finishEnter(el, false, void 0, true);
callHook(onEnterCancelled, [el]);
},
onAppearCancelled(el) {
finishEnter(el, true);
finishEnter(el, true, void 0, true);
callHook(onAppearCancelled, [el]);
},
onLeaveCancelled(el) {
@@ -265,7 +289,7 @@ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
resolve();
}
};
if (explicitTimeout) {
if (explicitTimeout != null) {
return setTimeout(resolveIfNotStale, explicitTimeout);
}
const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
@@ -336,8 +360,7 @@ function getTimeout(delays, durations) {
return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
}
function toMs(s) {
if (s === "auto")
return 0;
if (s === "auto") return 0;
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
}
function forceReflow() {
@@ -358,10 +381,11 @@ function patchClass(el, value, isSVG) {
}
}
const vShowOldKey = Symbol("_vod");
const vShowOriginalDisplay = Symbol("_vod");
const vShowHidden = Symbol("_vsh");
const vShow = {
beforeMount(el, { value }, { transition }) {
el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
if (transition && value) {
transition.beforeEnter(el);
} else {
@@ -374,8 +398,7 @@ const vShow = {
}
},
updated(el, { value, oldValue }, { transition }) {
if (!value === !oldValue)
return;
if (!value === !oldValue) return;
if (transition) {
if (value) {
transition.beforeEnter(el);
@@ -395,7 +418,8 @@ const vShow = {
}
};
function setDisplay(el, value) {
el.style.display = value ? el[vShowOldKey] : "none";
el.style.display = value ? el[vShowOriginalDisplay] : "none";
el[vShowHidden] = !value;
}
function initVShowForSSR() {
vShow.getSSRProps = ({ value }) => {
@@ -410,19 +434,32 @@ function useCssVars(getter) {
return;
}
const displayRE = /(^|;)\s*display\s*:/;
function patchStyle(el, prev, next) {
const style = el.style;
const currentDisplay = style.display;
const isCssString = shared.isString(next);
let hasControlledDisplay = false;
if (next && !isCssString) {
if (prev && !shared.isString(prev)) {
for (const key in prev) {
if (next[key] == null) {
setStyle(style, key, "");
if (prev) {
if (!shared.isString(prev)) {
for (const key in prev) {
if (next[key] == null) {
setStyle(style, key, "");
}
}
} else {
for (const prevStyle of prev.split(";")) {
const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
if (next[key] == null) {
setStyle(style, key, "");
}
}
}
}
for (const key in next) {
if (key === "display") {
hasControlledDisplay = true;
}
setStyle(style, key, next[key]);
}
} else {
@@ -433,13 +470,17 @@ function patchStyle(el, prev, next) {
next += ";" + cssVarText;
}
style.cssText = next;
hasControlledDisplay = displayRE.test(next);
}
} else if (prev) {
el.removeAttribute("style");
}
}
if (vShowOldKey in el) {
style.display = currentDisplay;
if (vShowOriginalDisplay in el) {
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
if (el[vShowHidden]) {
style.display = "none";
}
}
}
const importantRE = /\s*!important$/;
@@ -447,8 +488,7 @@ function setStyle(style, name, val) {
if (shared.isArray(val)) {
val.forEach((v) => setStyle(style, name, v));
} else {
if (val == null)
val = "";
if (val == null) val = "";
if (name.startsWith("--")) {
style.setProperty(name, val);
} else {
@@ -487,7 +527,7 @@ function autoPrefix(style, rawName) {
}
const xlinkNS = "http://www.w3.org/1999/xlink";
function patchAttr(el, key, value, isSVG, instance) {
function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) {
if (isSVG && key.startsWith("xlink:")) {
if (value == null) {
el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
@@ -495,35 +535,40 @@ function patchAttr(el, key, value, isSVG, instance) {
el.setAttributeNS(xlinkNS, key, value);
}
} else {
const isBoolean = shared.isSpecialBooleanAttr(key);
if (value == null || isBoolean && !shared.includeBooleanAttr(value)) {
el.removeAttribute(key);
} else {
el.setAttribute(key, isBoolean ? "" : value);
el.setAttribute(
key,
isBoolean ? "" : shared.isSymbol(value) ? String(value) : value
);
}
}
}
function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
function patchDOMProp(el, key, value, parentComponent, attrName) {
if (key === "innerHTML" || key === "textContent") {
if (prevChildren) {
unmountChildren(prevChildren, parentComponent, parentSuspense);
if (value != null) {
el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
}
el[key] = value == null ? "" : value;
return;
}
const tag = el.tagName;
if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
!tag.includes("-")) {
el._value = value;
const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
const newValue = value == null ? "" : value;
if (oldValue !== newValue) {
const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
const newValue = value == null ? (
// #11647: value should be set as empty string for null and undefined,
// but <input type="checkbox"> should be set as 'on'.
el.type === "checkbox" ? "on" : ""
) : String(value);
if (oldValue !== newValue || !("_value" in el)) {
el.value = newValue;
}
if (value == null) {
el.removeAttribute(key);
}
el._value = value;
return;
}
let needRemove = false;
@@ -543,7 +588,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
el[key] = value;
} catch (e) {
}
needRemove && el.removeAttribute(key);
needRemove && el.removeAttribute(attrName || key);
}
function addEventListener(el, event, handler, options) {
@@ -561,7 +606,10 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
} else {
const [name, options] = parseName(rawName);
if (nextValue) {
const invoker = invokers[rawName] = createInvoker(nextValue, instance);
const invoker = invokers[rawName] = createInvoker(
nextValue,
instance
);
addEventListener(el, name, invoker, options);
} else if (existingInvoker) {
removeEventListener(el, name, existingInvoker, options);
@@ -611,7 +659,9 @@ function patchStopImmediatePropagation(e, value) {
originalStop.call(e);
e._stopped = true;
};
return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
return value.map(
(fn) => (e2) => !e2._stopped && fn && fn(e2)
);
} else {
return value;
}
@@ -619,7 +669,7 @@ function patchStopImmediatePropagation(e, value) {
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
const isSVG = namespace === "svg";
if (key === "class") {
patchClass(el, nextValue, isSVG);
@@ -630,15 +680,15 @@ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, paren
patchEvent(el, key, prevValue, nextValue, parentComponent);
}
} else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
patchDOMProp(
el,
key,
nextValue,
prevChildren,
parentComponent,
parentSuspense,
unmountChildren
);
patchDOMProp(el, key, nextValue);
if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
}
} else if (
// #11081 force set props for possible async custom element
el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue))
) {
patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key);
} else {
if (key === "true-value") {
el._trueValue = nextValue;
@@ -682,66 +732,110 @@ function shouldSetAsProp(el, key, value, isSVG) {
return key in el;
}
const REMOVAL = {};
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function defineCustomElement(options, hydrate2) {
const Comp = runtimeCore.defineComponent(options);
function defineCustomElement(options, extraOptions, _createApp) {
const Comp = runtimeCore.defineComponent(options, extraOptions);
if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions);
class VueCustomElement extends VueElement {
constructor(initialProps) {
super(Comp, initialProps, hydrate2);
super(Comp, initialProps, _createApp);
}
}
VueCustomElement.def = Comp;
return VueCustomElement;
}
/*! #__NO_SIDE_EFFECTS__ */
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
return /* @__PURE__ */ defineCustomElement(options, hydrate);
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
};
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
};
class VueElement extends BaseClass {
constructor(_def, _props = {}, hydrate2) {
constructor(_def, _props = {}, _createApp = createApp) {
super();
this._def = _def;
this._props = _props;
this._createApp = _createApp;
this._isVueCE = true;
/**
* @internal
*/
this._instance = null;
/**
* @internal
*/
this._app = null;
/**
* @internal
*/
this._nonce = this._def.nonce;
this._connected = false;
this._resolved = false;
this._numberProps = null;
this._styleChildren = /* @__PURE__ */ new WeakSet();
this._ob = null;
if (this.shadowRoot && hydrate2) {
hydrate2(this._createVNode(), this.shadowRoot);
if (this.shadowRoot && _createApp !== createApp) {
this._root = this.shadowRoot;
} else {
this.attachShadow({ mode: "open" });
if (!this._def.__asyncLoader) {
this._resolveProps(this._def);
if (_def.shadowRoot !== false) {
this.attachShadow({ mode: "open" });
this._root = this.shadowRoot;
} else {
this._root = this;
}
}
if (!this._def.__asyncLoader) {
this._resolveProps(this._def);
}
}
connectedCallback() {
if (!this.isConnected) return;
if (!this.shadowRoot) {
this._parseSlots();
}
this._connected = true;
let parent = this;
while (parent = parent && (parent.parentNode || parent.host)) {
if (parent instanceof VueElement) {
this._parent = parent;
break;
}
}
if (!this._instance) {
if (this._resolved) {
this._setParent();
this._update();
} else {
this._resolveDef();
if (parent && parent._pendingResolve) {
this._pendingResolve = parent._pendingResolve.then(() => {
this._pendingResolve = void 0;
this._resolveDef();
});
} else {
this._resolveDef();
}
}
}
}
_setParent(parent = this._parent) {
if (parent) {
this._instance.parent = parent._instance;
this._instance.provides = parent._instance.provides;
}
}
disconnectedCallback() {
this._connected = false;
if (this._ob) {
this._ob.disconnect();
this._ob = null;
}
runtimeCore.nextTick(() => {
if (!this._connected) {
render(null, this.shadowRoot);
this._instance = null;
if (this._ob) {
this._ob.disconnect();
this._ob = null;
}
this._app && this._app.unmount();
if (this._instance) this._instance.ce = void 0;
this._app = this._instance = null;
}
});
}
@@ -749,7 +843,9 @@ class VueElement extends BaseClass {
* resolve inner component definition (handle possible async component)
*/
_resolveDef() {
this._resolved = true;
if (this._pendingResolve) {
return;
}
for (let i = 0; i < this.attributes.length; i++) {
this._setAttr(this.attributes[i].name);
}
@@ -760,6 +856,8 @@ class VueElement extends BaseClass {
});
this._ob.observe(this, { attributes: true });
const resolve = (def, isAsync = false) => {
this._resolved = true;
this._pendingResolve = void 0;
const { props, styles } = def;
let numberProps;
if (props && !shared.isArray(props)) {
@@ -777,22 +875,44 @@ class VueElement extends BaseClass {
if (isAsync) {
this._resolveProps(def);
}
this._applyStyles(styles);
this._update();
if (this.shadowRoot) {
this._applyStyles(styles);
}
this._mount(def);
};
const asyncDef = this._def.__asyncLoader;
if (asyncDef) {
asyncDef().then((def) => resolve(def, true));
this._pendingResolve = asyncDef().then(
(def) => resolve(this._def = def, true)
);
} else {
resolve(this._def);
}
}
_mount(def) {
this._app = this._createApp(def);
if (def.configureApp) {
def.configureApp(this._app);
}
this._app._ceVNode = this._createVNode();
this._app.mount(this._root);
const exposed = this._instance && this._instance.exposed;
if (!exposed) return;
for (const key in exposed) {
if (!shared.hasOwn(this, key)) {
Object.defineProperty(this, key, {
// unwrap ref to be consistent with public instance behavior
get: () => runtimeCore.unref(exposed[key])
});
}
}
}
_resolveProps(def) {
const { props } = def;
const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {});
for (const key of Object.keys(this)) {
if (key[0] !== "_" && declaredPropKeys.includes(key)) {
this._setProp(key, this[key], true, false);
this._setProp(key, this[key]);
}
}
for (const key of declaredPropKeys.map(shared.camelize)) {
@@ -801,18 +921,20 @@ class VueElement extends BaseClass {
return this._getProp(key);
},
set(val) {
this._setProp(key, val);
this._setProp(key, val, true, true);
}
});
}
}
_setAttr(key) {
let value = this.getAttribute(key);
if (key.startsWith("data-v-")) return;
const has = this.hasAttribute(key);
let value = has ? this.getAttribute(key) : REMOVAL;
const camelKey = shared.camelize(key);
if (this._numberProps && this._numberProps[camelKey]) {
if (has && this._numberProps && this._numberProps[camelKey]) {
value = shared.toNumber(value);
}
this._setProp(camelKey, value, false);
this._setProp(camelKey, value, false, true);
}
/**
* @internal
@@ -823,13 +945,22 @@ class VueElement extends BaseClass {
/**
* @internal
*/
_setProp(key, val, shouldReflect = true, shouldUpdate = true) {
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
if (val !== this._props[key]) {
this._props[key] = val;
if (val === REMOVAL) {
delete this._props[key];
} else {
this._props[key] = val;
if (key === "key" && this._app) {
this._app._ceVNode.key = val;
}
}
if (shouldUpdate && this._instance) {
this._update();
}
if (shouldReflect) {
const ob = this._ob;
ob && ob.disconnect();
if (val === true) {
this.setAttribute(shared.hyphenate(key), "");
} else if (typeof val === "string" || typeof val === "number") {
@@ -837,23 +968,30 @@ class VueElement extends BaseClass {
} else if (!val) {
this.removeAttribute(shared.hyphenate(key));
}
ob && ob.observe(this, { attributes: true });
}
}
}
_update() {
render(this._createVNode(), this.shadowRoot);
render(this._createVNode(), this._root);
}
_createVNode() {
const vnode = runtimeCore.createVNode(this._def, shared.extend({}, this._props));
const baseProps = {};
if (!this.shadowRoot) {
baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
}
const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props));
if (!this._instance) {
vnode.ce = (instance) => {
this._instance = instance;
instance.ce = this;
instance.isCE = true;
const dispatch = (event, args) => {
this.dispatchEvent(
new CustomEvent(event, {
detail: args
})
new CustomEvent(
event,
shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args }
)
);
};
instance.emit = (event, ...args) => {
@@ -862,27 +1000,92 @@ class VueElement extends BaseClass {
dispatch(shared.hyphenate(event), args);
}
};
let parent = this;
while (parent = parent && (parent.parentNode || parent.host)) {
if (parent instanceof VueElement) {
instance.parent = parent._instance;
instance.provides = parent._instance.provides;
break;
}
}
this._setParent();
};
}
return vnode;
}
_applyStyles(styles) {
if (styles) {
styles.forEach((css) => {
const s = document.createElement("style");
s.textContent = css;
this.shadowRoot.appendChild(s);
});
_applyStyles(styles, owner) {
if (!styles) return;
if (owner) {
if (owner === this._def || this._styleChildren.has(owner)) {
return;
}
this._styleChildren.add(owner);
}
const nonce = this._nonce;
for (let i = styles.length - 1; i >= 0; i--) {
const s = document.createElement("style");
if (nonce) s.setAttribute("nonce", nonce);
s.textContent = styles[i];
this.shadowRoot.prepend(s);
}
}
/**
* Only called when shadowRoot is false
*/
_parseSlots() {
const slots = this._slots = {};
let n;
while (n = this.firstChild) {
const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
(slots[slotName] || (slots[slotName] = [])).push(n);
this.removeChild(n);
}
}
/**
* Only called when shadowRoot is false
*/
_renderSlots() {
const outlets = (this._teleportTarget || this).querySelectorAll("slot");
const scopeId = this._instance.type.__scopeId;
for (let i = 0; i < outlets.length; i++) {
const o = outlets[i];
const slotName = o.getAttribute("name") || "default";
const content = this._slots[slotName];
const parent = o.parentNode;
if (content) {
for (const n of content) {
if (scopeId && n.nodeType === 1) {
const id = scopeId + "-s";
const walker = document.createTreeWalker(n, 1);
n.setAttribute(id, "");
let child;
while (child = walker.nextNode()) {
child.setAttribute(id, "");
}
}
parent.insertBefore(n, o);
}
} else {
while (o.firstChild) parent.insertBefore(o.firstChild, o);
}
parent.removeChild(o);
}
}
/**
* @internal
*/
_injectChildStyle(comp) {
this._applyStyles(comp.styles, comp);
}
/**
* @internal
*/
_removeChildStyle(comp) {
}
}
function useHost(caller) {
const instance = runtimeCore.getCurrentInstance();
const el = instance && instance.ce;
if (el) {
return el;
}
return null;
}
function useShadowRoot() {
const el = useHost();
return el && el.shadowRoot;
}
function useCssModule(name = "$style") {
@@ -907,7 +1110,11 @@ const positionMap = /* @__PURE__ */ new WeakMap();
const newPositionMap = /* @__PURE__ */ new WeakMap();
const moveCbKey = Symbol("_moveCb");
const enterCbKey = Symbol("_enterCb");
const TransitionGroupImpl = {
const decorate = (t) => {
delete t.props.mode;
return t;
};
const TransitionGroupImpl = /* @__PURE__ */ decorate({
name: "TransitionGroup",
props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, {
tag: String,
@@ -956,7 +1163,28 @@ const TransitionGroupImpl = {
const rawProps = runtimeCore.toRaw(props);
const cssTransitionProps = resolveTransitionProps(rawProps);
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()) : [];
for (let i = 0; i < children.length; i++) {
const child = children[i];
@@ -967,22 +1195,10 @@ const TransitionGroupImpl = {
);
}
}
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);
};
}
};
const removeMode = (props) => delete props.mode;
/* @__PURE__ */ removeMode(TransitionGroupImpl.props);
});
const TransitionGroup = TransitionGroupImpl;
function callPendingCbs(c) {
const el = c.el;
@@ -1045,8 +1261,7 @@ const vModelText = {
el[assignKey] = getModelAssigner(vnode);
const castToNumber = number || vnode.props && vnode.props.type === "number";
addEventListener(el, lazy ? "change" : "input", (e) => {
if (e.target.composing)
return;
if (e.target.composing) return;
let domValue = el.value;
if (trim) {
domValue = domValue.trim();
@@ -1071,17 +1286,16 @@ const vModelText = {
mounted(el, { value }) {
el.value = value == null ? "" : value;
},
beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
el[assignKey] = getModelAssigner(vnode);
if (el.composing)
return;
const elValue = number || el.type === "number" ? shared.looseToNumber(el.value) : el.value;
if (el.composing) return;
const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value;
const newValue = value == null ? "" : value;
if (elValue === newValue) {
return;
}
if (document.activeElement === el && el.type !== "range") {
if (lazy) {
if (lazy && value === oldValue) {
return;
}
if (trim && el.value.trim() === newValue) {
@@ -1133,12 +1347,17 @@ const vModelCheckbox = {
};
function setChecked(el, { value, oldValue }, vnode) {
el._modelValue = value;
let checked;
if (shared.isArray(value)) {
el.checked = shared.looseIndexOf(value, vnode.props.value) > -1;
checked = shared.looseIndexOf(value, vnode.props.value) > -1;
} else if (shared.isSet(value)) {
el.checked = value.has(vnode.props.value);
} else if (value !== oldValue) {
el.checked = shared.looseEqual(value, getCheckboxValue(el, true));
checked = value.has(vnode.props.value);
} else {
if (value === oldValue) return;
checked = shared.looseEqual(value, getCheckboxValue(el, true));
}
if (el.checked !== checked) {
el.checked = checked;
}
}
const vModelRadio = {
@@ -1177,27 +1396,24 @@ const vModelSelect = {
},
// set value in mounted & updated because <select> relies on its children
// <option>s.
mounted(el, { value, oldValue, modifiers: { number } }) {
setSelected(el, value, oldValue, number);
mounted(el, { value }) {
setSelected(el, value);
},
beforeUpdate(el, _binding, vnode) {
el[assignKey] = getModelAssigner(vnode);
},
updated(el, { value, oldValue, modifiers: { number } }) {
updated(el, { value }) {
if (!el._assigning) {
setSelected(el, value, oldValue, number);
setSelected(el, value);
}
}
};
function setSelected(el, value, oldValue, number) {
function setSelected(el, value) {
const isMultiple = el.multiple;
const isArrayValue = shared.isArray(value);
if (isMultiple && !isArrayValue && !shared.isSet(value)) {
return;
}
if (isArrayValue && shared.looseEqual(value, oldValue)) {
return;
}
for (let i = 0, l = el.options.length; i < l; i++) {
const option = el.options[i];
const optionValue = getValue(option);
@@ -1205,21 +1421,16 @@ function setSelected(el, value, oldValue, number) {
if (isArrayValue) {
const optionType = typeof optionValue;
if (optionType === "string" || optionType === "number") {
option.selected = value.includes(
number ? shared.looseToNumber(optionValue) : optionValue
);
option.selected = value.some((v) => String(v) === String(optionValue));
} else {
option.selected = shared.looseIndexOf(value, optionValue) > -1;
}
} else {
option.selected = value.has(optionValue);
}
} else {
if (shared.looseEqual(getValue(option), value)) {
if (el.selectedIndex !== i)
el.selectedIndex = i;
return;
}
} else if (shared.looseEqual(getValue(option), value)) {
if (el.selectedIndex !== i) el.selectedIndex = i;
return;
}
}
if (!isMultiple && el.selectedIndex !== -1) {
@@ -1327,8 +1538,7 @@ const withModifiers = (fn, modifiers) => {
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
for (let i = 0; i < modifiers.length; i++) {
const guard = modifierGuards[modifiers[i]];
if (guard && guard(event, modifiers))
return;
if (guard && guard(event, modifiers)) return;
}
return fn(event, ...args);
});
@@ -1350,7 +1560,9 @@ const withKeys = (fn, modifiers) => {
return;
}
const eventKey = shared.hyphenate(event.key);
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
if (modifiers.some(
(k) => k === eventKey || keyNames[k] === eventKey
)) {
return fn(event);
}
});
@@ -1378,13 +1590,14 @@ const createApp = (...args) => {
const { mount } = app;
app.mount = (containerOrSelector) => {
const container = normalizeContainer(containerOrSelector);
if (!container)
return;
if (!container) return;
const component = app._component;
if (!shared.isFunction(component) && !component.render && !component.template) {
component.template = container.innerHTML;
}
container.innerHTML = "";
if (container.nodeType === 1) {
container.textContent = "";
}
const proxy = mount(container, false, resolveRootNamespace(container));
if (container instanceof Element) {
container.removeAttribute("v-cloak");
@@ -1441,6 +1654,8 @@ exports.initDirectivesForSSR = initDirectivesForSSR;
exports.render = render;
exports.useCssModule = useCssModule;
exports.useCssVars = useCssVars;
exports.useHost = useHost;
exports.useShadowRoot = useShadowRoot;
exports.vModelCheckbox = vModelCheckbox;
exports.vModelDynamic = vModelDynamic;
exports.vModelRadio = vModelRadio;