ele-admin-plus 1.0.1 → 1.0.2
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/ele-avatar-group/index.js +2 -2
- package/es/ele-dot/index.d.ts +3 -3
- package/es/ele-dot/props.d.ts +1 -1
- package/es/ele-dot/props.js +1 -1
- package/es/ele-file-list/components/file-grid.js +1 -1
- package/es/ele-file-list/icons.d.ts +10 -2
- package/es/ele-file-list/icons.js +40 -132
- package/es/ele-map-picker/components/map-view.d.ts +1 -1
- package/es/ele-modal/util.js +1 -1
- package/es/ele-pro-layout/components/pro-tabs.js +2 -1
- package/es/ele-pro-layout/index.d.ts +370 -0
- package/es/ele-pro-layout/index.js +7 -7
- package/es/ele-pro-layout/props.d.ts +1 -4
- package/es/ele-pro-layout/props.js +2 -5
- package/es/ele-pro-layout/types/index.d.ts +1 -1
- package/es/ele-pro-table/components/table-view.d.ts +4 -13
- package/es/ele-pro-table/index.d.ts +5 -14
- package/es/ele-pro-table/index.js +3 -3
- package/es/ele-pro-table/props.d.ts +92 -9
- package/es/ele-pro-table/props.js +3 -1
- package/es/ele-pro-table/style/index.scss +2 -2
- package/es/ele-segmented/index.js +6 -3
- package/es/ele-toolbar/index.d.ts +0 -3
- package/es/ele-toolbar/props.d.ts +0 -1
- package/es/ele-toolbar/props.js +1 -3
- package/es/ele-watermark/index.d.ts +7 -1
- package/es/ele-watermark/index.js +67 -29
- package/es/ele-watermark/props.d.ts +2 -1
- package/es/ele-watermark/props.js +3 -1
- package/es/ele-watermark/types/index.d.ts +13 -0
- package/es/ele-watermark/util.d.ts +8 -1
- package/es/ele-watermark/util.js +31 -1
- package/es/utils/core.d.ts +1 -1
- package/es/utils/menu-util.js +1 -1
- package/lib/ele-avatar-group/index.js +2 -2
- package/lib/ele-dot/index.d.ts +3 -3
- package/lib/ele-dot/props.d.ts +1 -1
- package/lib/ele-dot/props.js +1 -1
- package/lib/ele-file-list/components/file-grid.js +1 -1
- package/lib/ele-file-list/icons.d.ts +10 -2
- package/lib/ele-file-list/icons.js +40 -132
- package/lib/ele-map-picker/components/map-view.d.ts +1 -1
- package/lib/ele-modal/util.js +1 -1
- package/lib/ele-pro-layout/components/pro-tabs.js +2 -1
- package/lib/ele-pro-layout/index.d.ts +370 -0
- package/lib/ele-pro-layout/index.js +6 -6
- package/lib/ele-pro-layout/props.d.ts +1 -4
- package/lib/ele-pro-layout/props.js +2 -5
- package/lib/ele-pro-layout/types/index.d.ts +1 -1
- package/lib/ele-pro-table/components/table-view.d.ts +4 -13
- package/lib/ele-pro-table/index.d.ts +5 -14
- package/lib/ele-pro-table/index.js +3 -3
- package/lib/ele-pro-table/props.d.ts +92 -9
- package/lib/ele-pro-table/props.js +3 -1
- package/lib/ele-pro-table/style/index.scss +2 -2
- package/lib/ele-segmented/index.js +5 -2
- package/lib/ele-toolbar/index.d.ts +0 -3
- package/lib/ele-toolbar/props.d.ts +0 -1
- package/lib/ele-toolbar/props.js +1 -3
- package/lib/ele-watermark/index.d.ts +7 -1
- package/lib/ele-watermark/index.js +65 -27
- package/lib/ele-watermark/props.d.ts +2 -1
- package/lib/ele-watermark/props.js +3 -1
- package/lib/ele-watermark/types/index.d.ts +13 -0
- package/lib/ele-watermark/util.d.ts +8 -1
- package/lib/ele-watermark/util.js +30 -0
- package/lib/utils/core.d.ts +1 -1
- package/lib/utils/menu-util.js +1 -1
- package/package.json +3 -1
|
@@ -1,6 +1,96 @@
|
|
|
1
1
|
import type { PropType, CSSProperties, ExtractPropTypes } from 'vue';
|
|
2
|
-
import tableProps from 'element-plus/es/components/table/src/table/defaults';
|
|
3
2
|
import type { Column, Columns, DataItem, Where, Datasource, RequestOption, ResponseOption, ParseData, Sorter, Filter, DoneParams, TablePagination, TableToolbar, TableTool, TableSize, RowClickChecked, TableLocale } from './types';
|
|
3
|
+
declare const tableProps: Omit<{
|
|
4
|
+
data: {
|
|
5
|
+
type: PropType<any[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
10
|
+
readonly required: false;
|
|
11
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
12
|
+
__epPropKey: true;
|
|
13
|
+
};
|
|
14
|
+
width: (StringConstructor | NumberConstructor)[];
|
|
15
|
+
height: (StringConstructor | NumberConstructor)[];
|
|
16
|
+
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
17
|
+
fit: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
stripe: BooleanConstructor;
|
|
22
|
+
border: BooleanConstructor;
|
|
23
|
+
rowKey: PropType<string | ((row: any) => string) | undefined>;
|
|
24
|
+
showHeader: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
showSummary: BooleanConstructor;
|
|
29
|
+
sumText: StringConstructor;
|
|
30
|
+
summaryMethod: PropType<import("element-plus/es/components/table/src/table/defaults").SummaryMethod<any> | undefined>;
|
|
31
|
+
rowClassName: PropType<import("element-plus/es/components/table/src/table/defaults").ColumnCls<any> | undefined>;
|
|
32
|
+
rowStyle: PropType<import("element-plus/es/components/table/src/table/defaults").ColumnStyle<any> | undefined>;
|
|
33
|
+
cellClassName: PropType<import("element-plus/es/components/table/src/table/defaults").CellCls<any> | undefined>;
|
|
34
|
+
cellStyle: PropType<import("element-plus/es/components/table/src/table/defaults").CellStyle<any> | undefined>;
|
|
35
|
+
headerRowClassName: PropType<import("element-plus/es/components/table/src/table/defaults").ColumnCls<any> | undefined>;
|
|
36
|
+
headerRowStyle: PropType<import("element-plus/es/components/table/src/table/defaults").ColumnStyle<any> | undefined>;
|
|
37
|
+
headerCellClassName: PropType<import("element-plus/es/components/table/src/table/defaults").CellCls<any> | undefined>;
|
|
38
|
+
headerCellStyle: PropType<import("element-plus/es/components/table/src/table/defaults").CellStyle<any> | undefined>;
|
|
39
|
+
highlightCurrentRow: BooleanConstructor;
|
|
40
|
+
currentRowKey: (StringConstructor | NumberConstructor)[];
|
|
41
|
+
emptyText: StringConstructor;
|
|
42
|
+
expandRowKeys: PropType<any[] | undefined>;
|
|
43
|
+
defaultExpandAll: BooleanConstructor;
|
|
44
|
+
defaultSort: PropType<import("element-plus/es/components/table/src/table/defaults").Sort | undefined>;
|
|
45
|
+
tooltipEffect: StringConstructor;
|
|
46
|
+
tooltipOptions: PropType<Partial<Pick<import("element-plus").ElTooltipProps, "showArrow" | "effect" | "enterable" | "popperClass" | "offset" | "placement" | "popperOptions" | "showAfter" | "hideAfter">> | undefined>;
|
|
47
|
+
spanMethod: PropType<((data: {
|
|
48
|
+
row: any;
|
|
49
|
+
rowIndex: number;
|
|
50
|
+
column: import("element-plus/es/components/table/src/table-column/defaults").TableColumnCtx<any>;
|
|
51
|
+
columnIndex: number;
|
|
52
|
+
}) => number[] | {
|
|
53
|
+
rowspan: number;
|
|
54
|
+
colspan: number;
|
|
55
|
+
} | undefined) | undefined>;
|
|
56
|
+
selectOnIndeterminate: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
indent: {
|
|
61
|
+
type: NumberConstructor;
|
|
62
|
+
default: number;
|
|
63
|
+
};
|
|
64
|
+
treeProps: {
|
|
65
|
+
type: PropType<{
|
|
66
|
+
hasChildren?: string | undefined;
|
|
67
|
+
children?: string | undefined;
|
|
68
|
+
} | undefined>;
|
|
69
|
+
default: () => {
|
|
70
|
+
hasChildren: string;
|
|
71
|
+
children: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
lazy: BooleanConstructor;
|
|
75
|
+
load: PropType<((row: any, treeNode: import("element-plus/es/components/table/src/table/defaults").TreeNode, resolve: (data: any[]) => void) => void) | undefined>;
|
|
76
|
+
style: {
|
|
77
|
+
type: PropType<CSSProperties>;
|
|
78
|
+
default: () => {};
|
|
79
|
+
};
|
|
80
|
+
className: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
tableLayout: {
|
|
85
|
+
type: PropType<"fixed" | "auto">;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
scrollbarAlwaysOn: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
flexible: BooleanConstructor;
|
|
93
|
+
}, "style">;
|
|
4
94
|
/**
|
|
5
95
|
* 表格组件属性
|
|
6
96
|
*/
|
|
@@ -83,10 +173,6 @@ export declare const tableViewProps: {
|
|
|
83
173
|
};
|
|
84
174
|
lazy: BooleanConstructor;
|
|
85
175
|
load: PropType<((row: any, treeNode: import("element-plus/es/components/table/src/table/defaults").TreeNode, resolve: (data: any[]) => void) => void) | undefined>;
|
|
86
|
-
style: {
|
|
87
|
-
type: PropType<CSSProperties>;
|
|
88
|
-
default: () => {};
|
|
89
|
-
};
|
|
90
176
|
className: {
|
|
91
177
|
type: StringConstructor;
|
|
92
178
|
default: string;
|
|
@@ -239,10 +325,6 @@ export declare const proTableProps: {
|
|
|
239
325
|
};
|
|
240
326
|
lazy: BooleanConstructor;
|
|
241
327
|
load: PropType<((row: any, treeNode: import("element-plus/es/components/table/src/table/defaults").TreeNode, resolve: (data: any[]) => void) => void) | undefined>;
|
|
242
|
-
style: {
|
|
243
|
-
type: PropType<CSSProperties>;
|
|
244
|
-
default: () => {};
|
|
245
|
-
};
|
|
246
328
|
className: {
|
|
247
329
|
type: StringConstructor;
|
|
248
330
|
default: string;
|
|
@@ -321,3 +403,4 @@ export type TablePropKeys = Array<keyof typeof tableProps>;
|
|
|
321
403
|
* 表格组件属性名
|
|
322
404
|
*/
|
|
323
405
|
export declare const tablePropKeys: TablePropKeys;
|
|
406
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import elTableProps from "element-plus/es/components/table/src/table/defaults";
|
|
2
|
+
import { omit } from "../utils/core";
|
|
3
|
+
const tableProps = omit(elTableProps, ["style"]);
|
|
2
4
|
const tableViewProps = {
|
|
3
5
|
...tableProps,
|
|
4
6
|
// 列配置
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
& > .el-table__inner-wrapper > .el-table__header-wrapper {
|
|
120
120
|
position: sticky;
|
|
121
121
|
top: eleVar('table', 'sticky-top');
|
|
122
|
-
z-index:
|
|
122
|
+
z-index: 3;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
|
|
134
134
|
/* 全屏 */
|
|
135
135
|
.ele-pro-table.is-maximized {
|
|
136
|
-
position: fixed;
|
|
136
|
+
position: fixed !important;
|
|
137
137
|
top: 0;
|
|
138
138
|
left: 0;
|
|
139
139
|
width: 100vw;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, Fragment, renderList, renderSlot, mergeProps, resolveDynamicComponent, normalizeStyle, createCommentVNode,
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, Fragment, renderList, renderSlot, mergeProps, resolveDynamicComponent, normalizeStyle, createCommentVNode, toDisplayString } from "vue";
|
|
2
2
|
import { ElIcon, ElTabs, ElTabPane } from "element-plus";
|
|
3
3
|
import { useLicense } from "../ele-config-provider/receiver";
|
|
4
4
|
import { segmentedProps, segmentedEmits } from "./props";
|
|
@@ -26,7 +26,10 @@ const _export_sfc = (sfc, props) => {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
|
-
const _hoisted_1 = {
|
|
29
|
+
const _hoisted_1 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "ele-segmented-item-label"
|
|
32
|
+
};
|
|
30
33
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
31
34
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
32
35
|
const _component_ElTabPane = resolveComponent("ElTabPane");
|
|
@@ -61,7 +64,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
61
64
|
]),
|
|
62
65
|
_: 2
|
|
63
66
|
}, 1040)) : createCommentVNode("", true),
|
|
64
|
-
|
|
67
|
+
item.label ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
|
|
65
68
|
])
|
|
66
69
|
]),
|
|
67
70
|
_: 2
|
|
@@ -8,7 +8,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
8
8
|
titleStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
9
9
|
bodyStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
10
10
|
toolsStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
11
|
-
form: BooleanConstructor;
|
|
12
11
|
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
12
|
title: StringConstructor;
|
|
14
13
|
subtitle: StringConstructor;
|
|
@@ -19,9 +18,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
19
18
|
titleStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
20
19
|
bodyStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
21
20
|
toolsStyle: import("vue").PropType<import("vue").CSSProperties>;
|
|
22
|
-
form: BooleanConstructor;
|
|
23
21
|
}>>, {
|
|
24
22
|
theme: import("./types").ToolbarTheme;
|
|
25
|
-
form: boolean;
|
|
26
23
|
}, {}>;
|
|
27
24
|
export default _sfc_main;
|
package/es/ele-toolbar/props.js
CHANGED
|
@@ -9,8 +9,13 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
9
9
|
font: import("vue").PropType<import("./types").WatermarkFont>;
|
|
10
10
|
gap: import("vue").PropType<import("./types").WatermarkGap>;
|
|
11
11
|
offset: import("vue").PropType<import("./types").WatermarkOffset>;
|
|
12
|
+
customStyle: import("vue").PropType<CSSProperties>;
|
|
12
13
|
}, {
|
|
13
|
-
|
|
14
|
+
rootKey: import("vue").Ref<number>;
|
|
15
|
+
rootRef: import("vue").Ref<HTMLDivElement | null>;
|
|
16
|
+
imgKey: import("vue").Ref<number>;
|
|
17
|
+
imgRef: import("vue").Ref<HTMLDivElement | null>;
|
|
18
|
+
imgStyle: import("vue").Ref<CSSProperties | undefined>;
|
|
14
19
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
20
|
width: NumberConstructor;
|
|
16
21
|
height: NumberConstructor;
|
|
@@ -21,5 +26,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
21
26
|
font: import("vue").PropType<import("./types").WatermarkFont>;
|
|
22
27
|
gap: import("vue").PropType<import("./types").WatermarkGap>;
|
|
23
28
|
offset: import("vue").PropType<import("./types").WatermarkOffset>;
|
|
29
|
+
customStyle: import("vue").PropType<CSSProperties>;
|
|
24
30
|
}>>, {}, {}>;
|
|
25
31
|
export default _sfc_main;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, nextTick, ref, onMounted, onBeforeMount, watch, openBlock, createElementBlock, renderSlot, normalizeStyle } from "vue";
|
|
2
2
|
import { useLicense } from "../ele-config-provider/receiver";
|
|
3
|
-
import { getFont, getPixelRatio, getGap, rotateWatermark } from "./util";
|
|
3
|
+
import { useMutation, getFont, getPixelRatio, getGap, rotateWatermark } from "./util";
|
|
4
4
|
import { watermarkProps } from "./props";
|
|
5
5
|
const SIZE = 2;
|
|
6
6
|
const GAP = 3;
|
|
@@ -9,29 +9,61 @@ const _sfc_main = defineComponent({
|
|
|
9
9
|
props: watermarkProps,
|
|
10
10
|
setup(props) {
|
|
11
11
|
const { authenticated } = useLicense();
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const { observe, disconnect } = useMutation({
|
|
13
|
+
getRoot: () => rootRef.value,
|
|
14
|
+
getEl: () => imgRef.value,
|
|
15
|
+
onDeleted: () => {
|
|
16
|
+
disconnect();
|
|
17
|
+
rootKey.value = rootKey.value + 1;
|
|
18
|
+
nextTick(() => {
|
|
19
|
+
observe();
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
onDalsified: () => {
|
|
23
|
+
disconnect();
|
|
24
|
+
imgKey.value = imgKey.value + 1;
|
|
25
|
+
nextTick(() => {
|
|
26
|
+
observe();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const rootKey = ref(1);
|
|
31
|
+
const rootRef = ref(null);
|
|
32
|
+
const imgKey = ref(1);
|
|
33
|
+
const imgRef = ref(null);
|
|
34
|
+
const imgStyle = ref();
|
|
35
|
+
const updateStyle = (base64, size) => {
|
|
15
36
|
const style = {
|
|
16
|
-
position: "absolute",
|
|
17
|
-
top: 0,
|
|
18
|
-
left: 0,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
position: "absolute !important",
|
|
38
|
+
top: "0 !important",
|
|
39
|
+
left: "0 !important",
|
|
40
|
+
right: "auto !important",
|
|
41
|
+
bottom: "auto !important",
|
|
42
|
+
width: "100% !important",
|
|
43
|
+
height: "100% !important",
|
|
44
|
+
pointerEvents: "none !important",
|
|
45
|
+
backgroundRepeat: "repeat !important",
|
|
46
|
+
opacity: "1 !important",
|
|
47
|
+
transform: "none !important",
|
|
48
|
+
filter: "none !important",
|
|
49
|
+
display: "block !important",
|
|
50
|
+
...props.customStyle
|
|
23
51
|
};
|
|
24
|
-
if (!authenticated || !base64
|
|
25
|
-
style.display = "none";
|
|
52
|
+
if (!authenticated || !base64) {
|
|
53
|
+
style.display = "none !important";
|
|
26
54
|
} else {
|
|
27
|
-
style.backgroundImage = `url('${base64
|
|
28
|
-
if (
|
|
29
|
-
style.backgroundSize =
|
|
55
|
+
style.backgroundImage = `url('${base64}') !important`;
|
|
56
|
+
if (size) {
|
|
57
|
+
style.backgroundSize = `${size} !important`;
|
|
30
58
|
}
|
|
31
|
-
style.zIndex = props.zIndex ??
|
|
59
|
+
style.zIndex = `${props.zIndex ?? 2147483647} !important`;
|
|
32
60
|
}
|
|
33
|
-
|
|
34
|
-
|
|
61
|
+
disconnect();
|
|
62
|
+
imgStyle.value = style;
|
|
63
|
+
nextTick(() => {
|
|
64
|
+
observe();
|
|
65
|
+
});
|
|
66
|
+
};
|
|
35
67
|
const getDefaultWidth = (ctx) => {
|
|
36
68
|
if (props.image || !ctx.measureText) {
|
|
37
69
|
return 120;
|
|
@@ -119,8 +151,7 @@ const _sfc_main = defineComponent({
|
|
|
119
151
|
drawWidth,
|
|
120
152
|
drawHeight
|
|
121
153
|
);
|
|
122
|
-
|
|
123
|
-
imgSize.value = `${(gapX + markWidth) * SIZE}px`;
|
|
154
|
+
updateStyle(canvas.toDataURL(), `${(gapX + markWidth) * SIZE}px`);
|
|
124
155
|
};
|
|
125
156
|
img.crossOrigin = "anonymous";
|
|
126
157
|
img.referrerPolicy = "no-referrer";
|
|
@@ -130,13 +161,15 @@ const _sfc_main = defineComponent({
|
|
|
130
161
|
ctx.restore();
|
|
131
162
|
rotateWatermark(ctx, alternateRotateX, alternateRotateY, rotate);
|
|
132
163
|
fillTexts(ctx, alternateDrawX, alternateDrawY, drawWidth, drawHeight);
|
|
133
|
-
|
|
134
|
-
imgSize.value = `${(gapX + markWidth) * SIZE}px`;
|
|
164
|
+
updateStyle(canvas.toDataURL(), `${(gapX + markWidth) * SIZE}px`);
|
|
135
165
|
}
|
|
136
166
|
};
|
|
137
167
|
onMounted(() => {
|
|
138
168
|
render();
|
|
139
169
|
});
|
|
170
|
+
onBeforeMount(() => {
|
|
171
|
+
disconnect();
|
|
172
|
+
});
|
|
140
173
|
watch(
|
|
141
174
|
() => props,
|
|
142
175
|
() => {
|
|
@@ -144,7 +177,7 @@ const _sfc_main = defineComponent({
|
|
|
144
177
|
},
|
|
145
178
|
{ deep: true }
|
|
146
179
|
);
|
|
147
|
-
return { imgStyle };
|
|
180
|
+
return { rootKey, rootRef, imgKey, imgRef, imgStyle };
|
|
148
181
|
}
|
|
149
182
|
});
|
|
150
183
|
const _export_sfc = (sfc, props) => {
|
|
@@ -154,13 +187,18 @@ const _export_sfc = (sfc, props) => {
|
|
|
154
187
|
}
|
|
155
188
|
return target;
|
|
156
189
|
};
|
|
157
|
-
const _hoisted_1 = { style: { position: "relative" } };
|
|
158
190
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
159
|
-
return openBlock(), createElementBlock("div",
|
|
191
|
+
return openBlock(), createElementBlock("div", {
|
|
192
|
+
ref: "rootRef",
|
|
193
|
+
key: _ctx.rootKey,
|
|
194
|
+
style: { position: "relative" }
|
|
195
|
+
}, [
|
|
160
196
|
renderSlot(_ctx.$slots, "default"),
|
|
161
|
-
|
|
197
|
+
(openBlock(), createElementBlock("div", {
|
|
198
|
+
ref: "imgRef",
|
|
199
|
+
key: _ctx.imgKey,
|
|
162
200
|
style: normalizeStyle(_ctx.imgStyle)
|
|
163
|
-
}, null, 4)
|
|
201
|
+
}, null, 4))
|
|
164
202
|
]);
|
|
165
203
|
}
|
|
166
204
|
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
1
|
+
import type { PropType, ExtractPropTypes, CSSProperties } from 'vue';
|
|
2
2
|
import type { WatermarkGap, WatermarkOffset, WatermarkFont } from './types';
|
|
3
3
|
export declare const watermarkProps: {
|
|
4
4
|
width: NumberConstructor;
|
|
@@ -10,5 +10,6 @@ export declare const watermarkProps: {
|
|
|
10
10
|
font: PropType<WatermarkFont>;
|
|
11
11
|
gap: PropType<WatermarkGap>;
|
|
12
12
|
offset: PropType<WatermarkOffset>;
|
|
13
|
+
customStyle: PropType<CSSProperties>;
|
|
13
14
|
};
|
|
14
15
|
export type WatermarkProps = ExtractPropTypes<typeof watermarkProps>;
|
|
@@ -21,3 +21,16 @@ export interface WatermarkFont {
|
|
|
21
21
|
/** 字体类型 */
|
|
22
22
|
fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* 水印篡改观测参数
|
|
26
|
+
*/
|
|
27
|
+
export interface MutationOption {
|
|
28
|
+
/** 获取根节点 */
|
|
29
|
+
getRoot: () => HTMLElement | null;
|
|
30
|
+
/** 获取水印节点 */
|
|
31
|
+
getEl: () => HTMLElement | null;
|
|
32
|
+
/** 水印被删除回调 */
|
|
33
|
+
onDeleted: () => void;
|
|
34
|
+
/** 水印样式被篡改回调 */
|
|
35
|
+
onDalsified: () => void;
|
|
36
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WatermarkGap, WatermarkFont } from './types';
|
|
1
|
+
import type { WatermarkGap, WatermarkFont, MutationOption } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* 获取文字样式
|
|
4
4
|
*/
|
|
@@ -15,3 +15,10 @@ export declare function getPixelRatio(): number;
|
|
|
15
15
|
* 旋转水印
|
|
16
16
|
*/
|
|
17
17
|
export declare function rotateWatermark(ctx: CanvasRenderingContext2D, rotateX: number, rotateY: number, rotate: number): void;
|
|
18
|
+
/**
|
|
19
|
+
* 水印篡改观测
|
|
20
|
+
*/
|
|
21
|
+
export declare function useMutation(option: MutationOption): {
|
|
22
|
+
observe: () => void;
|
|
23
|
+
disconnect: () => void;
|
|
24
|
+
};
|
package/es/ele-watermark/util.js
CHANGED
|
@@ -20,9 +20,39 @@ function rotateWatermark(ctx, rotateX, rotateY, rotate) {
|
|
|
20
20
|
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
21
21
|
ctx.translate(-rotateX, -rotateY);
|
|
22
22
|
}
|
|
23
|
+
function useMutation(option) {
|
|
24
|
+
const { getRoot, getEl, onDeleted, onDalsified } = option;
|
|
25
|
+
const deletedObserver = new MutationObserver((mutations) => {
|
|
26
|
+
const el = getEl();
|
|
27
|
+
mutations.forEach((mutation) => {
|
|
28
|
+
if (mutation.type === "childList" && Array.from(mutation.removedNodes).some((n) => n === el)) {
|
|
29
|
+
onDeleted();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
const falsifiedObserver = new MutationObserver(() => {
|
|
34
|
+
onDalsified();
|
|
35
|
+
});
|
|
36
|
+
const observe = () => {
|
|
37
|
+
const el = getEl();
|
|
38
|
+
if (el) {
|
|
39
|
+
falsifiedObserver.observe(el, { attributes: true });
|
|
40
|
+
}
|
|
41
|
+
const root = getRoot();
|
|
42
|
+
if (root) {
|
|
43
|
+
deletedObserver.observe(root, { childList: true });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const disconnect = () => {
|
|
47
|
+
falsifiedObserver.disconnect();
|
|
48
|
+
deletedObserver.disconnect();
|
|
49
|
+
};
|
|
50
|
+
return { observe, disconnect };
|
|
51
|
+
}
|
|
23
52
|
export {
|
|
24
53
|
getFont,
|
|
25
54
|
getGap,
|
|
26
55
|
getPixelRatio,
|
|
27
|
-
rotateWatermark
|
|
56
|
+
rotateWatermark,
|
|
57
|
+
useMutation
|
|
28
58
|
};
|
package/es/utils/core.d.ts
CHANGED
package/es/utils/menu-util.js
CHANGED
|
@@ -35,7 +35,7 @@ function getRouteComponent(menu, name, func) {
|
|
|
35
35
|
const layoutProvide = useLayoutState();
|
|
36
36
|
const keepAlive = computed(() => {
|
|
37
37
|
var _a2;
|
|
38
|
-
return (_a2 = unref(layoutProvide)) == null ? void 0 : _a2.keepAlive;
|
|
38
|
+
return !!((_a2 = unref(layoutProvide)) == null ? void 0 : _a2.keepAlive);
|
|
39
39
|
});
|
|
40
40
|
return () => {
|
|
41
41
|
if (!isAlive || !keepAlive.value) {
|
|
@@ -96,7 +96,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
96
96
|
}, [
|
|
97
97
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.avatarData, (item, index2) => {
|
|
98
98
|
return vue.openBlock(), vue.createBlock(_component_ElAvatar, {
|
|
99
|
-
key: index2 + "-" + item.value,
|
|
99
|
+
key: index2 + "-" + (item.value || item.label),
|
|
100
100
|
size: _ctx.size,
|
|
101
101
|
shape: _ctx.shape,
|
|
102
102
|
src: item.value,
|
|
@@ -147,7 +147,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
147
147
|
_ctx.overflowPopover ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
148
148
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.overflowData, (item, index2) => {
|
|
149
149
|
return vue.openBlock(), vue.createBlock(_component_ElAvatar, {
|
|
150
|
-
key: index2 + "-" + item.value,
|
|
150
|
+
key: index2 + "-" + (item.value || item.label),
|
|
151
151
|
size: _ctx.size,
|
|
152
152
|
shape: _ctx.shape,
|
|
153
153
|
src: item.value,
|
package/lib/ele-dot/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
7
7
|
};
|
|
8
8
|
text: StringConstructor;
|
|
9
9
|
size: {
|
|
10
|
-
type:
|
|
10
|
+
type: StringConstructor;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
13
|
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -19,11 +19,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
19
19
|
};
|
|
20
20
|
text: StringConstructor;
|
|
21
21
|
size: {
|
|
22
|
-
type:
|
|
22
|
+
type: StringConstructor;
|
|
23
23
|
default: string;
|
|
24
24
|
};
|
|
25
25
|
}>>, {
|
|
26
26
|
ripple: boolean;
|
|
27
|
-
size: string
|
|
27
|
+
size: string;
|
|
28
28
|
}, {}>;
|
|
29
29
|
export default _sfc_main;
|
package/lib/ele-dot/props.d.ts
CHANGED
package/lib/ele-dot/props.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { IconItem } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 本地小尺寸图标
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const localSmallIcons: IconItem[];
|
|
6
|
+
/**
|
|
7
|
+
* 本地图标
|
|
8
|
+
*/
|
|
9
|
+
export declare const localIcons: IconItem[];
|
|
6
10
|
/**
|
|
7
11
|
* 默认小尺寸图标
|
|
8
12
|
*/
|
|
9
13
|
export declare const smallIcons: IconItem[];
|
|
14
|
+
/**
|
|
15
|
+
* 默认图标
|
|
16
|
+
*/
|
|
17
|
+
export declare const icons: IconItem[];
|