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

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;

38
node_modules/element-plus/lib/utils/vue/global-node.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@vueuse/core');
const globalNodes = [];
let target = !core.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);
}
});
}
exports.changeGlobalNodesTarget = changeGlobalNodesTarget;
exports.createGlobalNode = createGlobalNode;
exports.removeGlobalNode = removeGlobalNode;
//# sourceMappingURL=global-node.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"global-node.js","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":["isClient"],"mappings":";;;;;;AACA,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,IAAI,MAAM,GAAG,CAACA,aAAQ,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;;;;;;"}

24
node_modules/element-plus/lib/utils/vue/icon.d.ts generated vendored Normal file
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;
};

41
node_modules/element-plus/lib/utils/vue/icon.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var iconsVue = require('@element-plus/icons-vue');
var runtime = require('./props/runtime.js');
const iconPropType = runtime.definePropType([
String,
Object,
Function
]);
const CloseComponents = {
Close: iconsVue.Close
};
const TypeComponents = {
Close: iconsVue.Close,
SuccessFilled: iconsVue.SuccessFilled,
InfoFilled: iconsVue.InfoFilled,
WarningFilled: iconsVue.WarningFilled,
CircleCloseFilled: iconsVue.CircleCloseFilled
};
const TypeComponentsMap = {
primary: iconsVue.InfoFilled,
success: iconsVue.SuccessFilled,
warning: iconsVue.WarningFilled,
error: iconsVue.CircleCloseFilled,
info: iconsVue.InfoFilled
};
const ValidateComponentsMap = {
validating: iconsVue.Loading,
success: iconsVue.CircleCheck,
error: iconsVue.CircleClose
};
exports.CloseComponents = CloseComponents;
exports.TypeComponents = TypeComponents;
exports.TypeComponentsMap = TypeComponentsMap;
exports.ValidateComponentsMap = ValidateComponentsMap;
exports.iconPropType = iconPropType;
//# sourceMappingURL=icon.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"icon.js","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":["definePropType","Close","SuccessFilled","InfoFilled","WarningFilled","CircleCloseFilled","Loading","CircleCheck","CircleClose"],"mappings":";;;;;;;AAWY,MAAC,YAAY,GAAGA,sBAAc,CAAC;AAC3C,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,CAAC,EAAE;AACS,MAAC,eAAe,GAAG;AAC/B,SAAEC,cAAK;AACP,EAAE;AACU,MAAC,cAAc,GAAG;AAC9B,SAAEA,cAAK;AACP,iBAAEC,sBAAa;AACf,cAAEC,mBAAU;AACZ,iBAAEC,sBAAa;AACf,qBAAEC,0BAAiB;AACnB,EAAE;AACU,MAAC,iBAAiB,GAAG;AACjC,EAAE,OAAO,EAAEF,mBAAU;AACrB,EAAE,OAAO,EAAED,sBAAa;AACxB,EAAE,OAAO,EAAEE,sBAAa;AACxB,EAAE,KAAK,EAAEC,0BAAiB;AAC1B,EAAE,IAAI,EAAEF,mBAAU;AAClB,EAAE;AACU,MAAC,qBAAqB,GAAG;AACrC,EAAE,UAAU,EAAEG,gBAAO;AACrB,EAAE,OAAO,EAAEC,oBAAW;AACtB,EAAE,KAAK,EAAEC,oBAAW;AACpB;;;;;;;;"}

9
node_modules/element-plus/lib/utils/vue/index.d.ts generated vendored Normal file
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';

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

@@ -0,0 +1,49 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var globalNode = require('./global-node.js');
var icon = require('./icon.js');
var install = require('./install.js');
var refs = require('./refs.js');
var size = require('./size.js');
var validator = require('./validator.js');
var vnode = require('./vnode.js');
var runtime = require('./props/runtime.js');
exports.changeGlobalNodesTarget = globalNode.changeGlobalNodesTarget;
exports.createGlobalNode = globalNode.createGlobalNode;
exports.removeGlobalNode = globalNode.removeGlobalNode;
exports.CloseComponents = icon.CloseComponents;
exports.TypeComponents = icon.TypeComponents;
exports.TypeComponentsMap = icon.TypeComponentsMap;
exports.ValidateComponentsMap = icon.ValidateComponentsMap;
exports.iconPropType = icon.iconPropType;
exports.withInstall = install.withInstall;
exports.withInstallDirective = install.withInstallDirective;
exports.withInstallFunction = install.withInstallFunction;
exports.withNoopInstall = install.withNoopInstall;
exports.composeRefs = refs.composeRefs;
exports.getComponentSize = size.getComponentSize;
exports.isValidComponentSize = validator.isValidComponentSize;
exports.isValidDatePickType = validator.isValidDatePickType;
exports.PatchFlags = vnode.PatchFlags;
exports.ensureOnlyChild = vnode.ensureOnlyChild;
exports.flattedChildren = vnode.flattedChildren;
exports.getFirstValidNode = vnode.getFirstValidNode;
exports.getNormalizedProps = vnode.getNormalizedProps;
exports.isComment = vnode.isComment;
exports.isFragment = vnode.isFragment;
exports.isTemplate = vnode.isTemplate;
exports.isText = vnode.isText;
exports.isValidElementNode = vnode.isValidElementNode;
exports.renderBlock = vnode.renderBlock;
exports.renderIf = vnode.renderIf;
exports.buildProp = runtime.buildProp;
exports.buildProps = runtime.buildProps;
exports.definePropType = runtime.definePropType;
exports.epPropKey = runtime.epPropKey;
exports.isEpProp = runtime.isEpProp;
//# sourceMappingURL=index.js.map

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

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

