@chaoswise/ui 3.1.16 → 3.1.17
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/lib/Antd5/_util/isNumeric.js +4 -0
- package/lib/Antd5/avatar/group.js +121 -0
- package/lib/Antd5/button/LoadingIcon.js +82 -0
- package/lib/Antd5/pagination/Select.js +24 -0
- package/lib/BasicLayout/locale/en_US.js +4 -0
- package/lib/BasicLayout/locale/index.js +11 -0
- package/lib/BasicLayout/locale/zh_CN.js +4 -0
- package/lib/BasicLayout/locale/zh_TW.js +4 -0
- package/lib/CWColorPicker/index.js +44 -44
- package/lib/CWMessage/MessageContent/TabList/index.js +13 -13
- package/lib/CWMessage/MessageContent/index.js +24 -24
- package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -7
- package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +14 -14
- package/lib/CWRangePicker/DropdownMenu/index.js +34 -34
- package/lib/CWRangePicker/Refresh/index.js +12 -12
- package/lib/CWRangePicker/TimeSpan/index.js +14 -14
- package/lib/CWRangePicker/index.js +56 -56
- package/lib/CWRangePicker/utils/generate/dayjs.js +110 -93
- package/lib/CWRangePicker/utils/generate/moment.js +99 -82
- package/lib/CWTable/assets/DownGraySvg.js +16 -0
- package/lib/CWTable/assets/DownLightSvg.js +16 -0
- package/lib/CWTable/assets/SortSvg.js +16 -0
- package/lib/CWTable/assets/SortingSvg.js +16 -0
- package/lib/CWTable/assets/UpGraySvg.js +15 -0
- package/lib/CWTable/assets/UpLightSvg.js +15 -0
- package/lib/CWTree/locale/en_US.js +3 -0
- package/lib/CWTree/locale/index.js +11 -0
- package/lib/CWTree/locale/zh_CN.js +3 -0
- package/lib/CWTree/locale/zh_TW.js +3 -0
- package/lib/ConfigProvider/ConfigProvider.js +6 -0
- package/lib/ConfigProvider/generate/dayjs.js +4 -0
- package/lib/Empty/index.js +10 -10
- package/lib/ErrorBoundary/ErrorPage.js +10 -10
- package/lib/Exception/index.js +22 -22
- package/lib/FilterDropDown/index.js +19 -19
- package/lib/Header/Document/index.js +5 -5
- package/lib/IconSelect/components/CustomImg/index.js +10 -10
- package/lib/IconSelect/components/SearchIcon/index.js +8 -8
- package/lib/IconSelect/index.js +16 -16
- package/lib/Joyride/List.js +11 -11
- package/lib/Joyride/index.js +55 -55
- package/lib/Pagination/index.js +34 -34
- package/lib/QuickTransfer/DragList.js +15 -15
- package/lib/QuickTransfer/index.js +59 -59
- package/lib/RangePicker/components/ExtraTimeFooter.js +1 -1
- package/lib/SearchBar/index.js +40 -40
- package/lib/TimeRangeSlider/Refresh/index.js +11 -11
- package/lib/TimeRangeSlider/TimeSpan/index.js +13 -13
- package/lib/TimeRangeSlider/index.js +32 -32
- package/lib/TimeRangeSlider/utils/generate/moment.js +106 -89
- package/lib/locales/en_US.json +1 -86
- package/lib/locales/index.js +11 -0
- package/lib/locales/ja_JP.json +1 -0
- package/lib/locales/zh_CN.json +1 -86
- package/lib/locales/zh_TW.json +1 -86
- package/package.json +2 -1
- /package/lib/Antd5/avatar/{Avatar.js → avatar.js} +0 -0
package/lib/Joyride/index.js
CHANGED
|
@@ -15,17 +15,17 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
15
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
16
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
18
|
-
import React, { useState, useEffect, useMemo, Fragment } from
|
|
19
|
-
import Joyride, { STATUS, ACTIONS } from
|
|
20
|
-
import PropTypes from
|
|
21
|
-
import welcomeImg from
|
|
22
|
-
import finishImg from
|
|
23
|
-
import List from
|
|
24
|
-
import { ArrowRightOutlined } from
|
|
25
|
-
import { merge } from
|
|
26
|
-
import useConfigContext from
|
|
27
|
-
import useStyle from
|
|
28
|
-
import { useIntl } from
|
|
18
|
+
import React, { useState, useEffect, useMemo, Fragment } from 'react';
|
|
19
|
+
import Joyride, { STATUS, ACTIONS } from 'react-joyride';
|
|
20
|
+
import PropTypes from 'prop-types';
|
|
21
|
+
import welcomeImg from './img/welcomeImg.png';
|
|
22
|
+
import finishImg from './img/finishImg.png';
|
|
23
|
+
import List from './List';
|
|
24
|
+
import { ArrowRightOutlined } from '@ant-design/icons';
|
|
25
|
+
import { merge } from 'lodash-es';
|
|
26
|
+
import useConfigContext from '../useConfigContext';
|
|
27
|
+
import useStyle from './style/index.style';
|
|
28
|
+
import { useIntl } from '../locales';
|
|
29
29
|
/**
|
|
30
30
|
* 基于react-joyride封装,支持全部 react-joyride api 具体参考文档:https://www.npmjs.com/package/react-joyride
|
|
31
31
|
*/
|
|
@@ -62,7 +62,7 @@ function CWJoyride(_ref) {
|
|
|
62
62
|
var intl = useIntl();
|
|
63
63
|
var _useConfigContext = useConfigContext(),
|
|
64
64
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
65
|
-
var prefixCls = getPrefixCls(
|
|
65
|
+
var prefixCls = getPrefixCls('joyride');
|
|
66
66
|
var _useStyle = useStyle(prefixCls),
|
|
67
67
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
68
68
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -102,25 +102,25 @@ function CWJoyride(_ref) {
|
|
|
102
102
|
return steps.map(function (item, index) {
|
|
103
103
|
var defaultStyles = {
|
|
104
104
|
options: {
|
|
105
|
-
backgroundColor:
|
|
106
|
-
primaryColor:
|
|
105
|
+
backgroundColor: '#fff',
|
|
106
|
+
primaryColor: '#fff'
|
|
107
107
|
},
|
|
108
108
|
tooltip: {
|
|
109
|
-
padding:
|
|
109
|
+
padding: '12px 12px 8px 12px'
|
|
110
110
|
},
|
|
111
111
|
tooltipTitle: {
|
|
112
112
|
marginBottom: 8,
|
|
113
|
-
padding:
|
|
113
|
+
padding: '0 8px',
|
|
114
114
|
fontSize: 12,
|
|
115
115
|
fontWeight: 400
|
|
116
116
|
},
|
|
117
117
|
tooltipContainer: {
|
|
118
|
-
textAlign:
|
|
118
|
+
textAlign: 'left'
|
|
119
119
|
},
|
|
120
120
|
tooltipContent: {
|
|
121
|
-
padding:
|
|
122
|
-
lineHeight:
|
|
123
|
-
color:
|
|
121
|
+
padding: '0 8px',
|
|
122
|
+
lineHeight: '20px',
|
|
123
|
+
color: 'rgba(0, 0, 0, .85)',
|
|
124
124
|
fontSize: 12
|
|
125
125
|
},
|
|
126
126
|
tooltipFooter: {
|
|
@@ -143,12 +143,12 @@ function CWJoyride(_ref) {
|
|
|
143
143
|
disableBeacon: true,
|
|
144
144
|
title: /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
145
145
|
style: {
|
|
146
|
-
color:
|
|
146
|
+
color: 'rgba(0, 0, 0, .85)',
|
|
147
147
|
fontWeight: 500
|
|
148
148
|
}
|
|
149
149
|
}, index + 1), "/", /*#__PURE__*/React.createElement("span", {
|
|
150
150
|
style: {
|
|
151
|
-
color:
|
|
151
|
+
color: 'rgba(0, 0, 0, .45)'
|
|
152
152
|
}
|
|
153
153
|
}, steps.length))
|
|
154
154
|
}, item), {}, {
|
|
@@ -157,24 +157,24 @@ function CWJoyride(_ref) {
|
|
|
157
157
|
locale: _objectSpread({
|
|
158
158
|
skip: /*#__PURE__*/React.createElement("span", {
|
|
159
159
|
style: {
|
|
160
|
-
color:
|
|
160
|
+
color: '#8C8C8C'
|
|
161
161
|
}
|
|
162
|
-
}, intl.get(
|
|
162
|
+
}, intl.get('6356dd5c-b99d-4b34-acb3-683e4d5edb40').d('跳过')),
|
|
163
163
|
next: /*#__PURE__*/React.createElement("span", {
|
|
164
164
|
style: {
|
|
165
|
-
color:
|
|
165
|
+
color: '#1890FF'
|
|
166
166
|
}
|
|
167
|
-
}, intl.get(
|
|
167
|
+
}, intl.get('989a0bb6-6956-41d0-b5c2-329f8b1e846c').d('下一步')),
|
|
168
168
|
last: /*#__PURE__*/React.createElement("span", {
|
|
169
169
|
style: {
|
|
170
|
-
color:
|
|
170
|
+
color: '#1890FF'
|
|
171
171
|
}
|
|
172
|
-
}, intl.get(
|
|
172
|
+
}, intl.get('668ced11-e48e-4717-ab82-dfb75ca2a7c9').d('完成')),
|
|
173
173
|
back: /*#__PURE__*/React.createElement("span", {
|
|
174
174
|
style: {
|
|
175
|
-
color:
|
|
175
|
+
color: '#5D5D5D'
|
|
176
176
|
}
|
|
177
|
-
}, intl.get(
|
|
177
|
+
}, intl.get('dd25dcba-5aea-4f44-9653-9ff61442e830').d('上一步'))
|
|
178
178
|
}, item.locale || {})
|
|
179
179
|
});
|
|
180
180
|
});
|
|
@@ -193,10 +193,10 @@ function CWJoyride(_ref) {
|
|
|
193
193
|
* 判断下一步是全部完成还是去下一个提示
|
|
194
194
|
*/
|
|
195
195
|
var judgeIsAllFinished = function judgeIsAllFinished(data) {
|
|
196
|
-
if (typeof data ===
|
|
196
|
+
if (typeof data === 'boolean') {
|
|
197
197
|
return data;
|
|
198
198
|
}
|
|
199
|
-
if (_typeof(data) ===
|
|
199
|
+
if (_typeof(data) === 'object') {
|
|
200
200
|
return data.isAllFinish;
|
|
201
201
|
}
|
|
202
202
|
return false;
|
|
@@ -205,13 +205,13 @@ function CWJoyride(_ref) {
|
|
|
205
205
|
callback(data);
|
|
206
206
|
|
|
207
207
|
// 点击关闭
|
|
208
|
-
if (data.lifecycle ===
|
|
208
|
+
if (data.lifecycle === 'complete' && data.action === 'close') {
|
|
209
209
|
setIsClose(true);
|
|
210
210
|
onClose(data);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// 点击完成 跳过和点击完成都算完成
|
|
214
|
-
if (data.lifecycle ===
|
|
214
|
+
if (data.lifecycle === 'complete' && (data.status === 'skipped' || data.status === 'finished') || data.type === 'tour:end') {
|
|
215
215
|
new Promise(function (resolve, reject) {
|
|
216
216
|
try {
|
|
217
217
|
resolve(onFinished(data));
|
|
@@ -286,38 +286,38 @@ function CWJoyride(_ref) {
|
|
|
286
286
|
}, rest)), /*#__PURE__*/React.createElement(_Modal, {
|
|
287
287
|
visible: welcomeVisible,
|
|
288
288
|
footer: null,
|
|
289
|
-
width:
|
|
289
|
+
width: 500,
|
|
290
290
|
onCancel: onHomeWelecomClose,
|
|
291
291
|
className: "".concat(prefixCls, "-modal")
|
|
292
292
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
293
293
|
style: {
|
|
294
|
-
width:
|
|
294
|
+
width: '100%'
|
|
295
295
|
},
|
|
296
296
|
src: welcomeImg
|
|
297
297
|
})), /*#__PURE__*/React.createElement("div", {
|
|
298
298
|
style: {
|
|
299
|
-
padding:
|
|
299
|
+
padding: '20px 20px 40px 20px'
|
|
300
300
|
}
|
|
301
301
|
}, /*#__PURE__*/React.createElement("div", {
|
|
302
302
|
style: {
|
|
303
303
|
fontSize: 22,
|
|
304
|
-
color:
|
|
304
|
+
color: '#000',
|
|
305
305
|
fontWeight: 500
|
|
306
306
|
}
|
|
307
|
-
}, intl.get(
|
|
307
|
+
}, intl.get('ff0c5073-02d4-471f-b34c-e47d916c1911').d('欢迎来到~')), /*#__PURE__*/React.createElement("div", {
|
|
308
308
|
style: {
|
|
309
309
|
fontSize: 26,
|
|
310
|
-
color:
|
|
310
|
+
color: '#000',
|
|
311
311
|
fontWeight: 600,
|
|
312
312
|
marginBottom: 24
|
|
313
313
|
}
|
|
314
|
-
}, intl.get(
|
|
314
|
+
}, intl.get('40dceacf-eb4e-47d8-a61d-ea64d4136994').d('云智慧IT服务管理系统')), /*#__PURE__*/React.createElement("span", {
|
|
315
315
|
className: "".concat(prefixCls, "-back"),
|
|
316
316
|
onClick: welcomeHandleCancel
|
|
317
|
-
}, intl.get(
|
|
317
|
+
}, intl.get('d8ae6e8c-be05-42dd-9724-63e866dae1eb').d('我不想进入')), /*#__PURE__*/React.createElement("span", {
|
|
318
318
|
className: "".concat(prefixCls, "-enter"),
|
|
319
319
|
onClick: welcomeHandleOk
|
|
320
|
-
}, intl.get(
|
|
320
|
+
}, intl.get('40f0805b-6978-4e6e-92af-88bc3720b2e9').d('让我们开始新手指引吧'), /*#__PURE__*/React.createElement(ArrowRightOutlined, {
|
|
321
321
|
className: "".concat(prefixCls, "-icon")
|
|
322
322
|
})))), /*#__PURE__*/React.createElement(_Modal, {
|
|
323
323
|
visible: taskVisible,
|
|
@@ -330,30 +330,30 @@ function CWJoyride(_ref) {
|
|
|
330
330
|
className: "".concat(prefixCls, "-modal")
|
|
331
331
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
332
332
|
style: {
|
|
333
|
-
width:
|
|
333
|
+
width: '100%'
|
|
334
334
|
},
|
|
335
335
|
src: finishImg
|
|
336
336
|
})), /*#__PURE__*/React.createElement("div", {
|
|
337
337
|
style: {
|
|
338
|
-
padding:
|
|
338
|
+
padding: '24px 40px 32px '
|
|
339
339
|
}
|
|
340
340
|
}, /*#__PURE__*/React.createElement("div", {
|
|
341
341
|
className: "".concat(prefixCls, "-finish-title")
|
|
342
|
-
}, intl.get(
|
|
342
|
+
}, intl.get('909d3868-2a03-48ce-a55c-68c788869ae7').d('非常好!您已经完成此任务!')), /*#__PURE__*/React.createElement("div", {
|
|
343
343
|
style: {
|
|
344
344
|
fontSize: 16,
|
|
345
345
|
marginBottom: 24
|
|
346
346
|
},
|
|
347
347
|
className: "".concat(prefixCls, "-finish-title")
|
|
348
|
-
}, intl.get(
|
|
348
|
+
}, intl.get('627a6799-d6da-421d-a2c4-d6982c27a258').d('需要继续下一个任务吗?')), /*#__PURE__*/React.createElement("div", {
|
|
349
349
|
className: "".concat(prefixCls, "-bottom")
|
|
350
350
|
}, /*#__PURE__*/React.createElement("span", {
|
|
351
351
|
className: "".concat(prefixCls, "-back"),
|
|
352
352
|
onClick: taskHandleCancel
|
|
353
|
-
}, intl.get(
|
|
353
|
+
}, intl.get('8ad38206-e527-4375-8714-7374072d71c0').d('不想继续了')), /*#__PURE__*/React.createElement("span", {
|
|
354
354
|
className: "".concat(prefixCls, "-enter"),
|
|
355
355
|
onClick: taskHandleOk
|
|
356
|
-
}, intl.get(
|
|
356
|
+
}, intl.get('e82f751b-a078-4745-8f37-c0f9defd2644').d('继续下一个任务'), /*#__PURE__*/React.createElement(ArrowRightOutlined, {
|
|
357
357
|
className: "".concat(prefixCls, "-icon")
|
|
358
358
|
}))))), /*#__PURE__*/React.createElement(_Modal, {
|
|
359
359
|
visible: finishVisible,
|
|
@@ -366,30 +366,30 @@ function CWJoyride(_ref) {
|
|
|
366
366
|
className: "".concat(prefixCls, "-modal")
|
|
367
367
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
|
|
368
368
|
style: {
|
|
369
|
-
width:
|
|
369
|
+
width: '100%'
|
|
370
370
|
},
|
|
371
371
|
src: finishImg
|
|
372
372
|
})), /*#__PURE__*/React.createElement("div", {
|
|
373
373
|
style: {
|
|
374
|
-
padding:
|
|
374
|
+
padding: '24px 54px 32px '
|
|
375
375
|
}
|
|
376
376
|
}, /*#__PURE__*/React.createElement("div", {
|
|
377
377
|
className: "".concat(prefixCls, "-finish-title")
|
|
378
|
-
}, intl.get(
|
|
378
|
+
}, intl.get('2f8e550a-ddca-47e6-92d2-5fee375fcf15').d('恭喜您已经完成所有任务!')), /*#__PURE__*/React.createElement("div", {
|
|
379
379
|
style: {
|
|
380
380
|
fontSize: 16,
|
|
381
381
|
marginBottom: 24
|
|
382
382
|
},
|
|
383
383
|
className: "".concat(prefixCls, "-finish-title")
|
|
384
|
-
}, intl.get(
|
|
384
|
+
}, intl.get('284a1c6c-017a-4483-a2f4-29cb277e7c8a').d('再看一次新手引导吗?')), /*#__PURE__*/React.createElement("div", {
|
|
385
385
|
className: "".concat(prefixCls, "-bottom")
|
|
386
386
|
}, /*#__PURE__*/React.createElement("span", {
|
|
387
387
|
className: "".concat(prefixCls, "-back"),
|
|
388
388
|
onClick: finishHandleCancel
|
|
389
|
-
}, intl.get(
|
|
389
|
+
}, intl.get('9b4d6b14-8eee-4158-9dff-2055c1bb7d7d').d('不了')), /*#__PURE__*/React.createElement("span", {
|
|
390
390
|
className: "".concat(prefixCls, "-enter"),
|
|
391
391
|
onClick: finishHandleOk
|
|
392
|
-
}, intl.get(
|
|
392
|
+
}, intl.get('677bd887-3b74-4c5a-8f47-b942e4b5d2b8').d('再看一次新手指引'), /*#__PURE__*/React.createElement(ArrowRightOutlined, {
|
|
393
393
|
className: "".concat(prefixCls, "-icon")
|
|
394
394
|
})))))));
|
|
395
395
|
}
|
package/lib/Pagination/index.js
CHANGED
|
@@ -16,15 +16,15 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
16
16
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
17
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
18
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
-
import React, { useState, useEffect, useRef, useCallback, useMemo } from
|
|
19
|
+
import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
20
20
|
// TODO: Select需要等到CwSelect迁移后替换
|
|
21
|
-
import Pagination from
|
|
22
|
-
import SimplePagination from
|
|
23
|
-
import useConfigContext from
|
|
24
|
-
import PropTypes from
|
|
25
|
-
import classnames from
|
|
26
|
-
import { useIntl } from
|
|
27
|
-
import useStyle from
|
|
21
|
+
import Pagination from '../Antd5/pagination';
|
|
22
|
+
import SimplePagination from '../SimplePagination';
|
|
23
|
+
import useConfigContext from '../useConfigContext';
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import classnames from 'classnames';
|
|
26
|
+
import { useIntl } from '../locales';
|
|
27
|
+
import useStyle from './index.style';
|
|
28
28
|
var Option = _Select.Option;
|
|
29
29
|
/**
|
|
30
30
|
* 分页,基于antd的Pagination封装
|
|
@@ -35,7 +35,7 @@ function CWPagination(props) {
|
|
|
35
35
|
simple = _props$simple === void 0 ? false : _props$simple,
|
|
36
36
|
current = props.current,
|
|
37
37
|
_props$size = props.size,
|
|
38
|
-
size = _props$size === void 0 ?
|
|
38
|
+
size = _props$size === void 0 ? '' : _props$size,
|
|
39
39
|
_props$onShowSizeChan = props.onShowSizeChange,
|
|
40
40
|
_onShowSizeChange = _props$onShowSizeChan === void 0 ? function () {} : _props$onShowSizeChan,
|
|
41
41
|
_props$defaultCurrent = props.defaultCurrent,
|
|
@@ -45,7 +45,7 @@ function CWPagination(props) {
|
|
|
45
45
|
defaultPageSize = _props$defaultPageSiz === void 0 ? 30 : _props$defaultPageSiz,
|
|
46
46
|
showTotal = props.showTotal,
|
|
47
47
|
_props$pageSizeOption = props.pageSizeOptions,
|
|
48
|
-
pageSizeOptions = _props$pageSizeOption === void 0 ? [
|
|
48
|
+
pageSizeOptions = _props$pageSizeOption === void 0 ? ['10', '30', '50', '100'] : _props$pageSizeOption,
|
|
49
49
|
_props$showQuickJumpe = props.showQuickJumper,
|
|
50
50
|
showQuickJumper = _props$showQuickJumpe === void 0 ? false : _props$showQuickJumpe,
|
|
51
51
|
_props$showSizeChange = props.showSizeChanger,
|
|
@@ -63,7 +63,7 @@ function CWPagination(props) {
|
|
|
63
63
|
var intl = useIntl();
|
|
64
64
|
var _useConfigContext = useConfigContext(),
|
|
65
65
|
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
66
|
-
var prefixCls = getPrefixCls(
|
|
66
|
+
var prefixCls = getPrefixCls('pagination');
|
|
67
67
|
var _useStyle = useStyle(prefixCls),
|
|
68
68
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
69
69
|
wrapCSSVar = _useStyle2[0],
|
|
@@ -71,8 +71,8 @@ function CWPagination(props) {
|
|
|
71
71
|
cssVarCls = _useStyle2[2];
|
|
72
72
|
var _ref = (intl === null || intl === void 0 ? void 0 : intl.options) || {},
|
|
73
73
|
_ref$currentLocale = _ref.currentLocale,
|
|
74
|
-
locale = _ref$currentLocale === void 0 ?
|
|
75
|
-
var _useState = useState(
|
|
74
|
+
locale = _ref$currentLocale === void 0 ? 'zh_CN' : _ref$currentLocale;
|
|
75
|
+
var _useState = useState(''),
|
|
76
76
|
_useState2 = _slicedToArray(_useState, 2),
|
|
77
77
|
value = _useState2[0],
|
|
78
78
|
setValue = _useState2[1];
|
|
@@ -86,9 +86,9 @@ function CWPagination(props) {
|
|
|
86
86
|
setPageInfo = _useState4[1];
|
|
87
87
|
//监听跳页的鼠标动作
|
|
88
88
|
useEffect(function () {
|
|
89
|
-
document.addEventListener(
|
|
89
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
90
90
|
return function () {
|
|
91
|
-
document.removeEventListener(
|
|
91
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
92
92
|
};
|
|
93
93
|
}, []);
|
|
94
94
|
//是否受控
|
|
@@ -108,17 +108,17 @@ function CWPagination(props) {
|
|
|
108
108
|
}, []);
|
|
109
109
|
//最终显示的页码
|
|
110
110
|
var _current = useMemo(function () {
|
|
111
|
-
return Object.prototype.hasOwnProperty.call(props,
|
|
111
|
+
return Object.prototype.hasOwnProperty.call(props, 'current') ? current : pageInfo.current;
|
|
112
112
|
}, [current, pageInfo.current]);
|
|
113
113
|
var _pageSize = useMemo(function () {
|
|
114
|
-
return Object.prototype.hasOwnProperty.call(props,
|
|
114
|
+
return Object.prototype.hasOwnProperty.call(props, 'pageSize') ? pageSize : pageInfo.pageSize;
|
|
115
115
|
}, [pageSize, pageInfo.pageSize]);
|
|
116
116
|
//总页数
|
|
117
117
|
var pageCount = Math.ceil(total / _pageSize);
|
|
118
118
|
//改变页码
|
|
119
119
|
var onChange = function onChange(page) {
|
|
120
120
|
checkJumperValue(page);
|
|
121
|
-
setValue(
|
|
121
|
+
setValue('');
|
|
122
122
|
};
|
|
123
123
|
//改变每页数量
|
|
124
124
|
var handleChangePageSize = function handleChangePageSize(size) {
|
|
@@ -132,7 +132,7 @@ function CWPagination(props) {
|
|
|
132
132
|
setPageInfo(_objectSpread(_objectSpread({}, pageInfo), {}, {
|
|
133
133
|
current: currents
|
|
134
134
|
}));
|
|
135
|
-
setValue(
|
|
135
|
+
setValue('');
|
|
136
136
|
_onChange(currents, _pageSize);
|
|
137
137
|
};
|
|
138
138
|
var inputChange = function inputChange(e) {
|
|
@@ -155,13 +155,13 @@ function CWPagination(props) {
|
|
|
155
155
|
}
|
|
156
156
|
handleChangePage(current);
|
|
157
157
|
} else {
|
|
158
|
-
setValue(
|
|
158
|
+
setValue('');
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
var itemRender_ = function itemRender_(page, type, originalElement) {
|
|
162
|
-
if (type ==
|
|
162
|
+
if (type == 'jump-prev' || type == 'jump-next') {
|
|
163
163
|
return /*#__PURE__*/React.createElement("span", {
|
|
164
|
-
className: classnames(_defineProperty({}, "".concat(prefixCls, "-jump-wrapper"), size !==
|
|
164
|
+
className: classnames(_defineProperty({}, "".concat(prefixCls, "-jump-wrapper"), size !== 'small'))
|
|
165
165
|
}, originalElement);
|
|
166
166
|
}
|
|
167
167
|
return originalElement;
|
|
@@ -217,7 +217,7 @@ function CWPagination(props) {
|
|
|
217
217
|
var pageSizeSelect = !simple && showSizeChanger && !disabled ? /*#__PURE__*/React.createElement(_Select, {
|
|
218
218
|
className: "".concat(prefixCls, "-page-select"),
|
|
219
219
|
value: String(_pageSize),
|
|
220
|
-
size: size ===
|
|
220
|
+
size: size === 'small' ? 'small' : 'default',
|
|
221
221
|
onChange: function onChange(pageSize) {
|
|
222
222
|
return handleChangePageSize(pageSize);
|
|
223
223
|
},
|
|
@@ -226,32 +226,32 @@ function CWPagination(props) {
|
|
|
226
226
|
return /*#__PURE__*/React.createElement(Option, {
|
|
227
227
|
value: value,
|
|
228
228
|
key: value
|
|
229
|
-
}, intl.get(
|
|
229
|
+
}, intl.get('acf777b3-ca63-422a-bd56-05bd1bc6c789', {
|
|
230
230
|
item: value
|
|
231
|
-
}).d(
|
|
231
|
+
}).d('每页{item}条'));
|
|
232
232
|
})) : null;
|
|
233
233
|
var isShowTotal = !simple && showTotal && !disabled ? /*#__PURE__*/React.createElement("span", {
|
|
234
234
|
className: "".concat(prefixCls, "-count")
|
|
235
|
-
}, typeof showTotal ===
|
|
235
|
+
}, typeof showTotal === 'boolean' ? /*#__PURE__*/React.createElement(React.Fragment, null, locale === 'zh' || locale === 'zh_CN' || locale === 'zh_TW' ? /*#__PURE__*/React.createElement(React.Fragment, null, intl.get('3b94bb1c-e89e-46a6-9b4c-e5f2f6f4156a').d('共'), /*#__PURE__*/React.createElement("span", {
|
|
236
236
|
style: {
|
|
237
|
-
padding:
|
|
237
|
+
padding: '0 4px'
|
|
238
238
|
}
|
|
239
|
-
}, total), intl.get(
|
|
239
|
+
}, total), intl.get('28d2875b-4a3e-4f08-8f3d-8ef5dabe2273').d('条')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
240
240
|
style: {
|
|
241
|
-
padding:
|
|
241
|
+
padding: '0 4px'
|
|
242
242
|
}
|
|
243
|
-
}, total), intl.get(
|
|
243
|
+
}, total), intl.get('3b94bb1c-e89e-46a6-9b4c-e5f2f6f4156a').d('共'))) : showTotal(total, [total === 0 ? 0 : (_current - 1) * _pageSize + 1, _current * _pageSize > total ? total : _current * _pageSize], pageCount)) : null;
|
|
244
244
|
var quickjumper = !simple && showQuickJumper && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
245
245
|
className: "".concat(prefixCls, "-input-main"),
|
|
246
246
|
ref: inputRef
|
|
247
|
-
}, /*#__PURE__*/React.createElement("span", null, intl.get(
|
|
247
|
+
}, /*#__PURE__*/React.createElement("span", null, intl.get('297787d3-d373-4a86-bd3e-ccd9a61e984e').d('跳到')), /*#__PURE__*/React.createElement(_Input, {
|
|
248
248
|
value: value,
|
|
249
|
-
size: size ===
|
|
249
|
+
size: size === 'small' ? 'small' : 'default',
|
|
250
250
|
onPressEnter: inputEnterHandle,
|
|
251
251
|
onBlur: inputBlurAndEnterHandle,
|
|
252
252
|
className: "".concat(prefixCls, "-jump-input"),
|
|
253
253
|
onChange: inputChange
|
|
254
|
-
}), /*#__PURE__*/React.createElement("span", null, intl.get(
|
|
254
|
+
}), /*#__PURE__*/React.createElement("span", null, intl.get('fa5b42d7-f0cb-4866-8ac9-217633e7aff9').d('页')));
|
|
255
255
|
var finalRenderPagination = wrapCSSVar(/*#__PURE__*/React.createElement("div", {
|
|
256
256
|
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-wrapper")),
|
|
257
257
|
ref: wrapperRef
|
|
@@ -280,7 +280,7 @@ function CWPagination(props) {
|
|
|
280
280
|
disabled: disabled,
|
|
281
281
|
hideOnSinglePage: hideOnSinglePage,
|
|
282
282
|
showSizeChanger: false,
|
|
283
|
-
itemRender:
|
|
283
|
+
itemRender: 'itemRender' in props ? itemRender : itemRender_
|
|
284
284
|
}, rest)), quickjumper))));
|
|
285
285
|
return !hideOnSinglePage ? finalRenderPagination : pageCount > 1 ? finalRenderPagination : null;
|
|
286
286
|
}
|
|
@@ -10,13 +10,13 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
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
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
-
import React, { Fragment, useRef } from
|
|
14
|
-
import { useDrag, useDrop } from
|
|
15
|
-
import { CloseOutlined } from
|
|
16
|
-
import classnames from
|
|
17
|
-
import LockSvg from
|
|
18
|
-
import DragSvg from
|
|
19
|
-
import { useIntl } from
|
|
13
|
+
import React, { Fragment, useRef } from 'react';
|
|
14
|
+
import { useDrag, useDrop } from 'react-dnd';
|
|
15
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
16
|
+
import classnames from 'classnames';
|
|
17
|
+
import LockSvg from './assets/LockSvg';
|
|
18
|
+
import DragSvg from './assets/DragSvg';
|
|
19
|
+
import { useIntl } from '../locales';
|
|
20
20
|
var DragList = function DragList(_ref) {
|
|
21
21
|
var index = _ref.index,
|
|
22
22
|
listItem = _ref.listItem,
|
|
@@ -34,14 +34,14 @@ var DragList = function DragList(_ref) {
|
|
|
34
34
|
var dragRef = useRef(null);
|
|
35
35
|
var _useDrag = useDrag({
|
|
36
36
|
item: {
|
|
37
|
-
type:
|
|
37
|
+
type: 'transferDrag',
|
|
38
38
|
index: index
|
|
39
39
|
}
|
|
40
40
|
}),
|
|
41
41
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
42
42
|
drag = _useDrag2[1];
|
|
43
43
|
var _useDrop = useDrop({
|
|
44
|
-
accept:
|
|
44
|
+
accept: 'transferDrag',
|
|
45
45
|
hover: function hover(item) {
|
|
46
46
|
if (!isHoverSwitching) return;
|
|
47
47
|
//拖拽目标的Index
|
|
@@ -63,7 +63,7 @@ var DragList = function DragList(_ref) {
|
|
|
63
63
|
}
|
|
64
64
|
return {
|
|
65
65
|
isOver: monitor.isOver(),
|
|
66
|
-
dropClassName: dragIndex < index ?
|
|
66
|
+
dropClassName: dragIndex < index ? 'drop-over-downward' : 'drop-over-upward'
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
drop: function drop(item) {
|
|
@@ -80,7 +80,7 @@ var DragList = function DragList(_ref) {
|
|
|
80
80
|
return /*#__PURE__*/React.createElement("div", null, renderColumns.map(function (item, index) {
|
|
81
81
|
return /*#__PURE__*/React.createElement("span", {
|
|
82
82
|
style: {
|
|
83
|
-
marginRight:
|
|
83
|
+
marginRight: '8px'
|
|
84
84
|
},
|
|
85
85
|
key: index
|
|
86
86
|
}, render(listItem[item]));
|
|
@@ -89,13 +89,13 @@ var DragList = function DragList(_ref) {
|
|
|
89
89
|
var renderPrefixIcon = /*#__PURE__*/React.createElement("div", {
|
|
90
90
|
className: "cw-transfer-right-content-item-prefix-icon-wrapper"
|
|
91
91
|
}, disabled ? /*#__PURE__*/React.createElement(LockSvg, null) : /*#__PURE__*/React.createElement(_Tooltip, {
|
|
92
|
-
title: intl.get(
|
|
92
|
+
title: intl.get('5fe60774-0f08-450f-a9d9-998996485fec').d('拖拽移动')
|
|
93
93
|
}, /*#__PURE__*/React.createElement(DragSvg, null)));
|
|
94
94
|
var renderItemContent = /*#__PURE__*/React.createElement("div", {
|
|
95
95
|
className: "cw-transfer-right-content-item"
|
|
96
96
|
}, hasPrefixIcon && renderPrefixIcon, /*#__PURE__*/React.createElement("div", {
|
|
97
97
|
className: "cw-transfer-right-content-item-text-wrapper"
|
|
98
|
-
}, type ===
|
|
98
|
+
}, type === 'table' ? renderTable(listItem) : render(title)), !disabled && /*#__PURE__*/React.createElement(CloseOutlined, {
|
|
99
99
|
className: "cw-transfer-right-content-del",
|
|
100
100
|
onClick: function onClick() {
|
|
101
101
|
return handleDelete(listItem);
|
|
@@ -104,11 +104,11 @@ var DragList = function DragList(_ref) {
|
|
|
104
104
|
var dragProps = dragList && !disabled ? {
|
|
105
105
|
ref: drag(drop(dragRef)),
|
|
106
106
|
style: {
|
|
107
|
-
cursor:
|
|
107
|
+
cursor: 'move'
|
|
108
108
|
}
|
|
109
109
|
} : {};
|
|
110
110
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
111
|
-
className: classnames(
|
|
111
|
+
className: classnames('cw-transfer-right-content-main', _defineProperty({}, dropClassName, isOver && !isHoverSwitching))
|
|
112
112
|
}, dragProps), renderItemContent));
|
|
113
113
|
};
|
|
114
114
|
export default DragList;
|