This commit is contained in:
2025-11-03 17:03:57 +08:00
commit 7a04b85667
16804 changed files with 2492292 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
export declare const unique: <T>(arr: T[]) => T[];
export declare const extractFirst: <T>(arr: T | T[]) => T;
type Many<T> = T | ReadonlyArray<T>;
/** like `_.castArray`, except falsy value returns empty array. */
export declare const castArray: <T>(arr: Many<T>) => T[];
export { castArray as ensureArray } from 'lodash-unified';

15
frontend/node_modules/element-plus/es/utils/arrays.mjs generated vendored Normal file
View File

@@ -0,0 +1,15 @@
export { castArray as ensureArray } from 'lodash-unified';
import { isArray } from '@vue/shared';
const unique = (arr) => [...new Set(arr)];
const extractFirst = (arr) => {
return isArray(arr) ? arr[0] : arr;
};
const castArray = (arr) => {
if (!arr && arr !== 0)
return [];
return isArray(arr) ? arr : [arr];
};
export { castArray, extractFirst, unique };
//# sourceMappingURL=arrays.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrays.mjs","sources":["../../../../packages/utils/arrays.ts"],"sourcesContent":["import { isArray } from './types'\n\nexport const unique = <T>(arr: T[]) => [...new Set(arr)]\n\nexport const extractFirst = <T>(arr: T | T[]): T => {\n return isArray(arr) ? arr[0] : arr\n}\n\ntype Many<T> = T | ReadonlyArray<T>\n// TODO: rename to `ensureArray`\n/** like `_.castArray`, except falsy value returns empty array. */\nexport const castArray = <T>(arr: Many<T>): T[] => {\n if (!arr && (arr as any) !== 0) return []\n return isArray(arr) ? arr : [arr as T]\n}\n\n// TODO: remove import alias\n// avoid naming conflicts\nexport { castArray as ensureArray } from 'lodash-unified'\n"],"names":[],"mappings":";;;AACY,MAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AACrC,MAAC,YAAY,GAAG,CAAC,GAAG,KAAK;AACrC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AACrC,EAAE;AACU,MAAC,SAAS,GAAG,CAAC,GAAG,KAAK;AAClC,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACvB,IAAI,OAAO,EAAE,CAAC;AACd,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AACpC;;;;"}

View File

@@ -0,0 +1,4 @@
import { isClient, isIOS } from '@vueuse/core';
export declare const isFirefox: () => boolean;
export declare const isAndroid: () => boolean;
export { isClient, isIOS };

View File

@@ -0,0 +1,8 @@
import { isClient } from '@vueuse/core';
export { isClient, isIOS } from '@vueuse/core';
const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
const isAndroid = () => isClient && /android/i.test(window.navigator.userAgent);
export { isAndroid, isFirefox };
//# sourceMappingURL=browser.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"browser.mjs","sources":["../../../../packages/utils/browser.ts"],"sourcesContent":["import { isClient, isIOS } from '@vueuse/core'\n\nexport const isFirefox = (): boolean =>\n isClient && /firefox/i.test(window.navigator.userAgent)\n\nexport const isAndroid = (): boolean =>\n isClient && /android/i.test(window.navigator.userAgent)\n\nexport { isClient, isIOS }\n"],"names":[],"mappings":";;;AACY,MAAC,SAAS,GAAG,MAAM,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE;AAC3E,MAAC,SAAS,GAAG,MAAM,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;;;;"}

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;

View File

@@ -0,0 +1,82 @@
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();
};
export { focusElement, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent };
//# sourceMappingURL=aria.mjs.map

File diff suppressed because one or more lines are too long

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 {};

View File

@@ -0,0 +1,18 @@
import { isClient } from '@vueuse/core';
import { isString } from '@vue/shared';
const getElement = (target) => {
if (!isClient || target === "")
return null;
if (isString(target)) {
try {
return document.querySelector(target);
} catch (e) {
return null;
}
}
return target;
};
export { getElement };
//# sourceMappingURL=element.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"element.mjs","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":[],"mappings":";;;AAEY,MAAC,UAAU,GAAG,CAAC,MAAM,KAAK;AACtC,EAAE,IAAI,CAAC,QAAQ,IAAI,MAAM,KAAK,EAAE;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,IAAI,QAAQ,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;;;;"}

View File

@@ -0,0 +1,8 @@
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 declare const getEventCode: (event: KeyboardEvent) => string;
export declare const getEventKey: (event: KeyboardEvent) => string;
export {};

View File

@@ -0,0 +1,42 @@
import { isAndroid } from '../browser.mjs';
import { EVENT_CODE } from '../../constants/aria.mjs';
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;
};
const getEventCode = (event) => {
if (event.code && event.code !== "Unidentified")
return event.code;
const key = getEventKey(event);
if (key) {
if (Object.values(EVENT_CODE).includes(key))
return key;
switch (key) {
case " ":
return EVENT_CODE.space;
default:
return "";
}
}
return "";
};
const getEventKey = (event) => {
let key = event.key && event.key !== "Unidentified" ? event.key : "";
if (!key && event.type === "keyup" && isAndroid()) {
const target = event.target;
key = target.value.charAt(target.selectionStart - 1);
}
return key;
};
export { composeEventHandlers, getEventCode, getEventKey, whenMouse };
//# sourceMappingURL=event.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"event.mjs","sources":["../../../../../packages/utils/dom/event.ts"],"sourcesContent":["import { EVENT_CODE } from '@element-plus/constants'\nimport { isAndroid } from '../browser'\n\nexport 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\nexport const getEventCode = (event: KeyboardEvent): string => {\n if (event.code && event.code !== 'Unidentified') return event.code\n // On android, event.code is always '' (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code#browser_compatibility)\n const key = getEventKey(event)\n\n if (key) {\n if (Object.values(EVENT_CODE).includes(key)) return key\n\n switch (key) {\n case ' ':\n return EVENT_CODE.space\n default:\n return ''\n }\n }\n\n return ''\n}\n\nexport const getEventKey = (event: KeyboardEvent): string => {\n let key = event.key && event.key !== 'Unidentified' ? event.key : ''\n\n // On Android, event.key and event.code may not be useful when entering characters or space\n // So here we directly get the last character of the input\n // **only takes effect in the keyup event**\n if (!key && event.type === 'keyup' && isAndroid()) {\n const target = event.target as HTMLInputElement\n key = target.value.charAt(target.selectionStart! - 1)\n }\n\n return key\n}\n"],"names":[],"mappings":";;;AAEY,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,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc;AACjD,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC;AACtB,EAAE,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AACjC,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC/C,MAAM,OAAO,GAAG,CAAC;AACjB,IAAI,QAAQ,GAAG;AACf,MAAM,KAAK,GAAG;AACd,QAAQ,OAAO,UAAU,CAAC,KAAK,CAAC;AAChC,MAAM;AACN,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,EAAE,CAAC;AACZ,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,KAAK,KAAK;AACtC,EAAE,IAAI,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,cAAc,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;AACvE,EAAE,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,EAAE,EAAE;AACrD,IAAI,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAChC,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AACzD,GAAG;AACH,EAAE,OAAO,GAAG,CAAC;AACb;;;;"}