6
node_modules/element-plus/lib/utils/vue/install.d.ts generated vendored Normal file
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>;

42
node_modules/element-plus/lib/utils/vue/install.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('@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 = shared.NOOP;
return component;
};
exports.withInstall = withInstall;
exports.withInstallDirective = withInstallDirective;
exports.withInstallFunction = withInstallFunction;
exports.withNoopInstall = withNoopInstall;
//# sourceMappingURL=install.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"install.js","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":["NOOP"],"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,GAAGA,WAAI,CAAC;AAC3B,EAAE,OAAO,SAAS,CAAC;AACnB;;;;;;;"}

View File

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

14
node_modules/element-plus/lib/utils/vue/props/index.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('./runtime.js');
exports.buildProp = runtime.buildProp;
exports.buildProps = runtime.buildProps;
exports.definePropType = runtime.definePropType;
exports.epPropKey = runtime.epPropKey;
exports.isEpProp = runtime.isEpProp;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","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,54 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var lodashUnified = require('lodash-unified');
var shared = require('@vue/shared');
const epPropKey = "__epPropKey";
const definePropType = (val) => val;
const isEpProp = (val) => shared.isObject(val) && !!val[epPropKey];
const buildProp = (prop, key) => {
if (!shared.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 (shared.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(", ");
vue.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 (shared.hasOwn(prop, "default"))
epProp.default = defaultValue;
return epProp;
};
const buildProps = (props) => lodashUnified.fromPairs(Object.entries(props).map(([key, option]) => [
key,
buildProp(option, key)
]));
exports.buildProp = buildProp;
exports.buildProps = buildProps;
exports.definePropType = definePropType;
exports.epPropKey = epPropKey;
exports.isEpProp = isEpProp;
//# sourceMappingURL=runtime.js.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,3 @@
'use strict';
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","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,3 @@
'use strict';
//# sourceMappingURL=util.js.map

View File

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

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

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

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

@@ -0,0 +1,20 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('@vue/shared');
const composeRefs = (...refs) => {
return (el) => {
refs.forEach((ref) => {
if (shared.isFunction(ref)) {
ref(el);
} else {
ref.value = el;
}
});
};
};
exports.composeRefs = composeRefs;
//# sourceMappingURL=refs.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"refs.js","sources":["../../../../../packages/utils/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\n\nimport type { ComponentPublicInstance, Ref } from 'vue'\n\nexport type RefSetter = (\n el: Element | ComponentPublicInstance | undefined\n) => void\n\nexport const composeRefs = (\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\n) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(el as Element | ComponentPublicInstance)\n } else {\n ref.value = el as HTMLElement | undefined\n }\n })\n }\n}\n"],"names":["isFunction"],"mappings":";;;;;;AACY,MAAC,WAAW,GAAG,CAAC,GAAG,IAAI,KAAK;AACxC,EAAE,OAAO,CAAC,EAAE,KAAK;AACjB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1B,MAAM,IAAIA,iBAAU,CAAC,GAAG,CAAC,EAAE;AAC3B,QAAQ,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,OAAO,MAAM;AACb,QAAQ,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;AACvB,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG,CAAC;AACJ;;;;"}

2
node_modules/element-plus/lib/utils/vue/size.d.ts generated vendored Normal file
View File

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

12
node_modules/element-plus/lib/utils/vue/size.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var size = require('../../constants/size.js');
const getComponentSize = (size$1) => {
return size.componentSizeMap[size$1 || "default"];
};
exports.getComponentSize = getComponentSize;
//# sourceMappingURL=size.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"size.js","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":["size","componentSizeMap"],"mappings":";;;;;;AACY,MAAC,gBAAgB,GAAG,CAACA,MAAI,KAAK;AAC1C,EAAE,OAAOC,qBAAgB,CAACD,MAAI,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,3 @@
'use strict';
//# sourceMappingURL=typescript.js.map

View File

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

13
node_modules/element-plus/lib/utils/vue/validator.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var size = require('../../constants/size.js');
var date = require('../../constants/date.js');
const isValidComponentSize = (val) => ["", ...size.componentSizes].includes(val);
const isValidDatePickType = (val) => [...date.datePickTypes].includes(val);
exports.isValidComponentSize = isValidComponentSize;
exports.isValidDatePickType = isValidDatePickType;
//# sourceMappingURL=validator.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"validator.js","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":["componentSizes","datePickTypes"],"mappings":";;;;;;;AACY,MAAC,oBAAoB,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,GAAGA,mBAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE;AACvE,MAAC,mBAAmB,GAAG,CAAC,GAAG,KAAK,CAAC,GAAGC,kBAAa,CAAC,CAAC,QAAQ,CAAC,GAAG;;;;;"}

51
node_modules/element-plus/lib/utils/vue/vnode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import { createBlock } from 'vue';
import type { VNode, VNodeArrayChildren, 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;
}> | 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 declare const ensureOnlyChild: (children: VNodeArrayChildren | undefined) => (string | number | boolean | void | VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | null | undefined) | VNodeArrayChildren;
export type FlattenVNodes = Array<VNodeChildAtom | RawSlots>;
export declare const flattedChildren: (children: FlattenVNodes | VNode | VNodeNormalizedChildren) => FlattenVNodes;

116
node_modules/element-plus/lib/utils/vue/vnode.js generated vendored Normal file
View File

@@ -0,0 +1,116 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var shared = require('@vue/shared');
var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
return PatchFlags2;
})(PatchFlags || {});
function isFragment(node) {
return vue.isVNode(node) && node.type === vue.Fragment;
}
function isText(node) {
return vue.isVNode(node) && node.type === vue.Text;
}
function isComment(node) {
return vue.isVNode(node) && node.type === vue.Comment;
}
const TEMPLATE = "template";
function isTemplate(node) {
return vue.isVNode(node) && node.type === TEMPLATE;
}
function isValidElementNode(node) {
return vue.isVNode(node) && !isFragment(node) && !isComment(node);
}
function getChildren(node, depth) {
if (isComment(node))
return;
if (isFragment(node) || isTemplate(node)) {
return depth > 0 ? getFirstValidNode(node.children, depth - 1) : void 0;
}
return node;
}
const getFirstValidNode = (nodes, maxDepth = 3) => {
if (shared.isArray(nodes)) {
return getChildren(nodes[0], maxDepth);
} else {
return getChildren(nodes, maxDepth);
}
};
function renderIf(condition, ...args) {
return condition ? renderBlock(...args) : vue.createCommentVNode("v-if", true);
}
function renderBlock(...args) {
return vue.openBlock(), vue.createBlock(...args);
}
const getNormalizedProps = (node) => {
if (!vue.isVNode(node)) {
return {};
}
const raw = node.props || {};
const type = (vue.isVNode(node.type) ? node.type.props : void 0) || {};
const props = {};
Object.keys(type).forEach((key) => {
if (shared.hasOwn(type[key], "default")) {
props[key] = type[key].default;
}
});
Object.keys(raw).forEach((key) => {
props[shared.camelize(key)] = raw[key];
});
return props;
};
const ensureOnlyChild = (children) => {
if (!shared.isArray(children) || children.length > 1) {
throw new Error("expect to receive a single Vue element child");
}
return children[0];
};
const flattedChildren = (children) => {
const vNodes = shared.isArray(children) ? children : [children];
const result = [];
vNodes.forEach((child) => {
var _a;
if (shared.isArray(child)) {
result.push(...flattedChildren(child));
} else if (vue.isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) {
result.push(child, ...flattedChildren(child.component.subTree));
} else if (vue.isVNode(child) && shared.isArray(child.children)) {
result.push(...flattedChildren(child.children));
} else if (vue.isVNode(child) && child.shapeFlag === 2) {
result.push(...flattedChildren(child.type()));
} else {
result.push(child);
}
});
return result;
};
exports.PatchFlags = PatchFlags;
exports.ensureOnlyChild = ensureOnlyChild;
exports.flattedChildren = flattedChildren;
exports.getFirstValidNode = getFirstValidNode;
exports.getNormalizedProps = getNormalizedProps;
exports.isComment = isComment;
exports.isFragment = isFragment;
exports.isTemplate = isTemplate;
exports.isText = isText;
exports.isValidElementNode = isValidElementNode;
exports.renderBlock = renderBlock;
exports.renderIf = renderIf;
//# sourceMappingURL=vnode.js.map

1
node_modules/element-plus/lib/utils/vue/vnode.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long