This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

25
node_modules/element-plus/lib/utils/dom/aria.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
/**
* Determine if the testing element is visible on screen no matter if its on the viewport or not
*/
export declare const isVisible: (element: HTMLElement) => boolean;
export declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
/**
* @desc Determine if target element is focusable
* @param element {HTMLElement}
* @returns {Boolean} true if it is focusable
*/
export declare const isFocusable: (element: HTMLElement) => boolean;
/**
* Trigger an event
* mouseenter, mouseleave, mouseover, keyup, change, click, etc.
* @param {HTMLElement} elm
* @param {String} name
* @param {*} opts
*/
export declare const triggerEvent: (elm: HTMLElement, name: string, ...opts: Array<boolean>) => HTMLElement;
export declare const isLeaf: (el: HTMLElement) => boolean;
export declare const getSibling: (el: HTMLElement, distance: number, elClass: string) => Element | null;
export declare const focusElement: (el?: HTMLElement | {
focus: () => void;
} | null, options?: FocusOptions) => void;
export declare const focusNode: (el: HTMLElement) => void;

93
node_modules/element-plus/lib/utils/dom/aria.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
const isHTMLElement = (e) => {
if (typeof Element === "undefined")
return false;
return e instanceof Element;
};
const isVisible = (element) => {
const computed = getComputedStyle(element);
return computed.position === "fixed" ? false : element.offsetParent !== null;
};
const obtainAllFocusableElements = (element) => {
return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
};
const isFocusable = (element) => {
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
return true;
}
if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") {
return false;
}
switch (element.nodeName) {
case "A": {
return !!element.href && element.rel !== "ignore";
}
case "INPUT": {
return !(element.type === "hidden" || element.type === "file");
}
case "BUTTON":
case "SELECT":
case "TEXTAREA": {
return true;
}
default: {
return false;
}
}
};
const triggerEvent = function(elm, name, ...opts) {
let eventName;
if (name.includes("mouse") || name.includes("click")) {
eventName = "MouseEvents";
} else if (name.includes("key")) {
eventName = "KeyboardEvent";
} else {
eventName = "HTMLEvents";
}
const evt = document.createEvent(eventName);
evt.initEvent(name, ...opts);
elm.dispatchEvent(evt);
return elm;
};
const isLeaf = (el) => !el.getAttribute("aria-owns");
const getSibling = (el, distance, elClass) => {
const { parentNode } = el;
if (!parentNode)
return null;
const siblings = parentNode.querySelectorAll(elClass);
const index = Array.prototype.indexOf.call(siblings, el);
return siblings[index + distance] || null;
};
const focusElement = (el, options) => {
if (!el || !el.focus)
return;
let cleanup = false;
if (isHTMLElement(el) && !isFocusable(el) && !el.getAttribute("tabindex")) {
el.setAttribute("tabindex", "-1");
cleanup = true;
}
el.focus(options);
if (isHTMLElement(el) && cleanup) {
el.removeAttribute("tabindex");
}
};
const focusNode = (el) => {
if (!el)
return;
focusElement(el);
!isLeaf(el) && el.click();
};
exports.focusElement = focusElement;
exports.focusNode = focusNode;
exports.getSibling = getSibling;
exports.isFocusable = isFocusable;
exports.isLeaf = isLeaf;
exports.isVisible = isVisible;
exports.obtainAllFocusableElements = obtainAllFocusableElements;
exports.triggerEvent = triggerEvent;
//# sourceMappingURL=aria.js.map

1
node_modules/element-plus/lib/utils/dom/aria.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/element-plus/lib/utils/dom/element.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
type GetElement = <T extends string | HTMLElement | Window | null | undefined>(target: T) => T extends string ? HTMLElement | null : T;
export declare const getElement: GetElement;
export {};

