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,12 @@
import Breadcrumb from './src/breadcrumb.vue';
import BreadcrumbItem from './src/breadcrumb-item.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElBreadcrumb: SFCWithInstall<typeof Breadcrumb> & {
BreadcrumbItem: typeof BreadcrumbItem;
};
export declare const ElBreadcrumbItem: SFCWithInstall<typeof BreadcrumbItem>;
export default ElBreadcrumb;
export * from './src/breadcrumb';
export * from './src/breadcrumb-item';
export * from './src/constants';
export type { BreadcrumbInstance, BreadcrumbItemInstance, } from './src/instances';

View File

@@ -0,0 +1,14 @@
import Breadcrumb from './src/breadcrumb2.mjs';
import BreadcrumbItem from './src/breadcrumb-item2.mjs';
export { breadcrumbProps } from './src/breadcrumb.mjs';
export { breadcrumbItemProps } from './src/breadcrumb-item.mjs';
export { breadcrumbKey } from './src/constants.mjs';
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
const ElBreadcrumb = withInstall(Breadcrumb, {
BreadcrumbItem
});
const ElBreadcrumbItem = withNoopInstall(BreadcrumbItem);
export { ElBreadcrumb, ElBreadcrumbItem, ElBreadcrumb as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/breadcrumb/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\nimport Breadcrumb from './src/breadcrumb.vue'\nimport BreadcrumbItem from './src/breadcrumb-item.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElBreadcrumb: SFCWithInstall<typeof Breadcrumb> & {\n BreadcrumbItem: typeof BreadcrumbItem\n} = withInstall(Breadcrumb, {\n BreadcrumbItem,\n})\nexport const ElBreadcrumbItem: SFCWithInstall<typeof BreadcrumbItem> =\n withNoopInstall(BreadcrumbItem)\nexport default ElBreadcrumb\n\nexport * from './src/breadcrumb'\nexport * from './src/breadcrumb-item'\nexport * from './src/constants'\nexport type {\n BreadcrumbInstance,\n BreadcrumbItemInstance,\n} from './src/instances'\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,YAAY,GAAG,WAAW,CAAC,UAAU,EAAE;AACpD,EAAE,cAAc;AAChB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG,eAAe,CAAC,cAAc;;;;"}

View File

@@ -0,0 +1,8 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type { RouteLocationRaw } from 'vue-router';
export declare const breadcrumbItemProps: {
readonly to: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => RouteLocationRaw & {}) | (() => RouteLocationRaw) | ((new (...args: any[]) => RouteLocationRaw & {}) | (() => RouteLocationRaw))[], unknown, unknown, "", boolean>;
readonly replace: BooleanConstructor;
};
export type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>;
export type BreadcrumbItemPropsPublic = __ExtractPublicPropTypes<typeof breadcrumbItemProps>;

View File

@@ -0,0 +1,12 @@
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
const breadcrumbItemProps = buildProps({
to: {
type: definePropType([String, Object]),
default: ""
},
replace: Boolean
});
export { breadcrumbItemProps };
//# sourceMappingURL=breadcrumb-item.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"breadcrumb-item.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\n\nexport const breadcrumbItemProps = buildProps({\n /**\n * @description target route of the link, same as `to` of `vue-router`\n */\n to: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n default: '',\n },\n /**\n * @description if `true`, the navigation will not leave a history record\n */\n replace: Boolean,\n} as const)\nexport type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>\nexport type BreadcrumbItemPropsPublic = __ExtractPublicPropTypes<\n typeof breadcrumbItemProps\n>\n"],"names":[],"mappings":";;AACY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,CAAC;;;;"}

View File

