@para-ui/core 4.0.3 → 4.0.5
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/ComboSelect/index.js +1 -1
- package/CycleSelector/index.d.ts +15 -1
- package/CycleSelector/index.js +104 -37
- package/CycleSelector/lang/en_US.d.ts +2 -1
- package/CycleSelector/lang/index.d.ts +4 -2
- package/CycleSelector/lang/zh_CN.d.ts +2 -1
- package/DynamicMultiBox/index.js +18 -2
- package/Form/index.js +2 -2
- package/FormItem/index.js +2 -2
- package/GlobalContext/componentsProps.d.ts +2 -0
- package/InputLang/index.d.ts +7 -3
- package/InputLang/index.js +33 -8
- package/README.md +12 -0
- package/Tree/index.js +2 -2
- package/Utils/index.d.ts +13 -0
- package/Utils/index.js +22 -0
- package/_verture/{index-e3011376.js → index-767e63dd.js} +1 -1
- package/index.d.ts +2 -0
- package/index.js +3 -2
- package/locale/en-US.d.ts +2 -1
- package/locale/index.d.ts +4 -2
- package/locale/index.js +6 -4
- package/locale/zh-CN.d.ts +2 -1
- package/package.json +1 -1
- package/umd/ComboSelect.js +1 -1
- package/umd/CycleSelector.js +4 -4
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/Tree.js +1 -1
- package/umd/Utils.js +1 -0
- package/umd/locale.js +1 -1
- /package/_verture/{index-80e8eb3f.js → index-d795d1f0.js} +0 -0
package/ComboSelect/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import SearchIcon from '@para-ui/icons/Search';
|
|
|
6
6
|
import CloseIcon from '@para-ui/icons/Close';
|
|
7
7
|
import CloseCircleF from '@para-ui/icons/CloseCircleF';
|
|
8
8
|
import Table from '../Table/index.js';
|
|
9
|
-
import { T as Tree } from '../_verture/index-
|
|
9
|
+
import { T as Tree } from '../_verture/index-767e63dd.js';
|
|
10
10
|
import { Button } from '../Button/index.js';
|
|
11
11
|
import { D as Dropdown } from '../_verture/index-389675ab.js';
|
|
12
12
|
import { Popover } from '../Popover/index.js';
|
package/CycleSelector/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @description 周期选择器
|
|
5
5
|
*/
|
|
6
6
|
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import { Dayjs } from 'dayjs';
|
|
8
|
+
import { HelperTextDetailProps } from "../HelperText";
|
|
7
9
|
import './index.scss';
|
|
8
10
|
export interface CycleSelectorValueProps {
|
|
9
11
|
/** 开始时间 */
|
|
@@ -25,10 +27,22 @@ export interface CycleSelectorValueProps {
|
|
|
25
27
|
/** 当结束方式是限定时间,结束执行的日期 */
|
|
26
28
|
endTime?: string;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
declare type DisabledTimes = {
|
|
31
|
+
disabledHours?: () => number[];
|
|
32
|
+
disabledMinutes?: (hour: number) => number[];
|
|
33
|
+
disabledSeconds?: (hour: number, minute: number) => number[];
|
|
34
|
+
};
|
|
35
|
+
declare type DisabledTime<DateType> = (date: DateType | null) => DisabledTimes;
|
|
36
|
+
export interface CycleSelectorProps extends HelperTextDetailProps {
|
|
29
37
|
className?: string;
|
|
30
38
|
style?: React.CSSProperties;
|
|
31
39
|
value: CycleSelectorValueProps;
|
|
40
|
+
/** 禁用 */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** 禁用日期 */
|
|
43
|
+
disabledDate?: (date: Dayjs) => boolean;
|
|
44
|
+
/** 禁用时间 */
|
|
45
|
+
disabledTime?: DisabledTime<Dayjs>;
|
|
32
46
|
onChange: (val: CycleSelectorValueProps) => void;
|
|
33
47
|
}
|
|
34
48
|
declare const CycleSelector: FunctionComponent<CycleSelectorProps>;
|
package/CycleSelector/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import { Popover } from '../Popover/index.js';
|
|
|
12
12
|
import { Button } from '../Button/index.js';
|
|
13
13
|
import GlobalContext from '@para-ui/core/GlobalContext';
|
|
14
14
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
15
|
+
import HelperText from '../HelperText/index.js';
|
|
16
|
+
import { getDateYYYYMMddHHMM } from '../Utils/index.js';
|
|
15
17
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
16
18
|
import 'rc-picker/es/generate/dayjs';
|
|
17
19
|
import '../Tag/index.js';
|
|
@@ -39,7 +41,6 @@ import 'rc-picker/lib/locale/zh_CN';
|
|
|
39
41
|
import '../Label/index.js';
|
|
40
42
|
import '../Help/index.js';
|
|
41
43
|
import '@para-ui/icons/Help';
|
|
42
|
-
import '../HelperText/index.js';
|
|
43
44
|
import '@para-ui/icons/SortRight';
|
|
44
45
|
import '../Empty/index.js';
|
|
45
46
|
import '../_verture/useGlobalProps-1e416658.js';
|
|
@@ -60,7 +61,7 @@ var en = {
|
|
|
60
61
|
week4: 'Thursday',
|
|
61
62
|
week5: 'Friday',
|
|
62
63
|
week6: 'Saturday',
|
|
63
|
-
|
|
64
|
+
week7: 'Sunday',
|
|
64
65
|
every: 'Every ',
|
|
65
66
|
day: 'Day',
|
|
66
67
|
week: 'Week',
|
|
@@ -128,7 +129,8 @@ var en = {
|
|
|
128
129
|
endRepetition: 'End repetition',
|
|
129
130
|
customCycle: 'Custom cycle',
|
|
130
131
|
cancel: 'Cancel',
|
|
131
|
-
confirm: 'Confirm'
|
|
132
|
+
confirm: 'Confirm',
|
|
133
|
+
next: 'Next'
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
var zh = {
|
|
@@ -140,7 +142,7 @@ var zh = {
|
|
|
140
142
|
week4: '星期四',
|
|
141
143
|
week5: '星期五',
|
|
142
144
|
week6: '星期六',
|
|
143
|
-
|
|
145
|
+
week7: '星期日',
|
|
144
146
|
every: '每',
|
|
145
147
|
day: '天',
|
|
146
148
|
week: '周',
|
|
@@ -208,7 +210,8 @@ var zh = {
|
|
|
208
210
|
endRepetition: '结束重复',
|
|
209
211
|
customCycle: '自定义周期',
|
|
210
212
|
cancel: '取 消',
|
|
211
|
-
confirm: '确 定'
|
|
213
|
+
confirm: '确 定',
|
|
214
|
+
next: '次后'
|
|
212
215
|
};
|
|
213
216
|
|
|
214
217
|
var localeJson = {
|
|
@@ -216,7 +219,7 @@ var localeJson = {
|
|
|
216
219
|
en
|
|
217
220
|
};
|
|
218
221
|
|
|
219
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-cycle-selector .cycle-selector-content {\n display: flex;\n}\n.paraui-v4-cycle-selector .cycle-selector-content .time-select {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector .cycle-selector-content .select-type {\n flex: 1;\n overflow: hidden;\n margin-left: 10px;\n}\n.paraui-v4-cycle-selector .text-tip {\n font-size: 12px;\n color: rgb(29, 33, 38);\n margin-top: 10px;\n}\n.paraui-v4-cycle-selector .text-tip button {\n height: inherit;\n font-size: 12px;\n margin-left: 8px;\n}\n\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content {\n width: 480px;\n padding: 15px 20px 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title {\n display: flex;\n line-height: 20px;\n align-items: center;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title .label {\n flex: 1;\n font-size: 14px;\n color: rgb(29, 33, 38);\n font-weight: 600;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title svg {\n color: rgb(92, 101, 115);\n cursor: pointer;\n font-size: 18px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title svg:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content {\n margin-top: 16px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item {\n display: flex;\n margin-bottom: 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item .label {\n line-height: 32px;\n width: 150px;\n color: rgb(92, 101, 115);\n font-size: 14px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item .form-content {\n display: flex;\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .frequency .form-content .frequency-select {\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .end-type .form-content .end-type-select {\n flex: 1;\n overflow: hidden;\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .end-type .form-content .right-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day {\n margin-bottom: 0;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content {\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select {\n display: flex;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div {\n flex: 1;\n overflow: hidden;\n height: 28px;\n margin-right: 6px;\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n line-height: 26px;\n text-align: center;\n cursor: pointer;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div.select-item {\n background-color: rgb(46, 101, 230);\n color: rgb(255, 255, 255);\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div:last-child {\n margin-right: 0;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip {\n min-height: 20px;\n display: flex;\n opacity: 0;\n transition: all 0.3s;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip.show-tip {\n opacity: 1;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip svg {\n color: rgb(255, 147, 38);\n font-size: 16px;\n vertical-align: middle;\n margin-right: 4px;\n margin-top: 2px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip span {\n font-size: 12px;\n color: rgb(255, 147, 38);\n flex: 1;\n overflow: hidden;\n line-height: 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .month-cycle-type-list .form-content > div {\n flex: 1;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .month-cycle-type-list .form-content > div:first-child {\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .footer {\n text-align: right;\n margin-top: 30px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .footer button:last-child {\n margin-left: 16px;\n}";
|
|
222
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-cycle-selector .cycle-selector-content {\n display: flex;\n}\n.paraui-v4-cycle-selector .cycle-selector-content .time-select {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector .cycle-selector-content .select-type {\n flex: 1;\n overflow: hidden;\n margin-left: 10px;\n}\n.paraui-v4-cycle-selector .cycle-selector-content .paraui-v4-helper-text {\n display: none;\n}\n.paraui-v4-cycle-selector .text-tip {\n font-size: 12px;\n color: rgb(29, 33, 38);\n margin-top: 10px;\n}\n.paraui-v4-cycle-selector .text-tip button {\n height: inherit;\n font-size: 12px;\n margin-left: 8px;\n}\n\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content {\n width: 480px;\n padding: 15px 20px 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title {\n display: flex;\n line-height: 20px;\n align-items: center;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title .label {\n flex: 1;\n font-size: 14px;\n color: rgb(29, 33, 38);\n font-weight: 600;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title svg {\n color: rgb(92, 101, 115);\n cursor: pointer;\n font-size: 18px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .title svg:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content {\n margin-top: 16px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item {\n display: flex;\n margin-bottom: 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item .label {\n line-height: 32px;\n width: 150px;\n color: rgb(92, 101, 115);\n font-size: 14px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .item .form-content {\n display: flex;\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .frequency .form-content .frequency-select {\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .end-type .form-content .end-type-select {\n flex: 1;\n overflow: hidden;\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .end-type .form-content .right-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day {\n margin-bottom: 0;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content {\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select {\n display: flex;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div {\n flex: 1;\n overflow: hidden;\n height: 28px;\n margin-right: 6px;\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n line-height: 26px;\n text-align: center;\n cursor: pointer;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div.select-item {\n background-color: rgb(46, 101, 230);\n color: rgb(255, 255, 255);\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content .execution-day-select > div:last-child {\n margin-right: 0;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip {\n min-height: 20px;\n display: flex;\n opacity: 0;\n transition: all 0.3s;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip.show-tip {\n opacity: 1;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip svg {\n color: rgb(255, 147, 38);\n font-size: 16px;\n vertical-align: middle;\n margin-right: 4px;\n margin-top: 2px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .execution-day .form-content > .tip span {\n font-size: 12px;\n color: rgb(255, 147, 38);\n flex: 1;\n overflow: hidden;\n line-height: 20px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .month-cycle-type-list .form-content > div {\n flex: 1;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .content .month-cycle-type-list .form-content > div:first-child {\n margin-right: 10px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .footer {\n text-align: right;\n margin-top: 30px;\n}\n.paraui-v4-cycle-selector-popover .cycle-selector-popover-content .footer button:last-child {\n margin-left: 16px;\n}";
|
|
220
223
|
styleInject(css_248z);
|
|
221
224
|
|
|
222
225
|
const CycleSelector = props => {
|
|
@@ -224,6 +227,12 @@ const CycleSelector = props => {
|
|
|
224
227
|
className,
|
|
225
228
|
style,
|
|
226
229
|
value,
|
|
230
|
+
disabled = false,
|
|
231
|
+
error,
|
|
232
|
+
hideErrorDom,
|
|
233
|
+
helperText,
|
|
234
|
+
disabledDate,
|
|
235
|
+
disabledTime,
|
|
227
236
|
onChange
|
|
228
237
|
} = props;
|
|
229
238
|
const {
|
|
@@ -247,7 +256,7 @@ const CycleSelector = props => {
|
|
|
247
256
|
constData.current.value = value;
|
|
248
257
|
useEffect(() => {
|
|
249
258
|
const arr = [];
|
|
250
|
-
for (let i = 1; i <
|
|
259
|
+
for (let i = 1; i < 31; i++) {
|
|
251
260
|
arr.push({
|
|
252
261
|
label: intl('every') + i,
|
|
253
262
|
value: i
|
|
@@ -295,7 +304,7 @@ const CycleSelector = props => {
|
|
|
295
304
|
}, [value, language]);
|
|
296
305
|
// 处理下拉框选择
|
|
297
306
|
const handleSelectData = () => {
|
|
298
|
-
var _a, _b
|
|
307
|
+
var _a, _b;
|
|
299
308
|
if (!((_a = constData.current.valueCom) === null || _a === void 0 ? void 0 : _a.startTime)) {
|
|
300
309
|
setList([{
|
|
301
310
|
label: intl('noRepetition'),
|
|
@@ -303,21 +312,15 @@ const CycleSelector = props => {
|
|
|
303
312
|
}]);
|
|
304
313
|
return;
|
|
305
314
|
}
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
const day = time.getDate();
|
|
309
|
-
const weekDay = time.getDay();
|
|
310
|
-
const hm = (_c = constData.current.valueCom) === null || _c === void 0 ? void 0 : _c.startTime.split(' ')[1];
|
|
311
|
-
const date = (_d = constData.current.valueCom) === null || _d === void 0 ? void 0 : _d.startTime.split(' ')[0];
|
|
312
|
-
const week = Math.ceil((day + 6 - (weekDay === 0 ? 7 : weekDay)) / 7);
|
|
313
|
-
constData.current.timeDetail = {
|
|
315
|
+
constData.current.timeDetail = getDateYYYYMMddHHMM((_b = constData.current.valueCom) === null || _b === void 0 ? void 0 : _b.startTime);
|
|
316
|
+
const {
|
|
314
317
|
month,
|
|
315
318
|
day,
|
|
316
319
|
weekDay,
|
|
317
320
|
hm,
|
|
318
321
|
week,
|
|
319
322
|
date
|
|
320
|
-
};
|
|
323
|
+
} = constData.current.timeDetail;
|
|
321
324
|
const selectList = [{
|
|
322
325
|
label: intl('noRepetition'),
|
|
323
326
|
value: 0
|
|
@@ -369,8 +372,11 @@ const CycleSelector = props => {
|
|
|
369
372
|
if (isNotExist('endType')) constData.current.valueCom.endType = 0;
|
|
370
373
|
if (isNotExist('monthCycleType')) constData.current.valueCom.monthCycleType = 'day';
|
|
371
374
|
if (isNotExist('endTime')) constData.current.valueCom.endTime = (_a = constData.current.timeDetail) === null || _a === void 0 ? void 0 : _a.date;
|
|
372
|
-
if (isNotExist('limitNum')) constData.current.valueCom.limitNum =
|
|
373
|
-
if (isNotExist('executionDay'))
|
|
375
|
+
if (isNotExist('limitNum')) constData.current.valueCom.limitNum = 1;
|
|
376
|
+
if (isNotExist('executionDay')) {
|
|
377
|
+
const index = handleWeekNum(Number((_b = constData.current.timeDetail) === null || _b === void 0 ? void 0 : _b.weekDay));
|
|
378
|
+
constData.current.valueCom.executionDay = index + '';
|
|
379
|
+
}
|
|
374
380
|
setValueCom(Object.assign({}, constData.current.valueCom));
|
|
375
381
|
};
|
|
376
382
|
// 清空弹窗里面的默认值
|
|
@@ -394,20 +400,27 @@ const CycleSelector = props => {
|
|
|
394
400
|
// 向外抛值
|
|
395
401
|
const changeCom = cancel => {
|
|
396
402
|
if (constData.current.valueCom.cycleType === 5) {
|
|
403
|
+
// 自定义重复
|
|
397
404
|
if (constData.current.valueCom.frequencyUnit === 'week') {
|
|
405
|
+
// 周
|
|
398
406
|
delete constData.current.valueCom.monthCycleType;
|
|
399
407
|
} else if (constData.current.valueCom.frequencyUnit === 'month') {
|
|
408
|
+
// 月
|
|
400
409
|
delete constData.current.valueCom.executionDay;
|
|
401
410
|
} else {
|
|
411
|
+
// 天 年
|
|
402
412
|
delete constData.current.valueCom.monthCycleType;
|
|
403
413
|
delete constData.current.valueCom.executionDay;
|
|
404
414
|
}
|
|
405
415
|
if (constData.current.valueCom.endType === 0) {
|
|
416
|
+
// 结束方式 无限重复
|
|
406
417
|
delete constData.current.valueCom.endTime;
|
|
407
418
|
delete constData.current.valueCom.limitNum;
|
|
408
419
|
} else if (constData.current.valueCom.endType === 1) {
|
|
420
|
+
// 结束方式 截止时间
|
|
409
421
|
delete constData.current.valueCom.limitNum;
|
|
410
422
|
} else {
|
|
423
|
+
// 结束方式 限定次数
|
|
411
424
|
delete constData.current.valueCom.endTime;
|
|
412
425
|
}
|
|
413
426
|
} else {
|
|
@@ -430,16 +443,24 @@ const CycleSelector = props => {
|
|
|
430
443
|
};
|
|
431
444
|
// 自定义周期文案提示
|
|
432
445
|
const handleText = () => {
|
|
433
|
-
var _a, _b;
|
|
434
|
-
if ((value === null || value === void 0 ? void 0 : value.cycleType) !== 5) return;
|
|
446
|
+
var _a, _b, _c, _d;
|
|
447
|
+
if ((value === null || value === void 0 ? void 0 : value.cycleType) !== 5 || error) return;
|
|
435
448
|
const text = [];
|
|
436
449
|
const everyText1 = intl('every') + value.frequency + intl(value.frequencyUnit);
|
|
437
450
|
const timeText = (_a = constData.current.timeDetail) === null || _a === void 0 ? void 0 : _a.hm;
|
|
438
451
|
if (value.frequencyUnit === 'week') {
|
|
439
452
|
const arr = [];
|
|
453
|
+
let str;
|
|
440
454
|
(_b = value.executionDay) === null || _b === void 0 ? void 0 : _b.split(',').forEach(item => {
|
|
441
|
-
|
|
455
|
+
let index = Number(item) - 1;
|
|
456
|
+
if (index === 0) {
|
|
457
|
+
index = 7;
|
|
458
|
+
str = intl('week' + index);
|
|
459
|
+
} else {
|
|
460
|
+
arr.push(intl('week' + index));
|
|
461
|
+
}
|
|
442
462
|
});
|
|
463
|
+
if (str) arr.push(str);
|
|
443
464
|
text.push(intl('text1', {
|
|
444
465
|
every: everyText1 + arr.join('、'),
|
|
445
466
|
time: timeText
|
|
@@ -447,13 +468,18 @@ const CycleSelector = props => {
|
|
|
447
468
|
} else if (value.frequencyUnit === 'month') {
|
|
448
469
|
text.push(intl('text1', {
|
|
449
470
|
every: everyText1,
|
|
450
|
-
time: constData.current.monthCycleTypeListMap[value.monthCycleType] + timeText
|
|
471
|
+
time: ((_c = constData.current.monthCycleTypeListMap) === null || _c === void 0 ? void 0 : _c[value.monthCycleType]) + timeText
|
|
451
472
|
}));
|
|
452
|
-
} else {
|
|
473
|
+
} else if (value.frequencyUnit === 'day') {
|
|
453
474
|
text.push(intl('text1', {
|
|
454
475
|
every: everyText1,
|
|
455
476
|
time: timeText
|
|
456
477
|
}));
|
|
478
|
+
} else {
|
|
479
|
+
text.push(intl('text1', {
|
|
480
|
+
every: everyText1,
|
|
481
|
+
time: ((_d = constData.current.timeDetail) === null || _d === void 0 ? void 0 : _d.date) + " " + timeText
|
|
482
|
+
}));
|
|
457
483
|
}
|
|
458
484
|
if (value.endType === 2) {
|
|
459
485
|
text.push(intl('text2', {
|
|
@@ -483,16 +509,21 @@ const CycleSelector = props => {
|
|
|
483
509
|
};
|
|
484
510
|
// 改变结束次数
|
|
485
511
|
const changeLimitNum = event => {
|
|
486
|
-
valueCom.limitNum = Number(event.target.value);
|
|
512
|
+
valueCom.limitNum = Number(event.target.value) < 1 ? 1 : Number(event.target.value);
|
|
487
513
|
setValueCom(Object.assign({}, valueCom));
|
|
488
514
|
};
|
|
489
515
|
const changeSelectVal = name => val => {
|
|
490
516
|
valueCom[name] = val;
|
|
491
517
|
setValueCom(Object.assign({}, valueCom));
|
|
492
518
|
};
|
|
519
|
+
const handleWeekNum = index => {
|
|
520
|
+
index += 1;
|
|
521
|
+
if (index === 8) index = 1;
|
|
522
|
+
return index;
|
|
523
|
+
};
|
|
493
524
|
// 点击周 按钮
|
|
494
525
|
const clickWeekBtn = index => () => {
|
|
495
|
-
var _a
|
|
526
|
+
var _a;
|
|
496
527
|
if (((_a = constData.current.timeDetail) === null || _a === void 0 ? void 0 : _a.weekDay) === index) {
|
|
497
528
|
setTipWeek(true);
|
|
498
529
|
clearTimeout(constData.current.timerTip);
|
|
@@ -501,7 +532,12 @@ const CycleSelector = props => {
|
|
|
501
532
|
}, 1300);
|
|
502
533
|
return;
|
|
503
534
|
}
|
|
504
|
-
|
|
535
|
+
handleWeekValue(index);
|
|
536
|
+
};
|
|
537
|
+
const handleWeekValue = index => {
|
|
538
|
+
var _a;
|
|
539
|
+
index = handleWeekNum(index);
|
|
540
|
+
const arr = ((_a = valueCom.executionDay) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
|
|
505
541
|
const json = {};
|
|
506
542
|
arr.forEach(item => {
|
|
507
543
|
json[item] = true;
|
|
@@ -512,6 +548,7 @@ const CycleSelector = props => {
|
|
|
512
548
|
json[index.toString()] = true;
|
|
513
549
|
}
|
|
514
550
|
valueCom.executionDay = Object.keys(json).join(',');
|
|
551
|
+
constData.current.valueCom = Object.assign({}, valueCom);
|
|
515
552
|
setValueCom(Object.assign({}, valueCom));
|
|
516
553
|
};
|
|
517
554
|
// 处理 天 周 月 年 展示不一样的周期
|
|
@@ -561,17 +598,17 @@ const CycleSelector = props => {
|
|
|
561
598
|
6: 'six',
|
|
562
599
|
7: 'seven'
|
|
563
600
|
};
|
|
564
|
-
const oreder = index + 1;
|
|
601
|
+
const oreder = handleWeekNum(index + 1);
|
|
565
602
|
const indexOfVal = (_a = valueCom.executionDay) === null || _a === void 0 ? void 0 : _a.indexOf(oreder.toString());
|
|
566
603
|
let selectBol = indexOfVal !== undefined && indexOfVal !== -1;
|
|
567
|
-
if (((_b = constData.current.timeDetail) === null || _b === void 0 ? void 0 : _b.weekDay) ===
|
|
604
|
+
if (((_b = constData.current.timeDetail) === null || _b === void 0 ? void 0 : _b.weekDay) === index + 1) {
|
|
568
605
|
selectBol = true;
|
|
569
606
|
}
|
|
570
607
|
return jsx("div", Object.assign({
|
|
571
608
|
className: selectBol ? 'select-item' : '',
|
|
572
|
-
onClick: clickWeekBtn(
|
|
609
|
+
onClick: clickWeekBtn(index + 1)
|
|
573
610
|
}, {
|
|
574
|
-
children: intl(numMap[
|
|
611
|
+
children: intl(numMap[index + 1])
|
|
575
612
|
}), index);
|
|
576
613
|
})
|
|
577
614
|
})), jsxs("p", Object.assign({
|
|
@@ -618,18 +655,18 @@ const CycleSelector = props => {
|
|
|
618
655
|
}, {
|
|
619
656
|
children: [valueCom.endType === 1 && jsx(DatePicker, {
|
|
620
657
|
disabledDate: current => {
|
|
621
|
-
return current && current < dayjs(valueCom.startTime);
|
|
658
|
+
return current && current < dayjs(new Date(valueCom.startTime).getTime() - 24 * 60 * 60 * 1000);
|
|
622
659
|
},
|
|
623
660
|
value: valueCom.endTime,
|
|
624
661
|
format: 'YYYY-MM-DD',
|
|
625
662
|
onChange: changeEndTypeTime
|
|
626
663
|
}), valueCom.endType === 2 && jsx(TextField, {
|
|
627
|
-
min:
|
|
664
|
+
min: 1,
|
|
628
665
|
type: "number",
|
|
629
666
|
placeholder: intl('placeholder'),
|
|
630
667
|
value: valueCom.limitNum,
|
|
631
668
|
onChange: changeLimitNum,
|
|
632
|
-
rightIcon: '
|
|
669
|
+
rightIcon: intl('next')
|
|
633
670
|
})]
|
|
634
671
|
}))]
|
|
635
672
|
}))]
|
|
@@ -679,6 +716,28 @@ const CycleSelector = props => {
|
|
|
679
716
|
}))]
|
|
680
717
|
}));
|
|
681
718
|
};
|
|
719
|
+
const disabledDateHand = () => {
|
|
720
|
+
if (disabledDate) return disabledDate;
|
|
721
|
+
return current => {
|
|
722
|
+
return current && current < dayjs(new Date().getTime() - 24 * 60 * 60 * 1000);
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
const range = (start, end) => {
|
|
726
|
+
const result = [];
|
|
727
|
+
for (let i = start; i < end; i++) {
|
|
728
|
+
result.push(i);
|
|
729
|
+
}
|
|
730
|
+
return result;
|
|
731
|
+
};
|
|
732
|
+
const disabledTimeHand = () => {
|
|
733
|
+
if (disabledTime) return disabledTime;
|
|
734
|
+
return () => {
|
|
735
|
+
return {
|
|
736
|
+
disabledHours: () => range(0, 24).splice(0, new Date().getHours()),
|
|
737
|
+
disabledMinutes: () => range(0, new Date().getMinutes())
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
};
|
|
682
741
|
return jsxs("div", Object.assign({
|
|
683
742
|
className: clsx("".concat($prefixCls, "-cycle-selector"), className),
|
|
684
743
|
style: style
|
|
@@ -694,14 +753,18 @@ const CycleSelector = props => {
|
|
|
694
753
|
className: 'cycle-selector-content'
|
|
695
754
|
}, {
|
|
696
755
|
children: [jsx(DatePicker, {
|
|
756
|
+
disabled: disabled,
|
|
697
757
|
value: valueCom.startTime,
|
|
698
758
|
className: 'time-select',
|
|
699
759
|
showTime: true,
|
|
700
760
|
format: 'YYYY-MM-DD HH:mm',
|
|
761
|
+
disabledDate: disabledDateHand(),
|
|
762
|
+
disabledTime: disabledTimeHand(),
|
|
701
763
|
placeholder: intl('pleaseSelect'),
|
|
702
|
-
onChange: changeStartTime
|
|
764
|
+
onChange: changeStartTime,
|
|
765
|
+
error: error
|
|
703
766
|
}), jsx(Select, {
|
|
704
|
-
disabled: !valueCom.startTime,
|
|
767
|
+
disabled: !valueCom.startTime || disabled,
|
|
705
768
|
list: list,
|
|
706
769
|
className: 'select-type',
|
|
707
770
|
placeholder: intl('pleaseSelect'),
|
|
@@ -709,7 +772,11 @@ const CycleSelector = props => {
|
|
|
709
772
|
onChange: changeSelect
|
|
710
773
|
})]
|
|
711
774
|
}))
|
|
712
|
-
})), handleText()
|
|
775
|
+
})), handleText(), jsx(HelperText, {
|
|
776
|
+
error: error,
|
|
777
|
+
hideErrorDom: hideErrorDom,
|
|
778
|
+
helperText: helperText
|
|
779
|
+
})]
|
|
713
780
|
}));
|
|
714
781
|
};
|
|
715
782
|
|
|
@@ -7,7 +7,7 @@ declare const _default: {
|
|
|
7
7
|
week4: string;
|
|
8
8
|
week5: string;
|
|
9
9
|
week6: string;
|
|
10
|
-
|
|
10
|
+
week7: string;
|
|
11
11
|
every: string;
|
|
12
12
|
day: string;
|
|
13
13
|
week: string;
|
|
@@ -76,5 +76,6 @@ declare const _default: {
|
|
|
76
76
|
customCycle: string;
|
|
77
77
|
cancel: string;
|
|
78
78
|
confirm: string;
|
|
79
|
+
next: string;
|
|
79
80
|
};
|
|
80
81
|
export default _default;
|
|
@@ -8,7 +8,7 @@ declare const _default: {
|
|
|
8
8
|
week4: string;
|
|
9
9
|
week5: string;
|
|
10
10
|
week6: string;
|
|
11
|
-
|
|
11
|
+
week7: string;
|
|
12
12
|
every: string;
|
|
13
13
|
day: string;
|
|
14
14
|
week: string;
|
|
@@ -77,6 +77,7 @@ declare const _default: {
|
|
|
77
77
|
customCycle: string;
|
|
78
78
|
cancel: string;
|
|
79
79
|
confirm: string;
|
|
80
|
+
next: string;
|
|
80
81
|
};
|
|
81
82
|
en: {
|
|
82
83
|
placeholder: string;
|
|
@@ -87,7 +88,7 @@ declare const _default: {
|
|
|
87
88
|
week4: string;
|
|
88
89
|
week5: string;
|
|
89
90
|
week6: string;
|
|
90
|
-
|
|
91
|
+
week7: string;
|
|
91
92
|
every: string;
|
|
92
93
|
day: string;
|
|
93
94
|
week: string;
|
|
@@ -156,6 +157,7 @@ declare const _default: {
|
|
|
156
157
|
customCycle: string;
|
|
157
158
|
cancel: string;
|
|
158
159
|
confirm: string;
|
|
160
|
+
next: string;
|
|
159
161
|
};
|
|
160
162
|
};
|
|
161
163
|
export default _default;
|
|
@@ -7,7 +7,7 @@ declare const _default: {
|
|
|
7
7
|
week4: string;
|
|
8
8
|
week5: string;
|
|
9
9
|
week6: string;
|
|
10
|
-
|
|
10
|
+
week7: string;
|
|
11
11
|
every: string;
|
|
12
12
|
day: string;
|
|
13
13
|
week: string;
|
|
@@ -76,5 +76,6 @@ declare const _default: {
|
|
|
76
76
|
customCycle: string;
|
|
77
77
|
cancel: string;
|
|
78
78
|
confirm: string;
|
|
79
|
+
next: string;
|
|
79
80
|
};
|
|
80
81
|
export default _default;
|
package/DynamicMultiBox/index.js
CHANGED
|
@@ -70,7 +70,7 @@ import 'rc-pagination';
|
|
|
70
70
|
import '@para-ui/icons/Right';
|
|
71
71
|
import '@para-ui/icons/DoubleLeft';
|
|
72
72
|
import '@para-ui/icons/DoubleRight';
|
|
73
|
-
import '../_verture/index-
|
|
73
|
+
import '../_verture/index-767e63dd.js';
|
|
74
74
|
import 'rc-tree';
|
|
75
75
|
import '../_verture/typeof-adeedc13.js';
|
|
76
76
|
import '@para-ui/icons/Document';
|
|
@@ -161,14 +161,30 @@ var FormItem = function FormItem(props) {
|
|
|
161
161
|
* @param {*} ReactNode
|
|
162
162
|
*/
|
|
163
163
|
var getTextField = function getTextField() {
|
|
164
|
+
var selectList = typeof list === 'function' ? list && list(rowIndex, id, name, valueList) : list || [];
|
|
165
|
+
var mergedProps = Object.assign({}, otherPropsCom);
|
|
166
|
+
if (selectList.length > 0 && mergedProps.fetchSuggestions === undefined) {
|
|
167
|
+
mergedProps.fetchSuggestions = function (value, cb) {
|
|
168
|
+
if (selectList.length > 0) {
|
|
169
|
+
cb(selectList.filter(function (item) {
|
|
170
|
+
var label = (item === null || item === void 0 ? void 0 : item.label) || (item === null || item === void 0 ? void 0 : item.value) || item;
|
|
171
|
+
if (typeof label === 'string') return label.toLowerCase().indexOf(value.toLowerCase()) > -1;
|
|
172
|
+
return false;
|
|
173
|
+
}));
|
|
174
|
+
} else cb([]);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
164
177
|
return jsx(TextField, Object.assign({}, rest, {
|
|
165
178
|
required: false,
|
|
166
179
|
label: "",
|
|
167
180
|
disabled: disabled,
|
|
168
181
|
onChange: function onChange(e) {
|
|
169
182
|
return inputChange(e.target.value);
|
|
183
|
+
},
|
|
184
|
+
onSelect: function onSelect(value) {
|
|
185
|
+
inputChange((value === null || value === void 0 ? void 0 : value.value) || value);
|
|
170
186
|
}
|
|
171
|
-
},
|
|
187
|
+
}, mergedProps));
|
|
172
188
|
};
|
|
173
189
|
/**
|
|
174
190
|
* @description: 返回下拉框组件
|
package/Form/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { DeepClone } from '@paraview/lib';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-
|
|
4
|
+
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-d795d1f0.js';
|
|
5
5
|
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
6
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
7
7
|
import '../TextField/index.js';
|
|
@@ -68,7 +68,7 @@ import 'rc-pagination';
|
|
|
68
68
|
import '@para-ui/icons/Right';
|
|
69
69
|
import '@para-ui/icons/DoubleLeft';
|
|
70
70
|
import '@para-ui/icons/DoubleRight';
|
|
71
|
-
import '../_verture/index-
|
|
71
|
+
import '../_verture/index-767e63dd.js';
|
|
72
72
|
import 'rc-tree';
|
|
73
73
|
import '../_verture/typeof-adeedc13.js';
|
|
74
74
|
import '@para-ui/icons/Document';
|
package/FormItem/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { F as default } from '../_verture/index-
|
|
3
|
+
export { F as default } from '../_verture/index-d795d1f0.js';
|
|
4
4
|
import 'clsx';
|
|
5
5
|
import '../Label/index.js';
|
|
6
6
|
import '../_verture/constant-5317fc89.js';
|
|
@@ -68,7 +68,7 @@ import 'rc-pagination';
|
|
|
68
68
|
import '@para-ui/icons/Right';
|
|
69
69
|
import '@para-ui/icons/DoubleLeft';
|
|
70
70
|
import '@para-ui/icons/DoubleRight';
|
|
71
|
-
import '../_verture/index-
|
|
71
|
+
import '../_verture/index-767e63dd.js';
|
|
72
72
|
import 'rc-tree';
|
|
73
73
|
import '../_verture/typeof-adeedc13.js';
|
|
74
74
|
import '@para-ui/icons/Document';
|
|
@@ -10,6 +10,7 @@ import { EmptyProps } from '../Empty';
|
|
|
10
10
|
import { QueryingProps } from '../Querying';
|
|
11
11
|
import { SelectorProps } from '../Selector/interface';
|
|
12
12
|
import { ComboSelectProps } from '../ComboSelect/interface';
|
|
13
|
+
import { InputLangProps } from '../InputLang';
|
|
13
14
|
interface ComponentsProps {
|
|
14
15
|
Select?: Partial<SelectProps>;
|
|
15
16
|
TextField?: Partial<TextFieldProps>;
|
|
@@ -18,6 +19,7 @@ interface ComponentsProps {
|
|
|
18
19
|
Querying?: Partial<QueryingProps>;
|
|
19
20
|
Selector?: Partial<SelectorProps>;
|
|
20
21
|
ComboSelect?: Partial<ComboSelectProps>;
|
|
22
|
+
InputLang?: Partial<InputLangProps>;
|
|
21
23
|
[name: string]: any;
|
|
22
24
|
}
|
|
23
25
|
export default ComponentsProps;
|
package/InputLang/index.d.ts
CHANGED
|
@@ -39,11 +39,11 @@ export interface InputLangProps extends HelperTextDetailProps {
|
|
|
39
39
|
/** 弹出框样式class */
|
|
40
40
|
popoverClassName?: string;
|
|
41
41
|
/** 默认值 不受控 */
|
|
42
|
-
defaultValue?: valueProps;
|
|
42
|
+
defaultValue?: string | valueProps;
|
|
43
43
|
/** 值 */
|
|
44
|
-
value?: valueProps;
|
|
44
|
+
value?: string | valueProps;
|
|
45
45
|
/** 改变值 */
|
|
46
|
-
onChange?: (val: valueProps) => void;
|
|
46
|
+
onChange?: (val: string | valueProps) => void;
|
|
47
47
|
/** 语言列表 */
|
|
48
48
|
langList?: (string | {
|
|
49
49
|
label: string;
|
|
@@ -57,6 +57,10 @@ export interface InputLangProps extends HelperTextDetailProps {
|
|
|
57
57
|
disabledDelete?: boolean;
|
|
58
58
|
/** 禁用key */
|
|
59
59
|
disabledKey?: boolean | string[];
|
|
60
|
+
/** 输出类型 */
|
|
61
|
+
typeOutput?: 'string' | 'object';
|
|
62
|
+
/** i18n标识 */
|
|
63
|
+
i18n?: boolean;
|
|
60
64
|
}
|
|
61
65
|
export declare const InputLang: FunctionComponent<InputLangProps>;
|
|
62
66
|
export default InputLang;
|