View File

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

View File

@@ -0,0 +1,7 @@
export { focusElement, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent } from './aria.mjs';
export { composeEventHandlers, getEventCode, getEventKey, whenMouse } from './event.mjs';
export { getClientXY, getOffsetTop, getOffsetTopDistance, isInContainer } from './position.mjs';
export { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView } from './scroll.mjs';
export { addClass, addUnit, classNameToArray, getStyle, hasClass, removeClass, removeStyle, setStyle } from './style.mjs';
export { getElement } from './element.mjs';
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","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;
};

View File

@@ -0,0 +1,52 @@
import { isClient } from '@vueuse/core';
const isInContainer = (el, container) => {
if (!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
};
};
export { getClientXY, getOffsetTop, getOffsetTopDistance, isInContainer };
//# sourceMappingURL=position.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"position.mjs","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":[],"mappings":";;AACY,MAAC,aAAa,GAAG,CAAC,EAAE,EAAE,SAAS,KAAK;AAChD,EAAE,IAAI,CAAC,QAAQ,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;;;;"}

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;

View File

@@ -0,0 +1,116 @@
import { isClient } from '@vueuse/core';
import { easeInOutCubic } from '../easings.mjs';
import { isWindow } from '../types.mjs';
import { rAF, cAF } from '../raf.mjs';
import { getStyle } from './style.mjs';
import { isFunction } from '@vue/shared';
const isScroll = (el, isVertical) => {
if (!isClient)
return false;
const key = {
undefined: "overflow",
true: "overflow-y",
false: "overflow-x"
}[String(isVertical)];
const overflow = getStyle(el, key);
return ["scroll", "auto", "overlay"].some((s) => overflow.includes(s));
};
const getScrollContainer = (el, isVertical) => {
if (!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 (!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 (!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 = easeInOutCubic(time > duration ? duration : time, from, to, duration);
if (isWindow(container)) {
container.scrollTo(window.pageXOffset, nextScrollTop);
} else {
container.scrollTop = nextScrollTop;
}
if (time < duration) {
handle = rAF(scroll);
} else if (isFunction(callback)) {
callback();
}
};
scroll();
return () => {
handle && cAF(handle);
};
}
const getScrollElement = (target, container) => {
if (isWindow(container)) {
return target.ownerDocument.documentElement;
}
return container;
};
const getScrollTop = (container) => {
if (isWindow(container)) {
return window.scrollY;
}
return container.scrollTop;
};
export { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView };
//# sourceMappingURL=scroll.mjs.map

File diff suppressed because one or more lines are too long

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;

View File

@@ -0,0 +1,71 @@
import { isNumber, isStringNumber } from '../types.mjs';
import { isClient } from '@vueuse/core';
import { camelize, isObject, isString } from '@vue/shared';
import { entriesOf, keysOf } from '../objects.mjs';
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 (!isClient || !element || !styleName)
return "";
let key = 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 (isObject(styleName)) {
entriesOf(styleName).forEach(([prop, value2]) => setStyle(element, prop, value2));
} else {
const key = camelize(styleName);
element.style[key] = value;
}
};
const removeStyle = (element, style) => {
if (!element || !style)
return;
if (isObject(style)) {
keysOf(style).forEach((prop) => removeStyle(element, prop));
} else {
setStyle(element, style, "");
}
};
function addUnit(value, defaultUnit = "px") {
if (!value)
return "";
if (isNumber(value) || isStringNumber(value)) {
return `${value}${defaultUnit}`;
} else if (isString(value)) {
return value;
}
}
export { addClass, addUnit, classNameToArray, getStyle, hasClass, removeClass, removeStyle, setStyle };
//# sourceMappingURL=style.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;

View File

@@ -0,0 +1,11 @@
function easeInOutCubic(t, b, c, d) {
const cc = c - b;
t /= d / 2;
if (t < 1) {
return cc / 2 * t * t * t + b;
}
return cc / 2 * ((t -= 2) * t * t + 2) + b;
}
export { easeInOutCubic };
//# sourceMappingURL=easings.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"easings.mjs","sources":["../../../../packages/utils/easings.ts"],"sourcesContent":["export function easeInOutCubic(t: number, b: number, c: number, d: number) {\n const cc = c - b\n t /= d / 2\n if (t < 1) {\n return (cc / 2) * t * t * t + b\n }\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC3C,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE;AACb,IAAI,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClC,GAAG;AACH,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7C;;;;"}

View File

@@ -0,0 +1,3 @@
export declare function throwError(scope: string, m: string): never;
export declare function debugWarn(err: Error): void;
export declare function debugWarn(scope: string, message: string): void;

14
frontend/node_modules/element-plus/es/utils/error.mjs generated vendored Normal file
View File

@@ -0,0 +1,14 @@
class ElementPlusError extends Error {
constructor(m) {
super(m);
this.name = "ElementPlusError";
}
}
function throwError(scope, m) {
throw new ElementPlusError(`[${scope}] ${m}`);
}
function debugWarn(scope, message) {
}
export { debugWarn, throwError };
//# sourceMappingURL=error.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"error.mjs","sources":["../../../../packages/utils/error.ts"],"sourcesContent":["import { isString } from './types'\n\nclass ElementPlusError extends Error {\n constructor(m: string) {\n super(m)\n this.name = 'ElementPlusError'\n }\n}\n\nexport function throwError(scope: string, m: string): never {\n throw new ElementPlusError(`[${scope}] ${m}`)\n}\n\nexport function debugWarn(err: Error): void\nexport function debugWarn(scope: string, message: string): void\nexport function debugWarn(scope: string | Error, message?: string): void {\n if (process.env.NODE_ENV !== 'production') {\n const error: Error = isString(scope)\n ? new ElementPlusError(`[${scope}] ${message}`)\n : scope\n // eslint-disable-next-line no-console\n console.warn(error)\n }\n}\n"],"names":[],"mappings":"AACA,MAAM,gBAAgB,SAAS,KAAK,CAAC;AACrC,EAAE,WAAW,CAAC,CAAC,EAAE;AACjB,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACb,IAAI,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;AACnC,GAAG;AACH,CAAC;AACM,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;AACrC,EAAE,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AACM,SAAS,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE;AAK1C;;;;"}

View File

@@ -0,0 +1 @@
export { NOOP, toRawType } from '@vue/shared';

View File

@@ -0,0 +1,2 @@
export { NOOP, toRawType } from '@vue/shared';
//# sourceMappingURL=functions.mjs.map

View File

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

View File

@@ -0,0 +1 @@
export declare const isKorean: (text: string) => boolean;

4
frontend/node_modules/element-plus/es/utils/i18n.mjs generated vendored Normal file
View File

@@ -0,0 +1,4 @@
const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
export { isKorean };
//# sourceMappingURL=i18n.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"i18n.mjs","sources":["../../../../packages/utils/i18n.ts"],"sourcesContent":["export const isKorean = (text: string) =>\n /([\\uAC00-\\uD7AF\\u3130-\\u318F])+/gi.test(text)\n"],"names":[],"mappings":"AAAY,MAAC,QAAQ,GAAG,CAAC,IAAI,KAAK,mCAAmC,CAAC,IAAI,CAAC,IAAI;;;;"}

15
frontend/node_modules/element-plus/es/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
export * from './dom';
export * from './vue';
export * from './arrays';
export * from './browser';
export * from './error';
export * from './functions';
export * from './i18n';
export * from './objects';
export * from './raf';
export * from './rand';
export * from './strings';
export * from './types';
export * from './typescript';
export * from './throttleByRaf';
export * from './easings';

30
frontend/node_modules/element-plus/es/utils/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,30 @@
export { castArray, extractFirst, unique } from './arrays.mjs';
export { isAndroid, isFirefox } from './browser.mjs';
export { debugWarn, throwError } from './error.mjs';
export { isKorean } from './i18n.mjs';
export { entriesOf, getProp, keysOf } from './objects.mjs';
export { cAF, rAF } from './raf.mjs';
export { generateId, getRandomInt } from './rand.mjs';
export { capitalize, escapeStringRegexp, kebabCase } from './strings.mjs';
export { isBoolean, isElement, isEmpty, isNumber, isPropAbsent, isStringNumber, isUndefined, isWindow } from './types.mjs';
export { mutable } from './typescript.mjs';
export { throttleByRaf } from './throttleByRaf.mjs';
export { easeInOutCubic } from './easings.mjs';
export { focusElement, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent } from './dom/aria.mjs';
export { composeEventHandlers, getEventCode, getEventKey, whenMouse } from './dom/event.mjs';
export { getClientXY, getOffsetTop, getOffsetTopDistance, isInContainer } from './dom/position.mjs';
export { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView } from './dom/scroll.mjs';
export { addClass, addUnit, classNameToArray, getStyle, hasClass, removeClass, removeStyle, setStyle } from './dom/style.mjs';
export { getElement } from './dom/element.mjs';
export { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode } from './vue/global-node.mjs';
export { CloseComponents, TypeComponents, TypeComponentsMap, ValidateComponentsMap, iconPropType } from './vue/icon.mjs';
export { withInstall, withInstallDirective, withInstallFunction, withNoopInstall } from './vue/install.mjs';
export { buildProp, buildProps, definePropType, epPropKey, isEpProp } from './vue/props/runtime.mjs';
export { composeRefs } from './vue/refs.mjs';
export { getComponentSize } from './vue/size.mjs';
export { isValidComponentSize, isValidDatePickType } from './vue/validator.mjs';
export { PatchFlags, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf } from './vue/vnode.mjs';
export { castArray as ensureArray } from 'lodash-unified';
export { isClient, isIOS } from '@vueuse/core';
export { NOOP, camelize, hasOwn, hyphenate, isArray, isDate, isFunction, isObject, isPlainObject, isPromise, isString, isSymbol, toRawType } from '@vue/shared';
//# sourceMappingURL=index.mjs.map

View File

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

View File

@@ -0,0 +1,8 @@
import type { Entries } from 'type-fest';
import type { Arrayable } from '.';
export declare const keysOf: <T extends object>(arr: T) => Array<keyof T>;
export declare const entriesOf: <T extends object>(arr: T) => Entries<T>;
export { hasOwn } from '@vue/shared';
export declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
value: T;
};