22
node_modules/element-plus/lib/utils/dom/element.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@vueuse/core');
var shared = require('@vue/shared');
const getElement = (target) => {
if (!core.isClient || target === "")
return null;
if (shared.isString(target)) {
try {
return document.querySelector(target);
} catch (e) {
return null;
}
}
return target;
};
exports.getElement = getElement;
//# sourceMappingURL=element.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"element.js","sources":["../../../../../packages/utils/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\nimport { isClient } from '../browser'\n\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\n target: T\n) => T extends string ? HTMLElement | null : T\n\nexport const getElement = ((\n target: string | HTMLElement | Window | null | undefined\n) => {\n if (!isClient || target === '') return null\n if (isString(target)) {\n try {\n return document.querySelector<HTMLElement>(target)\n } catch {\n return null\n }\n }\n return target\n}) as GetElement\n"],"names":["isClient","isString"],"mappings":";;;;;;;AAEY,MAAC,UAAU,GAAG,CAAC,MAAM,KAAK;AACtC,EAAE,IAAI,CAACA,aAAQ,IAAI,MAAM,KAAK,EAAE;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,IAAIC,eAAQ,CAAC,MAAM,CAAC,EAAE;AACxB,IAAI,IAAI;AACR,MAAM,OAAO,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAC5C,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}

6
node_modules/element-plus/lib/utils/dom/event.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export declare const composeEventHandlers: <E>(theirsHandler?: (event: E) => boolean | void, oursHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
checkForDefaultPrevented?: boolean | undefined;
}) => (event: E) => void;
type WhenMouseHandler = (e: PointerEvent) => any;
export declare const whenMouse: (handler: WhenMouseHandler) => WhenMouseHandler;
export {};

20
node_modules/element-plus/lib/utils/dom/event.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
const handleEvent = (event) => {
const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
if (checkForDefaultPrevented === false || !shouldPrevent) {
return oursHandler == null ? void 0 : oursHandler(event);
}
};
return handleEvent;
};
const whenMouse = (handler) => {
return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
};
exports.composeEventHandlers = composeEventHandlers;
exports.whenMouse = whenMouse;
//# sourceMappingURL=event.js.map

1
node_modules/element-plus/lib/utils/dom/event.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"event.js","sources":["../../../../../packages/utils/dom/event.ts"],"sourcesContent":["export const composeEventHandlers = <E>(\n theirsHandler?: (event: E) => boolean | void,\n oursHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) => {\n const handleEvent = (event: E) => {\n const shouldPrevent = theirsHandler?.(event)\n\n if (checkForDefaultPrevented === false || !shouldPrevent) {\n return oursHandler?.(event)\n }\n }\n return handleEvent\n}\n\ntype WhenMouseHandler = (e: PointerEvent) => any\nexport const whenMouse = (handler: WhenMouseHandler): WhenMouseHandler => {\n return (e: PointerEvent) =>\n e.pointerType === 'mouse' ? handler(e) : undefined\n}\n"],"names":[],"mappings":";;;;AAAY,MAAC,oBAAoB,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK;AAC9G,EAAE,MAAM,WAAW,GAAG,CAAC,KAAK,KAAK;AACjC,IAAI,MAAM,aAAa,GAAG,aAAa,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAChF,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,aAAa,EAAE;AAC9D,MAAM,OAAO,WAAW,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAC/D,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO,WAAW,CAAC;AACrB,EAAE;AACU,MAAC,SAAS,GAAG,CAAC,OAAO,KAAK;AACtC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;AAChE;;;;;"}

6
node_modules/element-plus/lib/utils/dom/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export * from './aria';
export * from './event';
export * from './position';
export * from './scroll';
export * from './style';
export * from './element';

44
node_modules/element-plus/lib/utils/dom/index.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var aria = require('./aria.js');
var event = require('./event.js');
var position = require('./position.js');
var scroll = require('./scroll.js');
var style = require('./style.js');
var element = require('./element.js');
exports.focusElement = aria.focusElement;
exports.focusNode = aria.focusNode;
exports.getSibling = aria.getSibling;
exports.isFocusable = aria.isFocusable;
exports.isLeaf = aria.isLeaf;
exports.isVisible = aria.isVisible;
exports.obtainAllFocusableElements = aria.obtainAllFocusableElements;
exports.triggerEvent = aria.triggerEvent;
exports.composeEventHandlers = event.composeEventHandlers;
exports.whenMouse = event.whenMouse;
exports.getClientXY = position.getClientXY;
exports.getOffsetTop = position.getOffsetTop;
exports.getOffsetTopDistance = position.getOffsetTopDistance;
exports.isInContainer = position.isInContainer;
exports.animateScrollTo = scroll.animateScrollTo;
exports.getScrollBarWidth = scroll.getScrollBarWidth;
exports.getScrollContainer = scroll.getScrollContainer;
exports.getScrollElement = scroll.getScrollElement;
exports.getScrollTop = scroll.getScrollTop;
exports.isScroll = scroll.isScroll;
exports.scrollIntoView = scroll.scrollIntoView;
exports.addClass = style.addClass;
exports.addUnit = style.addUnit;
exports.classNameToArray = style.classNameToArray;
exports.getStyle = style.getStyle;
exports.hasClass = style.hasClass;
exports.removeClass = style.removeClass;
exports.removeStyle = style.removeStyle;
exports.setStyle = style.setStyle;
exports.getElement = element.getElement;
//# sourceMappingURL=index.js.map

