zmdms-webui 0.0.180 → 0.0.182
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/dist/es/print/components/PrintBtn.js +1 -1
- package/dist/es/print/print.js +1 -1
- package/dist/es/sortable/index.d.ts +5 -0
- package/dist/es/sortable/index.js +5 -0
- package/dist/es/sortable/sortable-item.d.ts +14 -0
- package/dist/es/sortable/sortable-item.js +68 -0
- package/dist/es/sortable/sortable.d.ts +13 -0
- package/dist/es/sortable/sortable.js +16 -0
- package/dist/es/table/useInnerPagination.js +2 -2
- package/dist/es/watermark/interface.d.ts +4 -0
- package/dist/es/watermark/utils.js +60 -0
- package/dist/es/watermark/watermark-shadow.js +115 -0
- package/dist/es/watermark/watermark.js +10 -4
- package/dist/index.build.d.ts +1 -0
- package/dist/index.es.js +1 -0
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ var PrintBtn = function (_a) {
|
|
|
37
37
|
_a.label = 2;
|
|
38
38
|
case 2:
|
|
39
39
|
style_1 = document.createElement("style");
|
|
40
|
-
style_1.innerHTML = "\n @media print {\n body * {\n visibility: hidden;\n }\n }\n ";
|
|
40
|
+
style_1.innerHTML = "\n @media print {\n body * {\n visibility: hidden;\n }\n #watermark-shadow-id-zmdms {\n visibility: visible;\n }\n }\n ";
|
|
41
41
|
document.head.appendChild(style_1);
|
|
42
42
|
window.print();
|
|
43
43
|
setTimeout(function () {
|
package/dist/es/print/print.js
CHANGED
|
@@ -27,7 +27,7 @@ var Print = function (props, ref) {
|
|
|
27
27
|
"ztxk-print--water": headerProps.isWaterBtn,
|
|
28
28
|
});
|
|
29
29
|
var _d = useState(false), spinning = _d[0], setSpinning = _d[1];
|
|
30
|
-
return (jsx(Spin, __assign({ spinning: spinning || outSpinning }, { children: jsxs("div", __assign({ className: classes }, { children: [jsx(PrintHeader, __assign({ setSpinning: setSpinning, waterVisible: waterVisible, setWaterVisible: setWaterVisible }, headerProps)), jsx(WatermarkCom, __assign({ className: "ztxk-print--content", visible: waterVisible,
|
|
30
|
+
return (jsx(Spin, __assign({ spinning: spinning || outSpinning }, { children: jsxs("div", __assign({ className: classes }, { children: [jsx(PrintHeader, __assign({ setSpinning: setSpinning, waterVisible: waterVisible, setWaterVisible: setWaterVisible }, headerProps)), jsx(WatermarkCom, __assign({ className: "ztxk-print--content", visible: waterVisible, isShadow: true }, waterConfig, { children: jsx("div", __assign({ className: "ztxk-print--main" }, { children: children })) }))] })) })));
|
|
31
31
|
};
|
|
32
32
|
var PrintCom = memo(forwardRef(Print));
|
|
33
33
|
PrintCom.displayName = "ZTXK_WEBUI_Print";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface ISortableProps {
|
|
4
|
+
type: string | symbol;
|
|
5
|
+
onMoveItem: (dragIndex: number, hoverIndex: number) => void;
|
|
6
|
+
index: number;
|
|
7
|
+
id?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: any;
|
|
10
|
+
children?: any;
|
|
11
|
+
}
|
|
12
|
+
declare const Sortable: React__default.FC<ISortableProps>;
|
|
13
|
+
|
|
14
|
+
export { Sortable as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import classNames from '../node_modules/classnames/index.js';
|
|
5
|
+
import { useDrop } from '../node_modules/react-dnd/dist/hooks/useDrop/useDrop.js';
|
|
6
|
+
import { useDrag } from '../node_modules/react-dnd/dist/hooks/useDrag/useDrag.js';
|
|
7
|
+
|
|
8
|
+
var Sortable = function (_a) {
|
|
9
|
+
var type = _a.type, onMoveItem = _a.onMoveItem, index = _a.index, id = _a.id, children = _a.children, style = _a.style, className = _a.className;
|
|
10
|
+
var ref = useRef(null);
|
|
11
|
+
var classes = classNames("zt-sortable", className, {});
|
|
12
|
+
/**
|
|
13
|
+
* @description 定义可放置对象
|
|
14
|
+
*/
|
|
15
|
+
var _b = useDrop({
|
|
16
|
+
accept: type,
|
|
17
|
+
hover: function (item, monitor) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!ref.current) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// 当前拖动项索引
|
|
23
|
+
var dragIndex = item.index;
|
|
24
|
+
// 当前放置位置索引
|
|
25
|
+
var hoverIndex = index;
|
|
26
|
+
// 不要将项目本身替换
|
|
27
|
+
if (dragIndex === hoverIndex) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// 获取当前项的位置信息
|
|
31
|
+
var hoverBoundingRect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
32
|
+
// 元素高度的一半
|
|
33
|
+
var hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
34
|
+
// 确定鼠标位置
|
|
35
|
+
var clientOffset = monitor.getClientOffset();
|
|
36
|
+
// 鼠标位置纵坐标 与 当前hover元素顶部位置差
|
|
37
|
+
var hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
38
|
+
// 临界值判断
|
|
39
|
+
// 如果当前拖拽元素本身在当前放置元素之上 并且 鼠标位置与当前放置元素之差 要小于中间位置
|
|
40
|
+
if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// 如果当前拖拽元素本身在当前放置元素之下 并且鼠标位置与当前放置元素之差要 大于 中间位置
|
|
44
|
+
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
onMoveItem(dragIndex, hoverIndex);
|
|
48
|
+
item.index = hoverIndex;
|
|
49
|
+
},
|
|
50
|
+
}), drop = _b[1];
|
|
51
|
+
/**
|
|
52
|
+
* @description 定义可拖动对象
|
|
53
|
+
*/
|
|
54
|
+
var _c = useDrag({
|
|
55
|
+
type: type,
|
|
56
|
+
item: function () {
|
|
57
|
+
return { id: id, index: index };
|
|
58
|
+
},
|
|
59
|
+
collect: function (monitor) { return ({
|
|
60
|
+
isDragging: monitor.isDragging(),
|
|
61
|
+
}); },
|
|
62
|
+
}), isDragging = _c[0].isDragging, drag = _c[1];
|
|
63
|
+
var opacity = isDragging ? 0 : 1;
|
|
64
|
+
drag(drop(ref));
|
|
65
|
+
return (jsx("div", __assign({ ref: ref, className: classes, style: __assign(__assign({}, style), { opacity: opacity }) }, { children: children })));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { Sortable as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import Sortable$1 from './sortable-item.js';
|
|
3
|
+
|
|
4
|
+
interface ISortableProps {
|
|
5
|
+
children?: any;
|
|
6
|
+
}
|
|
7
|
+
interface SortableListComponent extends React__default.FC<ISortableProps> {
|
|
8
|
+
Item: typeof Sortable$1;
|
|
9
|
+
displayName: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Sortable: SortableListComponent;
|
|
12
|
+
|
|
13
|
+
export { Sortable as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { HTML5Backend } from '../node_modules/react-dnd-html5-backend/dist/index.js';
|
|
5
|
+
import Sortable$1 from './sortable-item.js';
|
|
6
|
+
import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js';
|
|
7
|
+
|
|
8
|
+
var SortableList = function (_a) {
|
|
9
|
+
var children = _a.children;
|
|
10
|
+
return (jsx(DndProvider, __assign({ backend: HTML5Backend, context: window }, { children: children })));
|
|
11
|
+
};
|
|
12
|
+
var Sortable = memo(SortableList);
|
|
13
|
+
Sortable.displayName = "ZTXK_WEBUI_Sortable";
|
|
14
|
+
Sortable.Item = Sortable$1;
|
|
15
|
+
|
|
16
|
+
export { Sortable as default };
|
|
@@ -55,9 +55,9 @@ function useInnerPagination(isInnerPagination, innerPaginationPageSize, options)
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
hideOnSinglePage: true,
|
|
58
|
-
position:
|
|
58
|
+
position: innerPaginationPosition,
|
|
59
59
|
defaultPageSize: pageSize,
|
|
60
|
-
pageSizeOptions:
|
|
60
|
+
pageSizeOptions: innerPaginationPageSizeOptions,
|
|
61
61
|
}); }, [
|
|
62
62
|
isInnerPagination,
|
|
63
63
|
current,
|
|
@@ -11,6 +11,10 @@ interface IWatermark extends IWaterConfig {
|
|
|
11
11
|
* 如果采取之前的模式 打印的时候需要勾选显示背景才能显示内容
|
|
12
12
|
*/
|
|
13
13
|
isAppendBody?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 是否采用 shadow-root的模式创建水印
|
|
16
|
+
*/
|
|
17
|
+
isShadow?: boolean;
|
|
14
18
|
}
|
|
15
19
|
interface WatermarkComponent extends React__default.FC<IWatermark> {
|
|
16
20
|
displayName: string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
|
|
3
|
+
function createWatermark(watermarkText, options, container) {
|
|
4
|
+
var width = options.width, height = options.height, rotate = options.rotate;
|
|
5
|
+
var watermarkWidth = width * 2;
|
|
6
|
+
var watermarkHeight = height * 2;
|
|
7
|
+
// 计算旋转后水印的占用空间
|
|
8
|
+
var radians = (Math.abs(rotate) * Math.PI) / 180;
|
|
9
|
+
var sin = Math.sin(radians);
|
|
10
|
+
var cos = Math.cos(radians);
|
|
11
|
+
var rotatedWidth = cos * watermarkWidth + sin * watermarkHeight;
|
|
12
|
+
var rotatedHeight = sin * watermarkWidth + cos * watermarkHeight;
|
|
13
|
+
// 计算容器可以容纳多少行和列的水印
|
|
14
|
+
var cols = Math.floor((container.offsetWidth || 600) / rotatedWidth);
|
|
15
|
+
var rows = Math.floor((container.offsetHeight || 600) / rotatedHeight);
|
|
16
|
+
// 创建一个水印元素
|
|
17
|
+
var fragment = document.createDocumentFragment();
|
|
18
|
+
// 循环创建和定位水印元素
|
|
19
|
+
for (var row = 0; row < rows; row++) {
|
|
20
|
+
for (var col = 0; col < cols; col++) {
|
|
21
|
+
// 克隆水印元素
|
|
22
|
+
var watermark = createWatermarkItem(watermarkText, __assign({}, options));
|
|
23
|
+
// 设置绝对定位
|
|
24
|
+
watermark.style.left = "".concat(col * rotatedWidth, "px");
|
|
25
|
+
watermark.style.top = "".concat(row * rotatedHeight, "px");
|
|
26
|
+
// 将克隆的水印添加到容器中
|
|
27
|
+
fragment.appendChild(watermark);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return fragment;
|
|
31
|
+
}
|
|
32
|
+
function createWatermarkItem(watermarkText, options) {
|
|
33
|
+
// 创建一个水印元素
|
|
34
|
+
var watermark = document.createElement("div");
|
|
35
|
+
watermark.className = "shadow-root--container";
|
|
36
|
+
var textContent = watermarkText;
|
|
37
|
+
if (Array.isArray(watermarkText)) {
|
|
38
|
+
textContent = watermarkText.join("\n");
|
|
39
|
+
}
|
|
40
|
+
watermark.innerHTML = "\n <span style=\"position: absolute; top: 20px; left: 20px\">".concat(textContent, "</span>\n <span style=\"position: absolute; bottom: 20px; right: 20px\">").concat(textContent, "</span>\n ");
|
|
41
|
+
var font = options.font, rotate = options.rotate, width = options.width, height = options.height, top = options.top, left = options.left;
|
|
42
|
+
// 设置水印样式
|
|
43
|
+
watermark.style.position = "absolute";
|
|
44
|
+
watermark.style.top = "".concat(top || 50, "px");
|
|
45
|
+
watermark.style.left = "".concat(left || 50, "px");
|
|
46
|
+
watermark.style.width = "".concat((width || 200) * 2, "px");
|
|
47
|
+
watermark.style.height = "".concat((height || 200) * 2, "px");
|
|
48
|
+
watermark.style.color = (font === null || font === void 0 ? void 0 : font.color) || "rgba(0, 0, 0, 0.2)";
|
|
49
|
+
watermark.style.fontFamily = (font === null || font === void 0 ? void 0 : font.fontFamily) || "微软雅黑";
|
|
50
|
+
watermark.style.fontSize = "".concat((font === null || font === void 0 ? void 0 : font.fontSize) || 14, "px");
|
|
51
|
+
watermark.style.fontStyle = (font === null || font === void 0 ? void 0 : font.fontStyle) || "normal";
|
|
52
|
+
watermark.style.fontWeight = (font === null || font === void 0 ? void 0 : font.fontWeight) || "normal";
|
|
53
|
+
watermark.style.textAlign = (font === null || font === void 0 ? void 0 : font.textAlign) || "center";
|
|
54
|
+
watermark.style.zIndex = "1000";
|
|
55
|
+
watermark.style.whiteSpace = "pre";
|
|
56
|
+
watermark.style.transform = "rotate(".concat(rotate || -20, "deg)");
|
|
57
|
+
return watermark;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { createWatermark };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { memo, forwardRef, useRef, useMemo, useEffect, useImperativeHandle } from 'react';
|
|
3
|
+
import { createWatermark } from './utils.js';
|
|
4
|
+
import { useMemoizedFn, useMount } from 'ahooks';
|
|
5
|
+
|
|
6
|
+
var WatermarkShadow = function (props, ref) {
|
|
7
|
+
var zIndex = props.zIndex, isMutationObserver = props.isMutationObserver, content = props.content, font = props.font, rotate = props.rotate, width = props.width, height = props.height, containerDomRef = props.containerDomRef;
|
|
8
|
+
var waterDomRef = useRef(null);
|
|
9
|
+
var shadowRootRef = useRef();
|
|
10
|
+
var createWaterMemo = useMemoizedFn(function () {
|
|
11
|
+
if (!content) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
var watermarkFragment = createWatermark(content, {
|
|
15
|
+
font: font,
|
|
16
|
+
rotate: rotate,
|
|
17
|
+
width: width,
|
|
18
|
+
height: height,
|
|
19
|
+
}, containerDomRef === null || containerDomRef === void 0 ? void 0 : containerDomRef.current);
|
|
20
|
+
if (shadowRootRef.current) {
|
|
21
|
+
while (shadowRootRef.current.firstChild) {
|
|
22
|
+
shadowRootRef.current.removeChild(shadowRootRef.current.firstChild);
|
|
23
|
+
}
|
|
24
|
+
shadowRootRef.current.appendChild(watermarkFragment);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
// 初始化一个监听器
|
|
28
|
+
var observerMemo = useMemo(function () {
|
|
29
|
+
// 配置观察器的选项
|
|
30
|
+
var config = { childList: true, attributes: true, subtree: true };
|
|
31
|
+
// 创建一个回调函数来处理观察到的变化
|
|
32
|
+
var callback = function (mutationsList) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
console.log("触发子级", mutationsList);
|
|
35
|
+
// 先解除监听
|
|
36
|
+
(_a = observer === null || observer === void 0 ? void 0 : observer.disconnect) === null || _a === void 0 ? void 0 : _a.call(observer);
|
|
37
|
+
createWaterMemo();
|
|
38
|
+
// 等元素挂载后再开始监听
|
|
39
|
+
(_b = observer === null || observer === void 0 ? void 0 : observer.observe) === null || _b === void 0 ? void 0 : _b.call(observer, shadowRootRef.current, config);
|
|
40
|
+
};
|
|
41
|
+
// 创建一个 MutationObserver 实例并传入回调函数
|
|
42
|
+
var observer = new MutationObserver(callback);
|
|
43
|
+
return {
|
|
44
|
+
observer: observer,
|
|
45
|
+
config: config,
|
|
46
|
+
};
|
|
47
|
+
}, [createWaterMemo]);
|
|
48
|
+
// 初始化创建shadow节点
|
|
49
|
+
useMount(function () {
|
|
50
|
+
if (waterDomRef.current) {
|
|
51
|
+
var shadowRoot = waterDomRef.current.attachShadow({
|
|
52
|
+
mode: "open",
|
|
53
|
+
});
|
|
54
|
+
shadowRootRef.current = shadowRoot;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
if (!content) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
var watermarkFragment = createWatermark(content, {
|
|
63
|
+
font: font,
|
|
64
|
+
rotate: rotate,
|
|
65
|
+
width: width,
|
|
66
|
+
height: height,
|
|
67
|
+
}, containerDomRef === null || containerDomRef === void 0 ? void 0 : containerDomRef.current);
|
|
68
|
+
if (shadowRootRef.current) {
|
|
69
|
+
while (shadowRootRef.current.firstChild) {
|
|
70
|
+
shadowRootRef.current.removeChild(shadowRootRef.current.firstChild);
|
|
71
|
+
}
|
|
72
|
+
shadowRootRef.current.appendChild(watermarkFragment);
|
|
73
|
+
// 是否监听?
|
|
74
|
+
if (isMutationObserver) {
|
|
75
|
+
(_b = (_a = observerMemo.observer) === null || _a === void 0 ? void 0 : _a.observe) === null || _b === void 0 ? void 0 : _b.call(_a, shadowRootRef.current, observerMemo.config);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return function () {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
(_b = (_a = observerMemo.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
81
|
+
};
|
|
82
|
+
}, [
|
|
83
|
+
content,
|
|
84
|
+
font,
|
|
85
|
+
height,
|
|
86
|
+
rotate,
|
|
87
|
+
width,
|
|
88
|
+
observerMemo,
|
|
89
|
+
isMutationObserver,
|
|
90
|
+
containerDomRef,
|
|
91
|
+
]);
|
|
92
|
+
useImperativeHandle(ref, function () {
|
|
93
|
+
return {
|
|
94
|
+
getWaterDomRef: function () { return waterDomRef.current; },
|
|
95
|
+
toggleVisible: function () {
|
|
96
|
+
if (waterDomRef.current) {
|
|
97
|
+
waterDomRef.current.style.visibility = "hidden";
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
return (jsx("div", { ref: waterDomRef, className: "ztxk-watermark--div", style: {
|
|
103
|
+
zIndex: zIndex,
|
|
104
|
+
position: "absolute",
|
|
105
|
+
visibility: "visible",
|
|
106
|
+
left: 0,
|
|
107
|
+
top: 0,
|
|
108
|
+
width: "100%",
|
|
109
|
+
height: "100%",
|
|
110
|
+
pointerEvents: "none",
|
|
111
|
+
} }));
|
|
112
|
+
};
|
|
113
|
+
var WatermarkShadow$1 = memo(forwardRef(WatermarkShadow));
|
|
114
|
+
|
|
115
|
+
export { WatermarkShadow$1 as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { memo, useRef, useMemo, useEffect } from 'react';
|
|
4
4
|
import classNames from '../node_modules/classnames/index.js';
|
|
5
5
|
import WatermarkDiv from './watermark-div.js';
|
|
6
|
+
import WatermarkShadow from './watermark-shadow.js';
|
|
6
7
|
import { mergeWaterConfig, createWater } from 'zmdms-utils';
|
|
7
8
|
import { useMutationObserver } from 'ahooks';
|
|
8
9
|
|
|
@@ -18,7 +19,7 @@ var reRendering = function (mutation, isWatermarkEle) {
|
|
|
18
19
|
};
|
|
19
20
|
// TODO: 通过方法设置水印隐藏 (有没有必要做)
|
|
20
21
|
var Watermark = function (props) {
|
|
21
|
-
var children = props.children, className = props.className, _a = props.visible, visible = _a === void 0 ? true : _a, _b = props.isMutationObserver, isMutationObserver = _b === void 0 ? true : _b, isAppendBody = props.isAppendBody, waterConfigProps = __rest(props, ["children", "className", "visible", "isMutationObserver", "isAppendBody"]);
|
|
22
|
+
var children = props.children, className = props.className, _a = props.visible, visible = _a === void 0 ? true : _a, _b = props.isMutationObserver, isMutationObserver = _b === void 0 ? true : _b, isAppendBody = props.isAppendBody, isShadow = props.isShadow, waterConfigProps = __rest(props, ["children", "className", "visible", "isMutationObserver", "isAppendBody", "isShadow"]);
|
|
22
23
|
// 主容器类名
|
|
23
24
|
var classes = classNames("ztxk-watermark", className, {
|
|
24
25
|
"ztxk-watermark--hidden": !visible,
|
|
@@ -56,10 +57,12 @@ var Watermark = function (props) {
|
|
|
56
57
|
}
|
|
57
58
|
console.log("触发父级", mutationsList);
|
|
58
59
|
mutationsList.forEach(function (mutation) {
|
|
60
|
+
var _a, _b;
|
|
59
61
|
if (reRendering(mutation, function (node) {
|
|
60
|
-
|
|
62
|
+
var _a, _b;
|
|
63
|
+
return node === ((_b = (_a = waterDomChildHandleRef.current) === null || _a === void 0 ? void 0 : _a.getWaterDomRef) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
61
64
|
})) {
|
|
62
|
-
waterDomRef.current.appendChild(waterDomChildHandleRef.current.getWaterDomRef());
|
|
65
|
+
waterDomRef.current.appendChild((_b = (_a = waterDomChildHandleRef.current) === null || _a === void 0 ? void 0 : _a.getWaterDomRef) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
63
66
|
}
|
|
64
67
|
});
|
|
65
68
|
}, waterDomRef, {
|
|
@@ -76,6 +79,9 @@ var Watermark = function (props) {
|
|
|
76
79
|
document.body.style.background = "";
|
|
77
80
|
}
|
|
78
81
|
}, [isAppendBody, visible, config.image]);
|
|
82
|
+
if (isShadow) {
|
|
83
|
+
return (jsxs("div", __assign({ className: classes, style: { position: "relative" }, ref: waterDomRef }, { children: [children, jsx(WatermarkShadow, { ref: waterDomChildHandleRef, isMutationObserver: isMutationObserver, content: content, font: font, rotate: rotate, width: width, height: height, containerDomRef: waterDomRef, zIndex: zIndex })] })));
|
|
84
|
+
}
|
|
79
85
|
return isAppendBody ? (jsx("div", __assign({ className: classes, style: { position: "relative" }, ref: waterDomRef }, { children: children }))) : (jsxs("div", __assign({ className: classes, style: { position: "relative" }, ref: waterDomRef }, { children: [children, jsx(WatermarkDiv, { ref: waterDomChildHandleRef, isMutationObserver: isMutationObserver, isAppendBody: isAppendBody, zIndex: zIndex, image: config.image })] })));
|
|
80
86
|
};
|
|
81
87
|
var WatermarkCom = memo(Watermark);
|
package/dist/index.build.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export { default as NotRoutePage } from './es/notroutepage/notRoutePage.js';
|
|
|
43
43
|
export { default as Alert } from './es/alert/alert.js';
|
|
44
44
|
export { default as ZtTransfer } from './es/zttransfer/zt-transfer.js';
|
|
45
45
|
export { default as Watermark } from './es/watermark/watermark.js';
|
|
46
|
+
export { default as Sortable } from './es/sortable/sortable.js';
|
|
46
47
|
export { Affix, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, Card, Carousel, Cascader, Checkbox, Col, Comment, ConfigProvider, Divider, Drawer, Dropdown, Empty, Grid, Image, Layout, List, Mentions, Menu, PageHeader, Popconfirm, Popover, Progress, Radio, Rate, Result, Row, Segmented, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Timeline, Tooltip, Transfer, Typography, Upload, message, notification } from 'antd';
|
|
47
48
|
export { IModalOpenOptions, IModalProps, IModalRef } from './es/modal/interface.js';
|
|
48
49
|
export { IFooterDom, IFooterProps } from './es/footer/interface.js';
|
package/dist/index.es.js
CHANGED
|
@@ -41,6 +41,7 @@ export { default as NotRoutePage } from './es/notroutepage/notRoutePage.js';
|
|
|
41
41
|
export { default as Alert } from './es/alert/alert.js';
|
|
42
42
|
export { default as ZtTransfer } from './es/zttransfer/zt-transfer.js';
|
|
43
43
|
export { default as Watermark } from './es/watermark/watermark.js';
|
|
44
|
+
export { default as Sortable } from './es/sortable/sortable.js';
|
|
44
45
|
export { Affix, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, Card, Carousel, Cascader, Checkbox, Col, Comment, ConfigProvider, Divider, Drawer, Dropdown, Empty, Grid, Image, Layout, List, Mentions, Menu, PageHeader, Popconfirm, Popover, Progress, Radio, Rate, Result, Row, Segmented, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Timeline, Tooltip, Transfer, Typography, Upload, message, notification } from 'antd';
|
|
45
46
|
export { default as Button } from './es/button/button.js';
|
|
46
47
|
export { default as NotAuthPage } from './es/notauthpage/notAuthPage.js';
|