View File

@@ -0,0 +1,18 @@
import { get, set } from 'lodash-unified';
export { hasOwn } from '@vue/shared';
const keysOf = (arr) => Object.keys(arr);
const entriesOf = (arr) => Object.entries(arr);
const getProp = (obj, path, defaultValue) => {
return {
get value() {
return get(obj, path, defaultValue);
},
set value(val) {
set(obj, path, val);
}
};
};
export { entriesOf, getProp, keysOf };
//# sourceMappingURL=objects.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"objects.mjs","sources":["../../../../packages/utils/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\n\nimport type { Entries } from 'type-fest'\nimport type { Arrayable } from '.'\n\nexport const keysOf = <T extends object>(arr: T) =>\n Object.keys(arr) as Array<keyof T>\nexport const entriesOf = <T extends object>(arr: T) =>\n Object.entries(arr) as Entries<T>\nexport { hasOwn } from '@vue/shared'\n\nexport const getProp = <T = any>(\n obj: Record<string, any>,\n path: Arrayable<string>,\n defaultValue?: any\n): { value: T } => {\n return {\n get value() {\n return get(obj, path, defaultValue)\n },\n set value(val: any) {\n set(obj, path, val)\n },\n }\n}\n"],"names":[],"mappings":";;;AACY,MAAC,MAAM,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;AACpC,MAAC,SAAS,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;AAE1C,MAAC,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,KAAK;AACpD,EAAE,OAAO;AACT,IAAI,IAAI,KAAK,GAAG;AAChB,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAC1C,KAAK;AACL,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE;AACnB,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AAC1B,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}

2
frontend/node_modules/element-plus/es/utils/raf.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare const rAF: (fn: () => void) => number;
export declare const cAF: (handle: number) => void;

7
frontend/node_modules/element-plus/es/utils/raf.mjs generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { isClient } from '@vueuse/core';
const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
export { cAF, rAF };
//# sourceMappingURL=raf.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"raf.mjs","sources":["../../../../packages/utils/raf.ts"],"sourcesContent":["import { isClient } from './browser'\n\nexport const rAF = (fn: () => void) =>\n isClient\n ? window.requestAnimationFrame(fn)\n : (setTimeout(fn, 16) as unknown as number)\n\nexport const cAF = (handle: number) =>\n isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle)\n"],"names":[],"mappings":";;AACY,MAAC,GAAG,GAAG,CAAC,EAAE,KAAK,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE;AAChF,MAAC,GAAG,GAAG,CAAC,MAAM,KAAK,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM;;;;"}

12
frontend/node_modules/element-plus/es/utils/rand.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* @deprecated Use `useId` `useIdInjection` instead
* Generate random number in range [0, 1000]
* Maybe replace with [uuid](https://www.npmjs.com/package/uuid)
*/
export declare const generateId: () => number;
/**
* @deprecated
* Generating a random int in range (0, max - 1)
* @param max {number}
*/
export declare const getRandomInt: (max: number) => number;

5
frontend/node_modules/element-plus/es/utils/rand.mjs generated vendored Normal file
View File

@@ -0,0 +1,5 @@
const generateId = () => Math.floor(Math.random() * 1e4);
const getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max));
export { generateId, getRandomInt };
//# sourceMappingURL=rand.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rand.mjs","sources":["../../../../packages/utils/rand.ts"],"sourcesContent":["/**\n * @deprecated Use `useId` `useIdInjection` instead\n * Generate random number in range [0, 1000]\n * Maybe replace with [uuid](https://www.npmjs.com/package/uuid)\n */\nexport const generateId = (): number => Math.floor(Math.random() * 10000)\n\n/**\n * @deprecated\n * Generating a random int in range (0, max - 1)\n * @param max {number}\n */\nexport const getRandomInt = (max: number) =>\n Math.floor(Math.random() * Math.floor(max))\n"],"names":[],"mappings":"AAAY,MAAC,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;AACpD,MAAC,YAAY,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
import { camelize, hyphenate } from '@vue/shared';
export { camelize, hyphenate };
export declare const kebabCase: (str: string) => string;
/**
* fork from {@link https://github.com/sindresorhus/escape-string-regexp}
*/
export declare const escapeStringRegexp: (string?: string) => string;
export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;

