| | |
| | | /** |
| | | * @vue/runtime-dom v3.5.25 |
| | | * @vue/runtime-dom v3.5.32 |
| | | * (c) 2018-present Yuxi (Evan) You and Vue contributors |
| | | * @license MIT |
| | | **/ |
| | |
| | | |
| | | const TRANSITION = "transition"; |
| | | const ANIMATION = "animation"; |
| | | const vtcKey = Symbol("_vtc"); |
| | | const vtcKey = /* @__PURE__ */ Symbol("_vtc"); |
| | | const DOMTransitionPropsValidators = { |
| | | name: String, |
| | | type: String, |
| | |
| | | } |
| | | } |
| | | |
| | | const vShowOriginalDisplay = Symbol("_vod"); |
| | | const vShowHidden = Symbol("_vsh"); |
| | | const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod"); |
| | | const vShowHidden = /* @__PURE__ */ Symbol("_vsh"); |
| | | const vShow = { |
| | | // used for prop mismatch check during hydration |
| | | name: "show", |
| | |
| | | }; |
| | | } |
| | | |
| | | const CSS_VAR_TEXT = Symbol(""); |
| | | const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(""); |
| | | function useCssVars(getter) { |
| | | return; |
| | | } |
| | |
| | | function removeEventListener(el, event, handler, options) { |
| | | el.removeEventListener(event, handler, options); |
| | | } |
| | | const veiKey = Symbol("_vei"); |
| | | const veiKey = /* @__PURE__ */ Symbol("_vei"); |
| | | function patchEvent(el, rawName, prevValue, nextValue, instance = null) { |
| | | const invokers = el[veiKey] || (el[veiKey] = {}); |
| | | const existingInvoker = invokers[rawName]; |
| | |
| | | } |
| | | } else if ( |
| | | // #11081 force set props for possible async custom element |
| | | el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue)) |
| | | el._isVueCE && // #12408 check if it's declared prop or it's async custom element |
| | | (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private |
| | | el._def.__asyncLoader && (/[A-Z]/.test(key) || !shared.isString(nextValue))) |
| | | ) { |
| | | patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key); |
| | | } else { |
| | |
| | | } |
| | | return key in el; |
| | | } |
| | | function shouldSetAsPropForVueCE(el, key) { |
| | | const props = ( |
| | | // @ts-expect-error _def is private |
| | | el._def.props |
| | | ); |
| | | if (!props) { |
| | | return false; |
| | | } |
| | | const camelKey = shared.camelize(key); |
| | | return Array.isArray(props) ? props.some((prop) => shared.camelize(prop) === camelKey) : Object.keys(props).some((prop) => shared.camelize(prop) === camelKey); |
| | | } |
| | | |
| | | const REMOVAL = {}; |
| | | // @__NO_SIDE_EFFECTS__ |
| | |
| | | this._dirty = false; |
| | | this._numberProps = null; |
| | | this._styleChildren = /* @__PURE__ */ new WeakSet(); |
| | | this._styleAnchors = /* @__PURE__ */ new WeakMap(); |
| | | this._ob = null; |
| | | if (this.shadowRoot && _createApp !== createApp) { |
| | | this._root = this.shadowRoot; |
| | |
| | | } |
| | | this._connected = true; |
| | | let parent = this; |
| | | while (parent = parent && (parent.parentNode || parent.host)) { |
| | | while (parent = parent && // #12479 should check assignedSlot first to get correct parent |
| | | (parent.assignedSlot || parent.parentNode || parent.host)) { |
| | | if (parent instanceof VueElement) { |
| | | this._parent = parent; |
| | | break; |
| | |
| | | } |
| | | return vnode; |
| | | } |
| | | _applyStyles(styles, owner) { |
| | | _applyStyles(styles, owner, parentComp) { |
| | | if (!styles) return; |
| | | if (owner) { |
| | | if (owner === this._def || this._styleChildren.has(owner)) { |
| | |
| | | this._styleChildren.add(owner); |
| | | } |
| | | const nonce = this._nonce; |
| | | const root = this.shadowRoot; |
| | | const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root); |
| | | let last = null; |
| | | 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); |
| | | root.insertBefore(s, last || insertionAnchor); |
| | | last = s; |
| | | if (i === 0) { |
| | | if (!parentComp) this._styleAnchors.set(this._def, s); |
| | | if (owner) this._styleAnchors.set(owner, s); |
| | | } |
| | | } |
| | | } |
| | | _getStyleAnchor(comp) { |
| | | if (!comp) { |
| | | return null; |
| | | } |
| | | const anchor = this._styleAnchors.get(comp); |
| | | if (anchor && anchor.parentNode === this.shadowRoot) { |
| | | return anchor; |
| | | } |
| | | if (anchor) { |
| | | this._styleAnchors.delete(comp); |
| | | } |
| | | return null; |
| | | } |
| | | _getRootStyleInsertionAnchor(root) { |
| | | for (let i = 0; i < root.childNodes.length; i++) { |
| | | const node = root.childNodes[i]; |
| | | if (!(node instanceof HTMLStyleElement)) { |
| | | return node; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * Only called when shadowRoot is false |
| | |
| | | /** |
| | | * @internal |
| | | */ |
| | | _injectChildStyle(comp) { |
| | | this._applyStyles(comp.styles, comp); |
| | | _injectChildStyle(comp, parentComp) { |
| | | this._applyStyles(comp.styles, comp, parentComp); |
| | | } |
| | | /** |
| | | * @internal |
| | |
| | | if (this._dirty && this._instance) { |
| | | this._update(); |
| | | } |
| | | } |
| | | /** |
| | | * @internal |
| | | */ |
| | | _hasShadowRoot() { |
| | | return this._def.shadowRoot !== false; |
| | | } |
| | | /** |
| | | * @internal |
| | |
| | | |
| | | const positionMap = /* @__PURE__ */ new WeakMap(); |
| | | const newPositionMap = /* @__PURE__ */ new WeakMap(); |
| | | const moveCbKey = Symbol("_moveCb"); |
| | | const enterCbKey = Symbol("_enterCb"); |
| | | const moveCbKey = /* @__PURE__ */ Symbol("_moveCb"); |
| | | const enterCbKey = /* @__PURE__ */ Symbol("_enterCb"); |
| | | const decorate = (t) => { |
| | | delete t.props.mode; |
| | | return t; |
| | |
| | | instance |
| | | ) |
| | | ); |
| | | positionMap.set(child, { |
| | | left: child.el.offsetLeft, |
| | | top: child.el.offsetTop |
| | | }); |
| | | positionMap.set(child, getPosition(child.el)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | function recordPosition(c) { |
| | | newPositionMap.set(c, { |
| | | left: c.el.offsetLeft, |
| | | top: c.el.offsetTop |
| | | }); |
| | | newPositionMap.set(c, getPosition(c.el)); |
| | | } |
| | | function applyTranslation(c) { |
| | | const oldPos = positionMap.get(c); |
| | |
| | | const dx = oldPos.left - newPos.left; |
| | | const dy = oldPos.top - newPos.top; |
| | | if (dx || dy) { |
| | | const s = c.el.style; |
| | | s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; |
| | | const el = c.el; |
| | | const s = el.style; |
| | | const rect = el.getBoundingClientRect(); |
| | | let scaleX = 1; |
| | | let scaleY = 1; |
| | | if (el.offsetWidth) scaleX = rect.width / el.offsetWidth; |
| | | if (el.offsetHeight) scaleY = rect.height / el.offsetHeight; |
| | | if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1; |
| | | if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1; |
| | | if (Math.abs(scaleX - 1) < 0.01) scaleX = 1; |
| | | if (Math.abs(scaleY - 1) < 0.01) scaleY = 1; |
| | | s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`; |
| | | s.transitionDuration = "0s"; |
| | | return c; |
| | | } |
| | | } |
| | | function getPosition(el) { |
| | | const rect = el.getBoundingClientRect(); |
| | | return { |
| | | left: rect.left, |
| | | top: rect.top |
| | | }; |
| | | } |
| | | function hasCSSTransform(el, root, moveClass) { |
| | | const clone = el.cloneNode(); |
| | |
| | | target.dispatchEvent(new Event("input")); |
| | | } |
| | | } |
| | | const assignKey = Symbol("_assign"); |
| | | const assignKey = /* @__PURE__ */ Symbol("_assign"); |
| | | function castValue(value, trim, number) { |
| | | if (trim) value = value.trim(); |
| | | if (number) value = shared.looseToNumber(value); |
| | |
| | | if (elValue === newValue) { |
| | | return; |
| | | } |
| | | if (document.activeElement === el && el.type !== "range") { |
| | | const rootNode = el.getRootNode(); |
| | | if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") { |
| | | if (lazy && value === oldValue) { |
| | | return; |
| | | } |
| | |
| | | exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) |
| | | }; |
| | | const withModifiers = (fn, modifiers) => { |
| | | if (!fn) return fn; |
| | | const cache = fn._withMods || (fn._withMods = {}); |
| | | const cacheKey = modifiers.join("."); |
| | | return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => { |