ele-admin-plus 1.1.9 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/core-export.d.ts +1 -0
- package/es/core-export.js +1 -0
- package/es/ele-alert/index.d.ts +2 -2
- package/es/ele-alert/props.d.ts +1 -1
- package/es/ele-app/components/message-body.d.ts +39 -0
- package/es/ele-app/components/message-body.js +92 -0
- package/es/ele-app/el.d.ts +2 -0
- package/es/ele-app/style/message/css-var.scss +0 -4
- package/es/ele-app/style/message/index.scss +199 -77
- package/es/ele-app/style/overwrite/input/index.scss +2 -0
- package/es/ele-app/style/overwrite/message-box/index.scss +31 -0
- package/es/ele-app/style/overwrite/tag/css-var.scss +0 -16
- package/es/ele-app/style/overwrite/tag/index.scss +57 -14
- package/es/ele-app/types.d.ts +6 -1
- package/es/ele-config-provider/components/receiver-view.js +3 -3
- package/es/ele-config-provider/index.d.ts +8 -4
- package/es/ele-config-provider/index.js +19 -5
- package/es/ele-config-provider/props.d.ts +9 -4
- package/es/ele-config-provider/props.js +9 -5
- package/es/ele-config-provider/receiver.js +2 -2
- package/es/ele-config-provider/types.d.ts +22 -1
- package/es/ele-data-table/types.d.ts +2 -0
- package/es/ele-drawer/index.d.ts +2 -2
- package/es/ele-edit-tag/index.d.ts +9 -4
- package/es/ele-edit-tag/index.js +4 -2
- package/es/ele-edit-tag/props.d.ts +3 -1
- package/es/ele-edit-tag/props.js +2 -0
- package/es/ele-edit-tag/style/index.scss +11 -4
- package/es/ele-icon-select/index.d.ts +10 -12
- package/es/ele-icon-select/props.d.ts +1 -1
- package/es/ele-map-picker/index.d.ts +1 -1
- package/es/ele-menus/index.d.ts +2 -2
- package/es/ele-menus/index.js +11 -0
- package/es/ele-modal/index.d.ts +3 -3
- package/es/ele-modal/style/index.scss +2 -0
- package/es/ele-modal/util.d.ts +1 -1
- package/es/ele-modal/util.js +2 -4
- package/es/ele-popconfirm/index.d.ts +3 -3
- package/es/ele-popconfirm/props.d.ts +1 -1
- package/es/ele-popover/index.d.ts +2 -2
- package/es/ele-pro-layout/components/pro-header.d.ts +1 -1
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
- package/es/ele-pro-layout/index.js +1 -1
- package/es/ele-pro-layout/types.d.ts +4 -4
- package/es/ele-pro-table/components/table-tools.d.ts +11 -2
- package/es/ele-pro-table/components/table-tools.js +14 -26
- package/es/ele-pro-table/components/tool-column.d.ts +1 -0
- package/es/ele-pro-table/components/tool-export.d.ts +29 -56
- package/es/ele-pro-table/components/tool-export.js +100 -52
- package/es/ele-pro-table/components/tool-print-body-cell.js +50 -6
- package/es/ele-pro-table/components/tool-print-header-cell.js +4 -1
- package/es/ele-pro-table/components/tool-print.d.ts +29 -50
- package/es/ele-pro-table/components/tool-print.js +174 -69
- package/es/ele-pro-table/index.js +59 -50
- package/es/ele-pro-table/style/index.scss +9 -0
- package/es/ele-pro-table/types.d.ts +32 -0
- package/es/ele-pro-table/util.d.ts +18 -3
- package/es/ele-pro-table/util.js +160 -28
- package/es/ele-table/style/index.scss +16 -0
- package/es/ele-tooltip/index.d.ts +3 -3
- package/es/ele-virtual-table/util.d.ts +3 -1
- package/es/ele-virtual-table/util.js +7 -2
- package/es/icons/LoadingOutlined.js +1 -1
- package/es/lang/en_US.js +7 -1
- package/es/lang/zh_CN.js +7 -1
- package/es/lang/zh_TW.js +7 -1
- package/es/style/themes/default.scss +82 -85
- package/es/style/themes/rounded.scss +11 -15
- package/es/utils/core.d.ts +7 -0
- package/es/utils/core.js +16 -2
- package/es/utils/message-box.d.ts +25 -0
- package/es/utils/message-box.js +71 -0
- package/es/utils/message.d.ts +44 -20
- package/es/utils/message.js +220 -37
- package/lib/core-export.cjs +8 -0
- package/lib/core-export.d.ts +1 -0
- package/lib/ele-alert/index.d.ts +2 -2
- package/lib/ele-alert/props.d.ts +1 -1
- package/lib/ele-app/components/message-body.cjs +91 -0
- package/lib/ele-app/components/message-body.d.ts +39 -0
- package/lib/ele-app/el.d.ts +2 -0
- package/lib/ele-app/style/message/css-var.scss +0 -4
- package/lib/ele-app/style/message/index.scss +199 -77
- package/lib/ele-app/style/overwrite/input/index.scss +2 -0
- package/lib/ele-app/style/overwrite/message-box/index.scss +31 -0
- package/lib/ele-app/style/overwrite/tag/css-var.scss +0 -16
- package/lib/ele-app/style/overwrite/tag/index.scss +57 -14
- package/lib/ele-app/types.d.ts +6 -1
- package/lib/ele-config-provider/components/receiver-view.cjs +1 -1
- package/lib/ele-config-provider/index.cjs +18 -4
- package/lib/ele-config-provider/index.d.ts +8 -4
- package/lib/ele-config-provider/props.cjs +9 -5
- package/lib/ele-config-provider/props.d.ts +9 -4
- package/lib/ele-config-provider/receiver.cjs +1 -1
- package/lib/ele-config-provider/types.d.ts +22 -1
- package/lib/ele-data-table/types.d.ts +2 -0
- package/lib/ele-drawer/index.d.ts +2 -2
- package/lib/ele-edit-tag/index.cjs +4 -2
- package/lib/ele-edit-tag/index.d.ts +9 -4
- package/lib/ele-edit-tag/props.cjs +2 -0
- package/lib/ele-edit-tag/props.d.ts +3 -1
- package/lib/ele-edit-tag/style/index.scss +11 -4
- package/lib/ele-icon-select/index.d.ts +10 -12
- package/lib/ele-icon-select/props.d.ts +1 -1
- package/lib/ele-map-picker/index.d.ts +1 -1
- package/lib/ele-menus/index.cjs +11 -0
- package/lib/ele-menus/index.d.ts +2 -2
- package/lib/ele-modal/index.d.ts +3 -3
- package/lib/ele-modal/style/index.scss +2 -0
- package/lib/ele-modal/util.cjs +1 -3
- package/lib/ele-modal/util.d.ts +1 -1
- package/lib/ele-popconfirm/index.d.ts +3 -3
- package/lib/ele-popconfirm/props.d.ts +1 -1
- package/lib/ele-popover/index.d.ts +2 -2
- package/lib/ele-pro-layout/components/pro-header.d.ts +1 -1
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
- package/lib/ele-pro-layout/index.cjs +1 -1
- package/lib/ele-pro-layout/types.d.ts +4 -4
- package/lib/ele-pro-table/components/table-tools.cjs +14 -26
- package/lib/ele-pro-table/components/table-tools.d.ts +11 -2
- package/lib/ele-pro-table/components/tool-column.d.ts +1 -0
- package/lib/ele-pro-table/components/tool-export.cjs +99 -51
- package/lib/ele-pro-table/components/tool-export.d.ts +29 -56
- package/lib/ele-pro-table/components/tool-print-body-cell.cjs +49 -5
- package/lib/ele-pro-table/components/tool-print-header-cell.cjs +4 -1
- package/lib/ele-pro-table/components/tool-print.cjs +172 -67
- package/lib/ele-pro-table/components/tool-print.d.ts +29 -50
- package/lib/ele-pro-table/index.cjs +59 -50
- package/lib/ele-pro-table/style/index.scss +9 -0
- package/lib/ele-pro-table/types.d.ts +32 -0
- package/lib/ele-pro-table/util.cjs +160 -28
- package/lib/ele-pro-table/util.d.ts +18 -3
- package/lib/ele-table/style/index.scss +16 -0
- package/lib/ele-tooltip/index.d.ts +3 -3
- package/lib/ele-virtual-table/util.cjs +7 -2
- package/lib/ele-virtual-table/util.d.ts +3 -1
- package/lib/icons/LoadingOutlined.cjs +1 -1
- package/lib/lang/en_US.cjs +7 -1
- package/lib/lang/zh_CN.cjs +7 -1
- package/lib/lang/zh_TW.cjs +7 -1
- package/lib/style/themes/default.scss +82 -85
- package/lib/style/themes/rounded.scss +11 -15
- package/lib/utils/core.cjs +16 -2
- package/lib/utils/core.d.ts +7 -0
- package/lib/utils/message-box.cjs +71 -0
- package/lib/utils/message-box.d.ts +25 -0
- package/lib/utils/message.cjs +216 -33
- package/lib/utils/message.d.ts +44 -20
- package/package.json +14 -14
|
@@ -185,6 +185,22 @@
|
|
|
185
185
|
table-layout: fixed;
|
|
186
186
|
border-collapse: collapse;
|
|
187
187
|
word-break: break-all;
|
|
188
|
+
|
|
189
|
+
&.is-border {
|
|
190
|
+
border-left: none;
|
|
191
|
+
border-right: 1px solid eleVar('table', 'border-color');
|
|
192
|
+
|
|
193
|
+
& > tr,
|
|
194
|
+
& > thead > tr,
|
|
195
|
+
& > tbody > tr,
|
|
196
|
+
& > tfoot > tr {
|
|
197
|
+
& > th,
|
|
198
|
+
& > td {
|
|
199
|
+
border-right-width: 0;
|
|
200
|
+
border-left-width: 1px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
188
204
|
}
|
|
189
205
|
}
|
|
190
206
|
|
|
@@ -7,6 +7,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
7
7
|
width: (StringConstructor | NumberConstructor)[];
|
|
8
8
|
isPopover: BooleanConstructor;
|
|
9
9
|
offset: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 12, boolean>;
|
|
10
|
+
zIndex: NumberConstructor;
|
|
10
11
|
trigger: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
11
12
|
effect: import('element-plus/es/utils/index').EpPropFinalized<StringConstructor, unknown, unknown, "dark", boolean>;
|
|
12
13
|
placement: import('element-plus/es/utils/index').EpPropFinalized<StringConstructor, import('element-plus').Placement, unknown, "bottom", boolean>;
|
|
@@ -36,7 +37,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
36
37
|
visible: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => boolean) | (() => boolean | null) | ((new (...args: any[]) => boolean) | (() => boolean | null))[], unknown, unknown, null, boolean>;
|
|
37
38
|
transition: StringConstructor;
|
|
38
39
|
enterable: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
39
|
-
zIndex: NumberConstructor;
|
|
40
40
|
gpuAcceleration: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
41
41
|
showAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
42
42
|
hideAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 200, boolean>;
|
|
@@ -68,6 +68,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
68
68
|
width: (StringConstructor | NumberConstructor)[];
|
|
69
69
|
isPopover: BooleanConstructor;
|
|
70
70
|
offset: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 12, boolean>;
|
|
71
|
+
zIndex: NumberConstructor;
|
|
71
72
|
trigger: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
72
73
|
effect: import('element-plus/es/utils/index').EpPropFinalized<StringConstructor, unknown, unknown, "dark", boolean>;
|
|
73
74
|
placement: import('element-plus/es/utils/index').EpPropFinalized<StringConstructor, import('element-plus').Placement, unknown, "bottom", boolean>;
|
|
@@ -97,7 +98,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
97
98
|
visible: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => boolean) | (() => boolean | null) | ((new (...args: any[]) => boolean) | (() => boolean | null))[], unknown, unknown, null, boolean>;
|
|
98
99
|
transition: StringConstructor;
|
|
99
100
|
enterable: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
100
|
-
zIndex: NumberConstructor;
|
|
101
101
|
gpuAcceleration: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
102
102
|
showAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
103
103
|
hideAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 200, boolean>;
|
|
@@ -106,10 +106,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
106
106
|
popperClass: StringConstructor;
|
|
107
107
|
popperStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
|
|
108
108
|
}>> & {
|
|
109
|
+
onClose?: ((e: any) => any) | undefined;
|
|
109
110
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
110
111
|
onHide?: ((e: Event) => any) | undefined;
|
|
111
112
|
onOpen?: ((e: any) => any) | undefined;
|
|
112
|
-
onClose?: ((e: any) => any) | undefined;
|
|
113
113
|
onShow?: ((e: Event) => any) | undefined;
|
|
114
114
|
"onBefore-show"?: ((e: Event) => any) | undefined;
|
|
115
115
|
"onBefore-hide"?: ((e: Event) => any) | undefined;
|
|
@@ -425,8 +425,10 @@ function getIndexValue(rowIndex, index, pageIndex) {
|
|
|
425
425
|
return String(index + rowIndex);
|
|
426
426
|
}
|
|
427
427
|
function getCellSpan(params, spanMethod) {
|
|
428
|
+
var _a;
|
|
428
429
|
const span = { rowspan: 1, colspan: 1 };
|
|
429
|
-
|
|
430
|
+
const type = (_a = params.column) == null ? void 0 : _a.type;
|
|
431
|
+
if ((!type || !["index", "selection", "expand"].includes(type)) && typeof spanMethod === "function") {
|
|
430
432
|
const result = spanMethod(params);
|
|
431
433
|
if (result != null) {
|
|
432
434
|
if (Array.isArray(result)) {
|
|
@@ -458,7 +460,10 @@ function getUserSums(summaryMethod, bodyCols, data) {
|
|
|
458
460
|
});
|
|
459
461
|
return summaryMethod({ columns, data });
|
|
460
462
|
}
|
|
461
|
-
function getSumValue(data, prop) {
|
|
463
|
+
function getSumValue(data, prop, index, sumText) {
|
|
464
|
+
if (index === 0) {
|
|
465
|
+
return sumText ?? "Sum";
|
|
466
|
+
}
|
|
462
467
|
if (!data || !prop) {
|
|
463
468
|
return "";
|
|
464
469
|
}
|
|
@@ -197,8 +197,10 @@ export declare function getUserSums(summaryMethod?: SummaryMethod, bodyCols?: Bo
|
|
|
197
197
|
* 计算列合计值
|
|
198
198
|
* @param data 表格数据
|
|
199
199
|
* @param prop 列字段名称
|
|
200
|
+
* @param index 列索引
|
|
201
|
+
* @param sumText 第一列文本
|
|
200
202
|
*/
|
|
201
|
-
export declare function getSumValue(data?: DataItem[], prop?: string): string;
|
|
203
|
+
export declare function getSumValue(data?: DataItem[], prop?: string, index?: number, sumText?: string): string;
|
|
202
204
|
/**
|
|
203
205
|
* 获取原始列配置
|
|
204
206
|
* @param columns 列配置
|
|
@@ -17,7 +17,7 @@ const _hoisted_1 = {
|
|
|
17
17
|
"stroke-width": "4",
|
|
18
18
|
"stroke-linecap": "round"
|
|
19
19
|
};
|
|
20
|
-
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("path", { d: "
|
|
20
|
+
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("path", { d: "M 22 6 C 34 6 42 14 42 26" }, null, -1);
|
|
21
21
|
const _hoisted_3 = [
|
|
22
22
|
_hoisted_2
|
|
23
23
|
];
|
package/lib/lang/en_US.cjs
CHANGED
|
@@ -43,6 +43,8 @@ const localeValues = {
|
|
|
43
43
|
columnTitle: "Check all",
|
|
44
44
|
columnReset: "Reset",
|
|
45
45
|
columnUntitled: "Untitled",
|
|
46
|
+
columnIndex: "Index",
|
|
47
|
+
columnExpand: "Expand",
|
|
46
48
|
columnFixedLeft: "Pin to left",
|
|
47
49
|
columnFixedRight: "Pin to right",
|
|
48
50
|
exportOk: "Ok",
|
|
@@ -53,7 +55,11 @@ const localeValues = {
|
|
|
53
55
|
exportSelectColumn: "Columns",
|
|
54
56
|
exportDataTypePage: "Current",
|
|
55
57
|
exportDataTypeSelected: "Selected",
|
|
56
|
-
exportDataTypeAll: "All"
|
|
58
|
+
exportDataTypeAll: "All",
|
|
59
|
+
exportOther: "Options",
|
|
60
|
+
exportOtherHeader: "Header",
|
|
61
|
+
exportOtherFooter: "Footer",
|
|
62
|
+
exportOtherTreeIndex: "Tree index"
|
|
57
63
|
},
|
|
58
64
|
copyable: {
|
|
59
65
|
copy: "Copy",
|
package/lib/lang/zh_CN.cjs
CHANGED
|
@@ -43,6 +43,8 @@ const localeValues = {
|
|
|
43
43
|
columnTitle: "全选",
|
|
44
44
|
columnReset: "重置",
|
|
45
45
|
columnUntitled: "无标题",
|
|
46
|
+
columnIndex: "序号列",
|
|
47
|
+
columnExpand: "展开列",
|
|
46
48
|
columnFixedLeft: "固定在左侧",
|
|
47
49
|
columnFixedRight: "固定在右侧",
|
|
48
50
|
exportOk: "确定",
|
|
@@ -53,7 +55,11 @@ const localeValues = {
|
|
|
53
55
|
exportSelectColumn: "选择字段",
|
|
54
56
|
exportDataTypePage: "当前页数据",
|
|
55
57
|
exportDataTypeSelected: "选中数据",
|
|
56
|
-
exportDataTypeAll: "全部数据"
|
|
58
|
+
exportDataTypeAll: "全部数据",
|
|
59
|
+
exportOther: "其它选项",
|
|
60
|
+
exportOtherHeader: "表头",
|
|
61
|
+
exportOtherFooter: "表尾",
|
|
62
|
+
exportOtherTreeIndex: "层级序号"
|
|
57
63
|
},
|
|
58
64
|
copyable: {
|
|
59
65
|
copy: "复制",
|
package/lib/lang/zh_TW.cjs
CHANGED
|
@@ -43,6 +43,8 @@ const localeValues = {
|
|
|
43
43
|
columnTitle: "列展示",
|
|
44
44
|
columnReset: "重置",
|
|
45
45
|
columnUntitled: "無標題",
|
|
46
|
+
columnIndex: "序號列",
|
|
47
|
+
columnExpand: "展開列",
|
|
46
48
|
columnFixedLeft: "固定在左側",
|
|
47
49
|
columnFixedRight: "固定在右側",
|
|
48
50
|
exportOk: "確認",
|
|
@@ -53,7 +55,11 @@ const localeValues = {
|
|
|
53
55
|
exportSelectColumn: "選擇字段",
|
|
54
56
|
exportDataTypePage: "當前頁數據",
|
|
55
57
|
exportDataTypeSelected: "選中數據",
|
|
56
|
-
exportDataTypeAll: "全部數據"
|
|
58
|
+
exportDataTypeAll: "全部數據",
|
|
59
|
+
exportOther: "更多選項",
|
|
60
|
+
exportOtherHeader: "表頭",
|
|
61
|
+
exportOtherFooter: "表尾",
|
|
62
|
+
exportOtherTreeIndex: "層級序號"
|
|
57
63
|
},
|
|
58
64
|
copyable: {
|
|
59
65
|
copy: "複製",
|
|
@@ -123,6 +123,7 @@ $ele: map.deep-merge(
|
|
|
123
123
|
// 消息提示
|
|
124
124
|
'color': elVar('text-color', 'regular'),
|
|
125
125
|
'size': elVar('font-size', 'base'),
|
|
126
|
+
'space': 16px,
|
|
126
127
|
'padding': 12px 14px,
|
|
127
128
|
'radius': elVar('border-radius', 'base'),
|
|
128
129
|
'shadow': elVar('box-shadow', 'light'),
|
|
@@ -135,12 +136,9 @@ $ele: map.deep-merge(
|
|
|
135
136
|
'close-color': elVar('text-color', 'placeholder'),
|
|
136
137
|
'close-hover-color': elVar('text-color', 'primary'),
|
|
137
138
|
'close-hover-bg': transparent,
|
|
138
|
-
'plain-bg': elVar('bg-color', 'overlay')
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// 消息提示遮罩层
|
|
142
|
-
'color': elVar('overlay-color', 'lighter'),
|
|
143
|
-
'size': 1000vw
|
|
139
|
+
'plain-bg': elVar('bg-color', 'overlay'),
|
|
140
|
+
'alert-padding': 10px 14px,
|
|
141
|
+
'mask-color': elVar('overlay-color', 'lighter')
|
|
144
142
|
),
|
|
145
143
|
'bottom-bar': (
|
|
146
144
|
// 底部工具栏
|
|
@@ -971,85 +969,84 @@ $ele: map.deep-merge(
|
|
|
971
969
|
'danger-border-color': elVar('color-error', 'light-7'),
|
|
972
970
|
'danger-close-color': elVar('color-error'),
|
|
973
971
|
'danger-close-hover-color': elVar('color-error'),
|
|
974
|
-
'danger-close-hover-bg': transparent
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
'
|
|
979
|
-
'
|
|
980
|
-
'
|
|
981
|
-
'
|
|
982
|
-
'close-
|
|
983
|
-
'close-
|
|
984
|
-
'close-
|
|
985
|
-
'
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
'
|
|
990
|
-
'
|
|
991
|
-
'
|
|
992
|
-
'
|
|
993
|
-
'close-
|
|
994
|
-
'close-
|
|
995
|
-
'
|
|
996
|
-
'
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
'color': #fff,
|
|
1001
|
-
'bg':
|
|
1002
|
-
'
|
|
1003
|
-
'
|
|
1004
|
-
'close-
|
|
1005
|
-
'info-color': elVar('text-color', 'primary'),
|
|
1006
|
-
'info-bg':
|
|
1007
|
-
'
|
|
1008
|
-
'
|
|
1009
|
-
'
|
|
1010
|
-
'success-color': #fff,
|
|
1011
|
-
'success-bg':
|
|
1012
|
-
'
|
|
1013
|
-
'
|
|
1014
|
-
'
|
|
1015
|
-
'warning-color': #fff,
|
|
1016
|
-
'warning-bg':
|
|
1017
|
-
'
|
|
1018
|
-
'
|
|
1019
|
-
'
|
|
1020
|
-
'danger-color': #fff,
|
|
1021
|
-
'danger-bg':
|
|
1022
|
-
'
|
|
1023
|
-
'
|
|
1024
|
-
'
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
'color': elVar('color-
|
|
1029
|
-
'
|
|
1030
|
-
'close-color': elVar('color
|
|
1031
|
-
'close-hover-
|
|
1032
|
-
'
|
|
1033
|
-
'
|
|
1034
|
-
'
|
|
1035
|
-
'
|
|
1036
|
-
'
|
|
1037
|
-
'
|
|
1038
|
-
'
|
|
1039
|
-
'
|
|
1040
|
-
'
|
|
1041
|
-
'
|
|
1042
|
-
'
|
|
1043
|
-
'
|
|
1044
|
-
'
|
|
1045
|
-
'
|
|
1046
|
-
'
|
|
1047
|
-
'
|
|
1048
|
-
'
|
|
1049
|
-
'
|
|
1050
|
-
'
|
|
1051
|
-
'danger-
|
|
1052
|
-
'danger-close-hover-bg': transparent
|
|
972
|
+
'danger-close-hover-bg': transparent,
|
|
973
|
+
'round-radius': 12px,
|
|
974
|
+
'round-padding': 0 10px,
|
|
975
|
+
'sm-size': 12px,
|
|
976
|
+
'sm-height': 20px,
|
|
977
|
+
'sm-padding': 0 4px,
|
|
978
|
+
'sm-radius': elVar('border-radius', 'small'),
|
|
979
|
+
'sm-close-size': 13px,
|
|
980
|
+
'sm-close-padding': 0,
|
|
981
|
+
'sm-close-margin': 0 -2px 0 2px,
|
|
982
|
+
'sm-close-radius': 2px,
|
|
983
|
+
'sm-round-radius': 10px,
|
|
984
|
+
'sm-round-padding': 0 6px,
|
|
985
|
+
'lg-size': 14px,
|
|
986
|
+
'lg-height': 32px,
|
|
987
|
+
'lg-padding': 0 12px,
|
|
988
|
+
'lg-radius': elVar('border-radius', 'base'),
|
|
989
|
+
'lg-close-size': 15px,
|
|
990
|
+
'lg-close-padding': 2px,
|
|
991
|
+
'lg-close-margin': 0 -8px 0 4px,
|
|
992
|
+
'lg-close-radius': 4px,
|
|
993
|
+
'lg-round-radius': 16px,
|
|
994
|
+
'lg-round-padding': 0 14px,
|
|
995
|
+
'dark-color': #fff,
|
|
996
|
+
'dark-bg': elVar('color-primary'),
|
|
997
|
+
'dark-close-color': #fff,
|
|
998
|
+
'dark-close-hover-color': #fff,
|
|
999
|
+
'dark-close-hover-bg': transparent,
|
|
1000
|
+
'dark-info-color': elVar('text-color', 'primary'),
|
|
1001
|
+
'dark-info-bg': elVar('color-info', 'light-7'),
|
|
1002
|
+
'dark-info-close-color': elVar('text-color', 'secondary'),
|
|
1003
|
+
'dark-info-close-hover-color': elVar('text-color', 'primary'),
|
|
1004
|
+
'dark-info-close-hover-bg': transparent,
|
|
1005
|
+
'dark-success-color': #fff,
|
|
1006
|
+
'dark-success-bg': elVar('color-success'),
|
|
1007
|
+
'dark-success-close-color': #fff,
|
|
1008
|
+
'dark-success-close-hover-color': #fff,
|
|
1009
|
+
'dark-success-close-hover-bg': transparent,
|
|
1010
|
+
'dark-warning-color': #fff,
|
|
1011
|
+
'dark-warning-bg': elVar('color-warning'),
|
|
1012
|
+
'dark-warning-close-color': #fff,
|
|
1013
|
+
'dark-warning-close-hover-color': #fff,
|
|
1014
|
+
'dark-warning-close-hover-bg': transparent,
|
|
1015
|
+
'dark-danger-color': #fff,
|
|
1016
|
+
'dark-danger-bg': elVar('color-error'),
|
|
1017
|
+
'dark-danger-close-color': #fff,
|
|
1018
|
+
'dark-danger-close-hover-color': #fff,
|
|
1019
|
+
'dark-danger-close-hover-bg': transparent,
|
|
1020
|
+
'plain-color': elVar('color-primary'),
|
|
1021
|
+
'plain-border-color': elVar('color-primary'),
|
|
1022
|
+
'plain-close-color': elVar('color-primary'),
|
|
1023
|
+
'plain-close-hover-color': elVar('color-primary'),
|
|
1024
|
+
'plain-close-hover-bg': transparent,
|
|
1025
|
+
'plain-info-color': elVar('text-color', 'regular'),
|
|
1026
|
+
'plain-info-border-color': elVar('color-info', 'light-3'),
|
|
1027
|
+
'plain-info-close-color': elVar('text-color', 'secondary'),
|
|
1028
|
+
'plain-info-close-hover-color': elVar('text-color', 'primary'),
|
|
1029
|
+
'plain-info-close-hover-bg': transparent,
|
|
1030
|
+
'plain-success-color': elVar('color-success'),
|
|
1031
|
+
'plain-success-border-color': elVar('color-success'),
|
|
1032
|
+
'plain-success-close-color': elVar('color-success'),
|
|
1033
|
+
'plain-success-close-hover-color': elVar('color-success'),
|
|
1034
|
+
'plain-success-close-hover-bg': transparent,
|
|
1035
|
+
'plain-warning-color': elVar('color-warning'),
|
|
1036
|
+
'plain-warning-border-color': elVar('color-warning'),
|
|
1037
|
+
'plain-warning-close-color': elVar('color-warning'),
|
|
1038
|
+
'plain-warning-close-hover-color': elVar('color-warning'),
|
|
1039
|
+
'plain-warning-close-hover-bg': transparent,
|
|
1040
|
+
'plain-danger-color': elVar('color-error'),
|
|
1041
|
+
'plain-danger-border-color': elVar('color-error'),
|
|
1042
|
+
'plain-danger-close-color': elVar('color-error'),
|
|
1043
|
+
'plain-danger-close-hover-color': elVar('color-error'),
|
|
1044
|
+
'plain-danger-close-hover-bg': transparent,
|
|
1045
|
+
'hit-border-color': elVar('color-primary'),
|
|
1046
|
+
'hit-info-border-color': elVar('color-info', 'light-3'),
|
|
1047
|
+
'hit-success-border-color': elVar('color-success'),
|
|
1048
|
+
'hit-warning-border-color': elVar('color-warning'),
|
|
1049
|
+
'hit-danger-border-color': elVar('color-error')
|
|
1053
1050
|
),
|
|
1054
1051
|
'tree': (
|
|
1055
1052
|
// 树
|
|
@@ -218,21 +218,17 @@ $ele-rounded: map.deep-merge(
|
|
|
218
218
|
'info-close-hover-bg': hsla(0, 0%, 60%, 0.25),
|
|
219
219
|
'success-close-hover-bg': elVar('color-success', 'light-8'),
|
|
220
220
|
'warning-close-hover-bg': elVar('color-warning', 'light-8'),
|
|
221
|
-
'danger-close-hover-bg': elVar('color-error', 'light-8')
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
'close-hover-bg': rgba(255, 255, 255, 0.2),
|
|
225
|
-
'
|
|
226
|
-
'
|
|
227
|
-
'
|
|
228
|
-
'
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
'close-hover-bg': elVar('color-
|
|
232
|
-
'info-close-hover-bg': hsla(0, 0%, 60%, 0.25),
|
|
233
|
-
'success-close-hover-bg': elVar('color-success', 'light-8'),
|
|
234
|
-
'warning-close-hover-bg': elVar('color-warning', 'light-8'),
|
|
235
|
-
'danger-close-hover-bg': elVar('color-error', 'light-8')
|
|
221
|
+
'danger-close-hover-bg': elVar('color-error', 'light-8'),
|
|
222
|
+
'dark-close-hover-bg': rgba(255, 255, 255, 0.2),
|
|
223
|
+
'dark-info-close-hover-bg': hsla(0, 0%, 60%, 0.25),
|
|
224
|
+
'dark-success-close-hover-bg': rgba(255, 255, 255, 0.2),
|
|
225
|
+
'dark-warning-close-hover-bg': rgba(255, 255, 255, 0.2),
|
|
226
|
+
'dark-danger-close-hover-bg': rgba(255, 255, 255, 0.2),
|
|
227
|
+
'plain-close-hover-bg': elVar('color-primary', 'light-8'),
|
|
228
|
+
'plain-info-close-hover-bg': hsla(0, 0%, 60%, 0.25),
|
|
229
|
+
'plain-success-close-hover-bg': elVar('color-success', 'light-8'),
|
|
230
|
+
'plain-warning-close-hover-bg': elVar('color-warning', 'light-8'),
|
|
231
|
+
'plain-danger-close-hover-bg': elVar('color-error', 'light-8')
|
|
236
232
|
),
|
|
237
233
|
'tree': (
|
|
238
234
|
'item-margin': 2px,
|
package/lib/utils/core.cjs
CHANGED
|
@@ -223,9 +223,9 @@ function contentIsEllipsis(el, direction) {
|
|
|
223
223
|
range.setEnd(el, el.childNodes.length);
|
|
224
224
|
const { width, height } = range.getBoundingClientRect();
|
|
225
225
|
const floorW = Math.floor(width);
|
|
226
|
-
const rangeWidth = width - floorW <
|
|
226
|
+
const rangeWidth = width - floorW < 8e-3 ? floorW : width;
|
|
227
227
|
const floorH = Math.floor(height);
|
|
228
|
-
const rangeHeight = height - floorH <
|
|
228
|
+
const rangeHeight = height - floorH < 8e-3 ? floorH : height;
|
|
229
229
|
const style = getCurrentStyle(el);
|
|
230
230
|
const top = Number.parseInt(style.paddingTop) || 0;
|
|
231
231
|
const left = Number.parseInt(style.paddingLeft) || 0;
|
|
@@ -241,6 +241,19 @@ function contentIsEllipsis(el, direction) {
|
|
|
241
241
|
}
|
|
242
242
|
return rangeWidth + horizontalPadding > el.offsetWidth || rangeHeight + verticalPadding > el.offsetHeight || el.scrollWidth > el.offsetWidth;
|
|
243
243
|
}
|
|
244
|
+
function queryChild(parentEl, className, attr) {
|
|
245
|
+
return Array.from(parentEl.children).find((el) => {
|
|
246
|
+
if (className && !el.classList.contains(className)) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
if (attr != null && attr[0] != null) {
|
|
250
|
+
if (el.getAttribute(attr[0]) != attr[1]) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
244
257
|
exports.assignObject = assignObject;
|
|
245
258
|
exports.bd09ToGcj02 = bd09ToGcj02;
|
|
246
259
|
exports.checkFullscreen = checkFullscreen;
|
|
@@ -256,6 +269,7 @@ exports.isExternalLink = isExternalLink;
|
|
|
256
269
|
exports.mapTree = mapTree;
|
|
257
270
|
exports.omit = omit;
|
|
258
271
|
exports.pick = pick;
|
|
272
|
+
exports.queryChild = queryChild;
|
|
259
273
|
exports.random = random;
|
|
260
274
|
exports.requestFullscreen = requestFullscreen;
|
|
261
275
|
exports.throttle = throttle;
|
package/lib/utils/core.d.ts
CHANGED
|
@@ -142,3 +142,10 @@ export declare function pick<T extends object, K extends keyof T>(obj: T, fields
|
|
|
142
142
|
* @param el 元素节点
|
|
143
143
|
*/
|
|
144
144
|
export declare function contentIsEllipsis(el: HTMLElement, direction?: 'horizontal' | 'vertical'): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* 查找子元素
|
|
147
|
+
* @param parentEl 父元素
|
|
148
|
+
* @param className 类名
|
|
149
|
+
* @param attr 属性
|
|
150
|
+
*/
|
|
151
|
+
export declare function queryChild(parentEl: Element, className?: string, attr?: string[]): Element | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const elementPlus = require("element-plus");
|
|
5
|
+
const receiver = require("../ele-config-provider/receiver");
|
|
6
|
+
const core = require("./core");
|
|
7
|
+
function getWrapEl(bodyEl) {
|
|
8
|
+
const parent = bodyEl || document.body;
|
|
9
|
+
const className = "ele-message-box-wrapper";
|
|
10
|
+
const el = core.queryChild(parent, className);
|
|
11
|
+
if (el != null) {
|
|
12
|
+
return el;
|
|
13
|
+
}
|
|
14
|
+
const elem = document.createElement("div");
|
|
15
|
+
elem.classList.add(className);
|
|
16
|
+
parent.appendChild(elem);
|
|
17
|
+
return elem;
|
|
18
|
+
}
|
|
19
|
+
function useMessageBox(globalOpt) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const layoutState = receiver.useLayoutState();
|
|
22
|
+
const globalProps = receiver.useGlobalProps("messageBox");
|
|
23
|
+
const appContext = (_b = (_a = vue.getCurrentInstance) == null ? void 0 : _a.call(vue)) == null ? void 0 : _b.appContext;
|
|
24
|
+
const state = { wrapEl: null, isActivated: true };
|
|
25
|
+
const hideClass = "is-hide";
|
|
26
|
+
vue.onActivated(() => {
|
|
27
|
+
state.isActivated = true;
|
|
28
|
+
state.wrapEl && state.wrapEl.classList.remove(hideClass);
|
|
29
|
+
});
|
|
30
|
+
vue.onDeactivated(() => {
|
|
31
|
+
state.isActivated = false;
|
|
32
|
+
state.wrapEl && state.wrapEl.classList.add(hideClass);
|
|
33
|
+
});
|
|
34
|
+
const getOption = (options) => {
|
|
35
|
+
const opt = {
|
|
36
|
+
...globalProps.value || {},
|
|
37
|
+
...globalOpt || {},
|
|
38
|
+
...options || {}
|
|
39
|
+
};
|
|
40
|
+
if (opt.inner) {
|
|
41
|
+
if (opt.appendTo == null && layoutState.modalsEl != null) {
|
|
42
|
+
if (state.wrapEl == null) {
|
|
43
|
+
state.wrapEl = getWrapEl(layoutState.modalsEl);
|
|
44
|
+
}
|
|
45
|
+
opt.appendTo = state.wrapEl;
|
|
46
|
+
}
|
|
47
|
+
opt.lockScroll = false;
|
|
48
|
+
}
|
|
49
|
+
return core.omit(opt, ["inner"]);
|
|
50
|
+
};
|
|
51
|
+
const messageBox = function(options) {
|
|
52
|
+
return elementPlus.ElMessageBox(getOption(options), appContext);
|
|
53
|
+
};
|
|
54
|
+
messageBox.alert = function(message, title, options, context) {
|
|
55
|
+
const ctx = context ?? appContext;
|
|
56
|
+
return elementPlus.ElMessageBox.alert(message, title, getOption(options), ctx);
|
|
57
|
+
};
|
|
58
|
+
messageBox.confirm = function(message, title, options, context) {
|
|
59
|
+
const ctx = context ?? appContext;
|
|
60
|
+
return elementPlus.ElMessageBox.confirm(message, title, getOption(options), ctx);
|
|
61
|
+
};
|
|
62
|
+
messageBox.prompt = function(message, title, options, context) {
|
|
63
|
+
const ctx = context ?? appContext;
|
|
64
|
+
return elementPlus.ElMessageBox.prompt(message, title, getOption(options), ctx);
|
|
65
|
+
};
|
|
66
|
+
messageBox.close = function() {
|
|
67
|
+
return elementPlus.ElMessageBox.close();
|
|
68
|
+
};
|
|
69
|
+
return messageBox;
|
|
70
|
+
}
|
|
71
|
+
exports.useMessageBox = useMessageBox;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElMessageBoxOptions, MessageBoxData as ElMessageBoxData } from 'element-plus';
|
|
2
|
+
import { AppContext } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 消息弹窗配置
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageBoxOptions extends ElMessageBoxOptions {
|
|
8
|
+
/** 是否限制在主体内部 */
|
|
9
|
+
inner?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 消息弹窗方法
|
|
13
|
+
*/
|
|
14
|
+
export type MessageBoxMethod = (message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: MessageBoxOptions, context?: AppContext | null) => Promise<ElMessageBoxData>;
|
|
15
|
+
/**
|
|
16
|
+
* 消息弹窗
|
|
17
|
+
*/
|
|
18
|
+
export interface MessageBox {
|
|
19
|
+
(options?: MessageBoxOptions, context?: AppContext | null): Promise<ElMessageBoxData>;
|
|
20
|
+
alert: MessageBoxMethod;
|
|
21
|
+
confirm: MessageBoxMethod;
|
|
22
|
+
prompt: MessageBoxMethod;
|
|
23
|
+
close: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useMessageBox(globalOpt?: MessageBoxOptions): MessageBox;
|