View File

@@ -0,0 +1,9 @@
import { capitalize as capitalize$1, hyphenate } from '@vue/shared';
export { camelize, hyphenate } from '@vue/shared';
const kebabCase = hyphenate;
const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
const capitalize = (str) => capitalize$1(str);
export { capitalize, escapeStringRegexp, kebabCase };
//# sourceMappingURL=strings.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"strings.mjs","sources":["../../../../packages/utils/strings.ts"],"sourcesContent":["import { camelize, hyphenate, capitalize as toCapitalize } from '@vue/shared'\n\nexport { camelize, hyphenate }\nexport const kebabCase = hyphenate\n\n/**\n * fork from {@link https://github.com/sindresorhus/escape-string-regexp}\n */\nexport const escapeStringRegexp = (string = '') =>\n string.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d')\n\n// NOTE: improve capitalize types. Restore previous code after the [PR](https://github.com/vuejs/core/pull/6212) merge\nexport const capitalize = <T extends string>(str: T) =>\n toCapitalize(str) as Capitalize<T>\n"],"names":["toCapitalize"],"mappings":";;;AAEY,MAAC,SAAS,GAAG,UAAU;AACvB,MAAC,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE;AAC5G,MAAC,UAAU,GAAG,CAAC,GAAG,KAAKA,YAAY,CAAC,GAAG;;;;"}

View File

@@ -0,0 +1,4 @@
export declare function throttleByRaf(cb: (...args: any[]) => void): {
(...args: any[]): void;
cancel(): void;
};

View File

@@ -0,0 +1,22 @@
import { cAF, rAF } from './raf.mjs';
function throttleByRaf(cb) {
let timer = 0;
const throttle = (...args) => {
if (timer) {
cAF(timer);
}
timer = rAF(() => {
cb(...args);
timer = 0;
});
};
throttle.cancel = () => {
cAF(timer);
timer = 0;
};
return throttle;
}
export { throttleByRaf };
//# sourceMappingURL=throttleByRaf.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"throttleByRaf.mjs","sources":["../../../../packages/utils/throttleByRaf.ts"],"sourcesContent":["import { cAF, rAF } from './raf'\n\nexport function throttleByRaf(cb: (...args: any[]) => void) {\n let timer = 0\n\n const throttle = (...args: any[]): void => {\n if (timer) {\n cAF(timer)\n }\n timer = rAF(() => {\n cb(...args)\n timer = 0\n })\n }\n\n throttle.cancel = () => {\n cAF(timer)\n timer = 0\n }\n\n return throttle\n}\n"],"names":[],"mappings":";;AACO,SAAS,aAAa,CAAC,EAAE,EAAE;AAClC,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,KAAK;AAChC,IAAI,IAAI,KAAK,EAAE;AACf,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;AACjB,KAAK;AACL,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM;AACtB,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAClB,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC;AACJ,EAAE,QAAQ,CAAC,MAAM,GAAG,MAAM;AAC1B,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;AACf,IAAI,KAAK,GAAG,CAAC,CAAC;AACd,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC;AAClB;;;;"}

View File

@@ -0,0 +1,9 @@
export { isArray, isFunction, isObject, isString, isDate, isPromise, isSymbol, isPlainObject, } from '@vue/shared';
export declare const isUndefined: (val: any) => val is undefined;
export declare const isBoolean: (val: any) => val is boolean;
export declare const isNumber: (val: any) => val is number;
export declare const isEmpty: (val: unknown) => boolean;
export declare const isElement: (e: unknown) => e is Element;
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
export declare const isStringNumber: (val: string) => boolean;
export declare const isWindow: (val: unknown) => val is Window;

24
frontend/node_modules/element-plus/es/utils/types.mjs generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import { isArray, isObject, isString } from '@vue/shared';
export { isArray, isDate, isFunction, isObject, isPlainObject, isPromise, isString, isSymbol } from '@vue/shared';
import { isNil } from 'lodash-unified';
const isUndefined = (val) => val === void 0;
const isBoolean = (val) => typeof val === "boolean";
const isNumber = (val) => typeof val === "number";
const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length;
const isElement = (e) => {
if (typeof Element === "undefined")
return false;
return e instanceof Element;
};
const isPropAbsent = (prop) => isNil(prop);
const isStringNumber = (val) => {
if (!isString(val)) {
return false;
}
return !Number.isNaN(Number(val));
};
const isWindow = (val) => val === window;
export { isBoolean, isElement, isEmpty, isNumber, isPropAbsent, isStringNumber, isUndefined, isWindow };
//# sourceMappingURL=types.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.mjs","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n isPlainObject,\n} from '@vue/shared'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined =>\n isNil(prop)\n\nexport const isStringNumber = (val: string): boolean => {\n if (!isString(val)) {\n return false\n }\n return !Number.isNaN(Number(val))\n}\n\nexport const isWindow = (val: unknown): val is Window => val === window\n"],"names":[],"mappings":";;;;AAYY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,SAAS,GAAG,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,UAAU;AAC/C,MAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,SAAS;AAC7C,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK;AAChC,EAAE,IAAI,OAAO,OAAO,KAAK,WAAW;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,OAAO,CAAC,YAAY,OAAO,CAAC;AAC9B,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;AACtC,MAAC,cAAc,GAAG,CAAC,GAAG,KAAK;AACvC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK;;;;"}

View File

