@ccs-ui/rc-pro 2.3.6-alpha-31 → 2.3.6-alpha-33
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/package.json +6 -27
- package/LICENSE +0 -21
- package/README.md +0 -37
- package/es/aj-captcha/index.d.ts +0 -34
- package/es/aj-captcha/index.js +0 -302
- package/es/aj-captcha/index.less +0 -89
- package/es/auth/index.d.ts +0 -15
- package/es/auth/index.js +0 -38
- package/es/breadcrumb.d.ts +0 -8
- package/es/breadcrumb.js +0 -40
- package/es/button/dropdown.d.ts +0 -6
- package/es/button/dropdown.js +0 -72
- package/es/button/group.d.ts +0 -2
- package/es/button/group.js +0 -176
- package/es/button/index.d.ts +0 -65
- package/es/button/index.js +0 -133
- package/es/cascader/index.d.ts +0 -33
- package/es/cascader/index.js +0 -120
- package/es/ccs.d.ts +0 -131
- package/es/ccs.js +0 -1
- package/es/color-picker/index.d.ts +0 -7
- package/es/color-picker/index.js +0 -142
- package/es/color-picker/index.less +0 -8
- package/es/config.d.ts +0 -6
- package/es/config.js +0 -126
- package/es/context/index.d.ts +0 -115
- package/es/context/index.js +0 -6
- package/es/date-picker/index.d.ts +0 -19
- package/es/date-picker/index.js +0 -72
- package/es/dialog/HookDrawer.d.ts +0 -9
- package/es/dialog/HookDrawer.js +0 -156
- package/es/dialog/HookModal.d.ts +0 -10
- package/es/dialog/HookModal.js +0 -213
- package/es/dialog/button.d.ts +0 -24
- package/es/dialog/button.js +0 -256
- package/es/dialog/context.d.ts +0 -25
- package/es/dialog/context.js +0 -13
- package/es/dialog/drawer-footer.d.ts +0 -16
- package/es/dialog/drawer-footer.js +0 -43
- package/es/dialog/form.d.ts +0 -16
- package/es/dialog/form.js +0 -53
- package/es/dialog/hook.d.ts +0 -80
- package/es/dialog/hook.js +0 -234
- package/es/dialog/index.d.ts +0 -19
- package/es/dialog/index.js +0 -14
- package/es/dialog/usePatchElement.d.ts +0 -5
- package/es/dialog/usePatchElement.js +0 -35
- package/es/editor/index.d.ts +0 -22
- package/es/editor/index.js +0 -18
- package/es/editor/index.less +0 -19
- package/es/editor/javascript.d.ts +0 -2
- package/es/editor/javascript.js +0 -56
- package/es/editor/json.d.ts +0 -7
- package/es/editor/json.js +0 -82
- package/es/editor/sql.d.ts +0 -2
- package/es/editor/sql.js +0 -54
- package/es/ellipsis/index.d.ts +0 -22
- package/es/ellipsis/index.js +0 -129
- package/es/ellipsis/index.less +0 -5
- package/es/ellipsis/useMeasure.d.ts +0 -9
- package/es/ellipsis/useMeasure.js +0 -142
- package/es/ellipsis/useResizeEffect.d.ts +0 -2
- package/es/ellipsis/useResizeEffect.js +0 -14
- package/es/ellipsis/withStopPropagation.d.ts +0 -4
- package/es/ellipsis/withStopPropagation.js +0 -38
- package/es/full-screen/index.d.ts +0 -3
- package/es/full-screen/index.js +0 -49
- package/es/group-form-item/index.d.ts +0 -11
- package/es/group-form-item/index.js +0 -124
- package/es/hooks/use-app.d.ts +0 -25
- package/es/hooks/use-app.js +0 -52
- package/es/hooks/use-event.d.ts +0 -10
- package/es/hooks/use-event.js +0 -69
- package/es/hooks/use-once-event.d.ts +0 -2
- package/es/hooks/use-once-event.js +0 -16
- package/es/hooks/use-page.d.ts +0 -10
- package/es/hooks/use-page.js +0 -10
- package/es/hooks/use-selection.d.ts +0 -17
- package/es/hooks/use-selection.js +0 -172
- package/es/hooks/use-tabs.d.ts +0 -2
- package/es/hooks/use-tabs.js +0 -10
- package/es/hooks/use-window.d.ts +0 -8
- package/es/hooks/use-window.js +0 -15
- package/es/index.d.ts +0 -37
- package/es/index.js +0 -37
- package/es/interval-button/index.d.ts +0 -14
- package/es/interval-button/index.js +0 -128
- package/es/layout-keep-alive/index.d.ts +0 -29
- package/es/layout-keep-alive/index.js +0 -400
- package/es/layout-keep-alive/index.less +0 -79
- package/es/layout-keep-alive/page.d.ts +0 -14
- package/es/layout-keep-alive/page.js +0 -53
- package/es/layout-single-page/index.d.ts +0 -14
- package/es/layout-single-page/index.js +0 -71
- package/es/layout-single-page/index.less +0 -15
- package/es/layout-single-page/page.d.ts +0 -13
- package/es/layout-single-page/page.js +0 -41
- package/es/loading/index.d.ts +0 -14
- package/es/loading/index.js +0 -43
- package/es/pro-grid/index.d.ts +0 -15
- package/es/pro-grid/index.js +0 -58
- package/es/pro-table/_utils.d.ts +0 -12
- package/es/pro-table/_utils.js +0 -94
- package/es/pro-table/form-item.d.ts +0 -9
- package/es/pro-table/form-item.js +0 -44
- package/es/pro-table/head.d.ts +0 -16
- package/es/pro-table/head.js +0 -225
- package/es/pro-table/index.d.ts +0 -23
- package/es/pro-table/index.js +0 -37
- package/es/pro-table/index.less +0 -82
- package/es/pro-table/operation.d.ts +0 -14
- package/es/pro-table/operation.js +0 -194
- package/es/pro-table/selection-alert.d.ts +0 -20
- package/es/pro-table/selection-alert.js +0 -64
- package/es/pro-table/size.d.ts +0 -10
- package/es/pro-table/size.js +0 -17
- package/es/pro-table/summary.d.ts +0 -8
- package/es/pro-table/summary.js +0 -32
- package/es/pro-table/table.d.ts +0 -104
- package/es/pro-table/table.js +0 -712
- package/es/pro-table/tree.d.ts +0 -24
- package/es/pro-table/tree.js +0 -197
- package/es/pro-tabs/index.d.ts +0 -9
- package/es/pro-tabs/index.js +0 -174
- package/es/resize-observer.d.ts +0 -15
- package/es/resize-observer.js +0 -37
- package/es/result/icon.d.ts +0 -3
- package/es/result/icon.js +0 -3
- package/es/result/index.d.ts +0 -12
- package/es/result/index.js +0 -68
- package/es/select/ modal.d.ts +0 -10
- package/es/select/ modal.js +0 -141
- package/es/select/api.d.ts +0 -25
- package/es/select/api.js +0 -67
- package/es/select/customize.d.ts +0 -25
- package/es/select/customize.js +0 -139
- package/es/select/index.d.ts +0 -31
- package/es/select/index.js +0 -108
- package/es/status-tag/index.d.ts +0 -13
- package/es/status-tag/index.js +0 -31
- package/es/table/index.d.ts +0 -19
- package/es/table/index.js +0 -253
- package/es/table/index.less +0 -29
- package/es/theme-dialog.d.ts +0 -28
- package/es/theme-dialog.js +0 -81
- package/es/time-picker/index.d.ts +0 -15
- package/es/time-picker/index.js +0 -49
- package/es/trigger/index.d.ts +0 -43
- package/es/trigger/index.js +0 -298
- package/es/trigger/index.less +0 -42
- package/es/types.d.ts +0 -0
- package/es/types.js +0 -0
- package/es/upload/index.d.ts +0 -42
- package/es/upload/index.js +0 -167
- package/es/upload/upload-image.d.ts +0 -6
- package/es/upload/upload-image.js +0 -205
- package/es/virtual-list/index.d.ts +0 -51
- package/es/virtual-list/index.js +0 -132
- package/es/water-mark/index.d.ts +0 -65
- package/es/water-mark/index.js +0 -141
- package/es/water-mark/relative.d.ts +0 -62
- package/es/water-mark/relative.js +0 -130
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropsWithCss, PropsWithNodeChildren } from '../ccs';
|
|
3
|
-
export type WaterMarkProps = PropsWithNodeChildren & PropsWithCss & {
|
|
4
|
-
/** 水印文字内容 */
|
|
5
|
-
content?: string;
|
|
6
|
-
/** 水印样式 */
|
|
7
|
-
markStyle?: React.CSSProperties;
|
|
8
|
-
/** 水印类名 */
|
|
9
|
-
markClassName?: string;
|
|
10
|
-
/** 水印之间的水平间距 */
|
|
11
|
-
gapX?: number;
|
|
12
|
-
/** 水印之间的垂直间距 */
|
|
13
|
-
gapY?: number;
|
|
14
|
-
/** 追加的水印元素的z-index */
|
|
15
|
-
zIndex?: number;
|
|
16
|
-
/** 水印的宽度 */
|
|
17
|
-
width?: number;
|
|
18
|
-
/** 水印的高度 */
|
|
19
|
-
height?: number;
|
|
20
|
-
/** 水印在canvas 画布上绘制的垂直偏移量,正常情况下,水印绘制在中间位置, 即 offsetTop = gapY / 2 */
|
|
21
|
-
offsetTop?: number;
|
|
22
|
-
/** 水印在canvas 画布上绘制的水平偏移量, 正常情况下,水印绘制在中间位置, 即 offsetTop = gapX / 2 */
|
|
23
|
-
offsetLeft?: number;
|
|
24
|
-
/** 水印绘制时,旋转的角度,单位 ° */
|
|
25
|
-
rotate?: number;
|
|
26
|
-
/** ClassName 前缀 */
|
|
27
|
-
prefixCls?: string;
|
|
28
|
-
/** 高清印图片源, 为了高清屏幕显示,建议使用 2倍或3倍图,优先使用图片渲染水印。 */
|
|
29
|
-
image?: string;
|
|
30
|
-
/**
|
|
31
|
-
* @description 文字颜色
|
|
32
|
-
* @default rgba(0,0,0,.15)
|
|
33
|
-
*/
|
|
34
|
-
fontColor?: string;
|
|
35
|
-
/**
|
|
36
|
-
* @description 文字样式
|
|
37
|
-
* @default normal
|
|
38
|
-
*/
|
|
39
|
-
fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
|
|
40
|
-
/**
|
|
41
|
-
* @description 文字族
|
|
42
|
-
* @default sans-serif
|
|
43
|
-
*/
|
|
44
|
-
fontFamily?: string;
|
|
45
|
-
/**
|
|
46
|
-
* @description 文字粗细
|
|
47
|
-
* @default normal
|
|
48
|
-
*/
|
|
49
|
-
fontWeight?: 'normal' | 'light' | 'weight' | number;
|
|
50
|
-
/**
|
|
51
|
-
* @description 文字大小
|
|
52
|
-
* @default 16
|
|
53
|
-
*/
|
|
54
|
-
fontSize?: number | string;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* 水印组件
|
|
58
|
-
* @param WaterMarkProps
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
declare const WaterMarkRelative: (props: WaterMarkProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export default WaterMarkRelative;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { ConfigProvider } from 'antd';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
-
/**
|
|
19
|
-
* 返回当前显示设备的物理像素分辨率与CSS像素分辨率之比
|
|
20
|
-
*
|
|
21
|
-
* @param context
|
|
22
|
-
* @see api 有些废弃了,其实类型 CanvasRenderingContext2D
|
|
23
|
-
*/
|
|
24
|
-
var getPixelRatio = function getPixelRatio(context) {
|
|
25
|
-
if (!context) {
|
|
26
|
-
return 1;
|
|
27
|
-
}
|
|
28
|
-
var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
|
|
29
|
-
return (window.devicePixelRatio || 1) / backingStore;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 水印组件
|
|
34
|
-
* @param WaterMarkProps
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
var WaterMarkRelative = function WaterMarkRelative(props) {
|
|
38
|
-
var markStyle = props.markStyle,
|
|
39
|
-
markClassName = props.markClassName,
|
|
40
|
-
_props$zIndex = props.zIndex,
|
|
41
|
-
zIndex = _props$zIndex === void 0 ? 9 : _props$zIndex,
|
|
42
|
-
_props$gapX = props.gapX,
|
|
43
|
-
gapX = _props$gapX === void 0 ? 212 : _props$gapX,
|
|
44
|
-
_props$gapY = props.gapY,
|
|
45
|
-
gapY = _props$gapY === void 0 ? 222 : _props$gapY,
|
|
46
|
-
_props$width = props.width,
|
|
47
|
-
width = _props$width === void 0 ? 120 : _props$width,
|
|
48
|
-
_props$height = props.height,
|
|
49
|
-
height = _props$height === void 0 ? 64 : _props$height,
|
|
50
|
-
_props$rotate = props.rotate,
|
|
51
|
-
rotate = _props$rotate === void 0 ? -22 : _props$rotate,
|
|
52
|
-
image = props.image,
|
|
53
|
-
content = props.content,
|
|
54
|
-
offsetLeft = props.offsetLeft,
|
|
55
|
-
offsetTop = props.offsetTop,
|
|
56
|
-
_props$fontStyle = props.fontStyle,
|
|
57
|
-
fontStyle = _props$fontStyle === void 0 ? 'normal' : _props$fontStyle,
|
|
58
|
-
_props$fontWeight = props.fontWeight,
|
|
59
|
-
fontWeight = _props$fontWeight === void 0 ? 'normal' : _props$fontWeight,
|
|
60
|
-
_props$fontColor = props.fontColor,
|
|
61
|
-
fontColor = _props$fontColor === void 0 ? 'rgba(0,0,0,.15)' : _props$fontColor,
|
|
62
|
-
_props$fontSize = props.fontSize,
|
|
63
|
-
fontSize = _props$fontSize === void 0 ? 16 : _props$fontSize,
|
|
64
|
-
_props$fontFamily = props.fontFamily,
|
|
65
|
-
fontFamily = _props$fontFamily === void 0 ? 'sans-serif' : _props$fontFamily,
|
|
66
|
-
customizePrefixCls = props.prefixCls;
|
|
67
|
-
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
68
|
-
getPrefixCls = _useContext.getPrefixCls;
|
|
69
|
-
var prefixCls = getPrefixCls('pro-layout-watermark', customizePrefixCls);
|
|
70
|
-
var waterMakrCls = classNames(prefixCls, markClassName);
|
|
71
|
-
var _useState = useState(''),
|
|
72
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
-
base64Url = _useState2[0],
|
|
74
|
-
setBase64Url = _useState2[1];
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
var canvas = document.createElement('canvas');
|
|
77
|
-
var ctx = canvas.getContext('2d');
|
|
78
|
-
var ratio = getPixelRatio(ctx);
|
|
79
|
-
var canvasWidth = "".concat((gapX + width) * ratio, "px");
|
|
80
|
-
var canvasHeight = "".concat((gapY + height) * ratio, "px");
|
|
81
|
-
var canvasOffsetLeft = offsetLeft || gapX / 2;
|
|
82
|
-
var canvasOffsetTop = offsetTop || gapY / 2;
|
|
83
|
-
canvas.setAttribute('width', canvasWidth);
|
|
84
|
-
canvas.setAttribute('height', canvasHeight);
|
|
85
|
-
if (ctx) {
|
|
86
|
-
// 旋转字符 rotate
|
|
87
|
-
ctx.translate(canvasOffsetLeft * ratio, canvasOffsetTop * ratio);
|
|
88
|
-
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
89
|
-
var markWidth = width * ratio;
|
|
90
|
-
var markHeight = height * ratio;
|
|
91
|
-
if (image) {
|
|
92
|
-
var img = new Image();
|
|
93
|
-
img.crossOrigin = 'anonymous';
|
|
94
|
-
img.referrerPolicy = 'no-referrer';
|
|
95
|
-
img.src = image;
|
|
96
|
-
img.onload = function () {
|
|
97
|
-
ctx.drawImage(img, 0, 0, markWidth, markHeight);
|
|
98
|
-
setBase64Url(canvas.toDataURL());
|
|
99
|
-
};
|
|
100
|
-
} else if (content) {
|
|
101
|
-
var markSize = Number(fontSize) * ratio;
|
|
102
|
-
ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
|
|
103
|
-
ctx.fillStyle = fontColor;
|
|
104
|
-
ctx.fillText(content, 0, 0);
|
|
105
|
-
setBase64Url(canvas.toDataURL());
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
// eslint-disable-next-line no-console
|
|
109
|
-
console.error('当前环境不支持Canvas');
|
|
110
|
-
}
|
|
111
|
-
}, [gapX, gapY, offsetLeft, offsetTop, rotate, fontStyle, fontWeight, width, height, fontFamily, fontColor, image, content, fontSize]);
|
|
112
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
113
|
-
children: base64Url && /*#__PURE__*/_jsx("div", {
|
|
114
|
-
className: waterMakrCls,
|
|
115
|
-
style: _objectSpread({
|
|
116
|
-
zIndex: zIndex,
|
|
117
|
-
position: 'fixed',
|
|
118
|
-
left: 0,
|
|
119
|
-
top: 0,
|
|
120
|
-
width: '100%',
|
|
121
|
-
height: '100%',
|
|
122
|
-
backgroundSize: "".concat(gapX + width, "px"),
|
|
123
|
-
pointerEvents: 'none',
|
|
124
|
-
backgroundRepeat: 'repeat',
|
|
125
|
-
backgroundImage: "url('".concat(base64Url, "')")
|
|
126
|
-
}, markStyle)
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
export default WaterMarkRelative;
|