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,10 @@
import Descriptions from './src/description.vue';
import DescriptionsItem from './src/description-item';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElDescriptions: SFCWithInstall<typeof Descriptions> & {
DescriptionsItem: typeof DescriptionsItem;
};
export declare const ElDescriptionsItem: SFCWithInstall<typeof DescriptionsItem>;
export default ElDescriptions;
export * from './src/description';
export * from './src/description-item';

View File

@@ -0,0 +1,13 @@
import Descriptions from './src/description2.mjs';
import DescriptionItem from './src/description-item.mjs';
export { descriptionItemProps } from './src/description-item.mjs';
export { descriptionProps } from './src/description.mjs';
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
const ElDescriptions = withInstall(Descriptions, {
DescriptionsItem: DescriptionItem
});
const ElDescriptionsItem = withNoopInstall(DescriptionItem);
export { ElDescriptions, ElDescriptionsItem, ElDescriptions as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/descriptions/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\nimport Descriptions from './src/description.vue'\nimport DescriptionsItem from './src/description-item'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElDescriptions: SFCWithInstall<typeof Descriptions> & {\n DescriptionsItem: typeof DescriptionsItem\n} = withInstall(Descriptions, {\n DescriptionsItem,\n})\n\nexport const ElDescriptionsItem: SFCWithInstall<typeof DescriptionsItem> =\n withNoopInstall(DescriptionsItem)\n\nexport default ElDescriptions\n\nexport * from './src/description'\nexport * from './src/description-item'\n"],"names":["DescriptionsItem"],"mappings":";;;;;;AAGY,MAAC,cAAc,GAAG,WAAW,CAAC,YAAY,EAAE;AACxD,oBAAEA,eAAgB;AAClB,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG,eAAe,CAACA,eAAgB;;;;"}

View File

@@ -0,0 +1 @@
export declare const COMPONENT_NAME = "ElDescriptionsItem";

View File

@@ -0,0 +1,4 @@
const COMPONENT_NAME = "ElDescriptionsItem";
export { COMPONENT_NAME };
//# sourceMappingURL=constants.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../../../../../packages/components/descriptions/src/constants.ts"],"sourcesContent":["export const COMPONENT_NAME = 'ElDescriptionsItem'\n"],"names":[],"mappings":"AAAY,MAAC,cAAc,GAAG;;;;"}

View File

@@ -0,0 +1,70 @@
import type { ExtractPropTypes, Slot, VNode, __ExtractPublicPropTypes } from 'vue';
export declare const descriptionItemProps: {
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
span: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
rowspan: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
width: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
minWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
labelWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
align: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "center" | "left" | "right", unknown, string, boolean>;
labelAlign: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "center" | "left" | "right", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
className: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
labelClassName: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
};
declare const DescriptionItem: import("vue").DefineComponent<{
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
span: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
rowspan: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
width: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
minWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
labelWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
align: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "center" | "left" | "right", unknown, string, boolean>;
labelAlign: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "center" | "left" | "right", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
className: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
labelClassName: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
span: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
rowspan: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
width: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
minWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
labelWidth: import("element-plus/es/utils").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, string, boolean>;
align: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "center" | "left" | "right", unknown, string, boolean>;
labelAlign: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "center" | "left" | "right", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
className: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
labelClassName: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
}>>, {
label: string;
span: number;
width: import("element-plus/es/utils").EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
minWidth: import("element-plus/es/utils").EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
className: string;
labelWidth: import("element-plus/es/utils").EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
align: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "center" | "left" | "right", unknown>;
rowspan: number;
labelClassName: string;
}>;
export default DescriptionItem;
export type DescriptionItemProps = ExtractPropTypes<typeof descriptionItemProps>;
export type DescriptionItemPropsPublic = __ExtractPublicPropTypes<typeof descriptionItemProps>;
export type DescriptionItemVNode = VNode & {
children: {
[name: string]: Slot;
} | null;
props: Partial<DescriptionItemProps> | null;
};

View File

@@ -0,0 +1,55 @@
import { defineComponent } from 'vue';
import { COMPONENT_NAME } from './constants.mjs';
import { columnAlignment } from '../../../constants/column-alignment.mjs';
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
const descriptionItemProps = buildProps({
label: {
type: String,
default: ""
},
span: {
type: Number,
default: 1
},
rowspan: {
type: Number,
default: 1
},
width: {
type: [String, Number],
default: ""
},
minWidth: {
type: [String, Number],
default: ""
},
labelWidth: {
type: [String, Number],
default: ""
},
align: {
type: String,
values: columnAlignment,
default: "left"
},
labelAlign: {
type: String,
values: columnAlignment
},
className: {
type: String,
default: ""
},
labelClassName: {
type: String,
default: ""
}
});
const DescriptionItem = defineComponent({
name: COMPONENT_NAME,
props: descriptionItemProps
});
export { DescriptionItem as default, descriptionItemProps };
//# sourceMappingURL=description-item.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"description-item.mjs","sources":["../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { columnAlignment } from '@element-plus/constants'\nimport { buildProps } from '@element-plus/utils'\nimport { COMPONENT_NAME } from './constants'\n\nimport type {\n ExtractPropTypes,\n Slot,\n VNode,\n __ExtractPublicPropTypes,\n} from 'vue'\n\nexport const descriptionItemProps = buildProps({\n /**\n * @description label text\n */\n label: {\n type: String,\n default: '',\n },\n /**\n * @description colspan of column\n */\n span: {\n type: Number,\n default: 1,\n },\n /**\n * @description the number of rows a cell should span\n */\n rowspan: {\n type: Number,\n default: 1,\n },\n /**\n * @description column width, the width of the same column in different rows is set by the max value (If no `border`, width contains label and content)\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column minimum width, columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion (If no`border`, width contains label and content)\n */\n minWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column label width, if not set, it will be the same as the width of the column. Higher priority than the `label-width` of `Descriptions`\n */\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column content alignment (If no `border`, effective for both label and content)\n */\n align: {\n type: String,\n values: columnAlignment,\n default: 'left',\n },\n /**\n * @description column label alignment, if omitted, the value of the above `align` attribute will be applied (If no `border`, please use `align` attribute)\n */\n labelAlign: {\n type: String,\n values: columnAlignment,\n },\n /**\n * @description column content custom class name\n */\n className: {\n type: String,\n default: '',\n },\n /**\n * @description column label custom class name\n */\n labelClassName: {\n type: String,\n default: '',\n },\n})\n\nconst DescriptionItem = defineComponent({\n name: COMPONENT_NAME,\n props: descriptionItemProps,\n})\n\nexport default DescriptionItem\n\nexport type DescriptionItemProps = ExtractPropTypes<typeof descriptionItemProps>\nexport type DescriptionItemPropsPublic = __ExtractPublicPropTypes<\n typeof descriptionItemProps\n>\nexport type DescriptionItemVNode = VNode & {\n children: { [name: string]: Slot } | null\n props: Partial<DescriptionItemProps> | null\n}\n"],"names":[],"mappings":";;;;;AAIY,MAAC,oBAAoB,GAAG,UAAU,CAAC;AAC/C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,eAAe;AAC3B,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,eAAe;AAC3B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACE,MAAC,eAAe,GAAG,eAAe,CAAC;AACxC,EAAE,IAAI,EAAE,cAAc;AACtB,EAAE,KAAK,EAAE,oBAAoB;AAC7B,CAAC;;;;"}

View File

@@ -0,0 +1,19 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Description from './description.vue';
export declare const descriptionProps: {
readonly border: BooleanConstructor;
readonly column: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly extra: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
};
export type DescriptionProps = ExtractPropTypes<typeof descriptionProps>;
export type DescriptionPropsPublic = __ExtractPublicPropTypes<typeof descriptionProps>;
export type DescriptionInstance = InstanceType<typeof Description> & unknown;

View File

@@ -0,0 +1,31 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
const descriptionProps = buildProps({
border: Boolean,
column: {
type: Number,
default: 3
},
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
size: useSizeProp,
title: {
type: String,
default: ""
},
extra: {
type: String,
default: ""
},
labelWidth: {
type: [String, Number],
default: ""
}
});
export { descriptionProps };
//# sourceMappingURL=description.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"description.mjs","sources":["../../../../../../packages/components/descriptions/src/description.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Description from './description.vue'\n\nexport const descriptionProps = buildProps({\n /**\n * @description with or without border\n */\n border: Boolean,\n /**\n * @description numbers of `Descriptions Item` in one line\n */\n column: {\n type: Number,\n default: 3,\n },\n /**\n * @description direction of list\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description size of list\n */\n size: useSizeProp,\n /**\n * @description title text, display on the top left\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description extra text, display on the top right\n */\n extra: {\n type: String,\n default: '',\n },\n /**\n * @description width of every label column\n */\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n} as const)\n\nexport type DescriptionProps = ExtractPropTypes<typeof descriptionProps>\nexport type DescriptionPropsPublic = __ExtractPublicPropTypes<\n typeof descriptionProps\n>\nexport type DescriptionInstance = InstanceType<typeof Description> & unknown\n"],"names":[],"mappings":";;;AAEY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,IAAI,OAAO,EAAE,YAAY;AACzB,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,45 @@
declare function __VLS_template(): {
title?(_: {}): any;
extra?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly border: BooleanConstructor;
readonly column: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly extra: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
}, {}, 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 border: BooleanConstructor;
readonly column: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly extra: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
}>>, {
readonly title: string;
readonly direction: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
readonly border: boolean;
readonly column: number;
readonly labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
readonly extra: 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,132 @@
import { defineComponent, useSlots, provide, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock } from 'vue';
import ElDescriptionsRow from './descriptions-row2.mjs';
import { descriptionsKey } from './token.mjs';
import { descriptionProps } from './description.mjs';
import { COMPONENT_NAME } from './constants.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
import { flattedChildren } from '../../../utils/vue/vnode.mjs';
const __default__ = defineComponent({
name: "ElDescriptions"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: descriptionProps,
setup(__props) {
const props = __props;
const ns = useNamespace("descriptions");
const descriptionsSize = useFormSize();
const slots = useSlots();
provide(descriptionsKey, props);
const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
const filledNode = (node, span, count, isLast = false) => {
if (!node.props) {
node.props = {};
}
if (span > count) {
node.props.span = count;
}
if (isLast) {
node.props.span = span;
}
return node;
};
const getRows = () => {
if (!slots.default)
return [];
const children = flattedChildren(slots.default()).filter((node) => {
var _a;
return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === COMPONENT_NAME;
});
const rows = [];
let temp = [];
let count = props.column;
let totalSpan = 0;
const rowspanTemp = [];
children.forEach((node, index) => {
var _a, _b, _c;
const span = ((_a = node.props) == null ? void 0 : _a.span) || 1;
const rowspan = ((_b = node.props) == null ? void 0 : _b.rowspan) || 1;
const rowNo = rows.length;
rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0);
if (rowspan > 1) {
for (let i = 1; i < rowspan; i++) {
rowspanTemp[_c = rowNo + i] || (rowspanTemp[_c] = 0);
rowspanTemp[rowNo + i]++;
totalSpan++;
}
}
if (rowspanTemp[rowNo] > 0) {
count -= rowspanTemp[rowNo];
rowspanTemp[rowNo] = 0;
}
if (index < children.length - 1) {
totalSpan += span > count ? count : span;
}
if (index === children.length - 1) {
const lastSpan = props.column - totalSpan % props.column;
temp.push(filledNode(node, lastSpan, count, true));
rows.push(temp);
return;
}
if (span < count) {
count -= span;
temp.push(node);
} else {
temp.push(filledNode(node, span, count));
rows.push(temp);
count = props.column;
temp = [];
}
});
return rows;
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(descriptionKls))
}, [
_ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("header"))
}, [
createElementVNode("div", {
class: normalizeClass(unref(ns).e("title"))
}, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString(_ctx.title), 1)
])
], 2),
createElementVNode("div", {
class: normalizeClass(unref(ns).e("extra"))
}, [
renderSlot(_ctx.$slots, "extra", {}, () => [
createTextVNode(toDisplayString(_ctx.extra), 1)
])
], 2)
], 2)) : createCommentVNode("v-if", true),
createElementVNode("div", {
class: normalizeClass(unref(ns).e("body"))
}, [
createElementVNode("table", {
class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", _ctx.border)])
}, [
createElementVNode("tbody", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => {
return openBlock(), createBlock(ElDescriptionsRow, {
key: _index,
row
}, null, 8, ["row"]);
}), 128))
])
], 2)
], 2)
], 2);
};
}
});
var Descriptions = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "description.vue"]]);
export { Descriptions as default };
//# sourceMappingURL=description2.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,31 @@
import type { PropType } from 'vue';
import type { IDescriptionsInject } from './descriptions.type';
import type { DescriptionItemVNode } from './description-item';
declare const _default: import("vue").DefineComponent<{
cell: {
type: PropType<DescriptionItemVNode>;
};
tag: {
type: StringConstructor;
default: string;
};
type: {
type: StringConstructor;
};
}, {
descriptions: IDescriptionsInject;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
cell: {
type: PropType<DescriptionItemVNode>;
};
tag: {
type: StringConstructor;
default: string;
};
type: {
type: StringConstructor;
};
}>>, {
tag: string;
}>;
export default _default;

View File

@@ -0,0 +1,114 @@
import { defineComponent, inject, withDirectives, h } from 'vue';
import { isNil } from 'lodash-unified';
import { descriptionsKey } from './token.mjs';
import { getNormalizedProps } from '../../../utils/vue/vnode.mjs';
import { addUnit } from '../../../utils/dom/style.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
var ElDescriptionsCell = defineComponent({
name: "ElDescriptionsCell",
props: {
cell: {
type: Object
},
tag: {
type: String,
default: "td"
},
type: {
type: String
}
},
setup() {
const descriptions = inject(descriptionsKey, {});
return {
descriptions
};
},
render() {
var _a;
const item = getNormalizedProps(this.cell);
const directives = (((_a = this.cell) == null ? void 0 : _a.dirs) || []).map((dire) => {
const { dir, arg, modifiers, value } = dire;
return [dir, value, arg, modifiers];
});
const { border, direction } = this.descriptions;
const isVertical = direction === "vertical";
const renderLabel = () => {
var _a2, _b, _c;
return ((_c = (_b = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b.label) == null ? void 0 : _c.call(_b)) || item.label;
};
const renderContent = () => {
var _a2, _b, _c;
return (_c = (_b = (_a2 = this.cell) == null ? void 0 : _a2.children) == null ? void 0 : _b.default) == null ? void 0 : _c.call(_b);
};
const span = item.span;
const rowspan = item.rowspan;
const align = item.align ? `is-${item.align}` : "";
const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
const className = item.className;
const labelClassName = item.labelClassName;
const width = this.type === "label" ? item.labelWidth || this.descriptions.labelWidth || item.width : item.width;
const style = {
width: addUnit(width),
minWidth: addUnit(item.minWidth)
};
const ns = useNamespace("descriptions");
switch (this.type) {
case "label":
return withDirectives(h(this.tag, {
style,
class: [
ns.e("cell"),
ns.e("label"),
ns.is("bordered-label", border),
ns.is("vertical-label", isVertical),
labelAlign,
labelClassName
],
colSpan: isVertical ? span : 1,
rowspan: isVertical ? 1 : rowspan
}, renderLabel()), directives);
case "content":
return withDirectives(h(this.tag, {
style,
class: [
ns.e("cell"),
ns.e("content"),
ns.is("bordered-content", border),
ns.is("vertical-content", isVertical),
align,
className
],
colSpan: isVertical ? span : span * 2 - 1,
rowspan: isVertical ? rowspan * 2 - 1 : rowspan
}, renderContent()), directives);
default: {
const label = renderLabel();
const labelStyle = {};
const width2 = addUnit(item.labelWidth || this.descriptions.labelWidth);
if (width2) {
labelStyle.width = width2;
labelStyle.display = "inline-block";
}
return withDirectives(h("td", {
style,
class: [ns.e("cell"), align],
colSpan: span,
rowspan
}, [
!isNil(label) ? h("span", {
style: labelStyle,
class: [ns.e("label"), labelClassName]
}, label) : void 0,
h("span", {
class: [ns.e("content"), className]
}, renderContent())
]), directives);
}
}
}
});
export { ElDescriptionsCell as default };
//# sourceMappingURL=descriptions-cell.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import type { DescriptionItemVNode } from './description-item';
export declare const descriptionsRowProps: {
readonly row: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => DescriptionItemVNode[]) | (() => DescriptionItemVNode[]) | ((new (...args: any[]) => DescriptionItemVNode[]) | (() => DescriptionItemVNode[]))[], unknown, unknown, () => never[], boolean>;
};