@@ -0,0 +1,73 @@
export declare const mutable: <T extends readonly any[] | Record<string, unknown>>(val: T) => Mutable<typeof val>;
export type Mutable<T> = {
-readonly [P in keyof T]: T[P];
};
export type HTMLElementCustomized<T> = HTMLElement & T;
/**
* @deprecated stop to use null
* @see {@link https://github.com/sindresorhus/meta/discussions/7}
*/
export type Nullable<T> = T | null;
export type Arrayable<T> = T | T[];
export type Awaitable<T> = Promise<T> | T;
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
type BrowserNativeObject = Date | FileList | File | Blob | RegExp;
/**
* Check whether it is tuple
*
* 检查是否为元组
*
* @example
* IsTuple<[1, 2, 3]> => true
* IsTuple<Array[number]> => false
*/
type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
/**
* Array method key
*
* 数组方法键
*/
type ArrayMethodKey = keyof any[];
/**
* Tuple index key
*
* 元组下标键
*
* @example
* TupleKey<[1, 2, 3]> => '0' | '1' | '2'
*/
type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, ArrayMethodKey>;
/**
* Array index key
*
* 数组下标键
*/
type ArrayKey = number;
/**
* Helper type for recursively constructing paths through a type
*
* 用于通过一个类型递归构建路径的辅助类型
*/
type PathImpl<K extends string | number, V> = V extends Primitive | BrowserNativeObject ? `${K}` : `${K}` | `${K}.${Path<V>}`;
/**
* Type which collects all paths through a type
*
* 通过一个类型收集所有路径的类型
*
* @see {@link FieldPath}
*/
type Path<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
[K in TupleKey<T>]-?: PathImpl<Exclude<K, symbol>, T[K]>;
}[TupleKey<T>] : PathImpl<ArrayKey, V> : {
[K in keyof T]-?: PathImpl<Exclude<K, symbol>, T[K]>;
}[keyof T];
/**
* Type which collects all paths through a type
*
* 通过一个类型收集所有路径的类型
*
* @example
* FieldPath<{ 1: number; a: number; b: string; c: { d: number; e: string }; f: [{ value: string }]; g: { value: string }[]; h: Date; i: FileList; j: File; k: Blob; l: RegExp }> => '1' | 'a' | 'b' | 'c' | 'f' | 'g' | 'c.d' | 'c.e' | 'f.0' | 'f.0.value' | 'g.number' | 'g.number.value' | 'h' | 'i' | 'j' | 'k' | 'l'
*/
export type FieldPath<T> = T extends object ? Path<T> : never;
export {};

View File

@@ -0,0 +1,4 @@
const mutable = (val) => val;
export { mutable };
//# sourceMappingURL=typescript.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"typescript.mjs","sources":["../../../../packages/utils/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\nexport type Awaitable<T> = Promise<T> | T\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint\ntype BrowserNativeObject = Date | FileList | File | Blob | RegExp\n\n/**\n * Check whether it is tuple\n *\n * 检查是否为元组\n *\n * @example\n * IsTuple<[1, 2, 3]> => true\n * IsTuple<Array[number]> => false\n */\ntype IsTuple<T extends ReadonlyArray<any>> = number extends T['length']\n ? false\n : true\n\n/**\n * Array method key\n *\n * 数组方法键\n */\ntype ArrayMethodKey = keyof any[]\n\n/**\n * Tuple index key\n *\n * 元组下标键\n *\n * @example\n * TupleKey<[1, 2, 3]> => '0' | '1' | '2'\n */\ntype TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, ArrayMethodKey>\n\n/**\n * Array index key\n *\n * 数组下标键\n */\ntype ArrayKey = number\n\n/**\n * Helper type for recursively constructing paths through a type\n *\n * 用于通过一个类型递归构建路径的辅助类型\n */\ntype PathImpl<K extends string | number, V> = V extends\n | Primitive\n | BrowserNativeObject\n ? `${K}`\n : `${K}` | `${K}.${Path<V>}`\n\n/**\n * Type which collects all paths through a type\n *\n * 通过一个类型收集所有路径的类型\n *\n * @see {@link FieldPath}\n */\ntype Path<T> =\n T extends ReadonlyArray<infer V>\n ? IsTuple<T> extends true\n ? {\n [K in TupleKey<T>]-?: PathImpl<Exclude<K, symbol>, T[K]>\n }[TupleKey<T>] // tuple\n : PathImpl<ArrayKey, V> // array\n : {\n [K in keyof T]-?: PathImpl<Exclude<K, symbol>, T[K]>\n }[keyof T] // object\n\n/**\n * Type which collects all paths through a type\n *\n * 通过一个类型收集所有路径的类型\n *\n * @example\n * FieldPath<{ 1: number; a: number; b: string; c: { d: number; e: string }; f: [{ value: string }]; g: { value: string }[]; h: Date; i: FileList; j: File; k: Blob; l: RegExp }> => '1' | 'a' | 'b' | 'c' | 'f' | 'g' | 'c.d' | 'c.e' | 'f.0' | 'f.0.value' | 'g.number' | 'g.number.value' | 'h' | 'i' | 'j' | 'k' | 'l'\n */\nexport type FieldPath<T> = T extends object ? Path<T> : never\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK;;;;"}

View File

@@ -0,0 +1,3 @@
export declare function createGlobalNode(id?: string): HTMLDivElement;
export declare function removeGlobalNode(el: HTMLElement): void;
export declare function changeGlobalNodesTarget(el: HTMLElement): void;

View File

@@ -0,0 +1,32 @@
import { isClient } from '@vueuse/core';
const globalNodes = [];
let target = !isClient ? void 0 : document.body;
function createGlobalNode(id) {
const el = document.createElement("div");
if (id !== void 0) {
el.setAttribute("id", id);
}
if (target) {
target.appendChild(el);
globalNodes.push(el);
}
return el;
}
function removeGlobalNode(el) {
globalNodes.splice(globalNodes.indexOf(el), 1);
el.remove();
}
function changeGlobalNodesTarget(el) {
if (el === target)
return;
target = el;
globalNodes.forEach((el2) => {
if (target && !el2.contains(target)) {
target.appendChild(el2);
}
});
}
export { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode };
//# sourceMappingURL=global-node.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"global-node.mjs","sources":["../../../../../packages/utils/vue/global-node.ts"],"sourcesContent":["import { isClient } from '../browser'\n\nconst globalNodes: HTMLElement[] = []\nlet target: HTMLElement | undefined = !isClient ? undefined : document.body\n\nexport function createGlobalNode(id?: string) {\n const el = document.createElement('div')\n if (id !== undefined) {\n el.setAttribute('id', id)\n }\n\n if (target) {\n target.appendChild(el)\n globalNodes.push(el)\n }\n\n return el\n}\n\nexport function removeGlobalNode(el: HTMLElement) {\n globalNodes.splice(globalNodes.indexOf(el), 1)\n el.remove()\n}\n\nexport function changeGlobalNodesTarget(el: HTMLElement) {\n if (el === target) return\n\n target = el\n globalNodes.forEach((el) => {\n if (target && !el.contains(target)) {\n target.appendChild(el)\n }\n })\n}\n"],"names":[],"mappings":";;AACA,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,IAAI,MAAM,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;AACzC,SAAS,gBAAgB,CAAC,EAAE,EAAE;AACrC,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC3C,EAAE,IAAI,EAAE,KAAK,KAAK,CAAC,EAAE;AACrB,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC9B,GAAG;AACH,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAC3B,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,GAAG;AACH,EAAE,OAAO,EAAE,CAAC;AACZ,CAAC;AACM,SAAS,gBAAgB,CAAC,EAAE,EAAE;AACrC,EAAE,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACjD,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;AACd,CAAC;AACM,SAAS,uBAAuB,CAAC,EAAE,EAAE;AAC5C,EAAE,IAAI,EAAE,KAAK,MAAM;AACnB,IAAI,OAAO;AACX,EAAE,MAAM,GAAG,EAAE,CAAC;AACd,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC/B,IAAI,IAAI,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACzC,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}

View File

