x-star-design 0.0.144 → 0.0.146
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/dist/config-template/define.js +5 -5
- package/dist/config-template/index.js +1 -1
- package/dist/locales/en_US.d.ts +4 -3
- package/dist/locales/en_US.js +4 -3
- package/dist/locales/index.d.ts +8 -6
- package/dist/locales/zh_CN.d.ts +4 -3
- package/dist/locales/zh_CN.js +4 -3
- package/dist/zip-code-search-input/define.d.ts +2 -0
- package/dist/zip-code-search-input/index.js +32 -26
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import dayjs from 'dayjs';
|
|
|
10
10
|
* // 返回: dayjs('2026-03-24 23:59:59.999')
|
|
11
11
|
*/
|
|
12
12
|
export var calculateAutoSubmitTime = function calculateAutoSubmitTime(courseEndTime) {
|
|
13
|
-
return courseEndTime.add(
|
|
13
|
+
return courseEndTime.add(21, 'day').endOf('day').millisecond(0);
|
|
14
14
|
};
|
|
15
15
|
// 基础竞赛类型(公用模板)
|
|
16
16
|
|
|
@@ -244,9 +244,9 @@ export var XCAMP_CONTEST_TEMPLATES = {
|
|
|
244
244
|
autoSubmitTime: undefined
|
|
245
245
|
},
|
|
246
246
|
XCAMP_FINAL_NO_LIMIT: {
|
|
247
|
-
contestTime: '
|
|
247
|
+
contestTime: 'noLimit',
|
|
248
248
|
limitTime: {
|
|
249
|
-
limitHour:
|
|
249
|
+
limitHour: 0,
|
|
250
250
|
limitMinute: 0
|
|
251
251
|
},
|
|
252
252
|
gradeTime: dayjs(),
|
|
@@ -285,7 +285,7 @@ export var XCAMP_CONTEST_TEMPLATES = {
|
|
|
285
285
|
XCAMP_FINAL_LIMIT: {
|
|
286
286
|
contestTime: 'limitTime',
|
|
287
287
|
limitTime: {
|
|
288
|
-
limitHour:
|
|
288
|
+
limitHour: 3,
|
|
289
289
|
limitMinute: 0
|
|
290
290
|
},
|
|
291
291
|
gradeTime: dayjs(),
|
|
@@ -298,7 +298,7 @@ export var XCAMP_CONTEST_TEMPLATES = {
|
|
|
298
298
|
paperRelease: 'afterExam',
|
|
299
299
|
answerRelease: 'afterExam',
|
|
300
300
|
tipRelease: 'always',
|
|
301
|
-
submission: '
|
|
301
|
+
submission: 'allowEarlySubmission',
|
|
302
302
|
restriction: 'never',
|
|
303
303
|
disorder: [],
|
|
304
304
|
personalScoreVisibility: 'always',
|
|
@@ -167,7 +167,7 @@ var ConfigTemplate = function ConfigTemplate(_ref) {
|
|
|
167
167
|
text: t('XCAMP_FINAL_LIMIT_TIME'),
|
|
168
168
|
icon: '►'
|
|
169
169
|
}, {
|
|
170
|
-
text: t('
|
|
170
|
+
text: t('XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION'),
|
|
171
171
|
icon: '►'
|
|
172
172
|
}, {
|
|
173
173
|
text: t('XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION'),
|
package/dist/locales/en_US.d.ts
CHANGED
|
@@ -243,11 +243,12 @@ declare const _default: {
|
|
|
243
243
|
readonly Download_Count_15: "Download error data (XJOI) 2 pairs";
|
|
244
244
|
readonly Rank_List_Not_Show_Real_Name: "Ranklist not show real name";
|
|
245
245
|
readonly XCAMP_FINAL_LIMIT: "Final Exam (Time Limit)";
|
|
246
|
-
readonly XCAMP_FINAL_NO_LIMIT_TIME: "Homework time
|
|
246
|
+
readonly XCAMP_FINAL_NO_LIMIT_TIME: "Homework time unlimited";
|
|
247
247
|
readonly XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: "No early submission";
|
|
248
|
+
readonly XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: "Allow early submission";
|
|
248
249
|
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: "Automatic submission enabled";
|
|
249
|
-
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "Automatic submission after
|
|
250
|
-
readonly XCAMP_FINAL_LIMIT_TIME: "Homework time limit
|
|
250
|
+
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "Automatic submission after 21 days";
|
|
251
|
+
readonly XCAMP_FINAL_LIMIT_TIME: "Homework time limit 3 hours";
|
|
251
252
|
};
|
|
252
253
|
};
|
|
253
254
|
export default _default;
|
package/dist/locales/en_US.js
CHANGED
|
@@ -243,10 +243,11 @@ export default {
|
|
|
243
243
|
Download_Count_15: 'Download error data (XJOI) 2 pairs',
|
|
244
244
|
Rank_List_Not_Show_Real_Name: 'Ranklist not show real name',
|
|
245
245
|
XCAMP_FINAL_LIMIT: 'Final Exam (Time Limit)',
|
|
246
|
-
XCAMP_FINAL_NO_LIMIT_TIME: 'Homework time
|
|
246
|
+
XCAMP_FINAL_NO_LIMIT_TIME: 'Homework time unlimited',
|
|
247
247
|
XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: 'No early submission',
|
|
248
|
+
XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: 'Allow early submission',
|
|
248
249
|
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: 'Automatic submission enabled',
|
|
249
|
-
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: 'Automatic submission after
|
|
250
|
-
XCAMP_FINAL_LIMIT_TIME: 'Homework time limit
|
|
250
|
+
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: 'Automatic submission after 21 days',
|
|
251
|
+
XCAMP_FINAL_LIMIT_TIME: 'Homework time limit 3 hours'
|
|
251
252
|
}
|
|
252
253
|
};
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -254,11 +254,12 @@ export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton
|
|
|
254
254
|
readonly Download_Count_15: "下载错误数据(XJOI)2对";
|
|
255
255
|
readonly Rank_List_Not_Show_Real_Name: "排行榜不显示真实姓名";
|
|
256
256
|
readonly XCAMP_FINAL_LIMIT: "期末考试(限时)";
|
|
257
|
-
readonly XCAMP_FINAL_NO_LIMIT_TIME: "
|
|
257
|
+
readonly XCAMP_FINAL_NO_LIMIT_TIME: "作业时长不限时";
|
|
258
258
|
readonly XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: "不允许提前交卷";
|
|
259
|
+
readonly XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: "允许提前交卷";
|
|
259
260
|
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: "定时自动交卷开启";
|
|
260
|
-
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "结课之日起
|
|
261
|
-
readonly XCAMP_FINAL_LIMIT_TIME: "作业时长
|
|
261
|
+
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "结课之日起21天后自动交卷";
|
|
262
|
+
readonly XCAMP_FINAL_LIMIT_TIME: "作业时长3小时";
|
|
262
263
|
};
|
|
263
264
|
} | {
|
|
264
265
|
readonly VisualDataConfig: {
|
|
@@ -505,11 +506,12 @@ export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton
|
|
|
505
506
|
readonly Download_Count_15: "Download error data (XJOI) 2 pairs";
|
|
506
507
|
readonly Rank_List_Not_Show_Real_Name: "Ranklist not show real name";
|
|
507
508
|
readonly XCAMP_FINAL_LIMIT: "Final Exam (Time Limit)";
|
|
508
|
-
readonly XCAMP_FINAL_NO_LIMIT_TIME: "Homework time
|
|
509
|
+
readonly XCAMP_FINAL_NO_LIMIT_TIME: "Homework time unlimited";
|
|
509
510
|
readonly XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: "No early submission";
|
|
511
|
+
readonly XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: "Allow early submission";
|
|
510
512
|
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: "Automatic submission enabled";
|
|
511
|
-
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "Automatic submission after
|
|
512
|
-
readonly XCAMP_FINAL_LIMIT_TIME: "Homework time limit
|
|
513
|
+
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "Automatic submission after 21 days";
|
|
514
|
+
readonly XCAMP_FINAL_LIMIT_TIME: "Homework time limit 3 hours";
|
|
513
515
|
};
|
|
514
516
|
})[T][U];
|
|
515
517
|
};
|
package/dist/locales/zh_CN.d.ts
CHANGED
|
@@ -243,11 +243,12 @@ declare const _default: {
|
|
|
243
243
|
readonly Download_Count_15: "下载错误数据(XJOI)2对";
|
|
244
244
|
readonly Rank_List_Not_Show_Real_Name: "排行榜不显示真实姓名";
|
|
245
245
|
readonly XCAMP_FINAL_LIMIT: "期末考试(限时)";
|
|
246
|
-
readonly XCAMP_FINAL_NO_LIMIT_TIME: "
|
|
246
|
+
readonly XCAMP_FINAL_NO_LIMIT_TIME: "作业时长不限时";
|
|
247
247
|
readonly XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: "不允许提前交卷";
|
|
248
|
+
readonly XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: "允许提前交卷";
|
|
248
249
|
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: "定时自动交卷开启";
|
|
249
|
-
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "结课之日起
|
|
250
|
-
readonly XCAMP_FINAL_LIMIT_TIME: "作业时长
|
|
250
|
+
readonly XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: "结课之日起21天后自动交卷";
|
|
251
|
+
readonly XCAMP_FINAL_LIMIT_TIME: "作业时长3小时";
|
|
251
252
|
};
|
|
252
253
|
};
|
|
253
254
|
export default _default;
|
package/dist/locales/zh_CN.js
CHANGED
|
@@ -243,10 +243,11 @@ export default {
|
|
|
243
243
|
Download_Count_15: '下载错误数据(XJOI)2对',
|
|
244
244
|
Rank_List_Not_Show_Real_Name: '排行榜不显示真实姓名',
|
|
245
245
|
XCAMP_FINAL_LIMIT: '期末考试(限时)',
|
|
246
|
-
XCAMP_FINAL_NO_LIMIT_TIME: '
|
|
246
|
+
XCAMP_FINAL_NO_LIMIT_TIME: '作业时长不限时',
|
|
247
247
|
XCAMP_FINAL_NO_LIMIT_NO_EARLY_SUBMISSION: '不允许提前交卷',
|
|
248
|
+
XCAMP_FINAL_NO_LIMIT_ALLOW_EARLY_SUBMISSION: '允许提前交卷',
|
|
248
249
|
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION: '定时自动交卷开启',
|
|
249
|
-
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: '结课之日起
|
|
250
|
-
XCAMP_FINAL_LIMIT_TIME: '作业时长
|
|
250
|
+
XCAMP_FINAL_NO_LIMIT_AUTO_SUBMISSION_TIME: '结课之日起21天后自动交卷',
|
|
251
|
+
XCAMP_FINAL_LIMIT_TIME: '作业时长3小时'
|
|
251
252
|
}
|
|
252
253
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SelectProps } from 'antd';
|
|
2
2
|
export interface ZipCodeSearchInputProps extends SelectProps {
|
|
3
3
|
debounceTimeout?: number;
|
|
4
|
+
onSearchStart?: (searchValue: string) => void;
|
|
5
|
+
onSearchEnd?: (searchValue: string, searchResult: SelectProps['options']) => void;
|
|
4
6
|
}
|
|
5
7
|
export type DebounceFunction<T extends (...args: any[]) => any> = (...args: Parameters<T>) => void;
|
|
@@ -3,7 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["value", "onChange", "debounceTimeout"],
|
|
6
|
+
var _excluded = ["value", "onChange", "debounceTimeout", "onSearchStart", "onSearchEnd"],
|
|
7
7
|
_excluded2 = ["value", "onChange"];
|
|
8
8
|
import { AutoComplete, Empty, Spin } from 'antd';
|
|
9
9
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
@@ -27,6 +27,8 @@ var ZipCodeSearchInput = function ZipCodeSearchInput(props) {
|
|
|
27
27
|
_onChange = props.onChange,
|
|
28
28
|
_props$debounceTimeou = props.debounceTimeout,
|
|
29
29
|
debounceTimeout = _props$debounceTimeou === void 0 ? 1000 : _props$debounceTimeou,
|
|
30
|
+
onSearchStart = props.onSearchStart,
|
|
31
|
+
onSearchEnd = props.onSearchEnd,
|
|
30
32
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
31
33
|
var _useLocale = useLocale('ZipCodeSearchInput'),
|
|
32
34
|
t = _useLocale.format;
|
|
@@ -50,64 +52,68 @@ var ZipCodeSearchInput = function ZipCodeSearchInput(props) {
|
|
|
50
52
|
}, [value]);
|
|
51
53
|
var handleSearch = /*#__PURE__*/function () {
|
|
52
54
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(newValue) {
|
|
53
|
-
var response, res, state, city;
|
|
55
|
+
var result, response, res, state, city;
|
|
54
56
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55
57
|
while (1) switch (_context.prev = _context.next) {
|
|
56
58
|
case 0:
|
|
57
|
-
|
|
59
|
+
result = [];
|
|
60
|
+
_context.prev = 1;
|
|
58
61
|
if (newValue) {
|
|
59
|
-
_context.next =
|
|
62
|
+
_context.next = 4;
|
|
60
63
|
break;
|
|
61
64
|
}
|
|
62
65
|
return _context.abrupt("return", setData([]));
|
|
63
|
-
case
|
|
66
|
+
case 4:
|
|
64
67
|
setLoading(true);
|
|
65
|
-
|
|
68
|
+
onSearchStart === null || onSearchStart === void 0 ? void 0 : onSearchStart(newValue);
|
|
69
|
+
_context.next = 8;
|
|
66
70
|
return fetch("https://api.zippopotam.us/us/".concat(newValue));
|
|
67
|
-
case
|
|
71
|
+
case 8:
|
|
68
72
|
response = _context.sent;
|
|
69
73
|
if (!response.ok) {
|
|
70
|
-
_context.next =
|
|
74
|
+
_context.next = 22;
|
|
71
75
|
break;
|
|
72
76
|
}
|
|
73
|
-
_context.next =
|
|
77
|
+
_context.next = 12;
|
|
74
78
|
return response.json();
|
|
75
|
-
case
|
|
79
|
+
case 12:
|
|
76
80
|
res = _context.sent;
|
|
77
81
|
if (res !== null && res !== void 0 && res.places) {
|
|
78
|
-
_context.next =
|
|
82
|
+
_context.next = 16;
|
|
79
83
|
break;
|
|
80
84
|
}
|
|
81
85
|
setData([]);
|
|
82
|
-
return _context.abrupt("return"
|
|
83
|
-
case
|
|
86
|
+
return _context.abrupt("return");
|
|
87
|
+
case 16:
|
|
84
88
|
state = res.places[0]['state'];
|
|
85
89
|
city = res.places[0]['place name'];
|
|
86
|
-
|
|
90
|
+
result = [{
|
|
87
91
|
label: "".concat(state, " / ").concat(city),
|
|
88
92
|
value: "".concat(state, " / ").concat(city),
|
|
89
93
|
code: newValue
|
|
90
|
-
}]
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case 19:
|
|
94
|
-
setData([]);
|
|
95
|
-
case 20:
|
|
96
|
-
_context.next = 25;
|
|
94
|
+
}];
|
|
95
|
+
setData(result);
|
|
96
|
+
_context.next = 23;
|
|
97
97
|
break;
|
|
98
98
|
case 22:
|
|
99
|
-
_context.prev = 22;
|
|
100
|
-
_context.t0 = _context["catch"](0);
|
|
101
99
|
setData([]);
|
|
100
|
+
case 23:
|
|
101
|
+
_context.next = 28;
|
|
102
|
+
break;
|
|
102
103
|
case 25:
|
|
103
104
|
_context.prev = 25;
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
_context.t0 = _context["catch"](1);
|
|
106
|
+
setData([]);
|
|
106
107
|
case 28:
|
|
108
|
+
_context.prev = 28;
|
|
109
|
+
setLoading(false);
|
|
110
|
+
onSearchEnd === null || onSearchEnd === void 0 ? void 0 : onSearchEnd(newValue, result);
|
|
111
|
+
return _context.finish(28);
|
|
112
|
+
case 32:
|
|
107
113
|
case "end":
|
|
108
114
|
return _context.stop();
|
|
109
115
|
}
|
|
110
|
-
}, _callee, null, [[
|
|
116
|
+
}, _callee, null, [[1, 25, 28, 32]]);
|
|
111
117
|
}));
|
|
112
118
|
return function handleSearch(_x) {
|
|
113
119
|
return _ref.apply(this, arguments);
|