View File

@@ -0,0 +1,11 @@
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
const descriptionsRowProps = buildProps({
row: {
type: definePropType(Array),
default: () => []
}
});
export { descriptionsRowProps };
//# sourceMappingURL=descriptions-row.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"descriptions-row.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { DescriptionItemVNode } from './description-item'\n\nexport const descriptionsRowProps = buildProps({\n row: {\n type: definePropType<DescriptionItemVNode[]>(Array),\n default: () => [],\n },\n} as const)\n"],"names":[],"mappings":";;AACY,MAAC,oBAAoB,GAAG,UAAU,CAAC;AAC/C,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
declare const _default: import("vue").DefineComponent<{
readonly row: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").DescriptionItemVNode[]) | (() => import("element-plus").DescriptionItemVNode[]) | ((new (...args: any[]) => import("element-plus").DescriptionItemVNode[]) | (() => import("element-plus").DescriptionItemVNode[]))[], unknown, unknown, () => never[], boolean>;
}, {}, 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 row: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus").DescriptionItemVNode[]) | (() => import("element-plus").DescriptionItemVNode[]) | ((new (...args: any[]) => import("element-plus").DescriptionItemVNode[]) | (() => import("element-plus").DescriptionItemVNode[]))[], unknown, unknown, () => never[], boolean>;
}>>, {
readonly row: import("element-plus").DescriptionItemVNode[];
}>;
export default _default;