@@ -0,0 +1,24 @@
import type { Component } from 'vue';
export declare const iconPropType: import("vue").PropType<string | Component>;
export declare const CloseComponents: {
Close: any;
};
export declare const TypeComponents: {
Close: any;
SuccessFilled: any;
InfoFilled: any;
WarningFilled: any;
CircleCloseFilled: any;
};
export declare const TypeComponentsMap: {
primary: any;
success: any;
warning: any;
error: any;
info: any;
};
export declare const ValidateComponentsMap: {
validating: any;
success: any;
error: any;
};

View File

@@ -0,0 +1,33 @@
import { Close, SuccessFilled, InfoFilled, WarningFilled, CircleCloseFilled, Loading, CircleCheck, CircleClose } from '@element-plus/icons-vue';
import { definePropType } from './props/runtime.mjs';
const iconPropType = definePropType([
String,
Object,
Function
]);
const CloseComponents = {
Close
};
const TypeComponents = {
Close,
SuccessFilled,
InfoFilled,
WarningFilled,
CircleCloseFilled
};
const TypeComponentsMap = {
primary: InfoFilled,
success: SuccessFilled,
warning: WarningFilled,
error: CircleCloseFilled,
info: InfoFilled
};
const ValidateComponentsMap = {
validating: Loading,
success: CircleCheck,
error: CircleClose
};
export { CloseComponents, TypeComponents, TypeComponentsMap, ValidateComponentsMap, iconPropType };
//# sourceMappingURL=icon.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"icon.mjs","sources":["../../../../../packages/utils/vue/icon.ts"],"sourcesContent":["import {\n CircleCheck,\n CircleClose,\n CircleCloseFilled,\n Close,\n InfoFilled,\n Loading,\n SuccessFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\nimport { definePropType } from './props'\n\nimport type { Component } from 'vue'\n\nexport const iconPropType = definePropType<string | Component>([\n String,\n Object,\n Function,\n])\n\nexport const CloseComponents = {\n Close,\n}\n\nexport const TypeComponents = {\n Close,\n SuccessFilled,\n InfoFilled,\n WarningFilled,\n CircleCloseFilled,\n}\n\nexport const TypeComponentsMap = {\n primary: InfoFilled,\n success: SuccessFilled,\n warning: WarningFilled,\n error: CircleCloseFilled,\n info: InfoFilled,\n}\n\nexport const ValidateComponentsMap = {\n validating: Loading,\n success: CircleCheck,\n error: CircleClose,\n}\n"],"names":[],"mappings":";;;AAWY,MAAC,YAAY,GAAG,cAAc,CAAC;AAC3C,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,EAAE,KAAK;AACP,EAAE;AACU,MAAC,cAAc,GAAG;AAC9B,EAAE,KAAK;AACP,EAAE,aAAa;AACf,EAAE,UAAU;AACZ,EAAE,aAAa;AACf,EAAE,iBAAiB;AACnB,EAAE;AACU,MAAC,iBAAiB,GAAG;AACjC,EAAE,OAAO,EAAE,UAAU;AACrB,EAAE,OAAO,EAAE,aAAa;AACxB,EAAE,OAAO,EAAE,aAAa;AACxB,EAAE,KAAK,EAAE,iBAAiB;AAC1B,EAAE,IAAI,EAAE,UAAU;AAClB,EAAE;AACU,MAAC,qBAAqB,GAAG;AACrC,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,OAAO,EAAE,WAAW;AACtB,EAAE,KAAK,EAAE,WAAW;AACpB;;;;"}

View File

@@ -0,0 +1,9 @@
export * from './global-node';
export * from './icon';
export * from './install';
export * from './props';
export * from './refs';
export * from './size';
export * from './typescript';
export * from './validator';
export * from './vnode';

View File

@@ -0,0 +1,9 @@
export { changeGlobalNodesTarget, createGlobalNode, removeGlobalNode } from './global-node.mjs';
export { CloseComponents, TypeComponents, TypeComponentsMap, ValidateComponentsMap, iconPropType } from './icon.mjs';
export { withInstall, withInstallDirective, withInstallFunction, withNoopInstall } from './install.mjs';
export { composeRefs } from './refs.mjs';
export { getComponentSize } from './size.mjs';
export { isValidComponentSize, isValidDatePickType } from './validator.mjs';
export { PatchFlags, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf } from './vnode.mjs';
export { buildProp, buildProps, definePropType, epPropKey, isEpProp } from './props/runtime.mjs';
//# sourceMappingURL=index.mjs.map

View File

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

View File

@@ -0,0 +1,6 @@
import type { Directive } from 'vue';
import type { SFCInstallWithContext, SFCWithInstall } from './typescript';
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
export declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>;
export declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>;
export declare const withNoopInstall: <T>(component: T) => SFCWithInstall<T>;

View File

@@ -0,0 +1,35 @@
import { NOOP } from '@vue/shared';
const withInstall = (main, extra) => {
main.install = (app) => {
for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
app.component(comp.name, comp);
}
};
if (extra) {
for (const [key, comp] of Object.entries(extra)) {
main[key] = comp;
}
}
return main;
};
const withInstallFunction = (fn, name) => {
fn.install = (app) => {
fn._context = app._context;
app.config.globalProperties[name] = fn;
};
return fn;
};
const withInstallDirective = (directive, name) => {
directive.install = (app) => {
app.directive(name, directive);
};
return directive;
};
const withNoopInstall = (component) => {
component.install = NOOP;
return component;
};
export { withInstall, withInstallDirective, withInstallFunction, withNoopInstall };
//# sourceMappingURL=install.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"install.mjs","sources":["../../../../../packages/utils/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\n\nimport type { App, Directive } from 'vue'\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\n\nexport const withInstall = <T, E extends Record<string, any>>(\n main: T,\n extra?: E\n) => {\n ;(main as SFCWithInstall<T>).install = (app): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp)\n }\n }\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n ;(main as any)[key] = comp\n }\n }\n return main as SFCWithInstall<T> & E\n}\n\nexport const withInstallFunction = <T>(fn: T, name: string) => {\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\n ;(fn as SFCInstallWithContext<T>)._context = app._context\n app.config.globalProperties[name] = fn\n }\n\n return fn as SFCInstallWithContext<T>\n}\n\nexport const withInstallDirective = <T extends Directive>(\n directive: T,\n name: string\n) => {\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\n app.directive(name, directive)\n }\n\n return directive as SFCWithInstall<T>\n}\n\nexport const withNoopInstall = <T>(component: T) => {\n ;(component as SFCWithInstall<T>).install = NOOP\n\n return component as SFCWithInstall<T>\n}\n"],"names":[],"mappings":";;AACY,MAAC,WAAW,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AAE5C,EAAE,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC1B,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC,EAAE;AAC7E,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAErD,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACvB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,EAAE;AACU,MAAC,mBAAmB,GAAG,CAAC,EAAE,EAAE,IAAI,KAAK;AAEjD,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAExB,IAAI,EAAE,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC/B,IAAI,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3C,GAAG,CAAC;AACJ,EAAE,OAAO,EAAE,CAAC;AACZ,EAAE;AACU,MAAC,oBAAoB,GAAG,CAAC,SAAS,EAAE,IAAI,KAAK;AAEzD,EAAE,SAAS,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC/B,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACnC,GAAG,CAAC;AACJ,EAAE,OAAO,SAAS,CAAC;AACnB,EAAE;AACU,MAAC,eAAe,GAAG,CAAC,SAAS,KAAK;AAE9C,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;AAC3B,EAAE,OAAO,SAAS,CAAC;AACnB;;;;"}

