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 @@
export declare const COMPONENT_NAME = "ElDescriptionsItem";

View File

@@ -0,0 +1,8 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const COMPONENT_NAME = "ElDescriptionsItem";
exports.COMPONENT_NAME = COMPONENT_NAME;
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","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,60 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var constants = require('./constants.js');
var columnAlignment = require('../../../constants/column-alignment.js');
var runtime = require('../../../utils/vue/props/runtime.js');
const descriptionItemProps = runtime.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.columnAlignment,
default: "left"
},
labelAlign: {
type: String,
values: columnAlignment.columnAlignment
},
className: {
type: String,
default: ""
},
labelClassName: {
type: String,
default: ""
}
});
const DescriptionItem = vue.defineComponent({
name: constants.COMPONENT_NAME,
props: descriptionItemProps
});
exports["default"] = DescriptionItem;
exports.descriptionItemProps = descriptionItemProps;
//# sourceMappingURL=description-item.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"description-item.js","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":["buildProps","columnAlignment","defineComponent","COMPONENT_NAME"],"mappings":";;;;;;;;;AAIY,MAAC,oBAAoB,GAAGA,kBAAU,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,EAAEC,+BAAe;AAC3B,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEA,+BAAe;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,GAAGC,mBAAe,CAAC;AACxC,EAAE,IAAI,EAAEC,wBAAc;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,35 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../utils/vue/props/runtime.js');
var index = require('../../../hooks/use-size/index.js');
const descriptionProps = runtime.buildProps({
border: Boolean,
column: {
type: Number,
default: 3
},
direction: {
type: String,
values: ["horizontal", "vertical"],
default: "horizontal"
},
size: index.useSizeProp,
title: {
type: String,
default: ""
},
extra: {
type: String,
default: ""
},
labelWidth: {
type: [String, Number],
default: ""
}
});
exports.descriptionProps = descriptionProps;
//# sourceMappingURL=description.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"description.js","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":["buildProps","useSizeProp"],"mappings":";;;;;;;AAEY,MAAC,gBAAgB,GAAGA,kBAAU,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,EAAEC,iBAAW;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,136 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var descriptionsRow = require('./descriptions-row2.js');
var token = require('./token.js');
var description = require('./description.js');
var constants = require('./constants.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-namespace/index.js');
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
var vnode = require('../../../utils/vue/vnode.js');
const __default__ = vue.defineComponent({
name: "ElDescriptions"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: description.descriptionProps,
setup(__props) {
const props = __props;
const ns = index.useNamespace("descriptions");
const descriptionsSize = useFormCommonProps.useFormSize();
const slots = vue.useSlots();
vue.provide(token.descriptionsKey, props);
const descriptionKls = vue.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 = vnode.flattedChildren(slots.default()).filter((node) => {
var _a;
return ((_a = node == null ? void 0 : node.type) == null ? void 0 : _a.name) === constants.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 vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass(vue.unref(descriptionKls))
}, [
_ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(vue.unref(ns).e("header"))
}, [
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(ns).e("title"))
}, [
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
])
], 2),
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(ns).e("extra"))
}, [
vue.renderSlot(_ctx.$slots, "extra", {}, () => [
vue.createTextVNode(vue.toDisplayString(_ctx.extra), 1)
])
], 2)
], 2)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(ns).e("body"))
}, [
vue.createElementVNode("table", {
class: vue.normalizeClass([vue.unref(ns).e("table"), vue.unref(ns).is("bordered", _ctx.border)])
}, [
vue.createElementVNode("tbody", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getRows(), (row, _index) => {
return vue.openBlock(), vue.createBlock(descriptionsRow["default"], {
key: _index,
row
}, null, 8, ["row"]);
}), 128))
])
], 2)
], 2)
], 2);
};
}
});
var Descriptions = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "description.vue"]]);
exports["default"] = Descriptions;
//# sourceMappingURL=description2.js.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,118 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var lodashUnified = require('lodash-unified');
var token = require('./token.js');
var vnode = require('../../../utils/vue/vnode.js');
var style = require('../../../utils/dom/style.js');
var index = require('../../../hooks/use-namespace/index.js');
var ElDescriptionsCell = vue.defineComponent({
name: "ElDescriptionsCell",
props: {
cell: {
type: Object
},
tag: {
type: String,
default: "td"
},
type: {
type: String
}
},
setup() {
const descriptions = vue.inject(token.descriptionsKey, {});
return {
descriptions
};
},
render() {
var _a;
const item = vnode.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$1 = {
width: style.addUnit(width),
minWidth: style.addUnit(item.minWidth)
};
const ns = index.useNamespace("descriptions");
switch (this.type) {
case "label":
return vue.withDirectives(vue.h(this.tag, {
style: style$1,
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 vue.withDirectives(vue.h(this.tag, {
style: style$1,
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 = style.addUnit(item.labelWidth || this.descriptions.labelWidth);
if (width2) {
labelStyle.width = width2;
labelStyle.display = "inline-block";
}
return vue.withDirectives(vue.h("td", {
style: style$1,
class: [ns.e("cell"), align],
colSpan: span,
rowspan
}, [
!lodashUnified.isNil(label) ? vue.h("span", {
style: labelStyle,
class: [ns.e("label"), labelClassName]
}, label) : void 0,
vue.h("span", {
class: [ns.e("content"), className]
}, renderContent())
]), directives);
}
}
}
});
exports["default"] = ElDescriptionsCell;
//# sourceMappingURL=descriptions-cell.js.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,15 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../utils/vue/props/runtime.js');
const descriptionsRowProps = runtime.buildProps({
row: {
type: runtime.definePropType(Array),
default: () => []
}
});
exports.descriptionsRowProps = descriptionsRowProps;
//# sourceMappingURL=descriptions-row.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"descriptions-row.js","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":["buildProps","definePropType"],"mappings":";;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEC,sBAAc,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,72 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var descriptionsCell = require('./descriptions-cell.js');
var token = require('./token.js');
var descriptionsRow = require('./descriptions-row.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
const __default__ = vue.defineComponent({
name: "ElDescriptionsRow"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: descriptionsRow.descriptionsRowProps,
setup(__props) {
const descriptions = vue.inject(token.descriptionsKey, {});
return (_ctx, _cache) => {
return vue.unref(descriptions).direction === "vertical" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
vue.createElementVNode("tr", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, _index) => {
return vue.openBlock(), vue.createBlock(vue.unref(descriptionsCell["default"]), {
key: `tr1-${_index}`,
cell,
tag: "th",
type: "label"
}, null, 8, ["cell"]);
}), 128))
]),
vue.createElementVNode("tr", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, _index) => {
return vue.openBlock(), vue.createBlock(vue.unref(descriptionsCell["default"]), {
key: `tr2-${_index}`,
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"]);
}), 128))
])
], 64)) : (vue.openBlock(), vue.createElementBlock("tr", { key: 1 }, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, _index) => {
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
key: `tr3-${_index}`
}, [
vue.unref(descriptions).border ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
vue.createVNode(vue.unref(descriptionsCell["default"]), {
cell,
tag: "td",
type: "label"
}, null, 8, ["cell"]),
vue.createVNode(vue.unref(descriptionsCell["default"]), {
cell,
tag: "td",
type: "content"
}, null, 8, ["cell"])
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(descriptionsCell["default"]), {
key: 1,
cell,
tag: "td",
type: "both"
}, null, 8, ["cell"]))
], 64);
}), 128))
]));
};
}
});
var ElDescriptionsRow = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "descriptions-row.vue"]]);
exports["default"] = ElDescriptionsRow;
//# sourceMappingURL=descriptions-row2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"descriptions-row2.js","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":["inject","descriptionsKey"],"mappings":";;;;;;;;;;uCAgCc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAIA,IAAA,MAAM,YAAe,GAAAA,UAAA,CAAOC,qBAAiB,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,3 @@
'use strict';
//# sourceMappingURL=descriptions.type.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"descriptions.type.js","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,8 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const descriptionsKey = Symbol("elDescriptions");
exports.descriptionsKey = descriptionsKey;
//# sourceMappingURL=token.js.map

View File

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