View File

@@ -0,0 +1,68 @@
import { defineComponent, inject, unref, openBlock, createElementBlock, Fragment, createElementVNode, renderList, createBlock, createVNode } from 'vue';
import ElDescriptionsCell from './descriptions-cell.mjs';
import { descriptionsKey } from './token.mjs';
import { descriptionsRowProps } from './descriptions-row.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
const __default__ = defineComponent({
name: "ElDescriptionsRow"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: descriptionsRowProps,
setup(__props) {
const descriptions = inject(descriptionsKey, {});
return (_ctx, _cache) => {
return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
return openBlock(), createBlock(unref(ElDescriptionsCell), {
key: `tr1-${_index}`,
cell,
tag: "th",
type: "label"
}, null, 8, ["cell"]);
}), 128))
]),
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
return openBlock(), createBlock(unref(ElDescriptionsCell), {
key: `tr2-${_index}`,
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"]);
}), 128))
])
], 64)) : (openBlock(), createElementBlock("tr", { key: 1 }, [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
return openBlock(), createElementBlock(Fragment, {
key: `tr3-${_index}`
}, [
unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createVNode(unref(ElDescriptionsCell), {
cell,
tag: "td",
type: "label"
}, null, 8, ["cell"]),
createVNode(unref(ElDescriptionsCell), {
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"])
], 64)) : (openBlock(), createBlock(unref(ElDescriptionsCell), {
key: 1,
cell,
tag: "td",
type: "both"
}, null, 8, ["cell"]))
], 64);
}), 128))
]));
};
}
});
var ElDescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "descriptions-row.vue"]]);
export { ElDescriptionsRow as default };
//# sourceMappingURL=descriptions-row2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"descriptions-row2.mjs","sources":["../../../../../../packages/components/descriptions/src/descriptions-row.vue"],"sourcesContent":["<template>\n <template v-if=\"descriptions.direction === 'vertical'\">\n <tr>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr1-${_index}`\">\n <el-descriptions-cell :cell=\"cell\" tag=\"th\" type=\"label\" />\n </template>\n </tr>\n <tr>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr2-${_index}`\">\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"content\" />\n </template>\n </tr>\n </template>\n <tr v-else>\n <template v-for=\"(cell, _index) in row\" :key=\"`tr3-${_index}`\">\n <template v-if=\"descriptions.border\">\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"label\" />\n <el-descriptions-cell :cell=\"cell\" tag=\"td\" type=\"content\" />\n </template>\n <el-descriptions-cell v-else :cell=\"cell\" tag=\"td\" type=\"both\" />\n </template>\n </tr>\n</template>\n\n<script lang=\"ts\" setup>\nimport { inject } from 'vue'\nimport ElDescriptionsCell from './descriptions-cell'\nimport { descriptionsKey } from './token'\nimport { descriptionsRowProps } from './descriptions-row'\n\nimport type { IDescriptionsInject } from './descriptions.type'\n\ndefineOptions({\n name: 'ElDescriptionsRow',\n})\n\ndefineProps(descriptionsRowProps)\n\nconst descriptions = inject(descriptionsKey, {} as IDescriptionsInject)\n</script>\n"],"names":[],"mappings":";;;;;;mCAgCc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAIA,IAAA,MAAM,YAAe,GAAA,MAAA,CAAO,eAAiB,EAAA,EAAyB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,22 @@
import type { ColumnAlignment, ComponentSize } from 'element-plus/es/constants';
export interface IDescriptionsInject {
border: boolean;
column: number;
direction: 'horizontal' | 'vertical';
size: ComponentSize;
title: string;
extra: string;
labelWidth: string | number;
}
export interface IDescriptionsItemInject {
label: string;
span: number;
rowspan: number;
width: string | number;
minWidth: string | number;
labelWidth: string | number;
align: ColumnAlignment;
labelAlign?: ColumnAlignment;
className: string;
labelClassName: string;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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