@pointcloud/pcloud-components 0.1.21 → 0.1.24

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.
Files changed (69) hide show
  1. package/README.md +1 -1
  2. package/dist/esm/AdvancedFilter/FormFilter.js +3 -3
  3. package/dist/esm/AdvancedFilter/interface.d.ts +3 -3
  4. package/dist/esm/AdvancedFilter/styles/index.less +146 -146
  5. package/dist/esm/AspectRatio/index.d.ts +9 -0
  6. package/dist/esm/AspectRatio/index.js +46 -0
  7. package/dist/esm/ColorPicker/index.js +1 -1
  8. package/dist/esm/ColorPicker/index.less +18 -18
  9. package/dist/esm/ColorPicker/interface.d.ts +3 -3
  10. package/dist/esm/ConfigProvider/interface.d.ts +1 -1
  11. package/dist/esm/DCascader/index.js +6 -6
  12. package/dist/esm/DCascader/index.less +24 -24
  13. package/dist/esm/DForm/DItem/itemType.d.ts +5 -1
  14. package/dist/esm/DForm/DItem/itemsRender.d.ts +2 -0
  15. package/dist/esm/DForm/DItem/itemsRender.js +8 -0
  16. package/dist/esm/DForm/helper.d.ts +2 -0
  17. package/dist/esm/DForm/helper.js +33 -10
  18. package/dist/esm/DForm/index.js +7 -4
  19. package/dist/esm/DForm/index.less +5 -0
  20. package/dist/esm/DInput/index.js +14 -14
  21. package/dist/esm/DModal/interface.d.ts +2 -2
  22. package/dist/esm/DModal/styles/index.less +27 -27
  23. package/dist/esm/DSelect/index.js +39 -45
  24. package/dist/esm/DTable/index.js +6 -6
  25. package/dist/esm/DTable/index.less +71 -71
  26. package/dist/esm/DTreeSelect/index.less +11 -11
  27. package/dist/esm/DUpload/helper.js +47 -47
  28. package/dist/esm/DUpload/index.less +19 -19
  29. package/dist/esm/ErrorBoundary/index.less +44 -44
  30. package/dist/esm/IPAddress/index.d.ts +20 -0
  31. package/dist/esm/IPAddress/index.js +248 -0
  32. package/dist/esm/IPAddress/index.less +75 -0
  33. package/dist/esm/IconFont/index.d.ts +17 -0
  34. package/dist/esm/IconFont/index.js +27 -0
  35. package/dist/esm/InfiniteScrollList/index.d.ts +9 -0
  36. package/dist/esm/InfiniteScrollList/index.js +9 -4
  37. package/dist/esm/InfiniteScrollList/styles/index.less +2 -0
  38. package/dist/esm/LabelValue/interface.d.ts +1 -1
  39. package/dist/esm/LabelValue/styles/index.less +23 -23
  40. package/dist/esm/Loading/hooks/useLoading.d.ts +6 -0
  41. package/dist/esm/Loading/hooks/useLoading.js +35 -0
  42. package/dist/esm/Loading/index.d.ts +5 -4
  43. package/dist/esm/Loading/index.js +9 -9
  44. package/dist/esm/Loading/interface.d.ts +6 -3
  45. package/dist/esm/Loading/loading.d.ts +2 -4
  46. package/dist/esm/Loading/loading.js +5 -3
  47. package/dist/esm/Loading/styles/index.less +25 -25
  48. package/dist/esm/NoData/styles/index.less +24 -24
  49. package/dist/esm/PictureCard/index.d.ts +1 -1
  50. package/dist/esm/PictureCard/index.less +28 -28
  51. package/dist/esm/RCropper/handler.d.ts +16 -0
  52. package/dist/esm/RCropper/handler.js +146 -0
  53. package/dist/esm/RCropper/index.d.ts +4 -0
  54. package/dist/esm/RCropper/index.js +183 -0
  55. package/dist/esm/RCropper/interface.d.ts +70 -0
  56. package/dist/esm/RCropper/interface.js +1 -0
  57. package/dist/esm/RCropper/styles/toolbar.less +25 -0
  58. package/dist/esm/RCropper/svgIcons.d.ts +28 -0
  59. package/dist/esm/RCropper/svgIcons.js +158 -0
  60. package/dist/esm/RCropper/toolbar.d.ts +5 -0
  61. package/dist/esm/RCropper/toolbar.js +84 -0
  62. package/dist/esm/WordCloud/index.d.ts +6 -2
  63. package/dist/esm/WordCloud/index.js +110 -5
  64. package/dist/esm/commonStyle/index.less +1 -1
  65. package/dist/esm/index.d.ts +9 -1
  66. package/dist/esm/index.js +6 -2
  67. package/dist/umd/pcloud-components.min.css +1 -1
  68. package/dist/umd/pcloud-components.min.js +1 -1
  69. package/package.json +107 -106