View File

@@ -0,0 +1,3 @@
export * from './util';
export * from './types';
export * from './runtime';

View File

@@ -0,0 +1,2 @@
export { buildProp, buildProps, definePropType, epPropKey, isEpProp } from './runtime.mjs';
//# sourceMappingURL=index.mjs.map

View File

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

View File

@@ -0,0 +1,29 @@
import type { PropType } from 'vue';
import type { EpProp, EpPropConvert, EpPropFinalized, EpPropInput, EpPropMergeType, IfEpProp, IfNativePropType, NativePropType } from './types';
export declare const epPropKey = "__epPropKey";
export declare const definePropType: <T>(val: any) => PropType<T>;
export declare const isEpProp: (val: unknown) => val is EpProp<any, any, any>;
/**
* @description Build prop. It can better optimize prop types
* @description 生成 prop能更好地优化类型
* @example
// limited options
// the type will be PropType<'light' | 'dark'>
buildProp({
type: String,
values: ['light', 'dark'],
} as const)
* @example
// limited options and other types
// the type will be PropType<'small' | 'large' | number>
buildProp({
type: [String, Number],
values: ['small', 'large'],
validator: (val: unknown): val is number => typeof val === 'number',
} as const)
@link see more: https://github.com/element-plus/element-plus/pull/3341
*/
export declare const buildProp: <Type = never, Value = never, Validator = never, Default extends EpPropMergeType<Type, Value, Validator> = never, Required extends boolean = false>(prop: EpPropInput<Type, Value, Validator, Default, Required>, key?: string) => EpPropFinalized<Type, Value, Validator, Default, Required>;
export declare const buildProps: <Props extends Record<string, {
[epPropKey]: true;
} | NativePropType | EpPropInput<any, any, any, any, any>>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };

View File

@@ -0,0 +1,46 @@
import { warn } from 'vue';
import { fromPairs } from 'lodash-unified';
import { isObject, hasOwn } from '@vue/shared';
const epPropKey = "__epPropKey";
const definePropType = (val) => val;
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
const buildProp = (prop, key) => {
if (!isObject(prop) || isEpProp(prop))
return prop;
const { values, required, default: defaultValue, type, validator } = prop;
const _validator = values || validator ? (val) => {
let valid = false;
let allowedValues = [];
if (values) {
allowedValues = Array.from(values);
if (hasOwn(prop, "default")) {
allowedValues.push(defaultValue);
}
valid || (valid = allowedValues.includes(val));
}
if (validator)
valid || (valid = validator(val));
if (!valid && allowedValues.length > 0) {
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
}
return valid;
} : void 0;
const epProp = {
type,
required: !!required,
validator: _validator,
[epPropKey]: true
};
if (hasOwn(prop, "default"))
epProp.default = defaultValue;
return epProp;
};
const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
key,
buildProp(option, key)
]));
export { buildProp, buildProps, definePropType, epPropKey, isEpProp };
//# sourceMappingURL=runtime.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,120 @@
import type { epPropKey } from './runtime';
import type { ExtractPropTypes, PropType } from 'vue';
import type { IfNever, UnknownToNever, WritableArray } from './util';
type Value<T> = T[keyof T];
/**
* Extract the type of a single prop
*
* 提取单个 prop 的参数类型
*
* @example
* ExtractPropType<{ type: StringConstructor }> => string | undefined
* ExtractPropType<{ type: StringConstructor, required: true }> => string
* ExtractPropType<{ type: BooleanConstructor }> => boolean
*/
export type ExtractPropType<T extends object> = Value<ExtractPropTypes<{
key: T;
}>>;
/**
* Extracts types via `ExtractPropTypes`, accepting `PropType<T>`, `XXXConstructor`, `never`...
*
* 通过 `ExtractPropTypes` 提取类型,接受 `PropType<T>`、`XXXConstructor`、`never`...
*
* @example
* ResolvePropType<BooleanConstructor> => boolean
* ResolvePropType<PropType<T>> => T
**/
export type ResolvePropType<T> = IfNever<T, never, ExtractPropType<{
type: WritableArray<T>;
required: true;
}>>;
/**
* Merge Type, Value, Validator types
* 合并 Type、Value、Validator 的类型
*
* @example
* EpPropMergeType<StringConstructor, '1', 1> => 1 | "1" // ignores StringConstructor
* EpPropMergeType<StringConstructor, never, number> => string | number
*/
export type EpPropMergeType<Type, Value, Validator> = IfNever<UnknownToNever<Value>, ResolvePropType<Type>, never> | UnknownToNever<Value> | UnknownToNever<Validator>;
/**
* Handling default values for input (constraints)
*
* 处理输入参数的默认值(约束)
*/
export type EpPropInputDefault<Required extends boolean, Default> = Required extends true ? never : Default extends Record<string, unknown> | Array<any> ? () => Default : (() => Default) | Default;
/**
* Native prop types, e.g: `BooleanConstructor`, `StringConstructor`, `null`, `undefined`, etc.
*
* 原生 prop `类型BooleanConstructor`、`StringConstructor`、`null`、`undefined` 等
*/
export type NativePropType = ((...args: any) => any) | {
new (...args: any): any;
} | undefined | null;
export type IfNativePropType<T, Y, N> = [T] extends [NativePropType] ? Y : N;
/**
* input prop `buildProp` or `buildProps` (constraints)
*
* prop 输入参数(约束)
*
* @example
* EpPropInput<StringConstructor, 'a', never, never, true>
* ⬇️
* {
type?: StringConstructor | undefined;
required?: true | undefined;
values?: readonly "a"[] | undefined;
validator?: ((val: any) => boolean) | ((val: any) => val is never) | undefined;
default?: undefined;
}
*/
export type EpPropInput<Type, Value, Validator, Default extends EpPropMergeType<Type, Value, Validator>, Required extends boolean> = {
type?: Type;
required?: Required;
values?: readonly Value[];
validator?: ((val: any) => val is Validator) | ((val: any) => boolean);
default?: EpPropInputDefault<Required, Default>;
};
/**
* output prop `buildProp` or `buildProps`.
*
* prop 输出参数。
*
* @example
* EpProp<'a', 'b', true>
* ⬇️
* {
readonly type: PropType<"a">;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
readonly default: "b";
__epPropKey: true;
}
*/
export type EpProp<Type, Default, Required> = {
readonly type: PropType<Type>;
readonly required: [Required] extends [true] ? true : false;
readonly validator: ((val: unknown) => boolean) | undefined;
[epPropKey]: true;
} & IfNever<Default, unknown, {
readonly default: Default;
}>;
/**
* Determine if it is `EpProp`
*/
export type IfEpProp<T, Y, N> = T extends {
[epPropKey]: true;
} ? Y : N;
/**
* Converting input to output.
*
* 将输入转换为输出
*/
export type EpPropConvert<Input> = Input extends EpPropInput<infer Type, infer Value, infer Validator, any, infer Required> ? EpPropFinalized<Type, Value, Validator, Input['default'], Required> : never;
/**
* Finalized conversion output
*
* 最终转换 EpProp
*/
export type EpPropFinalized<Type, Value, Validator, Default, Required> = EpProp<EpPropMergeType<Type, Value, Validator>, UnknownToNever<Default>, Required>;
export {};

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=types.mjs.map

