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
+10
View File
@@ -0,0 +1,10 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import "../../utils/index.js";
import { RowAlign, RowInstance, RowJustify, RowProps, RowPropsPublic, rowProps } from "./src/row.js";
import { _default } from "./src/row.vue.js";
import { rowContextKey } from "./src/constants.js";
//#region ../../packages/components/row/index.d.ts
declare const ElRow: SFCWithInstall<typeof _default>;
//#endregion
export { ElRow, ElRow as default, RowAlign, RowInstance, RowJustify, RowProps, RowPropsPublic, rowContextKey, rowProps };
+11
View File
@@ -0,0 +1,11 @@
import { withInstall } from "../../utils/vue/install.mjs";
import { RowAlign, RowJustify, rowProps } from "./src/row.mjs";
import { rowContextKey } from "./src/constants.mjs";
import row_default from "./src/row2.mjs";
//#region ../../packages/components/row/index.ts
const ElRow = withInstall(row_default);
//#endregion
export { ElRow, ElRow as default, RowAlign, RowJustify, rowContextKey, rowProps };
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["Row"],"sources":["../../../../../packages/components/row/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Row from './src/row.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElRow: SFCWithInstall<typeof Row> = withInstall(Row)\nexport default ElRow\n\nexport * from './src/row'\nexport * from './src/constants'\n"],"mappings":";;;;;;AAKA,MAAa,QAAoC,YAAYA,YAAI"}
@@ -0,0 +1,9 @@
import { ComputedRef, InjectionKey } from "vue";
//#region ../../packages/components/row/src/constants.d.ts
interface RowContext {
gutter: ComputedRef<number>;
}
declare const rowContextKey: InjectionKey<RowContext>;
//#endregion
export { rowContextKey };
@@ -0,0 +1,6 @@
//#region ../../packages/components/row/src/constants.ts
const rowContextKey = Symbol("rowContextKey");
//#endregion
export { rowContextKey };
//# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../packages/components/row/src/constants.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\n\ninterface RowContext {\n gutter: ComputedRef<number>\n}\n\nexport const rowContextKey: InjectionKey<RowContext> = Symbol('rowContextKey')\n"],"mappings":";AAMA,MAAa,gBAA0C,OAAO,gBAAgB"}
+48
View File
@@ -0,0 +1,48 @@
import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
import "../../../utils/index.js";
import { _default } from "./row.vue.js";
import * as vue from "vue";
import { ExtractPublicPropTypes } from "vue";
//#region ../../packages/components/row/src/row.d.ts
declare const RowJustify: readonly ["start", "center", "end", "space-around", "space-between", "space-evenly"];
declare const RowAlign: readonly ["top", "middle", "bottom"];
interface RowProps {
/**
* @description custom element tag
*/
tag?: string;
/**
* @description grid spacing
*/
gutter?: number;
/**
* @description horizontal alignment of flex layout
*/
justify?: (typeof RowJustify)[number];
/**
* @description vertical alignment of flex layout
*/
align?: (typeof RowAlign)[number];
}
/**
* @deprecated Removed after 3.0.0, Use `RowProps` instead.
*/
declare const rowProps: {
readonly tag: EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
readonly gutter: EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
readonly justify: EpPropFinalized<StringConstructor, "center" | "space-around" | "space-between" | "space-evenly" | "end" | "start", unknown, "start", boolean>;
readonly align: {
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "top" | "bottom" | "middle", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
/**
* @deprecated Removed after 3.0.0, Use `RowProps` instead.
*/
type RowPropsPublic = ExtractPublicPropTypes<typeof rowProps>;
type RowInstance = InstanceType<typeof _default> & unknown;
//#endregion
export { RowAlign, RowInstance, RowJustify, RowProps, RowPropsPublic, rowProps };
+42
View File
@@ -0,0 +1,42 @@
import { buildProps } from "../../../utils/vue/props/runtime.mjs";
//#region ../../packages/components/row/src/row.ts
const RowJustify = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
];
const RowAlign = [
"top",
"middle",
"bottom"
];
/**
* @deprecated Removed after 3.0.0, Use `RowProps` instead.
*/
const rowProps = buildProps({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: RowJustify,
default: "start"
},
align: {
type: String,
values: RowAlign
}
});
//#endregion
export { RowAlign, RowJustify, rowProps };
//# sourceMappingURL=row.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"row.mjs","names":[],"sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type Row from './row.vue'\n\nexport const RowJustify = [\n 'start',\n 'center',\n 'end',\n 'space-around',\n 'space-between',\n 'space-evenly',\n] as const\n\nexport const RowAlign = ['top', 'middle', 'bottom'] as const\n\nexport interface RowProps {\n /**\n * @description custom element tag\n */\n tag?: string\n /**\n * @description grid spacing\n */\n gutter?: number\n /**\n * @description horizontal alignment of flex layout\n */\n justify?: (typeof RowJustify)[number]\n /**\n * @description vertical alignment of flex layout\n */\n align?: (typeof RowAlign)[number]\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `RowProps` instead.\n */\nexport const rowProps = buildProps({\n /**\n * @description custom element tag\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description grid spacing\n */\n gutter: {\n type: Number,\n default: 0,\n },\n /**\n * @description horizontal alignment of flex layout\n */\n justify: {\n type: String,\n values: RowJustify,\n default: 'start',\n },\n /**\n * @description vertical alignment of flex layout\n */\n align: {\n type: String,\n values: RowAlign,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `RowProps` instead.\n */\nexport type RowPropsPublic = ExtractPublicPropTypes<typeof rowProps>\nexport type RowInstance = InstanceType<typeof Row> & unknown\n"],"mappings":";;;AAKA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,WAAW;CAAC;CAAO;CAAU;CAAS;;;;AAwBnD,MAAa,WAAW,WAAW;CAIjC,KAAK;EACH,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,SAAS;EACP,MAAM;EACN,QAAQ;EACR,SAAS;EACV;CAID,OAAO;EACL,MAAM;EACN,QAAQ;EACT;CACF,CAAU"}
+22
View File
@@ -0,0 +1,22 @@
import { RowJustify, RowProps } from "./row.js";
import * as vue from "vue";
//#region ../../packages/components/row/src/row.vue.d.ts
declare var __VLS_8: {};
type __VLS_Slots = {} & {
default?: (props: typeof __VLS_8) => any;
};
declare const __VLS_base: vue.DefineComponent<RowProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<RowProps> & Readonly<{}>, {
justify: typeof RowJustify[number];
tag: string;
gutter: number;
}, {}, {}, {}, 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,40 @@
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
import { rowProps } from "./row.mjs";
import { rowContextKey } from "./constants.mjs";
import { computed, createBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderSlot, resolveDynamicComponent, withCtx } from "vue";
//#region ../../packages/components/row/src/row.vue?vue&type=script&setup=true&lang.ts
var row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
name: "ElRow",
__name: "row",
props: rowProps,
setup(__props) {
const props = __props;
const ns = useNamespace("row");
provide(rowContextKey, { gutter: computed(() => props.gutter) });
const style = computed(() => {
const styles = {};
if (!props.gutter) return styles;
styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
return styles;
});
const rowKls = computed(() => [
ns.b(),
ns.is(`justify-${props.justify}`, props.justify !== "start"),
ns.is(`align-${props.align}`, !!props.align)
]);
return (_ctx, _cache) => {
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
class: normalizeClass(rowKls.value),
style: normalizeStyle(style.value)
}, {
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
_: 3
}, 8, ["class", "style"]);
};
}
});
//#endregion
export { row_vue_vue_type_script_setup_true_lang_default as default };
//# sourceMappingURL=row.vue_vue_type_script_setup_true_lang.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"row.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../../../packages/components/row/src/row.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" :class=\"rowKls\" :style=\"style\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from './constants'\n\nimport type { CSSProperties } from 'vue'\nimport type { RowProps } from './row'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = withDefaults(defineProps<RowProps>(), {\n tag: 'div',\n gutter: 0,\n justify: 'start',\n})\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n\nconst rowKls = computed(() => [\n ns.b(),\n ns.is(`justify-${props.justify}`, props.justify !== 'start'),\n ns.is(`align-${props.align}`, !!props.align),\n])\n</script>\n"],"mappings":";;;;;;;;;;;EAkBA,MAAM,QAAQ;EAMd,MAAM,KAAK,aAAa,MAAK;AAG7B,UAAQ,eAAe,EACrB,QAHa,eAAe,MAAM,OAAM,EAIzC,CAAA;EAED,MAAM,QAAQ,eAAe;GAC3B,MAAM,SAAwB,EAAC;AAC/B,OAAI,CAAC,MAAM,OACT,QAAO;AAGT,UAAO,cAAc,OAAO,aAAa,IAAI,MAAM,SAAS,EAAE;AAC9D,UAAO;IACR;EAED,MAAM,SAAS,eAAe;GAC5B,GAAG,GAAG;GACN,GAAG,GAAG,WAAW,MAAM,WAAW,MAAM,YAAY,QAAQ;GAC5D,GAAG,GAAG,SAAS,MAAM,SAAS,CAAC,CAAC,MAAM,MAAM;GAC7C,CAAA;;uBA5CC,YAEY,wBAFI,QAAA,IAAG,EAAA;IAAG,OAAK,eAAE,OAAA,MAAM;IAAG,OAAK,eAAE,MAAA,MAAK;;2BACxC,CAAR,WAAQ,KAAA,QAAA,UAAA"}
+8
View File
@@ -0,0 +1,8 @@
import row_vue_vue_type_script_setup_true_lang_default from "./row.vue_vue_type_script_setup_true_lang.mjs";
//#region ../../packages/components/row/src/row.vue
var row_default = row_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { row_default as default };
//# sourceMappingURL=row2.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"row2.mjs","names":[],"sources":["../../../../../../packages/components/row/src/row.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" :class=\"rowKls\" :style=\"style\">\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from './constants'\n\nimport type { CSSProperties } from 'vue'\nimport type { RowProps } from './row'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = withDefaults(defineProps<RowProps>(), {\n tag: 'div',\n gutter: 0,\n justify: 'start',\n})\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n\nconst rowKls = computed(() => [\n ns.b(),\n ns.is(`justify-${props.justify}`, props.justify !== 'start'),\n ns.is(`align-${props.align}`, !!props.align),\n])\n</script>\n"],"mappings":""}
+2
View File
@@ -0,0 +1,2 @@
import "../../base/style/css.mjs";
import "element-plus/theme-chalk/el-row.css";
+2
View File
@@ -0,0 +1,2 @@
import "../../base/style/index.mjs";
import "element-plus/theme-chalk/src/row.scss";