feat: initial commit - Phase 1 & 2 core features

This commit is contained in:
hiderfong
2026-04-22 17:07:33 +08:00
commit 1773bda06b
25005 changed files with 6252106 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import "../../utils/index.js";
import { BorderStyle, DividerInstance, DividerProps, DividerPropsPublic, dividerProps } from "./src/divider.js";
import { _default } from "./src/divider.vue.js";
//#region ../../packages/components/divider/index.d.ts
declare const ElDivider: SFCWithInstall<typeof _default>;
//#endregion
export { BorderStyle, DividerInstance, DividerProps, DividerPropsPublic, ElDivider, ElDivider as default, dividerProps };
+10
View File
@@ -0,0 +1,10 @@
import { withInstall } from "../../utils/vue/install.mjs";
import { dividerProps } from "./src/divider.mjs";
import divider_default from "./src/divider2.mjs";
//#region ../../packages/components/divider/index.ts
const ElDivider = withInstall(divider_default);
//#endregion
export { ElDivider, ElDivider as default, dividerProps };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["Divider"],"sources":["../../../../../packages/components/divider/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Divider from './src/divider.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElDivider: SFCWithInstall<typeof Divider> = withInstall(Divider)\nexport default ElDivider\n\nexport * from './src/divider'\n"],"mappings":";;;;;AAKA,MAAa,YAA4C,YAAYA,gBAAQ"}
@@ -0,0 +1,36 @@
import { EpPropFinalized } from "../../../utils/vue/props/types.js";
import "../../../utils/index.js";
import { _default } from "./divider.vue.js";
import { ExtractPublicPropTypes } from "vue";
//#region ../../packages/components/divider/src/divider.d.ts
type BorderStyle = CSSStyleDeclaration['borderStyle'];
interface DividerProps {
/**
* @description Set divider's direction
*/
direction?: 'horizontal' | 'vertical';
/**
* @description Set the style of divider
*/
contentPosition?: 'left' | 'center' | 'right';
/**
* @description the position of the customized content on the divider line
*/
borderStyle?: BorderStyle;
}
/**
* @deprecated Removed after 3.0.0, Use `DividerProps` instead.
*/
declare const dividerProps: {
readonly direction: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly contentPosition: EpPropFinalized<StringConstructor, "center" | "left" | "right", unknown, "center", boolean>;
readonly borderStyle: EpPropFinalized<(new (...args: any[]) => string) | (() => string) | (((new (...args: any[]) => string) | (() => string)) | null)[], unknown, unknown, "solid", boolean>;
};
/**
* @deprecated Removed after 3.0.0, Use `DividerProps` instead.
*/
type DividerPropsPublic = ExtractPublicPropTypes<typeof dividerProps>;
type DividerInstance = InstanceType<typeof _default> & unknown;
//#endregion
export { BorderStyle, DividerInstance, DividerProps, DividerPropsPublic, dividerProps };
@@ -0,0 +1,30 @@
import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
//#region ../../packages/components/divider/src/divider.ts
/**
* @deprecated Removed after 3.0.0, Use `DividerProps` instead.
*/
const dividerProps = buildProps({
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
contentPosition: {
type: String,
values: [
"left",
"center",
"right"
],
default: "center"
},
borderStyle: {
type: definePropType(String),
default: "solid"
}
});
//#endregion
export { dividerProps };
//# sourceMappingURL=divider.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"divider.mjs","names":[],"sources":["../../../../../../packages/components/divider/src/divider.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type Divider from './divider.vue'\n\nexport type BorderStyle = CSSStyleDeclaration['borderStyle']\n\nexport interface DividerProps {\n /**\n * @description Set divider's direction\n */\n direction?: 'horizontal' | 'vertical'\n /**\n * @description Set the style of divider\n */\n contentPosition?: 'left' | 'center' | 'right'\n /**\n * @description the position of the customized content on the divider line\n */\n borderStyle?: BorderStyle\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `DividerProps` instead.\n */\nexport const dividerProps = buildProps({\n /**\n * @description Set divider's direction\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description Set the style of divider\n */\n contentPosition: {\n type: String,\n values: ['left', 'center', 'right'],\n default: 'center',\n },\n /**\n * @description the position of the customized content on the divider line\n */\n borderStyle: {\n type: definePropType<BorderStyle>(String),\n default: 'solid',\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `DividerProps` instead.\n */\nexport type DividerPropsPublic = ExtractPublicPropTypes<typeof dividerProps>\n\nexport type DividerInstance = InstanceType<typeof Divider> & unknown\n"],"mappings":";;;;;;AAyBA,MAAa,eAAe,WAAW;CAIrC,WAAW;EACT,MAAM;EACN,QAAQ,CAAC,cAAc,WAAW;EAClC,SAAS;EACV;CAID,iBAAiB;EACf,MAAM;EACN,QAAQ;GAAC;GAAQ;GAAU;GAAQ;EACnC,SAAS;EACV;CAID,aAAa;EACX,MAAM,eAA4B,OAAO;EACzC,SAAS;EACV;CACF,CAAU"}
@@ -0,0 +1,22 @@
import { BorderStyle, DividerProps } from "./divider.js";
import * as vue from "vue";
//#region ../../packages/components/divider/src/divider.vue.d.ts
declare var __VLS_1: {};
type __VLS_Slots = {} & {
default?: (props: typeof __VLS_1) => any;
};
declare const __VLS_base: vue.DefineComponent<DividerProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<DividerProps> & Readonly<{}>, {
borderStyle: BorderStyle;
direction: "horizontal" | "vertical";
contentPosition: "left" | "center" | "right";
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
declare const _default: typeof __VLS_export;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};
//#endregion
export { _default };
@@ -0,0 +1,31 @@
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
import { dividerProps } from "./divider.mjs";
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, unref } from "vue";
//#region ../../packages/components/divider/src/divider.vue?vue&type=script&setup=true&lang.ts
var divider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
name: "ElDivider",
__name: "divider",
props: dividerProps,
setup(__props) {
const props = __props;
const ns = useNamespace("divider");
const dividerStyle = computed(() => {
return ns.cssVar({ "border-style": props.borderStyle });
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([unref(ns).b(), unref(ns).m(__props.direction)]),
style: normalizeStyle(dividerStyle.value),
role: "separator"
}, [_ctx.$slots.default && __props.direction !== "vertical" ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass([unref(ns).e("text"), unref(ns).is(__props.contentPosition)])
}, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)], 6);
};
}
});
//#endregion
export { divider_vue_vue_type_script_setup_true_lang_default as default };
//# sourceMappingURL=divider.vue_vue_type_script_setup_true_lang.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"divider.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/divider/src/divider.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b(), ns.m(direction)]\"\n :style=\"dividerStyle\"\n role=\"separator\"\n >\n <div\n v-if=\"$slots.default && direction !== 'vertical'\"\n :class=\"[ns.e('text'), ns.is(contentPosition)]\"\n >\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { DividerProps } from './divider'\n\ndefineOptions({\n name: 'ElDivider',\n})\nconst props = withDefaults(defineProps<DividerProps>(), {\n direction: 'horizontal',\n contentPosition: 'center',\n borderStyle: 'solid',\n})\nconst ns = useNamespace('divider')\nconst dividerStyle = computed(() => {\n return ns.cssVar({\n 'border-style': props.borderStyle,\n }) as CSSProperties\n})\n</script>\n"],"mappings":";;;;;;;;;;EAyBA,MAAM,QAAQ;EAKd,MAAM,KAAK,aAAa,UAAS;EACjC,MAAM,eAAe,eAAe;AAClC,UAAO,GAAG,OAAO,EACf,gBAAgB,MAAM,aACvB,CAAC;IACH;;uBAlCC,mBAWM,OAAA;IAVH,OAAK,eAAA,CAAG,MAAA,GAAE,CAAC,GAAC,EAAI,MAAA,GAAE,CAAC,EAAE,QAAA,UAAS,CAAA,CAAA;IAC9B,OAAK,eAAE,aAAA,MAAY;IACpB,MAAK;OAGGA,KAAAA,OAAO,WAAW,QAAA,cAAS,2BADnC,mBAKM,OAAA;;IAHH,OAAK,eAAA,CAAG,MAAA,GAAE,CAAC,EAAC,OAAA,EAAU,MAAA,GAAE,CAAC,GAAG,QAAA,gBAAe,CAAA,CAAA;OAE5C,WAAQ,KAAA,QAAA,UAAA"}
@@ -0,0 +1,8 @@
import divider_vue_vue_type_script_setup_true_lang_default from "./divider.vue_vue_type_script_setup_true_lang.mjs";
//#region ../../packages/components/divider/src/divider.vue
var divider_default = divider_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { divider_default as default };
//# sourceMappingURL=divider2.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"divider2.mjs","names":[],"sources":["../../../../../../packages/components/divider/src/divider.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b(), ns.m(direction)]\"\n :style=\"dividerStyle\"\n role=\"separator\"\n >\n <div\n v-if=\"$slots.default && direction !== 'vertical'\"\n :class=\"[ns.e('text'), ns.is(contentPosition)]\"\n >\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { DividerProps } from './divider'\n\ndefineOptions({\n name: 'ElDivider',\n})\nconst props = withDefaults(defineProps<DividerProps>(), {\n direction: 'horizontal',\n contentPosition: 'center',\n borderStyle: 'solid',\n})\nconst ns = useNamespace('divider')\nconst dividerStyle = computed(() => {\n return ns.cssVar({\n 'border-style': props.borderStyle,\n }) as CSSProperties\n})\n</script>\n"],"mappings":""}
@@ -0,0 +1,2 @@
import "../../base/style/css.mjs";
import "element-plus/theme-chalk/el-divider.css";
@@ -0,0 +1,2 @@
import "../../base/style/index.mjs";
import "element-plus/theme-chalk/src/divider.scss";