@@ -1,11 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _typeof from "@babel/runtime/helpers/esm/typeof";
3
- /*
4
- * @Author : wangfeihu
5
- * @Date : 2023-06-16 11:25:57
6
- * @LastEditors : wangfeihu
7
- * @LastEditTime : 2023-08-30 11:26:22
8
- * @Description : 辅助方法集合
3
+ /*
4
+ * @Author : wangfeihu
5
+ * @Date : 2023-06-16 11:25:57
6
+ * @LastEditors : wangfeihu
7
+ * @LastEditTime : 2023-08-30 11:26:22
8
+ * @Description : 辅助方法集合
9
9
  */
10
10
 
11
11
  /** 转换base64时的参数 */
@@ -41,12 +41,12 @@ function getType(value) {
41
41
  }
42
42
  }
43
43
 
44
- /**
45
- * @description : 将图像文件转换为Base64格式
46
- * @param {Blob} blob 图像文件
47
- * @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
48
- * @return {Promise<string>} 包含Base64字符串的Promise对象
49
- * @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
44
+ /**
45
+ * @description : 将图像文件转换为Base64格式
46
+ * @param {Blob} blob 图像文件
47
+ * @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
48
+ * @return {Promise<string>} 包含Base64字符串的Promise对象
49
+ * @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
50
50
  */