View File

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

View File

@@ -0,0 +1,8 @@
export type Writable<T> = {
-readonly [P in keyof T]: T[P];
};
export type WritableArray<T> = T extends readonly any[] ? Writable<T> : T;
export type IfNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
export type IfUnknown<T, Y, N> = [unknown] extends [T] ? Y : N;
export type UnknownToNever<T> = IfUnknown<T, never, T>;
export {};

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=util.mjs.map

View File

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

View File

@@ -0,0 +1,2 @@
import type { ComponentPublicInstance, Ref } from 'vue';
export declare const composeRefs: (...refs: Ref<HTMLElement | undefined>[]) => (el: Element | ComponentPublicInstance | null) => void;

View File

@@ -0,0 +1,10 @@
const composeRefs = (...refs) => {
return (el) => {
refs.forEach((ref) => {
ref.value = el;
});
};
};
export { composeRefs };
//# sourceMappingURL=refs.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"refs.mjs","sources":["../../../../../packages/utils/vue/refs.ts"],"sourcesContent":["import type { ComponentPublicInstance, Ref } from 'vue'\n\nexport const composeRefs = (...refs: Ref<HTMLElement | undefined>[]) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n ref.value = el as HTMLElement | undefined\n })\n }\n}\n"],"names":[],"mappings":"AAAY,MAAC,WAAW,GAAG,CAAC,GAAG,IAAI,KAAK;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK;AACjB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1B,MAAM,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;AACrB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC;AACJ;;;;"}

View File

@@ -0,0 +1,2 @@
import type { ComponentSize } from 'element-plus/es/constants';
export declare const getComponentSize: (size?: ComponentSize) => 40 | 32 | 24;

View File

@@ -0,0 +1,8 @@
import { componentSizeMap } from '../../constants/size.mjs';
const getComponentSize = (size) => {
return componentSizeMap[size || "default"];
};
export { getComponentSize };
//# sourceMappingURL=size.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"size.mjs","sources":["../../../../../packages/utils/vue/size.ts"],"sourcesContent":["import { componentSizeMap } from '@element-plus/constants'\n\nimport type { ComponentSize } from '@element-plus/constants'\n\nexport const getComponentSize = (size?: ComponentSize) => {\n return componentSizeMap[size || 'default']\n}\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,IAAI,KAAK;AAC1C,EAAE,OAAO,gBAAgB,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;AAC7C;;;;"}

View File

@@ -0,0 +1,6 @@
import type { AppContext, EmitsOptions, Plugin, SetupContext } from 'vue';
export type SFCWithInstall<T> = T & Plugin;
export type SFCInstallWithContext<T> = SFCWithInstall<T> & {
_context: AppContext | null;
};
export type EmitFn<E extends EmitsOptions> = SetupContext<E>['emit'];

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=typescript.mjs.map

View File

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

View File

@@ -0,0 +1,3 @@
import type { ComponentSize, DatePickType } from 'element-plus/es/constants';
export declare const isValidComponentSize: (val: string) => val is ComponentSize | "";
export declare const isValidDatePickType: (val: string) => val is DatePickType;

View File

@@ -0,0 +1,8 @@
import { componentSizes } from '../../constants/size.mjs';
import { datePickTypes } from '../../constants/date.mjs';
const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
const isValidDatePickType = (val) => [...datePickTypes].includes(val);
export { isValidComponentSize, isValidDatePickType };
//# sourceMappingURL=validator.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"validator.mjs","sources":["../../../../../packages/utils/vue/validator.ts"],"sourcesContent":["import { componentSizes, datePickTypes } from '@element-plus/constants'\n\nimport type { ComponentSize, DatePickType } from '@element-plus/constants'\n\nexport const isValidComponentSize = (val: string): val is ComponentSize | '' =>\n ['', ...componentSizes].includes(val)\n\nexport const isValidDatePickType = (val: string): val is DatePickType =>\n ([...datePickTypes] as string[]).includes(val)\n"],"names":[],"mappings":";;;AACY,MAAC,oBAAoB,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAG,cAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE;AACvE,MAAC,mBAAmB,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,CAAC,QAAQ,CAAC,GAAG;;;;"}

View File

@@ -0,0 +1,48 @@
import { createBlock } from 'vue';
import type { VNode, VNodeChild, VNodeNormalizedChildren } from 'vue';
export declare enum PatchFlags {
TEXT = 1,
CLASS = 2,
STYLE = 4,
PROPS = 8,
FULL_PROPS = 16,
HYDRATE_EVENTS = 32,
STABLE_FRAGMENT = 64,
KEYED_FRAGMENT = 128,
UNKEYED_FRAGMENT = 256,
NEED_PATCH = 512,
DYNAMIC_SLOTS = 1024,
HOISTED = -1,
BAIL = -2
}
export type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;
export type RawSlots = Exclude<VNodeNormalizedChildren, Array<any> | null | string>;
export declare function isFragment(node: VNode): boolean;
export declare function isFragment(node: unknown): node is VNode;
export declare function isText(node: VNode): boolean;
export declare function isText(node: unknown): node is VNode;
export declare function isComment(node: VNode): boolean;
export declare function isComment(node: unknown): node is VNode;
export declare function isTemplate(node: VNode): boolean;
export declare function isTemplate(node: unknown): node is VNode;
/**
* determine if the element is a valid element type rather than fragments and comment e.g. <template> v-if
* @param node {VNode} node to be tested
*/
export declare function isValidElementNode(node: VNode): boolean;
export declare function isValidElementNode(node: unknown): node is VNode;
export declare const getFirstValidNode: (nodes: VNodeNormalizedChildren, maxDepth?: number) => string | number | boolean | void | VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | import("vue").VNodeArrayChildren | {
[name: string]: unknown;
$stable?: boolean;
} | null | undefined;
export declare function renderIf(condition: boolean, ...args: Parameters<typeof createBlock>): VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>;
export declare function renderBlock(...args: Parameters<typeof createBlock>): VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>;
export declare const getNormalizedProps: (node: VNode) => Record<string, any>;
export type FlattenVNodes = Array<VNodeChildAtom | RawSlots>;
export declare const flattedChildren: (children: FlattenVNodes | VNode | VNodeNormalizedChildren) => FlattenVNodes;

Some files were not shown because too many files have changed in this diff Show More