1
node_modules/element-plus/lib/utils/dom/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,7 @@
export declare const isInContainer: (el?: Element, container?: Element | Window) => boolean;
export declare const getOffsetTop: (el: HTMLElement) => number;
export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
export declare const getClientXY: (event: MouseEvent | TouchEvent) => {
clientX: number;
clientY: number;
};

59
node_modules/element-plus/lib/utils/dom/position.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@vueuse/core');
const isInContainer = (el, container) => {
if (!core.isClient || !el || !container)
return false;
const elRect = el.getBoundingClientRect();
let containerRect;
if (container instanceof Element) {
containerRect = container.getBoundingClientRect();
} else {
containerRect = {
top: 0,
right: window.innerWidth,
bottom: window.innerHeight,
left: 0
};
}
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
};
const getOffsetTop = (el) => {
let offset = 0;
let parent = el;
while (parent) {
offset += parent.offsetTop;
parent = parent.offsetParent;
}
return offset;
};
const getOffsetTopDistance = (el, containerEl) => {
return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
};
const getClientXY = (event) => {
let clientX;
let clientY;
if (event.type === "touchend") {
clientY = event.changedTouches[0].clientY;
clientX = event.changedTouches[0].clientX;
} else if (event.type.startsWith("touch")) {
clientY = event.touches[0].clientY;
clientX = event.touches[0].clientX;
} else {
clientY = event.clientY;
clientX = event.clientX;
}
return {
clientX,
clientY
};
};
exports.getClientXY = getClientXY;
exports.getOffsetTop = getOffsetTop;
exports.getOffsetTopDistance = getOffsetTopDistance;
exports.isInContainer = isInContainer;
//# sourceMappingURL=position.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"position.js","sources":["../../../../../packages/utils/dom/position.ts"],"sourcesContent":["import { isClient } from '../browser'\n\nexport const isInContainer = (\n el?: Element,\n container?: Element | Window\n): boolean => {\n if (!isClient || !el || !container) return false\n\n const elRect = el.getBoundingClientRect()\n\n let containerRect: Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>\n if (container instanceof Element) {\n containerRect = container.getBoundingClientRect()\n } else {\n containerRect = {\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n left: 0,\n }\n }\n return (\n elRect.top < containerRect.bottom &&\n elRect.bottom > containerRect.top &&\n elRect.right > containerRect.left &&\n elRect.left < containerRect.right\n )\n}\n\nexport const getOffsetTop = (el: HTMLElement) => {\n let offset = 0\n let parent = el\n\n while (parent) {\n offset += parent.offsetTop\n parent = parent.offsetParent as HTMLElement\n }\n\n return offset\n}\n\nexport const getOffsetTopDistance = (\n el: HTMLElement,\n containerEl: HTMLElement\n) => {\n return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl))\n}\n\nexport const getClientXY = (event: MouseEvent | TouchEvent) => {\n let clientX: number\n let clientY: number\n if (event.type === 'touchend') {\n clientY = (event as TouchEvent).changedTouches[0].clientY\n clientX = (event as TouchEvent).changedTouches[0].clientX\n } else if (event.type.startsWith('touch')) {\n clientY = (event as TouchEvent).touches[0].clientY\n clientX = (event as TouchEvent).touches[0].clientX\n } else {\n clientY = (event as MouseEvent).clientY\n clientX = (event as MouseEvent).clientX\n }\n return {\n clientX,\n clientY,\n }\n}\n"],"names":["isClient"],"mappings":";;;;;;AACY,MAAC,aAAa,GAAG,CAAC,EAAE,EAAE,SAAS,KAAK;AAChD,EAAE,IAAI,CAACA,aAAQ,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,MAAM,MAAM,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;AAC5C,EAAE,IAAI,aAAa,CAAC;AACpB,EAAE,IAAI,SAAS,YAAY,OAAO,EAAE;AACpC,IAAI,aAAa,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;AACtD,GAAG,MAAM;AACT,IAAI,aAAa,GAAG;AACpB,MAAM,GAAG,EAAE,CAAC;AACZ,MAAM,KAAK,EAAE,MAAM,CAAC,UAAU;AAC9B,MAAM,MAAM,EAAE,MAAM,CAAC,WAAW;AAChC,MAAM,IAAI,EAAE,CAAC;AACb,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,MAAM,CAAC,GAAG,GAAG,aAAa,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC;AAC1J,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,EAAE,KAAK;AACpC,EAAE,IAAI,MAAM,GAAG,CAAC,CAAC;AACjB,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,OAAO,MAAM,EAAE;AACjB,IAAI,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC;AAC/B,IAAI,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;AACjC,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB,EAAE;AACU,MAAC,oBAAoB,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK;AACzD,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;AAChE,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,KAAK,KAAK;AACtC,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9C,IAAI,OAAO,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9C,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AAC7C,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACvC,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACvC,GAAG,MAAM;AACT,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC5B,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC5B,GAAG;AACH,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;;;;"}

