tntd 3.0.49 → 3.0.51
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/_util/hooks/useScrollLock.js +68 -0
- package/es/_util/hooks/useScrollLock.js.map +1 -0
- package/es/anchor/anchor.js +96 -0
- package/es/anchor/anchor.js.map +1 -0
- package/es/anchor/anchor.less +79 -0
- package/es/anchor/index.js +7 -9
- package/es/anchor/index.js.map +1 -1
- package/es/array-input/icon.js +36 -0
- package/es/array-input/icon.js.map +1 -0
- package/es/checkbox/checkbox-group.js +16 -0
- package/es/checkbox/checkbox-group.js.map +1 -0
- package/es/ellipsis/index.js +30 -10
- package/es/ellipsis/index.js.map +1 -1
- package/es/page-loading/index.less +4 -4
- package/es/page-loading/loading.gif +0 -0
- package/es/page-loading/loading1.gif +0 -0
- package/es/query-form/Field/Composition/FieldPopover.js +31 -24
- package/es/query-form/Field/Composition/Select.js +31 -24
- package/es/query-form/Field/Composition/SelectInput.js +18 -17
- package/es/query-form/Field/Composition/ValueTag.js +18 -17
- package/es/query-form/Field/Composition/index.js +37 -30
- package/es/query-form/Field/Composition/utils.js +3 -3
- package/es/radio/radio-group.js +16 -0
- package/es/radio/radio-group.js.map +1 -0
- package/es/scroll-bar/Bar.js +18 -17
- package/es/scroll-bar/Context.js +3 -3
- package/es/scroll-bar/ScrollBar.js +3 -3
- package/es/scroll-bar/Thumb.js +18 -17
- package/es/scroll-bar/index.js +3 -3
- package/es/scroll-bar/util.js +13 -7
- package/es/steps/stepStyle/small.less +5 -0
- package/es/table/total-shower.js +20 -0
- package/es/table/total-shower.js.map +1 -0
- package/es/tntd-rc-select/style/index.less +20 -2
- package/es/tooltip/tooltip.js +19 -5
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/simple-template.js +19 -0
- package/es/utils/simple-template.js.map +1 -0
- package/lib/_util/hooks/useScrollLock.d.ts +9 -0
- package/lib/_util/hooks/useScrollLock.d.ts.map +1 -0
- package/lib/_util/hooks/useScrollLock.js +114 -0
- package/lib/_util/hooks/useScrollLock.js.map +1 -0
- package/lib/anchor/anchor.d.ts +15 -0
- package/lib/anchor/anchor.d.ts.map +1 -0
- package/lib/anchor/anchor.js +131 -0
- package/lib/anchor/anchor.js.map +1 -0
- package/lib/anchor/anchor.less +79 -0
- package/lib/anchor/index.d.ts +3 -2
- package/lib/anchor/index.d.ts.map +1 -1
- package/lib/anchor/index.js +7 -40
- package/lib/anchor/index.js.map +1 -1
- package/lib/array-input/icon.d.ts +4 -0
- package/lib/array-input/icon.d.ts.map +1 -0
- package/lib/array-input/icon.js +36 -0
- package/lib/array-input/icon.js.map +1 -0
- package/lib/checkbox/checkbox-group.d.ts +8 -0
- package/lib/checkbox/checkbox-group.d.ts.map +1 -0
- package/lib/checkbox/checkbox-group.js +16 -0
- package/lib/checkbox/checkbox-group.js.map +1 -0
- package/lib/ellipsis/index.d.ts.map +1 -1
- package/lib/ellipsis/index.js +30 -10
- package/lib/ellipsis/index.js.map +1 -1
- package/lib/notification/assets/svg-error-tip.d.ts +1 -1
- package/lib/notification/assets/svg-success-tip.d.ts +1 -1
- package/lib/page-loading/index.less +4 -4
- package/lib/page-loading/loading.gif +0 -0
- package/lib/page-loading/loading1.gif +0 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +31 -24
- package/lib/query-form/Field/Composition/Select.js +31 -24
- package/lib/query-form/Field/Composition/SelectInput.js +18 -17
- package/lib/query-form/Field/Composition/ValueTag.js +18 -17
- package/lib/query-form/Field/Composition/index.js +37 -30
- package/lib/query-form/Field/Composition/utils.js +3 -3
- package/lib/radio/radio-group.d.ts +8 -0
- package/lib/radio/radio-group.d.ts.map +1 -0
- package/lib/radio/radio-group.js +16 -0
- package/lib/radio/radio-group.js.map +1 -0
- package/lib/scroll-bar/Bar.js +18 -17
- package/lib/scroll-bar/Context.js +3 -3
- package/lib/scroll-bar/ScrollBar.js +3 -3
- package/lib/scroll-bar/Thumb.js +18 -17
- package/lib/scroll-bar/index.js +3 -3
- package/lib/scroll-bar/util.js +13 -7
- package/lib/segmented/index.d.ts +1 -1
- package/lib/steps/stepStyle/small.less +5 -0
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/lib/table/total-shower.d.ts +9 -0
- package/lib/table/total-shower.d.ts.map +1 -0
- package/lib/table/total-shower.js +20 -0
- package/lib/table/total-shower.js.map +1 -0
- package/lib/tntd-rc-select/style/index.less +20 -2
- package/lib/tooltip/tooltip.d.ts +1 -0
- package/lib/tooltip/tooltip.d.ts.map +1 -1
- package/lib/tooltip/tooltip.js +23 -9
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/utils/simple-template.d.ts +9 -0
- package/lib/utils/simple-template.d.ts.map +1 -0
- package/lib/utils/simple-template.js +19 -0
- package/lib/utils/simple-template.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.plusIcon = exports.deleteIcon = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
"default": e
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var plusIcon = exports.plusIcon = _react["default"].createElement("svg", {
|
|
14
|
+
viewBox: "64 64 896 896",
|
|
15
|
+
focusable: "false",
|
|
16
|
+
"data-icon": "plus-circle",
|
|
17
|
+
width: "1em",
|
|
18
|
+
height: "1em",
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, _react["default"].createElement("path", {
|
|
22
|
+
d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"
|
|
23
|
+
}), _react["default"].createElement("path", {
|
|
24
|
+
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
|
|
25
|
+
}));
|
|
26
|
+
var deleteIcon = exports.deleteIcon = _react["default"].createElement("svg", {
|
|
27
|
+
viewBox: "64 64 896 896",
|
|
28
|
+
focusable: "false",
|
|
29
|
+
"data-icon": "delete",
|
|
30
|
+
width: "1em",
|
|
31
|
+
height: "1em",
|
|
32
|
+
fill: "currentColor",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, _react["default"].createElement("path", {
|
|
35
|
+
d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
|
|
36
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/array-input/icon.js"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEZ,QAAA,QAAQ,GAAG,CACtB,uCACE,OAAO,EAAC,eAAe,EACvB,SAAS,EAAC,OAAO,eACP,aAAa,EACvB,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,IAAI,EAAC,cAAc,iBACP,MAAM;IAElB,wCAAM,CAAC,EAAC,2LAA2L,GAAQ;IAC3M,wCAAM,CAAC,EAAC,+KAA+K,GAAQ,CAC3L,CACP,CAAA;AAEY,QAAA,UAAU,GAAG,CACxB,uCACE,OAAO,EAAC,eAAe,EACvB,SAAS,EAAC,OAAO,eACP,QAAQ,EAClB,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,IAAI,EAAC,cAAc,iBACP,MAAM;IAElB,wCAAM,CAAC,EAAC,qVAAqV,GAAQ,CACjW,CACP,CAAA","sourcesContent":["import React from 'react'\n\nexport const plusIcon = (\n <svg\n viewBox=\"64 64 896 896\"\n focusable=\"false\"\n data-icon=\"plus-circle\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z\"></path>\n <path d=\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z\"></path>\n </svg>\n)\n\nexport const deleteIcon = (\n <svg\n viewBox=\"64 64 896 896\"\n focusable=\"false\"\n data-icon=\"delete\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z\"></path>\n </svg>\n)\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CheckboxGroupProps as AntdCheckboxGroupProps } from 'antd/lib/checkbox/Group';
|
|
3
|
+
export declare type CheckboxGroupProps = AntdCheckboxGroupProps & {
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<AntdCheckboxGroupProps & React.RefAttributes<unknown>>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=checkbox-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../src/checkbox/checkbox-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAI1F,oBAAY,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;;AAED,wBAA2E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
require("react");
|
|
8
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
9
|
+
var _connect = require("../connect");
|
|
10
|
+
var _previewText = require("../preview-text");
|
|
11
|
+
function _interopRequireDefault(e) {
|
|
12
|
+
return e && e.__esModule ? e : {
|
|
13
|
+
"default": e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var _default = exports["default"] = (0, _connect.connectReadonlyComponent)(_checkbox["default"].Group, _previewText.PreviewText.Select);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-group.js","sourceRoot":"","sources":["../../src/checkbox/checkbox-group.tsx"],"names":[],"mappings":";;;;;AAAA,iBAAyC;AACzC,gEAAuC;AAEvC,wCAAqD;AACrD,kDAA6C;AAM7C,kBAAe,IAAA,kCAAwB,EAAC,kBAAQ,CAAC,KAAK,EAAE,0BAAW,CAAC,MAAM,CAAC,CAAA","sourcesContent":["import React, { forwardRef } from 'react'\nimport Checkbox from 'antd/lib/checkbox'\nimport type { CheckboxGroupProps as AntdCheckboxGroupProps } from 'antd/lib/checkbox/Group'\nimport { connectReadonlyComponent } from '../connect'\nimport { PreviewText } from '../preview-text'\n\nexport type CheckboxGroupProps = AntdCheckboxGroupProps & {\n readonly?: boolean\n}\n\nexport default connectReadonlyComponent(Checkbox.Group, PreviewText.Select)\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ellipsis/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ellipsis/index.js"],"names":[],"mappings":"AAkCe,yDAgKd"}
|
package/lib/ellipsis/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var _popover2 = _interopRequireDefault(require("../popover"));
|
|
|
19
19
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
20
20
|
var _CopySVG = _interopRequireDefault(require("./Svg/CopySVG"));
|
|
21
21
|
var _TickSVG = _interopRequireDefault(require("./Svg/TickSVG"));
|
|
22
|
+
var _useScrollLock = _interopRequireDefault(require("../_util/hooks/useScrollLock"));
|
|
22
23
|
require("./index.less");
|
|
23
24
|
function _getRequireWildcardCache(e) {
|
|
24
25
|
if ("function" != typeof WeakMap) return null;
|
|
@@ -105,15 +106,16 @@ function _arrayWithHoles(r) {
|
|
|
105
106
|
var tolerance = 0; // In px. Depends on the font you are using
|
|
106
107
|
var isEllipsisActive = function isEllipsisActive(e) {
|
|
107
108
|
var _a, _b;
|
|
109
|
+
e.setAttribute('style', '');
|
|
108
110
|
if (e.offsetWidth === e.scrollWidth && e.offsetHeight === e.scrollHeight) {
|
|
109
111
|
var styleStr = 'overflow:visible; ';
|
|
110
112
|
if (!((_b = (_a = e === null || e === void 0 ? void 0 : e.parentNode) === null || _a === void 0 ? void 0 : _a.getAttribute('style')) === null || _b === void 0 ? void 0 : _b.includes('width'))) {
|
|
111
113
|
styleStr += 'max-width:100%;';
|
|
112
114
|
}
|
|
113
115
|
e.parentNode.setAttribute('style', styleStr);
|
|
114
|
-
e.setAttribute(
|
|
116
|
+
e.setAttribute('style', 'overflow:inherit');
|
|
115
117
|
} else {
|
|
116
|
-
e.setAttribute(
|
|
118
|
+
e.setAttribute('style', '');
|
|
117
119
|
}
|
|
118
120
|
return e.offsetWidth + tolerance < e.scrollWidth || e.offsetHeight < e.scrollHeight;
|
|
119
121
|
};
|
|
@@ -134,7 +136,8 @@ var _default = exports["default"] = function _default(props) {
|
|
|
134
136
|
prefix = props.prefix,
|
|
135
137
|
suffix = props.suffix,
|
|
136
138
|
_props$needRefresh = props.needRefresh,
|
|
137
|
-
needRefresh = _props$needRefresh === void 0 ? true : _props$needRefresh
|
|
139
|
+
needRefresh = _props$needRefresh === void 0 ? true : _props$needRefresh,
|
|
140
|
+
enableScrollObserver = props.enableScrollObserver;
|
|
138
141
|
var _useState = (0, _react.useState)(1),
|
|
139
142
|
_useState2 = _slicedToArray(_useState, 2),
|
|
140
143
|
renderId = _useState2[0],
|
|
@@ -159,12 +162,25 @@ var _default = exports["default"] = function _default(props) {
|
|
|
159
162
|
lineHeight = _useState10[0],
|
|
160
163
|
setLineHeight = _useState10[1];
|
|
161
164
|
var elementRef = (0, _react.useRef)();
|
|
165
|
+
var isScrolling = (0, _useScrollLock["default"])({
|
|
166
|
+
enableScrollObserver: enableScrollObserver
|
|
167
|
+
});
|
|
168
|
+
(0, _react.useEffect)(function () {
|
|
169
|
+
if (isScrolling) {
|
|
170
|
+
setTipVisible(false);
|
|
171
|
+
}
|
|
172
|
+
}, [isScrolling]);
|
|
162
173
|
var computeElement = function computeElement() {
|
|
163
174
|
elementRef.current && isEllipsisActive(elementRef.current) ? setFlag(true) : (setFlag(false), setTipVisible(false));
|
|
164
175
|
if (elementRef.current) {
|
|
165
176
|
setLineHeight(getComputedStyle(elementRef.current, null).getPropertyValue('line-height'));
|
|
166
177
|
}
|
|
167
178
|
};
|
|
179
|
+
(0, _react.useEffect)(function () {
|
|
180
|
+
return function () {
|
|
181
|
+
elementRef.current = null; // 清理引用
|
|
182
|
+
};
|
|
183
|
+
}, []);
|
|
168
184
|
(0, _react.useLayoutEffect)(function () {
|
|
169
185
|
if (needRefresh) {
|
|
170
186
|
setRenderId(function (id) {
|
|
@@ -183,17 +199,18 @@ var _default = exports["default"] = function _default(props) {
|
|
|
183
199
|
computeElement();
|
|
184
200
|
}, [renderId]);
|
|
185
201
|
(0, _react.useEffect)(function () {
|
|
186
|
-
|
|
202
|
+
var handleResize = function handleResize() {
|
|
203
|
+
return computeElement();
|
|
204
|
+
};
|
|
205
|
+
window.addEventListener('resize', handleResize);
|
|
187
206
|
return function () {
|
|
188
|
-
window.removeEventListener('resize',
|
|
207
|
+
window.removeEventListener('resize', handleResize);
|
|
189
208
|
};
|
|
190
209
|
}, []);
|
|
191
210
|
// original Node
|
|
192
211
|
var inner = typeof children === 'string' ? children : _popover ? content : title;
|
|
193
212
|
// for className
|
|
194
|
-
var getClassName =
|
|
195
|
-
return "overflow min-width-0 ".concat(_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap', " ").concat(className || '');
|
|
196
|
-
};
|
|
213
|
+
var getClassName = "overflow min-width-0 ".concat(_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap', " ").concat(className || '');
|
|
197
214
|
// Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)
|
|
198
215
|
var handleVisibleChange = function handleVisibleChange(visible) {
|
|
199
216
|
// const { onVisibleChange } = props;
|
|
@@ -204,9 +221,12 @@ var _default = exports["default"] = function _default(props) {
|
|
|
204
221
|
var handleCopy = function handleCopy(innerText) {
|
|
205
222
|
(0, _copyToClipboard["default"])(innerText);
|
|
206
223
|
setHasCopy(!hasCopy);
|
|
207
|
-
setTimeout(function () {
|
|
224
|
+
var timer = setTimeout(function () {
|
|
208
225
|
setHasCopy(false);
|
|
209
226
|
}, 1000);
|
|
227
|
+
return function () {
|
|
228
|
+
return clearTimeout(timer);
|
|
229
|
+
}; // 清除定时器
|
|
210
230
|
};
|
|
211
231
|
var renderNode = function renderNode() {
|
|
212
232
|
var popoverNode = _react["default"].createElement(_popover2["default"], Object.assign({}, props, {
|
|
@@ -243,7 +263,7 @@ var _default = exports["default"] = function _default(props) {
|
|
|
243
263
|
maxWidth: widthLimit
|
|
244
264
|
})
|
|
245
265
|
}, prefix && prefix, _react["default"].createElement("div", {
|
|
246
|
-
className: getClassName
|
|
266
|
+
className: getClassName,
|
|
247
267
|
key: renderId
|
|
248
268
|
}, inner || inner === 0 ? renderNode() : emptyText), !!suffix && suffix, (inner || inner === 0) && _copyable && lineHeight && _react["default"].createElement("div", {
|
|
249
269
|
className: "svg-button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ellipsis/index.js"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0EAAoC;AACpC,+CAA2E;AAE3E,yDAAgC;AAChC,yDAAgC;AAEhC,4DAA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AAE,KAAK,KAAG,CAAC,CAAC,IAAI,SAAS,IAAI,UAAU,IAAI,CAChD,uCACE,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IAEtD,CAAC,OAAO,CAAC,CAAC,CAAC,CACV,8BAAC,iBAAO,IACN,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,GACD,CACH,CAAC,CAAC,CAAC,CACF,8BAAC,iBAAO,IACN,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,GACD,CACH,CACG,CACP,CACG,CACL,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["/*\n * @Author: 梁洪刚\n * @CreatDate: 2021-03-31 13:57:32\n * @Describe: 省略号组件\n */\n\nimport copy from 'copy-to-clipboard'\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport Popover from '../popover'\nimport Tooltip from '../tooltip'\n\nimport CopySVG from './Svg/CopySVG'\nimport TickSVG from './Svg/TickSVG'\nimport './index.less'\n\nconst tolerance = 0 // In px. Depends on the font you are using\n\nconst isEllipsisActive = (e) => {\n if (e.offsetWidth === e.scrollWidth && e.offsetHeight === e.scrollHeight) {\n let styleStr = 'overflow:visible; '\n if (!e?.parentNode?.getAttribute('style')?.includes('width')) {\n styleStr += 'max-width:100%;'\n }\n e.parentNode.setAttribute('style', styleStr)\n e.setAttribute(\"style\",'overflow:inherit');\n }else {\n e.setAttribute(\"style\", \"\")\n }\n return e.offsetWidth + tolerance < e.scrollWidth || e.offsetHeight < e.scrollHeight\n}\n\nexport default (props) => {\n let {\n _popover = props.Popover, // `Popover` or `Tooltip` ?\n title, // in most cases for `Tooltip`\n content, // in most cases for `Popover`\n className,\n style,\n widthLimit, // width trigger value\n _lines = props.lines !== 1 && props.lines, // number or lines, default 1 line;\n children, // children Node\n emptyText, // default: null\n _copyable = props.copyable, // copy function\n prefix, // 前缀dom\n suffix, // 后缀dom\n needRefresh = true // select.options的情况下不要刷新\n } = props\n\n const [renderId, setRenderId] = useState(1);\n // allow visible or not state\n const [flag, setFlag] = useState(true)\n // visible[Tooltip/Popover] state\n const [tipVisible, setTipVisible] = useState(false)\n // copy animation state\n const [hasCopy, setHasCopy] = useState(false)\n const [lineHeight, setLineHeight] = useState()\n\n const elementRef = useRef()\n\n const computeElement = ()=>{\n elementRef.current && isEllipsisActive(elementRef.current)\n ? setFlag(true)\n : (setFlag(false), setTipVisible(false))\n\n if (elementRef.current) {\n setLineHeight(getComputedStyle(elementRef.current, null).getPropertyValue('line-height'))\n }\n }\n\n useLayoutEffect(()=>{\n if (needRefresh) {\n setRenderId(id => id + 1);\n }else {\n if(renderId < 2) {\n setRenderId(id => id + 1);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [title, needRefresh, content, children])\n\n useEffect(() => {\n computeElement()\n },[renderId])\n\n useEffect(()=>{\n window.addEventListener(\"resize\",computeElement)\n return ()=>{\n window.removeEventListener('resize',computeElement)\n }\n },[])\n\n // original Node\n const inner = typeof children === 'string' ? children : _popover ? content : title\n\n // for className\n const getClassName = () => {\n return `overflow min-width-0 ${_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap'} ${className || ''}`\n }\n\n // Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)\n const handleVisibleChange = (visible) => {\n // const { onVisibleChange } = props;\n // onVisibleChange(visible);\n flag && setTipVisible(visible)\n }\n\n // onClick Copy Button\n const handleCopy = (innerText) => {\n copy(innerText)\n setHasCopy(!hasCopy)\n setTimeout(() => {\n setHasCopy(false)\n }, 1000)\n }\n\n const renderNode = () => {\n const popoverNode = (\n <Popover\n {...props}\n content={content || children}\n visible={tipVisible}\n onVisibleChange={(visible) => handleVisibleChange(visible)}\n >\n <div className={className} style={{ WebkitLineClamp: _lines }} ref={elementRef}>\n {children || content}\n </div>\n </Popover>\n )\n\n const tooltipNode = (\n <Tooltip\n {...props}\n title={title || children}\n visible={tipVisible}\n onVisibleChange={(visible) => handleVisibleChange(visible)}\n >\n <div className={className} style={{ WebkitLineClamp: _lines }} ref={elementRef}>\n {children || title}\n </div>\n </Tooltip>\n )\n\n return _popover ? popoverNode : tooltipNode\n }\n\n return (\n <>\n <div\n className=\"tntd-ellipsis\"\n style={{\n ...style,\n maxWidth: widthLimit,\n }}\n >\n {/* prefix */}\n {prefix && prefix}\n {/* content */}\n <div className={getClassName()} key={renderId}>{(inner||inner===0) ? renderNode() : emptyText}</div>\n {/* suffix */}\n {!!suffix && suffix}\n {/* copyable button */}\n {(inner||inner===0) && _copyable && lineHeight && (\n <div\n className=\"svg-button\"\n style={{\n height: lineHeight,\n }}\n onClick={() => handleCopy(elementRef.current.innerText)}\n >\n {!hasCopy ? (\n <CopySVG\n style={{\n height: lineHeight,\n }}\n />\n ) : (\n <TickSVG\n style={{\n height: lineHeight,\n }}\n />\n )}\n </div>\n )}\n </div>\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ellipsis/index.js"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0EAAoC;AACpC,+CAA2E;AAE3E,yDAAgC;AAChC,yDAAgC;AAEhC,4DAAmC;AACnC,4DAAmC;AACnC,iFAAwD;AACxD,wBAAqB;AAErB,MAAM,SAAS,GAAG,CAAC,CAAC,CAAC,2CAA2C;AAEhE,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,EAAE;;IAC7B,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,YAAY,EAAE;QACxE,IAAI,QAAQ,GAAG,oBAAoB,CAAC;QACpC,IAAI,CAAC,CAAA,MAAA,M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AM;YAEjB,uCAAK,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,IACxC,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAC5C;YAEL,CAAC,CAAC,MAAM,IAAI,MAAM;YAElB,CAAC,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,SAAS,IAAI,UAAU,IAAI,CACpD,uCACE,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IACtD,CAAC,OAAO,CAAC,CAAC,CAAC,CACV,8BAAC,iBAAO,IACN,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,GACD,CACH,CAAC,CAAC,CAAC,CACF,8BAAC,iBAAO,IACN,KAAK,EAAE;oBACL,MAAM,EAAE,UAAU;iBACnB,GACD,CACH,CACG,CACP,CACG,CACL,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * @Author: 梁洪刚\n * @CreatDate: 2021-03-31 13:57:32\n * @Describe: 省略号组件\n */\n\nimport copy from 'copy-to-clipboard'\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport Popover from '../popover'\nimport Tooltip from '../tooltip'\n\nimport CopySVG from './Svg/CopySVG'\nimport TickSVG from './Svg/TickSVG'\nimport useScrollLock from '../_util/hooks/useScrollLock'\nimport './index.less'\n\nconst tolerance = 0; // In px. Depends on the font you are using\n\nconst isEllipsisActive = (e) => {\n e.setAttribute('style', '');\n if (e.offsetWidth === e.scrollWidth && e.offsetHeight === e.scrollHeight) {\n let styleStr = 'overflow:visible; ';\n if (!e?.parentNode?.getAttribute('style')?.includes('width')) {\n styleStr += 'max-width:100%;';\n }\n e.parentNode.setAttribute('style', styleStr);\n e.setAttribute('style', 'overflow:inherit');\n } else {\n e.setAttribute('style', '');\n }\n return e.offsetWidth + tolerance < e.scrollWidth || e.offsetHeight < e.scrollHeight;\n};\n\nexport default (props) => {\n let {\n _popover = props.Popover, // `Popover` or `Tooltip` ?\n title, // in most cases for `Tooltip`\n content, // in most cases for `Popover`\n className,\n style,\n widthLimit, // width trigger value\n _lines = props.lines !== 1 && props.lines, // number or lines, default 1 line;\n children, // children Node\n emptyText, // default: null\n _copyable = props.copyable, // copy function\n prefix, // 前缀dom\n suffix, // 后缀dom\n needRefresh = true, \n enableScrollObserver// select.options的情况下不要刷新\n } = props\n\n const [renderId, setRenderId] = useState(1);\n // allow visible or not state\n const [flag, setFlag] = useState(true);\n // visible[Tooltip/Popover] state\n const [tipVisible, setTipVisible] = useState(false);\n // copy animation state\n const [hasCopy, setHasCopy] = useState(false);\n const [lineHeight, setLineHeight] = useState();\n\n const elementRef = useRef();\n\n const isScrolling = useScrollLock({enableScrollObserver});\n useEffect(()=>{\n if(isScrolling) {\n setTipVisible(false)\n }\n },[isScrolling])\n \n \n const computeElement = () => {\n elementRef.current && isEllipsisActive(elementRef.current) ? setFlag(true) : (setFlag(false), setTipVisible(false));\n\n if (elementRef.current) {\n setLineHeight(getComputedStyle(elementRef.current, null).getPropertyValue('line-height'));\n }\n };\n useEffect(() => {\n return () => {\n elementRef.current = null; // 清理引用\n };\n }, []);\n useLayoutEffect(() => {\n if (needRefresh) {\n setRenderId((id) => id + 1);\n } else {\n if (renderId < 2) {\n setRenderId((id) => id + 1);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [title, needRefresh, content, children]);\n\n useEffect(() => {\n computeElement();\n }, [renderId]);\n\n useEffect(() => {\n const handleResize = () => computeElement();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n // original Node\n const inner = typeof children === 'string' ? children : _popover ? content : title;\n\n // for className\n const getClassName = `overflow min-width-0 ${_lines ? 'ellipsis-wrap' : 'ellipsis-nowrap'} ${className || ''}`;\n\n // Tooltip.trigger(default 'hover') ==trigger==> onVisibleChange(visible)\n const handleVisibleChange = (visible) => {\n // const { onVisibleChange } = props;\n // onVisibleChange(visible);\n flag && setTipVisible(visible);\n };\n\n // onClick Copy Button\n const handleCopy = (innerText) => {\n copy(innerText);\n setHasCopy(!hasCopy);\n const timer = setTimeout(() => {\n setHasCopy(false);\n }, 1000);\n return () => clearTimeout(timer); // 清除定时器\n };\n\n const renderNode = () => {\n const popoverNode = (\n <Popover\n {...props}\n content={content || children}\n visible={tipVisible}\n onVisibleChange={(visible) => handleVisibleChange(visible)}>\n <div className={className} style={{ WebkitLineClamp: _lines }} ref={elementRef}>\n {children || content}\n </div>\n </Popover>\n );\n\n const tooltipNode = (\n <Tooltip {...props} title={title || children} visible={tipVisible} onVisibleChange={(visible) => handleVisibleChange(visible)}>\n <div className={className} style={{ WebkitLineClamp: _lines }} ref={elementRef}>\n {children || title}\n </div>\n </Tooltip>\n );\n\n return _popover ? popoverNode : tooltipNode;\n };\n\n return (\n <>\n <div\n className=\"tntd-ellipsis\"\n style={{\n ...style,\n maxWidth: widthLimit\n }}>\n {/* prefix */}\n {prefix && prefix}\n {/* content */}\n <div className={getClassName} key={renderId}>\n {inner || inner === 0 ? renderNode() : emptyText}\n </div>\n {/* suffix */}\n {!!suffix && suffix}\n {/* copyable button */}\n {(inner || inner === 0) && _copyable && lineHeight && (\n <div\n className=\"svg-button\"\n style={{\n height: lineHeight\n }}\n onClick={() => handleCopy(elementRef.current.innerText)}>\n {!hasCopy ? (\n <CopySVG\n style={{\n height: lineHeight\n }}\n />\n ) : (\n <TickSVG\n style={{\n height: lineHeight\n }}\n />\n )}\n </div>\n )}\n </div>\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const MemoForwardRef: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "style" | "className" | "children" | "clipPath" | "filter" | "mask" | "path" | "target" | "
|
|
2
|
+
declare const MemoForwardRef: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "style" | "className" | "children" | "clipPath" | "filter" | "mask" | "path" | "href" | "target" | "onClick" | "onChange" | "lang" | "by" | "from" | "in" | "to" | "media" | "id" | "tabIndex" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "name" | "origin" | "key" | "width" | "height" | "focusable" | "fill" | "viewBox" | "rotate" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "max" | "method" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "calcMode" | "capHeight" | "clip" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "display" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "format" | "fr" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "letterSpacing" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "overflow" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "transform" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan"> & React.RefAttributes<SVGSVGElement>>>;
|
|
3
3
|
export default MemoForwardRef;
|
|
4
4
|
//# sourceMappingURL=svg-error-tip.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const MemoForwardRef: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "style" | "className" | "children" | "clipPath" | "filter" | "mask" | "path" | "target" | "
|
|
2
|
+
declare const MemoForwardRef: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "style" | "className" | "children" | "clipPath" | "filter" | "mask" | "path" | "href" | "target" | "onClick" | "onChange" | "lang" | "by" | "from" | "in" | "to" | "media" | "id" | "tabIndex" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "name" | "origin" | "key" | "width" | "height" | "focusable" | "fill" | "viewBox" | "rotate" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "max" | "method" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "calcMode" | "capHeight" | "clip" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "display" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "format" | "fr" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "letterSpacing" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "overflow" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "transform" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan"> & React.RefAttributes<SVGSVGElement>>>;
|
|
3
3
|
export default MemoForwardRef;
|
|
4
4
|
//# sourceMappingURL=svg-success-tip.d.ts.map
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
position: absolute;
|
|
11
11
|
top: 45%;
|
|
12
12
|
left: 50%;
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
13
|
+
width: 51px;
|
|
14
|
+
height: 64px;
|
|
15
15
|
background-size: 100% 100%;
|
|
16
16
|
transform: translate(-50%, -50%);
|
|
17
17
|
background-repeat: no-repeat;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
span {
|
|
22
22
|
position: absolute;
|
|
23
23
|
left: 50%;
|
|
24
|
-
bottom:
|
|
24
|
+
bottom: -17px;
|
|
25
25
|
transform: translate(-50%, 0);
|
|
26
26
|
width: 100%;
|
|
27
27
|
font-size: 12px;
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
color: #fff;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -51,18 +51,24 @@ function _interopRequireWildcard(e, r) {
|
|
|
51
51
|
}
|
|
52
52
|
return n["default"] = e, t && t.set(e, n), n;
|
|
53
53
|
}
|
|
54
|
-
function _interopRequireDefault(
|
|
55
|
-
return
|
|
56
|
-
"default":
|
|
54
|
+
function _interopRequireDefault(obj) {
|
|
55
|
+
return obj && obj.__esModule ? obj : {
|
|
56
|
+
"default": obj
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function _defineProperty(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
function _defineProperty(obj, key, value) {
|
|
60
|
+
key = _toPropertyKey(key);
|
|
61
|
+
if (key in obj) {
|
|
62
|
+
Object.defineProperty(obj, key, {
|
|
63
|
+
value: value,
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
obj[key] = value;
|
|
70
|
+
}
|
|
71
|
+
return obj;
|
|
66
72
|
}
|
|
67
73
|
function _toPropertyKey(t) {
|
|
68
74
|
var i = _toPrimitive(t, "string");
|
|
@@ -78,23 +84,24 @@ function _toPrimitive(t, r) {
|
|
|
78
84
|
}
|
|
79
85
|
return ("string" === r ? String : Number)(t);
|
|
80
86
|
}
|
|
81
|
-
function _slicedToArray(
|
|
82
|
-
return _arrayWithHoles(
|
|
87
|
+
function _slicedToArray(arr, i) {
|
|
88
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
83
89
|
}
|
|
84
90
|
function _nonIterableRest() {
|
|
85
91
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
86
92
|
}
|
|
87
|
-
function _unsupportedIterableToArray(
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
94
|
+
if (!o) return;
|
|
95
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
96
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
97
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
98
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
99
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
93
100
|
}
|
|
94
|
-
function _arrayLikeToArray(
|
|
95
|
-
(
|
|
96
|
-
for (var
|
|
97
|
-
return
|
|
101
|
+
function _arrayLikeToArray(arr, len) {
|
|
102
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
103
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
104
|
+
return arr2;
|
|
98
105
|
}
|
|
99
106
|
function _iterableToArrayLimit(r, l) {
|
|
100
107
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
@@ -123,8 +130,8 @@ function _iterableToArrayLimit(r, l) {
|
|
|
123
130
|
return a;
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
|
-
function _arrayWithHoles(
|
|
127
|
-
if (Array.isArray(
|
|
133
|
+
function _arrayWithHoles(arr) {
|
|
134
|
+
if (Array.isArray(arr)) return arr;
|
|
128
135
|
}
|
|
129
136
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
130
137
|
var t = {};
|
|
@@ -46,18 +46,24 @@ function _interopRequireWildcard(e, r) {
|
|
|
46
46
|
}
|
|
47
47
|
return n["default"] = e, t && t.set(e, n), n;
|
|
48
48
|
}
|
|
49
|
-
function _interopRequireDefault(
|
|
50
|
-
return
|
|
51
|
-
"default":
|
|
49
|
+
function _interopRequireDefault(obj) {
|
|
50
|
+
return obj && obj.__esModule ? obj : {
|
|
51
|
+
"default": obj
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function _defineProperty(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
function _defineProperty(obj, key, value) {
|
|
55
|
+
key = _toPropertyKey(key);
|
|
56
|
+
if (key in obj) {
|
|
57
|
+
Object.defineProperty(obj, key, {
|
|
58
|
+
value: value,
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
obj[key] = value;
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
61
67
|
}
|
|
62
68
|
function _toPropertyKey(t) {
|
|
63
69
|
var i = _toPrimitive(t, "string");
|
|
@@ -73,23 +79,24 @@ function _toPrimitive(t, r) {
|
|
|
73
79
|
}
|
|
74
80
|
return ("string" === r ? String : Number)(t);
|
|
75
81
|
}
|
|
76
|
-
function _slicedToArray(
|
|
77
|
-
return _arrayWithHoles(
|
|
82
|
+
function _slicedToArray(arr, i) {
|
|
83
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
78
84
|
}
|
|
79
85
|
function _nonIterableRest() {
|
|
80
86
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
81
87
|
}
|
|
82
|
-
function _unsupportedIterableToArray(
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
89
|
+
if (!o) return;
|
|
90
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
91
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
92
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
93
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
94
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
88
95
|
}
|
|
89
|
-
function _arrayLikeToArray(
|
|
90
|
-
(
|
|
91
|
-
for (var
|
|
92
|
-
return
|
|
96
|
+
function _arrayLikeToArray(arr, len) {
|
|
97
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
98
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
99
|
+
return arr2;
|
|
93
100
|
}
|
|
94
101
|
function _iterableToArrayLimit(r, l) {
|
|
95
102
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
@@ -118,8 +125,8 @@ function _iterableToArrayLimit(r, l) {
|
|
|
118
125
|
return a;
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
|
-
function _arrayWithHoles(
|
|
122
|
-
if (Array.isArray(
|
|
128
|
+
function _arrayWithHoles(arr) {
|
|
129
|
+
if (Array.isArray(arr)) return arr;
|
|
123
130
|
}
|
|
124
131
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
125
132
|
var t = {};
|