@@ -0,0 +1,20 @@
declare function __VLS_template(): {
default?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly to: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw) | ((new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw))[], unknown, unknown, "", boolean>;
readonly replace: BooleanConstructor;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly to: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw) | ((new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw))[], unknown, unknown, "", boolean>;
readonly replace: BooleanConstructor;
}>>, {
readonly replace: boolean;
readonly to: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw) | ((new (...args: any[]) => import("vue-router").RouteLocationRaw & {}) | (() => import("vue-router").RouteLocationRaw))[], unknown, unknown>;
}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,60 @@
import { defineComponent, getCurrentInstance, inject, ref, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, withCtx, resolveDynamicComponent, toDisplayString } from 'vue';
import { ElIcon } from '../../icon/index.mjs';
import { breadcrumbKey } from './constants.mjs';
import { breadcrumbItemProps } from './breadcrumb-item.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElBreadcrumbItem"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: breadcrumbItemProps,
setup(__props) {
const props = __props;
const instance = getCurrentInstance();
const breadcrumbContext = inject(breadcrumbKey, void 0);
const ns = useNamespace("breadcrumb");
const router = instance.appContext.config.globalProperties.$router;
const link = ref();
const onClick = () => {
if (!props.to || !router)
return;
props.replace ? router.replace(props.to) : router.push(props.to);
};
return (_ctx, _cache) => {
var _a, _b;
return openBlock(), createElementBlock("span", {
class: normalizeClass(unref(ns).e("item"))
}, [
createElementVNode("span", {
ref_key: "link",
ref: link,
class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!_ctx.to)]),
role: "link",
onClick
}, [
renderSlot(_ctx.$slots, "default")
], 2),
((_a = unref(breadcrumbContext)) == null ? void 0 : _a.separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("separator"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(unref(breadcrumbContext).separatorIcon)))
]),
_: 1
}, 8, ["class"])) : (openBlock(), createElementBlock("span", {
key: 1,
class: normalizeClass(unref(ns).e("separator")),
role: "presentation"
}, toDisplayString((_b = unref(breadcrumbContext)) == null ? void 0 : _b.separator), 3))
], 2);
};
}
});
var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "breadcrumb-item.vue"]]);
export { BreadcrumbItem as default };
//# sourceMappingURL=breadcrumb-item2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"breadcrumb-item2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('item')\">\n <span\n ref=\"link\"\n :class=\"[ns.e('inner'), ns.is('link', !!to)]\"\n role=\"link\"\n @click=\"onClick\"\n >\n <slot />\n </span>\n <el-icon v-if=\"breadcrumbContext?.separatorIcon\" :class=\"ns.e('separator')\">\n <component :is=\"breadcrumbContext.separatorIcon\" />\n </el-icon>\n <span v-else :class=\"ns.e('separator')\" role=\"presentation\">\n {{ breadcrumbContext?.separator }}\n </span>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { breadcrumbKey } from './constants'\nimport { breadcrumbItemProps } from './breadcrumb-item'\n\nimport type { Router } from 'vue-router'\n\ndefineOptions({\n name: 'ElBreadcrumbItem',\n})\n\nconst props = defineProps(breadcrumbItemProps)\n\nconst instance = getCurrentInstance()!\nconst breadcrumbContext = inject(breadcrumbKey, undefined)\nconst ns = useNamespace('breadcrumb')\n\nconst router = instance.appContext.config.globalProperties.$router as Router\n\nconst link = ref<HTMLSpanElement>()\n\nconst onClick = () => {\n if (!props.to || !router) return\n props.replace ? router.replace(props.to) : router.push(props.to)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;mCA4Bc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAM,MAAA,iBAAA,GAAoB,MAAO,CAAA,aAAA,EAAe,KAAS,CAAA,CAAA,CAAA;AACzD,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AAEpC,IAAA,MAAM,MAAS,GAAA,QAAA,CAAS,UAAW,CAAA,MAAA,CAAO,gBAAiB,CAAA,OAAA,CAAA;AAE3D,IAAA,MAAM,OAAO,GAAqB,EAAA,CAAA;AAElC,IAAA,MAAM,UAAU,MAAM;AACpB,MAAA,IAAI,CAAC,KAAA,CAAM,EAAM,IAAA,CAAC,MAAQ;AAC1B,QAAM,OAAA;AAAyD,MACjE,KAAA,CAAA,OAAA,GAAA,MAAA,CAAA,OAAA,CAAA,KAAA,CAAA,EAAA,CAAA,GAAA,MAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,12 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const breadcrumbProps: {
readonly separator: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "/", boolean>;
readonly separatorIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>;
export type BreadcrumbPropsPublic = __ExtractPublicPropTypes<typeof breadcrumbProps>;

View File