11
node_modules/element-plus/lib/utils/dom/scroll.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export declare const isScroll: (el: HTMLElement, isVertical?: boolean) => boolean;
export declare const getScrollContainer: (el: HTMLElement, isVertical?: boolean) => Window | HTMLElement | undefined;
export declare const getScrollBarWidth: (namespace: string) => number;
/**
* Scroll with in the container element, positioning the **selected** element at the top
* of the container
*/
export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
export declare function animateScrollTo(container: HTMLElement | Window, from: number, to: number, duration: number, callback?: unknown): () => void;
export declare const getScrollElement: (target: HTMLElement, container: HTMLElement | Window) => HTMLElement;
export declare const getScrollTop: (container: HTMLElement | Window) => number;

126
node_modules/element-plus/lib/utils/dom/scroll.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@vueuse/core');
var easings = require('../easings.js');
var types = require('../types.js');
var raf = require('../raf.js');
var style = require('./style.js');
var shared = require('@vue/shared');
const isScroll = (el, isVertical) => {
if (!core.isClient)
return false;
const key = {
undefined: "overflow",
true: "overflow-y",
false: "overflow-x"
}[String(isVertical)];
const overflow = style.getStyle(el, key);
return ["scroll", "auto", "overlay"].some((s) => overflow.includes(s));
};
const getScrollContainer = (el, isVertical) => {
if (!core.isClient)
return;
let parent = el;
while (parent) {
if ([window, document, document.documentElement].includes(parent))
return window;
if (isScroll(parent, isVertical))
return parent;
parent = parent.parentNode;
}
return parent;
};
let scrollBarWidth;
const getScrollBarWidth = (namespace) => {
var _a;
if (!core.isClient)
return 0;
if (scrollBarWidth !== void 0)
return scrollBarWidth;
const outer = document.createElement("div");
outer.className = `${namespace}-scrollbar__wrap`;
outer.style.visibility = "hidden";
outer.style.width = "100px";
outer.style.position = "absolute";
outer.style.top = "-9999px";
document.body.appendChild(outer);
const widthNoScroll = outer.offsetWidth;
outer.style.overflow = "scroll";
const inner = document.createElement("div");
inner.style.width = "100%";
outer.appendChild(inner);
const widthWithScroll = inner.offsetWidth;
(_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
scrollBarWidth = widthNoScroll - widthWithScroll;
return scrollBarWidth;
};
function scrollIntoView(container, selected) {
if (!core.isClient)
return;
if (!selected) {
container.scrollTop = 0;
return;
}
const offsetParents = [];
let pointer = selected.offsetParent;
while (pointer !== null && container !== pointer && container.contains(pointer)) {
offsetParents.push(pointer);
pointer = pointer.offsetParent;
}
const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
const bottom = top + selected.offsetHeight;
const viewRectTop = container.scrollTop;
const viewRectBottom = viewRectTop + container.clientHeight;
if (top < viewRectTop) {
container.scrollTop = top;
} else if (bottom > viewRectBottom) {
container.scrollTop = bottom - container.clientHeight;
}
}
function animateScrollTo(container, from, to, duration, callback) {
const startTime = Date.now();
let handle;
const scroll = () => {
const timestamp = Date.now();
const time = timestamp - startTime;
const nextScrollTop = easings.easeInOutCubic(time > duration ? duration : time, from, to, duration);
if (types.isWindow(container)) {
container.scrollTo(window.pageXOffset, nextScrollTop);
} else {
container.scrollTop = nextScrollTop;
}
if (time < duration) {
handle = raf.rAF(scroll);
} else if (shared.isFunction(callback)) {
callback();
}
};
scroll();
return () => {
handle && raf.cAF(handle);
};
}
const getScrollElement = (target, container) => {
if (types.isWindow(container)) {
return target.ownerDocument.documentElement;
}
return container;
};
const getScrollTop = (container) => {
if (types.isWindow(container)) {
return window.scrollY;
}
return container.scrollTop;
};
exports.animateScrollTo = animateScrollTo;
exports.getScrollBarWidth = getScrollBarWidth;
exports.getScrollContainer = getScrollContainer;
exports.getScrollElement = getScrollElement;
exports.getScrollTop = getScrollTop;
exports.isScroll = isScroll;
exports.scrollIntoView = scrollIntoView;
//# sourceMappingURL=scroll.js.map

File diff suppressed because one or more lines are too long

9
node_modules/element-plus/lib/utils/dom/style.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { CSSProperties } from 'vue';
export declare const classNameToArray: (cls?: string) => string[];
export declare const hasClass: (el: Element, cls: string) => boolean;
export declare const addClass: (el: Element, cls: string) => void;
export declare const removeClass: (el: Element, cls: string) => void;
export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
export declare const removeStyle: (element: HTMLElement, style: CSSProperties | keyof CSSProperties) => void;
export declare function addUnit(value?: string | number, defaultUnit?: string): string | undefined;

82
node_modules/element-plus/lib/utils/dom/style.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var types = require('../types.js');
var core = require('@vueuse/core');
var shared = require('@vue/shared');
var objects = require('../objects.js');
const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
const hasClass = (el, cls) => {
if (!el || !cls)
return false;
if (cls.includes(" "))
throw new Error("className should not contain space.");
return el.classList.contains(cls);
};
const addClass = (el, cls) => {
if (!el || !cls.trim())
return;
el.classList.add(...classNameToArray(cls));
};
const removeClass = (el, cls) => {
if (!el || !cls.trim())
return;
el.classList.remove(...classNameToArray(cls));
};
const getStyle = (element, styleName) => {
var _a;
if (!core.isClient || !element || !styleName)
return "";
let key = shared.camelize(styleName);
if (key === "float")
key = "cssFloat";
try {
const style = element.style[key];
if (style)
return style;
const computed = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, "");
return computed ? computed[key] : "";
} catch (e) {
return element.style[key];
}
};
const setStyle = (element, styleName, value) => {
if (!element || !styleName)
return;
if (shared.isObject(styleName)) {
objects.entriesOf(styleName).forEach(([prop, value2]) => setStyle(element, prop, value2));
} else {
const key = shared.camelize(styleName);
element.style[key] = value;
}
};
const removeStyle = (element, style) => {
if (!element || !style)
return;
if (shared.isObject(style)) {
objects.keysOf(style).forEach((prop) => removeStyle(element, prop));
} else {
setStyle(element, style, "");
}
};
function addUnit(value, defaultUnit = "px") {
if (!value)
return "";
if (types.isNumber(value) || types.isStringNumber(value)) {
return `${value}${defaultUnit}`;
} else if (shared.isString(value)) {
return value;
}
}
exports.addClass = addClass;
exports.addUnit = addUnit;
exports.classNameToArray = classNameToArray;
exports.getStyle = getStyle;
exports.hasClass = hasClass;
exports.removeClass = removeClass;
exports.removeStyle = removeStyle;
exports.setStyle = setStyle;
//# sourceMappingURL=style.js.map

1
node_modules/element-plus/lib/utils/dom/style.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long