51
51
  function imageToBase64(blob, options) {
52
52
  return new Promise(function (resolve, reject) {
@@ -97,11 +97,11 @@ function imageToBase64(blob, options) {
97
97
  });
98
98
  }
99
99
 
100
- /**
101
- * @description : 将传入的文件转换为UploadFile数组
102
- * @param {any} files 目标文件对象
103
- * @return {UploadFile[]} UploadFile数组
104
- * @example :
100
+ /**
101
+ * @description : 将传入的文件转换为UploadFile数组
102
+ * @param {any} files 目标文件对象
103
+ * @return {UploadFile[]} UploadFile数组
104
+ * @example :
105
105
  */
106
106
  function getUploadFile(files, maxCount) {
107
107
  if (files) {
@@ -114,11 +114,11 @@ function getUploadFile(files, maxCount) {
114
114
  return [];
115
115
  }
116
116
 
117
- /**
118
- * @description : 根据传入的option对象获取缩略图参数
119
- * @param {ThumbOptionProps} option 缩略图参数对象
120
- * @return {ThumbOptionProps} ThumbOption对象
121
- * @example :
117
+ /**
118
+ * @description : 根据传入的option对象获取缩略图参数
119
+ * @param {ThumbOptionProps} option 缩略图参数对象
120
+ * @return {ThumbOptionProps} ThumbOption对象
121
+ * @example :
122
122
  */
123
123
  function getThumbOption(option) {
124
124
  var _ref2 = option || {},
@@ -152,12 +152,12 @@ function getThumbOption(option) {
152
152
  return _option;
153
153
  }
154
154
 
155
- /**
156
- * @description : a标签下载文件
157
- * @param {Blob | string} url a标签的下载url或文件流
158
- * @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
159
- * @return {*}
160
- * @example :
155
+ /**
156
+ * @description : a标签下载文件
157
+ * @param {Blob | string} url a标签的下载url或文件流
158
+ * @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
159
+ * @return {*}
160
+ * @example :
161
161
  */
162
162
  function downloadFile(url, fileName) {
163
163
  var eLink = document.createElement('a');
@@ -170,11 +170,11 @@ function downloadFile(url, fileName) {
170
170
  document.body.removeChild(eLink);
171
171
  }
172
172
 
173
- /**
174
- * @description : a标签预览文件
175
- * @param {Blob | string} url a标签的预览url或文件流
176
- * @return {*}
177
- * @example :
173
+ /**
174
+ * @description : a标签预览文件
175
+ * @param {Blob | string} url a标签的预览url或文件流
176
+ * @return {*}
177
+ * @example :
178
178
  */
179
179
  function previewFile(url) {
180
180
  var eLink = document.createElement('a');
@@ -187,13 +187,13 @@ function previewFile(url) {
187
187
  document.body.removeChild(eLink);
188
188
  }
189
189
 
190
- /**
191
- * @description : 以递归方式深度查找一个对象
192
- * @param {Record} object 待查找的对象
193
- * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
194
- * @param {number} maxDepth 递归的最大深度,默认10
195
- * @return {*} 查找到的对象,未查找到则返回undefined
196
- * @example :
190
+ /**
191
+ * @description : 以递归方式深度查找一个对象
192
+ * @param {Record} object 待查找的对象
193
+ * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
194
+ * @param {number} maxDepth 递归的最大深度,默认10
195
+ * @return {*} 查找到的对象,未查找到则返回undefined
196
+ * @example :
197
197
  */
198
198
  // eslint-disable-next-line no-unused-vars
199
199
  function deepFindObject(object, fn) {
@@ -223,13 +223,13 @@ function deepFindObject(object, fn) {
223
223
  return recursive(object, undefined, '', fn, {});
224
224
  }
225
225
 
226
- /**
227
- * @description : 以递归方式深度查找一个Jsx对象
228
- * @param {Record} object 待查找的Jsx对象
229
- * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
230
- * @param {number} maxDepth 递归的最大深度,默认10
231
- * @return {*} 查找到的对象,未查找到则返回undefined
232
- * @example :
226
+ /**
227
+ * @description : 以递归方式深度查找一个Jsx对象
228
+ * @param {Record} object 待查找的Jsx对象
229
+ * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
230
+ * @param {number} maxDepth 递归的最大深度,默认10
231
+ * @return {*} 查找到的对象,未查找到则返回undefined
232
+ * @example :
233
233
  */
234
234
  // eslint-disable-next-line no-unused-vars
235
235
  function deepFindJsx(object, fn) {
@@ -1,19 +1,19 @@
1
- @import '../commonStyle/index.less';
2
-
3
- .@{prefix}-upload {
4
- .preview .ant-upload-list-item-actions a[target='_blank'][rel='noopener noreferrer'] {
5
- opacity: initial !important;
6
- pointer-events: initial !important;
7
- }
8
-
9
- .ant-upload-list.ant-upload-list-picture-card .ant-upload-span {
10
- .ant-upload-list-item-thumbnail {
11
- height: 46px;
12
- }
13
-
14
- .ant-upload-list-item-name {
15
- position: absolute;
16
- display: initial;
17
- }
18
- }
19
- }
1
+ @import '../commonStyle/index.less';
2
+
3
+ .@{prefix}-upload {
4
+ .preview .ant-upload-list-item-actions a[target='_blank'][rel='noopener noreferrer'] {
5
+ opacity: initial !important;
6
+ pointer-events: initial !important;
7
+ }
8
+
9
+ .ant-upload-list.ant-upload-list-picture-card .ant-upload-span {
10
+ .ant-upload-list-item-thumbnail {
11
+ height: 46px;
12
+ }
13
+
14
+ .ant-upload-list-item-name {
15
+ position: absolute;
16
+ display: initial;
17
+ }
18
+ }
19
+ }
@@ -1,44 +1,44 @@
1
- @import '../commonStyle/index.less';
2
-
3
- .@{prefix}-error-boundary {
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- justify-content: center;
8
- width: auto;
9
- margin: 20px;
10
- padding: 15px;
11
- background-color: rgb(221, 127, 127);
12
- border-radius: 10px;
13
-
14
- .error-text {
15
- margin-top: 20px;
16
- }
17
-
18
- .error-refresh {
19
- width: 140px;
20
- height: 40px;
21
- color: white;
22
- font-weight: bold;
23
- line-height: 40px;
24
- text-align: center;
25
- background-color: #4593ef;
26
- border-radius: 5px;
27
- cursor: pointer;
28
- }
29
-
30
- .errorDetiles {
31
- .detilesLink {
32
- color: blue;
33
- }
34
-
35
- .errordetails {
36
- padding: 10px;
37
- color: #777;
38
- font-size: 80%;
39
- background-color: rgb(204, 198, 190);
40
- border: 1px solid #777;
41
- border-radius: 5px;
42
- }
43
- }
44
- }
1
+ @import '../commonStyle/index.less';
2
+
3
+ .@{prefix}-error-boundary {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ justify-content: center;
8
+ width: auto;
9
+ margin: 20px;
10
+ padding: 15px;
11
+ background-color: rgb(221, 127, 127);
12
+ border-radius: 10px;
13
+
14
+ .error-text {
15
+ margin-top: 20px;
16
+ }
17
+
18
+ .error-refresh {
19
+ width: 140px;
20
+ height: 40px;
21
+ color: white;
22
+ font-weight: bold;
23
+ line-height: 40px;
24
+ text-align: center;
25
+ background-color: #4593ef;
26
+ border-radius: 5px;
27
+ cursor: pointer;
28
+ }
29
+
30
+ .errorDetiles {
31
+ .detilesLink {
32
+ color: blue;
33
+ }
34
+
35
+ .errordetails {
36
+ padding: 10px;
37
+ color: #777;
38
+ font-size: 80%;
39
+ background-color: rgb(204, 198, 190);
40
+ border: 1px solid #777;
41
+ border-radius: 5px;
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface IPAddressProps {
4
+ className?: string;
5
+ value?: string;
6
+ onChange?: (_value: string) => void;
7
+ onFocus?: (_value: string, _index: number) => void;
8
+ onBlur?: (_value: string, _index: number) => void;
9
+ type?: 'IPv4' | 'IPv6';
10
+ delimiter?: React.ReactNode;
11
+ readOnly?: boolean;
12
+ disabled?: boolean;
13
+ size?: 'small' | 'middle' | 'large';
14
+ style?: React.CSSProperties;
15
+ inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
16
+ autoComplete?: boolean;
17
+ normalize?: boolean;
18
+ }
19
+ declare const IPAddress: React.FC<IPAddressProps>;
20
+ export default IPAddress;
@@ -0,0 +1,248 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
+ import React, { useState, useEffect, useRef, useCallback, useContext } from 'react';
6
+ import classNames from 'classnames';
7
+ import { ConfigContext } from "../ConfigProvider";
8
+ import "./index.less";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ // IPv6 规范化函数
12
+ var normalizeIPv6 = function normalizeIPv6(ipv6) {
13
+ if (!ipv6) return '';
14
+ if (ipv6 === '::') return '0000:0000:0000:0000:0000:0000:0000:0000';
15
+ // 处理开头/结尾的 ::
16
+ var normalized = ipv6;
17
+ if (normalized.startsWith('::')) normalized = '0' + normalized;
18
+ if (normalized.endsWith('::')) normalized = normalized + '0';
19
+ var parts = normalized.split('::');
20
+ var leftParts = parts[0].split(':').filter(Boolean);
21
+ var rightParts = parts.length > 1 ? parts[1].split(':').filter(Boolean) : [];
22
+ var zeroSegmentsNeeded = 8 - leftParts.length - rightParts.length;
23
+ var zeroSegments = Array(zeroSegmentsNeeded).fill('0000');
24
+ return [].concat(_toConsumableArray(leftParts), _toConsumableArray(zeroSegments), _toConsumableArray(rightParts)).map(function (segment) {
25
+ return segment.padStart(4, '0');
26
+ }).join(':');
27
+ };
28
+ var getInitialAddress = function getInitialAddress(type, value) {
29
+ if (!value) {
30
+ var len = type === 'IPv6' ? 8 : 4;
31
+ return Array.from({
32
+ length: len
33
+ }, function () {
34
+ return {
35
+ value: ''
36
+ };
37
+ });
38
+ }
39
+ if (type === 'IPv6') {
40
+ var normalized = normalizeIPv6(value);
41
+ return normalized.split(':').map(function (i) {
42
+ return {
43
+ value: i
44
+ };
45
+ });
46
+ } else {
47
+ var parts = value.split('.').map(function (i) {
48
+ return {
49
+ value: i.replace(/\D/g, '')
50
+ };
51
+ });
52
+ while (parts.length < 4) parts.push({
53
+ value: ''
54
+ });
55
+ return parts.slice(0, 4);
56
+ }
57
+ };
58
+ var IPAddress = function IPAddress(props) {
59
+ var _props$className = props.className,
60
+ className = _props$className === void 0 ? '' : _props$className,
61
+ value = props.value,
62
+ _props$type = props.type,
63
+ type = _props$type === void 0 ? 'IPv4' : _props$type,
64
+ delimiter = props.delimiter,
65
+ readOnly = props.readOnly,
66
+ disabled = props.disabled,
67
+ _props$size = props.size,
68
+ size = _props$size === void 0 ? 'middle' : _props$size,
69
+ _props$style = props.style,
70
+ style = _props$style === void 0 ? {} : _props$style,
71
+ inputProps = props.inputProps,
72
+ _props$autoComplete = props.autoComplete,
73
+ autoComplete = _props$autoComplete === void 0 ? true : _props$autoComplete,
74
+ _props$normalize = props.normalize,
75
+ normalize = _props$normalize === void 0 ? true : _props$normalize,
76
+ onChange = props.onChange,
77
+ onFocus = props.onFocus,
78
+ onBlur = props.onBlur;
79
+ var _useContext = useContext(ConfigContext),
80
+ prefixCls = _useContext.prefixCls,
81
+ getPrefixCls = _useContext.getPrefixCls;
82
+ var classname = getPrefixCls('ip-address');
83
+ var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-ip-address"), !!prefixCls), classname);
84
+ var _useState = useState(function () {
85
+ return getInitialAddress(type, value);
86
+ }),
87
+ _useState2 = _slicedToArray(_useState, 2),
88
+ address = _useState2[0],
89
+ setAddress = _useState2[1];
90
+ var refs = useRef([]);
91
+ useEffect(function () {
92
+ setAddress(getInitialAddress(type, value));
93
+ }, [value, type]);
94
+ var getValue = useCallback(function (addr) {
95
+ var vals = addr.map(function (item) {
96
+ return item.value;
97
+ });
98
+ var splitSymbol = type === 'IPv6' ? ':' : '.';
99
+ if (type !== 'IPv6') return vals.join(splitSymbol);
100
+ if (normalize) return normalizeIPv6(vals.join(splitSymbol));
101
+
102
+ // 1. 去除前导零但保留至少一个0
103
+ var simplifiedSegments = vals.map(function (seg) {
104
+ if (seg === '0') return '0';
105
+ var trimmed = seg.replace(/^0+/, '');
106
+ return trimmed === '' ? '0' : trimmed;
107
+ });
108
+
109
+ // 2. 查找最长连续0段用于压缩
110
+ var bestZeroRange = {
111
+ start: -1,
112
+ length: 0
113
+ };
114
+ var currentZeroStart = -1;
115
+ simplifiedSegments.forEach(function (seg, i) {
116
+ if (seg === '0') {
117
+ if (currentZeroStart === -1) currentZeroStart = i;
118
+ var currentLength = i - currentZeroStart + 1;
119
+ if (currentLength > bestZeroRange.length) {
120
+ bestZeroRange = {
121
+ start: currentZeroStart,
122
+ length: currentLength
123
+ };
124
+ }
125
+ } else {
126
+ currentZeroStart = -1;
127
+ }
128
+ });
129
+
130
+ // 3. 生成压缩后的地址
131
+ if (bestZeroRange.length >= 2) {
132
+ var before = simplifiedSegments.slice(0, bestZeroRange.start);
133
+ var after = simplifiedSegments.slice(bestZeroRange.start + bestZeroRange.length);
134
+ var beforeStr = before.join(':');
135
+ var afterStr = after.join(':');
136
+
137
+ // 处理边界情况
138
+ if (before.length === 0 && after.length === 0) return '::'; // 全零情况
139
+ if (before.length === 0) return '::' + afterStr; // 开头压缩
140
+ if (after.length === 0) return beforeStr + '::'; // 结尾压缩
141
+
142
+ return beforeStr + '::' + afterStr;
143
+ }
144
+ return simplifiedSegments.join(':');
145
+ }, [type, normalize]);
146
+ var handleInput = useCallback(function (idx, v) {
147
+ var nv = v;
148
+ var maxLen = type === 'IPv6' ? 4 : 3;
149
+ if (type === 'IPv6') {
150
+ nv = v.replace(/[^a-fA-F0-9]/g, '').toLowerCase();
151
+ } else {
152
+ nv = v.replace(/\D/g, '');
153
+ if (nv && parseInt(nv, 10) > 255) {
154
+ nv = '255';
155
+ }
156
+ }
157
+ if (nv.length > maxLen) nv = nv.slice(0, maxLen);
158
+ var next = address.map(function (item, i) {
159
+ return i === idx ? {
160
+ value: nv
161
+ } : item;
162
+ });
163
+ setAddress(next);
164
+ if (onChange) {
165
+ onChange(getValue(next));
166
+ }
167
+ }, [address, autoComplete, getValue, onChange, type]);
168
+ // 自动聚焦下一个输入框
169
+ var handleKeyUp = useCallback(function (idx, value, event) {
170
+ if (event.key === 'Backspace') return;
171
+ if (autoComplete && (type === 'IPv4' && value.length === 3 && idx < 3 || type === 'IPv6' && value.length === 4 && idx < 7)) {
172
+ var _refs$current;
173
+ (_refs$current = refs.current[idx + 1]) === null || _refs$current === void 0 || _refs$current.focus();
174
+ }
175
+ }, [type, autoComplete]);
176
+ var handleKeyDown = useCallback(function (idx, value, event) {
177
+ if (event.key === 'Backspace' && value === '' && idx > 0) {
178
+ var _refs$current2;
179
+ event.preventDefault();
180
+ (_refs$current2 = refs.current[idx - 1]) === null || _refs$current2 === void 0 || _refs$current2.focus();
181
+ }
182
+ }, []);
183
+ var handleFocus = function handleFocus(idx, value) {
184
+ onFocus === null || onFocus === void 0 || onFocus(value, idx);
185
+ };
186
+ var handleBlur = function handleBlur(idx, value) {
187
+ onBlur === null || onBlur === void 0 || onBlur(value, idx);
188
+ };
189
+ var renderDelimiter = function renderDelimiter() {
190
+ if (delimiter) return /*#__PURE__*/_jsx("span", {
191
+ children: delimiter
192
+ });
193
+ return type === 'IPv6' ? /*#__PURE__*/_jsx("span", {
194
+ style: {
195
+ margin: '0 2px',
196
+ color: '#00000060'
197
+ },
198
+ children: ":"
199
+ }) : /*#__PURE__*/_jsx("span", {
200
+ style: {
201
+ margin: '0 2px',
202
+ color: '#00000060'
203
+ },
204
+ children: "\xB7"
205
+ });
206
+ };
207
+ return /*#__PURE__*/_jsx("div", {
208
+ className: "".concat(wrapperClass, " ").concat(className, " ").concat(size, " ").concat(disabled ? 'disabled' : '', " ").concat(readOnly ? 'readonly' : ''),
209
+ style: style,
210
+ children: address.map(function (item, idx) {
211
+ return /*#__PURE__*/_jsxs(React.Fragment, {
212
+ children: [/*#__PURE__*/_jsx("input", _objectSpread({
213
+ id: "ip-address-input-".concat(idx),
214
+ ref: function ref(el) {
215
+ return refs.current[idx] = el;
216
+ },
217
+ type: type === 'IPv4' ? 'number' : 'text',
218
+ value: item.value || undefined,
219
+ readOnly: readOnly,
220
+ disabled: disabled,
221
+ maxLength: type === 'IPv6' ? 4 : 3,
222
+ style: _objectSpread({
223
+ width: type === 'IPv6' ? '4em' : '3em',
224
+ textAlign: 'center',
225
+ letterSpacing: type === 'IPv6' ? '0.1em' : undefined,
226
+ marginRight: idx < address.length - 1 ? 0 : undefined
227
+ }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.style),
228
+ onChange: function onChange(e) {
229
+ return handleInput(idx, e.target.value);
230
+ },
231
+ onKeyUp: function onKeyUp(e) {
232
+ return handleKeyUp(idx, item.value, e);
233
+ },
234
+ onKeyDown: function onKeyDown(e) {
235
+ return handleKeyDown(idx, item.value, e);
236
+ },
237
+ onFocus: function onFocus(e) {
238
+ return handleFocus(idx, e.target.value);
239
+ },
240
+ onBlur: function onBlur(e) {
241
+ return handleBlur(idx, e.target.value);
242
+ }
243
+ }, inputProps)), idx < address.length - 1 && renderDelimiter()]
244
+ }, idx);
245
+ })
246
+ });
247
+ };
248
+ export default IPAddress;
@@ -0,0 +1,75 @@
1
+ @import '../commonStyle/index.less';
2
+
3
+ .@{prefix}-ip-address {
4
+ border: 1px solid #d9d9d9;
5
+ border-radius: 2px;
6
+ transition: all 0.3s;
7
+ display: inline-block;
8
+
9
+ &.small {
10
+ height: 24px;
11
+ }
12
+
13
+ &.large {
14
+ padding: 6.5px 10px;
15
+ }
16
+
17
+ &.middle {
18
+ padding: 4px 10px;
19
+ }
20
+
21
+ &.disabled {
22
+ color: rgba(0, 0, 0, 25%);
23
+ background-color: #f5f5f5;
24
+ border-color: #d9d9d9;
25
+ box-shadow: none;
26
+ cursor: not-allowed;
27
+ opacity: 1;
28
+
29
+ &:hover {
30
+ border-color: #d9d9d9;
31
+ }
32
+ }
33
+
34
+ &:hover {
35
+ border-color: #4d90ff;
36
+ }
37
+
38
+ &:focus-within {
39
+ border-color: #40a9ff;
40
+ box-shadow: 0 0 0 2px rgba(24, 144, 255, 20%);
41
+ }
42
+
43
+ input {
44
+ border: none;
45
+ background: none;
46
+ text-align: center;
47
+ outline: 0;
48
+ padding: 0;
49
+ margin: 0;
50
+ box-sizing: border-box;
51
+ font-variant: tabular-nums;
52
+ font-feature-settings: 'tnum';
53
+ position: relative;
54
+ display: inline-block;
55
+ color: #000000d9;
56
+ font-size: 14px;
57
+ line-height: 1.5715;
58
+ }
59
+
60
+ input[disabled] {
61
+ cursor: not-allowed;
62
+ color: inherit;
63
+ }
64
+
65
+ input[type='number'] {
66
+ appearance: textfield; /* 移除Firefox的特殊样式 */
67
+ }
68
+
69
+ /* 移除上下箭头 */
70
+ input[type='number']::-webkit-outer-spin-button,
71
+ input[type='number']::-webkit-inner-spin-button {
72
+ appearance: none;
73
+ margin: 0;
74
+ }
75
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { getTwoToneColor, setTwoToneColor } from '@ant-design/icons';
3
+ declare const setIconfontScriptUrl: (urls: string | string[]) => void;
4
+ export interface IconFontProps {
5
+ type: string;
6
+ scriptUrl?: string | string[];
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ onClick?: React.MouseEventHandler<HTMLElement>;
10
+ }
11
+ interface IconFontType extends React.FC<IconFontProps> {
12
+ setIconfontScriptUrl: typeof setIconfontScriptUrl;
13
+ getTWoToneColor: typeof getTwoToneColor;
14
+ setTwoToneColor: typeof setTwoToneColor;
15
+ }
16
+ declare const IconFont: IconFontType;
17
+ export default IconFont;
@@ -0,0 +1,27 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["scriptUrl"];
4
+ import React from 'react';
5
+ import { createFromIconfontCN, getTwoToneColor, setTwoToneColor } from '@ant-design/icons';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ var scriptUrls = [];
8
+ var setIconfontScriptUrl = function setIconfontScriptUrl(urls) {
9
+ scriptUrls = Array.isArray(urls) ? urls : [urls];
10
+ };
11
+ var IconFont = function IconFont(_ref) {
12
+ var propScriptUrl = _ref.scriptUrl,
13
+ restProps = _objectWithoutProperties(_ref, _excluded);
14
+ var finalScriptUrls = propScriptUrl ? Array.isArray(propScriptUrl) ? propScriptUrl : [propScriptUrl] : scriptUrls;
15
+ if (!finalScriptUrls.length) {
16
+ console.error('IconFont 组件需要配置 scriptUrl,请在项目入口处先调用 setIconfontScriptUrl() 或在组件 props 中传入 scriptUrl');
17
+ return null;
18
+ }
19
+ var IconComponent = createFromIconfontCN({
20
+ scriptUrl: finalScriptUrls
21
+ });
22
+ return /*#__PURE__*/_jsx(IconComponent, _objectSpread({}, restProps));
23
+ };
24
+ IconFont.setIconfontScriptUrl = setIconfontScriptUrl;
25
+ IconFont.getTWoToneColor = getTwoToneColor;
26
+ IconFont.setTwoToneColor = setTwoToneColor;
27
+ export default IconFont;
@@ -48,6 +48,15 @@ interface ISLProps<T, P> {
48
48
  * @default 200
49
49
  */
50
50
  visibilityHeight?: number;
51
+ /**
52
+ * @description 是否显示 BackTop
53
+ * @default false
54
+ */
55
+ showBackTop?: boolean;
56
+ /**
57
+ * @description 列表底部提示
58
+ */
59
+ endMessage?: React.ReactNode;
51
60
  }
52
61
  export declare type InfiniteScrollListProps<T, P> = ISLProps<T, P>;
53
62
  declare const _default: React.MemoExoticComponent<(<T, P>(props: ISLProps<T, P>) => import("react/jsx-runtime").JSX.Element)>;