@@ -0,0 +1,15 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
import { iconPropType } from '../../../utils/vue/icon.mjs';
const breadcrumbProps = buildProps({
separator: {
type: String,
default: "/"
},
separatorIcon: {
type: iconPropType
}
});
export { breadcrumbProps };
//# sourceMappingURL=breadcrumb.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"breadcrumb.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const breadcrumbProps = buildProps({\n /**\n * @description separator character\n */\n separator: {\n type: String,\n default: '/',\n },\n /**\n * @description icon component of icon separator\n */\n separatorIcon: {\n type: iconPropType,\n },\n} as const)\nexport type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>\nexport type BreadcrumbPropsPublic = __ExtractPublicPropTypes<\n typeof breadcrumbProps\n>\n"],"names":[],"mappings":";;;AACY,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,29 @@
declare function __VLS_template(): {
default?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly separator: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "/", boolean>;
readonly separatorIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly separator: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "/", boolean>;
readonly separatorIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>>, {
readonly separator: string;
}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,42 @@
import { defineComponent, ref, provide, onMounted, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
import { breadcrumbKey } from './constants.mjs';
import { breadcrumbProps } from './breadcrumb.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useLocale } from '../../../hooks/use-locale/index.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElBreadcrumb"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: breadcrumbProps,
setup(__props) {
const props = __props;
const { t } = useLocale();
const ns = useNamespace("breadcrumb");
const breadcrumb = ref();
provide(breadcrumbKey, props);
onMounted(() => {
const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
if (items.length) {
items[items.length - 1].setAttribute("aria-current", "page");
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "breadcrumb",
ref: breadcrumb,
class: normalizeClass(unref(ns).b()),
"aria-label": unref(t)("el.breadcrumb.label"),
role: "navigation"
}, [
renderSlot(_ctx.$slots, "default")
], 10, ["aria-label"]);
};
}
});
var Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "breadcrumb.vue"]]);
export { Breadcrumb as default };
//# sourceMappingURL=breadcrumb2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"breadcrumb2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb.vue"],"sourcesContent":["<template>\n <div\n ref=\"breadcrumb\"\n :class=\"ns.b()\"\n :aria-label=\"t('el.breadcrumb.label')\"\n role=\"navigation\"\n >\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { onMounted, provide, ref } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { breadcrumbKey } from './constants'\nimport { breadcrumbProps } from './breadcrumb'\n\ndefineOptions({\n name: 'ElBreadcrumb',\n})\n\nconst { t } = useLocale()\nconst props = defineProps(breadcrumbProps)\n\nconst ns = useNamespace('breadcrumb')\nconst breadcrumb = ref<HTMLDivElement>()\n\nprovide(breadcrumbKey, props)\n\nonMounted(() => {\n const items = breadcrumb.value!.querySelectorAll(`.${ns.e('item')}`)\n if (items.length) {\n items[items.length - 1].setAttribute('aria-current', 'page')\n }\n})\n</script>\n"],"names":[],"mappings":";;;;;;;mCAiBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAGxB,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,aAAa,GAAoB,EAAA,CAAA;AAEvC,IAAA,OAAA,CAAQ,eAAe,KAAK,CAAA,CAAA;AAE5B,IAAA,SAAA,CAAU,MAAM;AACd,MAAM,MAAA,KAAA,GAAQ,WAAW,KAAO,CAAA,gBAAA,CAAiB,IAAI,EAAG,CAAA,CAAA,CAAE,MAAM,CAAC,CAAE,CAAA,CAAA,CAAA;AACnE,MAAA,IAAI,MAAM,MAAQ,EAAA;AAChB,QAAA,KAAA,CAAM,MAAM,MAAS,GAAA,CAAC,CAAE,CAAA,YAAA,CAAa,gBAAgB,MAAM,CAAA,CAAA;AAAA,OAC7D;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,3 @@
import type { InjectionKey } from 'vue';
import type { BreadcrumbProps } from './breadcrumb';
export declare const breadcrumbKey: InjectionKey<BreadcrumbProps>;

View File

@@ -0,0 +1,4 @@
const breadcrumbKey = Symbol("breadcrumbKey");
export { breadcrumbKey };
//# sourceMappingURL=constants.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../../../../../packages/components/breadcrumb/src/constants.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { BreadcrumbProps } from './breadcrumb'\n\nexport const breadcrumbKey: InjectionKey<BreadcrumbProps> =\n Symbol('breadcrumbKey')\n"],"names":[],"mappings":"AAAY,MAAC,aAAa,GAAG,MAAM,CAAC,eAAe;;;;"}

View File

@@ -0,0 +1,4 @@
import type Breadcrumb from './breadcrumb.vue';
import type BreadcrumbItem from './breadcrumb-item.vue';
export type BreadcrumbItemInstance = InstanceType<typeof BreadcrumbItem> & unknown;
export type BreadcrumbInstance = InstanceType<typeof Breadcrumb> & unknown;

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-breadcrumb.css';

View File

@@ -0,0 +1,3 @@
import '../../base/style/css.mjs';
import 'element-plus/theme-chalk/el-breadcrumb.css';
//# sourceMappingURL=css.mjs.map

View File

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

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/breadcrumb.scss';

View File

@@ -0,0 +1,3 @@
import '../../base/style/index.mjs';
import 'element-plus/theme-chalk/src/breadcrumb.scss';
//# sourceMappingURL=index.mjs.map

View File

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