x-star-design 0.0.75 → 0.0.77
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/ac-animation/define.d.ts +2 -2
- package/dist/ac-animation/index.d.ts +2 -2
- package/dist/aliplayer/index.d.ts +1 -1
- package/dist/aliplayer/index.js +7 -4
- package/dist/anchor-x-tabs/index.d.ts +1 -1
- package/dist/assets/score-report/xcamp-logo.png +0 -0
- package/dist/assets/score-report/xyd-logo.png +0 -0
- package/dist/code-detail-modal/index.d.ts +2 -2
- package/dist/code-mirror-wrapper/index.d.ts +2 -2
- package/dist/contact-button/index.d.ts +1 -1
- package/dist/contact-button/index.js +3 -3
- package/dist/contest-time-input/index.d.ts +1 -1
- package/dist/dom-observer/index.d.ts +9 -0
- package/dist/dom-observer/index.js +34 -0
- package/dist/draggable-layout/index.d.ts +2 -2
- package/dist/error-boundary/error-page/index.d.ts +1 -1
- package/dist/error-boundary/index.d.ts +2 -1
- package/dist/feedback/index.d.ts +2 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +3 -0
- package/dist/input-numbers/index.d.ts +1 -1
- package/dist/loading-mask/index.d.ts +1 -1
- package/dist/locales/en_US.d.ts +21 -0
- package/dist/locales/en_US.js +21 -0
- package/dist/locales/index.d.ts +44 -2
- package/dist/locales/index.js +2 -2
- package/dist/locales/zh_CN.d.ts +21 -0
- package/dist/locales/zh_CN.js +21 -0
- package/dist/micro-app/index.d.ts +1 -1
- package/dist/rainbow-cat/index.d.ts +3 -2
- package/dist/score-report/define.d.ts +37 -0
- package/dist/score-report/define.js +1 -0
- package/dist/score-report/index.d.ts +4 -0
- package/dist/score-report/index.js +167 -0
- package/dist/sort-table/index.d.ts +1 -1
- package/dist/styles/index.css +142 -0
- package/dist/submission-status/index.d.ts +1 -1
- package/dist/tenant-provider/index.d.ts +40 -0
- package/dist/tenant-provider/index.js +78 -0
- package/dist/title-with-icon/index.d.ts +1 -1
- package/dist/user-avatar/index.d.ts +1 -1
- package/dist/virtual-table/index.d.ts +2 -1
- package/dist/visual-data-config/index.d.ts +3 -2
- package/dist/x-tabs/index.d.ts +1 -1
- package/package.json +2 -1
- /package/dist/assets/contact-button/{xcQrCode.png → xcamp-qr-code.png} +0 -0
- /package/dist/assets/contact-button/{wechatCode.jpg → xyd-qr-code.jpg} +0 -0
|
@@ -6,7 +6,7 @@ export interface ImgShowProps {
|
|
|
6
6
|
offsetX?: number;
|
|
7
7
|
offsetY?: number;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface TitleShowProps {
|
|
10
10
|
offsetX?: number;
|
|
11
11
|
offsetY?: number;
|
|
12
12
|
fontSize?: number;
|
|
@@ -30,7 +30,7 @@ export interface AcAnimationProps {
|
|
|
30
30
|
/**
|
|
31
31
|
* @default offsetX: 0, offsetY: 0, fontSize: 36, fontFamily: 'Arial', shadowColor: 'rgba(2,38,121,0.2)', color: '#022679' 相对canvas水平垂直居中
|
|
32
32
|
*/
|
|
33
|
-
titleStyle?:
|
|
33
|
+
titleStyle?: TitleShowProps;
|
|
34
34
|
/**
|
|
35
35
|
* @description canvas卸载时的回调
|
|
36
36
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AcAnimationProps } from './define';
|
|
3
|
-
declare const AcAnimation: React.
|
|
2
|
+
import type { AcAnimationProps } from './define';
|
|
3
|
+
declare const AcAnimation: ({ title, imgUrl, imgSizeAndPosition, titleStyle, onFinish, }: AcAnimationProps) => React.JSX.Element;
|
|
4
4
|
export default AcAnimation;
|
|
@@ -38,7 +38,7 @@ export declare class AliplayerManager {
|
|
|
38
38
|
remove(player: AliplayerInstance): void;
|
|
39
39
|
private setActivePlayer;
|
|
40
40
|
}
|
|
41
|
-
interface AliplayerProps {
|
|
41
|
+
export interface AliplayerProps {
|
|
42
42
|
config: AliplayerConfig;
|
|
43
43
|
onCreate?: (player: AliplayerInstance) => void;
|
|
44
44
|
}
|
package/dist/aliplayer/index.js
CHANGED
|
@@ -128,16 +128,19 @@ var Aliplayer = function Aliplayer(_ref) {
|
|
|
128
128
|
}, []);
|
|
129
129
|
var player = useRef();
|
|
130
130
|
useEffect(function () {
|
|
131
|
-
if (!
|
|
131
|
+
if (!document.getElementById('aliplayer-css')) {
|
|
132
132
|
var link = document.createElement('link');
|
|
133
|
+
link.id = 'aliplayer-css';
|
|
133
134
|
link.rel = 'stylesheet';
|
|
134
135
|
link.href = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.25.0/skins/default/aliplayer-min.css';
|
|
136
|
+
document.head.append(link);
|
|
137
|
+
}
|
|
138
|
+
if (!document.getElementById('aliplayer-js')) {
|
|
135
139
|
var script = document.createElement('script');
|
|
140
|
+
script.id = 'aliplayer-js';
|
|
136
141
|
script.type = 'text/javascript';
|
|
137
142
|
script.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.25.0/aliplayer-h5-min.js';
|
|
138
|
-
|
|
139
|
-
head.append(link);
|
|
140
|
-
head.append(script);
|
|
143
|
+
document.head.append(script);
|
|
141
144
|
}
|
|
142
145
|
}, []);
|
|
143
146
|
useEffect(function () {
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ModalProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CodeDetail } from './define';
|
|
4
|
-
interface CodeDetailModalProps extends ModalProps {
|
|
4
|
+
export interface CodeDetailModalProps extends ModalProps {
|
|
5
5
|
codeData: CodeDetail;
|
|
6
6
|
open: boolean;
|
|
7
7
|
onCancel: () => void;
|
|
8
8
|
}
|
|
9
|
-
declare const CodeDetailModal: React.
|
|
9
|
+
declare const CodeDetailModal: ({ codeData, open, onCancel, ...props }: CodeDetailModalProps) => React.JSX.Element;
|
|
10
10
|
export default CodeDetailModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LangId, Theme } from './define';
|
|
3
|
-
interface
|
|
3
|
+
export interface CodeMirrorWrapperProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
value?: string;
|
|
6
6
|
/**
|
|
@@ -26,5 +26,5 @@ interface Props {
|
|
|
26
26
|
readOnly?: boolean;
|
|
27
27
|
[key: string]: unknown;
|
|
28
28
|
}
|
|
29
|
-
declare const CodeMirrorWrapper: ({ className, value, theme, onChange, lang, readOnly, ...props }:
|
|
29
|
+
declare const CodeMirrorWrapper: ({ className, value, theme, onChange, lang, readOnly, ...props }: CodeMirrorWrapperProps) => React.JSX.Element;
|
|
30
30
|
export default CodeMirrorWrapper;
|
|
@@ -2,8 +2,8 @@ import { QrcodeOutlined } from '@ant-design/icons';
|
|
|
2
2
|
import { Card, Popover, Space } from 'antd';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { getTransResult } from 'x-star-utils';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import xcampQrCode from "../assets/contact-button/xcamp-qr-code.png";
|
|
6
|
+
import xydQrCode from "../assets/contact-button/xyd-qr-code.jpg";
|
|
7
7
|
import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
8
8
|
import { useLocale } from "../locales";
|
|
9
9
|
import { prefix } from "../utils/global";
|
|
@@ -23,7 +23,7 @@ var ContactButton = function ContactButton() {
|
|
|
23
23
|
style: {
|
|
24
24
|
height: 100
|
|
25
25
|
},
|
|
26
|
-
src: getTransResult(lang,
|
|
26
|
+
src: getTransResult(lang, xydQrCode, xcampQrCode)
|
|
27
27
|
}), t('CONTACT_TIP'), t('CONTACT_TELEPHONE'))
|
|
28
28
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
29
29
|
className: "".concat(prefix, "-contactButtonCard"),
|
|
@@ -3,7 +3,7 @@ interface ContestTimeInputValue {
|
|
|
3
3
|
limitHour?: number | null;
|
|
4
4
|
limitMinute?: number | null;
|
|
5
5
|
}
|
|
6
|
-
interface ContestTimeInputProps {
|
|
6
|
+
export interface ContestTimeInputProps {
|
|
7
7
|
suffix?: React.ReactNode;
|
|
8
8
|
prefix?: React.ReactNode;
|
|
9
9
|
defaultValue?: ContestTimeInputValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DomObserverProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
target: Element | (() => Element) | React.MutableRefObject<Element>;
|
|
5
|
+
options?: MutationObserverInit;
|
|
6
|
+
callback: MutationCallback;
|
|
7
|
+
}
|
|
8
|
+
declare const DomObserver: ({ children, target, options, callback, }: DomObserverProps) => React.JSX.Element;
|
|
9
|
+
export default DomObserver;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
var defaultOptions = {
|
|
3
|
+
attributes: true,
|
|
4
|
+
// 监听属性变化
|
|
5
|
+
characterData: true,
|
|
6
|
+
// 监听文本内容变化
|
|
7
|
+
childList: true,
|
|
8
|
+
// 监听子节点变化
|
|
9
|
+
subtree: true // 监听整个子树
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var DomObserver = function DomObserver(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
target = _ref.target,
|
|
15
|
+
_ref$options = _ref.options,
|
|
16
|
+
options = _ref$options === void 0 ? defaultOptions : _ref$options,
|
|
17
|
+
callback = _ref.callback;
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
// 创建一个观察器实例并传入回调函数
|
|
20
|
+
var observer = new MutationObserver(callback);
|
|
21
|
+
|
|
22
|
+
// 子组件中要观察的节点
|
|
23
|
+
var targetNode = target instanceof Element ? target : typeof target === 'function' ? target() : target.current;
|
|
24
|
+
|
|
25
|
+
// 开始观察目标节点
|
|
26
|
+
observer.observe(targetNode, options);
|
|
27
|
+
return function () {
|
|
28
|
+
// 在组件卸载时,停止观察
|
|
29
|
+
observer.disconnect();
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
33
|
+
};
|
|
34
|
+
export default DomObserver;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface DraggableLayoutProps {
|
|
2
|
+
export interface DraggableLayoutProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
dividerClassName?: string;
|
|
@@ -14,5 +14,5 @@ interface DraggableLayoutProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* 可拖拽布局
|
|
16
16
|
*/
|
|
17
|
-
declare const DraggableLayout: React.
|
|
17
|
+
declare const DraggableLayout: ({ className, style, dividerClassName, dividerWidth, dividerChildren, defaultWidth, minWidth, collapsible, left, right, }: DraggableLayoutProps) => React.JSX.Element;
|
|
18
18
|
export default DraggableLayout;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ErrorBoundaryProps as ReactErrorBoundaryProps } from 'react-error-boundary';
|
|
3
|
-
|
|
3
|
+
export type ErrorBoundaryProps = Partial<ReactErrorBoundaryProps>;
|
|
4
|
+
declare const ErrorBoundary: ({ fallback, fallbackRender, FallbackComponent, ...rest }: ErrorBoundaryProps) => React.JSX.Element;
|
|
4
5
|
export default ErrorBoundary;
|
|
5
6
|
export type { FallbackProps } from 'react-error-boundary';
|
package/dist/feedback/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ interface FeedbackItem {
|
|
|
3
3
|
value: string | number;
|
|
4
4
|
label: string;
|
|
5
5
|
}
|
|
6
|
-
interface FeedbackProps {
|
|
6
|
+
export interface FeedbackProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description 标题
|
|
9
9
|
* @default 您对本题目的反馈
|
|
@@ -42,5 +42,5 @@ interface FeedbackProps {
|
|
|
42
42
|
*/
|
|
43
43
|
feedbackTextAreaKey: string;
|
|
44
44
|
}
|
|
45
|
-
declare const Feedback: React.
|
|
45
|
+
declare const Feedback: ({ title, feedbackListGood, feedbackListBad, activeColor, iconClassName, onSubmit, feedbackKey, feedbackTypeKey, feedbackTextAreaKey, }: FeedbackProps) => React.JSX.Element;
|
|
46
46
|
export default Feedback;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,54 @@
|
|
|
1
1
|
export { default as AcAnimation } from './ac-animation';
|
|
2
|
+
export type { AcAnimationProps } from './ac-animation/define';
|
|
2
3
|
export { default as AcConfig } from './ac-config';
|
|
4
|
+
export type { AcConfigHandle, AcConfigProps } from './ac-config';
|
|
3
5
|
export { default as Aliplayer } from './aliplayer';
|
|
4
|
-
export type { AliplayerConfig, AliplayerInstance } from './aliplayer';
|
|
6
|
+
export type { AliplayerConfig, AliplayerInstance, AliplayerProps, } from './aliplayer';
|
|
5
7
|
export { default as AnchorXTabs } from './anchor-x-tabs';
|
|
8
|
+
export type { AnchorTabProps } from './anchor-x-tabs';
|
|
6
9
|
export { default as CodeDetailModal } from './code-detail-modal';
|
|
10
|
+
export type { CodeDetailModalProps } from './code-detail-modal';
|
|
7
11
|
export { default as CodeMirrorWrapper } from './code-mirror-wrapper';
|
|
12
|
+
export type { CodeMirrorWrapperProps } from './code-mirror-wrapper';
|
|
8
13
|
export { LangId, Language, Theme } from './code-mirror-wrapper/define';
|
|
9
14
|
export { default as ContactButton } from './contact-button';
|
|
10
15
|
export { default as ContestTimeInput } from './contest-time-input';
|
|
16
|
+
export type { ContestTimeInputProps } from './contest-time-input';
|
|
17
|
+
export { default as DomObserver } from './dom-observer';
|
|
18
|
+
export type { DomObserverProps } from './dom-observer';
|
|
11
19
|
export { default as DraggableLayout } from './draggable-layout';
|
|
20
|
+
export type { DraggableLayoutProps } from './draggable-layout';
|
|
12
21
|
export { default as ErrorBoundary } from './error-boundary';
|
|
13
|
-
export type { FallbackProps } from './error-boundary';
|
|
22
|
+
export type { ErrorBoundaryProps, FallbackProps } from './error-boundary';
|
|
14
23
|
export { default as Feedback } from './feedback';
|
|
24
|
+
export type { FeedbackProps } from './feedback';
|
|
15
25
|
export { default as InputNumbers } from './input-numbers';
|
|
26
|
+
export type { InputNumbersProps } from './input-numbers';
|
|
16
27
|
export { default as LoadingMask } from './loading-mask';
|
|
28
|
+
export type { LoadingMaskProps } from './loading-mask';
|
|
17
29
|
export { LocaleProvider } from './locales';
|
|
30
|
+
export type { LocaleProviderProps } from './locales';
|
|
18
31
|
export { default as MicroApp } from './micro-app';
|
|
32
|
+
export type { MicroAppProps } from './micro-app';
|
|
19
33
|
export { default as RainbowCat } from './rainbow-cat';
|
|
34
|
+
export type { RainbowCatProps } from './rainbow-cat';
|
|
35
|
+
export { default as ScoreReport } from './score-report';
|
|
36
|
+
export type { ScoreMessage, ScoreReportDetail, ScoreReportProps, ScoreType, } from './score-report/define';
|
|
20
37
|
export { default as SortTable } from './sort-table';
|
|
38
|
+
export type { SortTableProps } from './sort-table';
|
|
21
39
|
export { default as StatusTag } from './status-tag';
|
|
22
40
|
export type { StatusTagProps, StatusTagShape, StatusTagStyle, StatusTagType, } from './status-tag/define';
|
|
23
41
|
export { default as SubmissionStatus } from './submission-status';
|
|
42
|
+
export type { SubmissionStatusProps } from './submission-status';
|
|
43
|
+
export { TenantProvider, getThemeConfig, useTenant } from './tenant-provider';
|
|
44
|
+
export type { Tenant, TenantName, TenantProviderProps, TenantTheme, } from './tenant-provider';
|
|
24
45
|
export { default as TitleWithIcon } from './title-with-icon';
|
|
46
|
+
export type { TitleWithIconProps } from './title-with-icon';
|
|
25
47
|
export { default as UserAvatar } from './user-avatar';
|
|
48
|
+
export type { UserAvatarProps } from './user-avatar';
|
|
26
49
|
export { default as VirtualTable } from './virtual-table';
|
|
50
|
+
export type { VirtualTableProps } from './virtual-table';
|
|
27
51
|
export { default as VisualDataConfig } from './visual-data-config';
|
|
52
|
+
export type { VisualDataConfigProps } from './visual-data-config';
|
|
28
53
|
export { default as XTabs } from './x-tabs';
|
|
54
|
+
export type { XTabsProps } from './x-tabs';
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { default as CodeMirrorWrapper } from "./code-mirror-wrapper";
|
|
|
7
7
|
export { LangId, Language, Theme } from "./code-mirror-wrapper/define";
|
|
8
8
|
export { default as ContactButton } from "./contact-button";
|
|
9
9
|
export { default as ContestTimeInput } from "./contest-time-input";
|
|
10
|
+
export { default as DomObserver } from "./dom-observer";
|
|
10
11
|
export { default as DraggableLayout } from "./draggable-layout";
|
|
11
12
|
export { default as ErrorBoundary } from "./error-boundary";
|
|
12
13
|
export { default as Feedback } from "./feedback";
|
|
@@ -15,9 +16,11 @@ export { default as LoadingMask } from "./loading-mask";
|
|
|
15
16
|
export { LocaleProvider } from "./locales";
|
|
16
17
|
export { default as MicroApp } from "./micro-app";
|
|
17
18
|
export { default as RainbowCat } from "./rainbow-cat";
|
|
19
|
+
export { default as ScoreReport } from "./score-report";
|
|
18
20
|
export { default as SortTable } from "./sort-table";
|
|
19
21
|
export { default as StatusTag } from "./status-tag";
|
|
20
22
|
export { default as SubmissionStatus } from "./submission-status";
|
|
23
|
+
export { TenantProvider, getThemeConfig, useTenant } from "./tenant-provider";
|
|
21
24
|
export { default as TitleWithIcon } from "./title-with-icon";
|
|
22
25
|
export { default as UserAvatar } from "./user-avatar";
|
|
23
26
|
export { default as VirtualTable } from "./virtual-table";
|
|
@@ -4,7 +4,7 @@ export interface InputNumbersValue {
|
|
|
4
4
|
start?: string | number | null;
|
|
5
5
|
end?: string | number | null;
|
|
6
6
|
}
|
|
7
|
-
interface InputNumbersProps extends Omit<InputNumberProps, 'defaultValue' | 'value' | 'onChange'> {
|
|
7
|
+
export interface InputNumbersProps extends Omit<InputNumberProps, 'defaultValue' | 'value' | 'onChange'> {
|
|
8
8
|
defaultValue?: InputNumbersValue;
|
|
9
9
|
value?: InputNumbersValue;
|
|
10
10
|
onChange?: (value: InputNumbersValue) => void;
|
package/dist/locales/en_US.d.ts
CHANGED
|
@@ -150,5 +150,26 @@ declare const _default: {
|
|
|
150
150
|
readonly ResourceRestriction: "Resource Restriction";
|
|
151
151
|
readonly ResourceRestrictionDesc: "Access to other course materials, Learning spaces, Premium Problem Bank, and forums is restricted.";
|
|
152
152
|
};
|
|
153
|
+
readonly ScoreReport: {
|
|
154
|
+
readonly In_Game_Total_Score: "Timed Score";
|
|
155
|
+
readonly ScoreReport: "Score Report";
|
|
156
|
+
readonly Score: "Score:";
|
|
157
|
+
readonly ScoreReportTitle: "Score Report";
|
|
158
|
+
readonly ScoreCopylink: "copy link";
|
|
159
|
+
readonly DownloadDom: "Download the score report";
|
|
160
|
+
readonly ScoreReportButtonTip: "Visible after homework/exam";
|
|
161
|
+
readonly clipboardSuccessTip: "The link has been copied to the clipboard";
|
|
162
|
+
readonly CopyFail: "Copy failed, no permission to write to clipboard, refused to write to clipboard, please change browser.";
|
|
163
|
+
readonly Example_RANK: "Rank";
|
|
164
|
+
readonly Example_In_Game_Total_Score: "Timed Score";
|
|
165
|
+
readonly Example_PROGRAMMING_QUESTIONS: "Programming Problems";
|
|
166
|
+
readonly Example_Objective_Question: "Objective Problem";
|
|
167
|
+
readonly Example_Problem_Type: "Required";
|
|
168
|
+
readonly Example_Option_Problem: "Bonus";
|
|
169
|
+
readonly Example_USER: "User";
|
|
170
|
+
readonly Example_Class: "Class";
|
|
171
|
+
readonly Example_Paper: "Paper";
|
|
172
|
+
readonly Example_Time: "Time";
|
|
173
|
+
};
|
|
153
174
|
};
|
|
154
175
|
export default _default;
|
package/dist/locales/en_US.js
CHANGED
|
@@ -149,5 +149,26 @@ export default {
|
|
|
149
149
|
RestrictionsDuringHomeworkExam: 'Restrictions During Homework/Exam',
|
|
150
150
|
ResourceRestriction: 'Resource Restriction',
|
|
151
151
|
ResourceRestrictionDesc: 'Access to other course materials, Learning spaces, Premium Problem Bank, and forums is restricted.'
|
|
152
|
+
},
|
|
153
|
+
ScoreReport: {
|
|
154
|
+
In_Game_Total_Score: 'Timed Score',
|
|
155
|
+
ScoreReport: 'Score Report',
|
|
156
|
+
Score: 'Score:',
|
|
157
|
+
ScoreReportTitle: 'Score Report',
|
|
158
|
+
ScoreCopylink: 'copy link',
|
|
159
|
+
DownloadDom: 'Download the score report',
|
|
160
|
+
ScoreReportButtonTip: 'Visible after homework/exam',
|
|
161
|
+
clipboardSuccessTip: 'The link has been copied to the clipboard',
|
|
162
|
+
CopyFail: 'Copy failed, no permission to write to clipboard, refused to write to clipboard, please change browser.',
|
|
163
|
+
Example_RANK: 'Rank',
|
|
164
|
+
Example_In_Game_Total_Score: 'Timed Score',
|
|
165
|
+
Example_PROGRAMMING_QUESTIONS: 'Programming Problems',
|
|
166
|
+
Example_Objective_Question: 'Objective Problem',
|
|
167
|
+
Example_Problem_Type: 'Required',
|
|
168
|
+
Example_Option_Problem: 'Bonus',
|
|
169
|
+
Example_USER: 'User',
|
|
170
|
+
Example_Class: 'Class',
|
|
171
|
+
Example_Paper: 'Paper',
|
|
172
|
+
Example_Time: 'Time'
|
|
152
173
|
}
|
|
153
174
|
};
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import en_US from './en_US';
|
|
3
3
|
import zh_CN from './zh_CN';
|
|
4
|
-
interface LocaleProviderProps {
|
|
4
|
+
export interface LocaleProviderProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
locale?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const LocaleProvider: ({ children, locale, }: LocaleProviderProps) => React.JSX.Element;
|
|
9
9
|
type MessageMap = typeof zh_CN | typeof en_US;
|
|
10
|
-
export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton" | "CodeDetailModal" | "ContactButton" | "ErrorPage" | "Feedback" | "MicroApp" | "ContestTimeInput" | "AcConfig">(slice: T) => {
|
|
10
|
+
export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton" | "CodeDetailModal" | "ContactButton" | "ErrorPage" | "Feedback" | "MicroApp" | "ContestTimeInput" | "AcConfig" | "ScoreReport">(slice: T) => {
|
|
11
11
|
locale: string;
|
|
12
12
|
format: <U extends keyof MessageMap[T]>(key: U) => ({
|
|
13
13
|
readonly VisualDataConfig: {
|
|
@@ -161,6 +161,27 @@ export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton
|
|
|
161
161
|
readonly ResourceRestriction: "限制资源访问";
|
|
162
162
|
readonly ResourceRestrictionDesc: "限制访问其他课件、学习空间、精品题库、论坛";
|
|
163
163
|
};
|
|
164
|
+
readonly ScoreReport: {
|
|
165
|
+
readonly In_Game_Total_Score: "赛中总分";
|
|
166
|
+
readonly ScoreReport: "成绩单";
|
|
167
|
+
readonly Score: "成绩:";
|
|
168
|
+
readonly ScoreReportTitle: "成绩报告单";
|
|
169
|
+
readonly ScoreCopylink: "复制链接";
|
|
170
|
+
readonly DownloadDom: "下载成绩报告单";
|
|
171
|
+
readonly ScoreReportButtonTip: "作业/考试结束后可见";
|
|
172
|
+
readonly clipboardSuccessTip: "已将链接复制到剪贴板";
|
|
173
|
+
readonly CopyFail: "复制失败,没有写入剪贴板的权限,拒绝写入剪切板,请更换浏览器。";
|
|
174
|
+
readonly Example_RANK: "名次";
|
|
175
|
+
readonly Example_In_Game_Total_Score: "赛中总分";
|
|
176
|
+
readonly Example_PROGRAMMING_QUESTIONS: "编程题";
|
|
177
|
+
readonly Example_Objective_Question: "客观题";
|
|
178
|
+
readonly Example_Problem_Type: "必做题";
|
|
179
|
+
readonly Example_Option_Problem: "选做题";
|
|
180
|
+
readonly Example_USER: "用户";
|
|
181
|
+
readonly Example_Class: "班级";
|
|
182
|
+
readonly Example_Paper: "试卷";
|
|
183
|
+
readonly Example_Time: "时间";
|
|
184
|
+
};
|
|
164
185
|
} | {
|
|
165
186
|
readonly VisualDataConfig: {
|
|
166
187
|
readonly Time_MS: "Time Limit(MS)";
|
|
@@ -313,6 +334,27 @@ export declare const useLocale: <T extends "VisualDataConfig" | "TranslateButton
|
|
|
313
334
|
readonly ResourceRestriction: "Resource Restriction";
|
|
314
335
|
readonly ResourceRestrictionDesc: "Access to other course materials, Learning spaces, Premium Problem Bank, and forums is restricted.";
|
|
315
336
|
};
|
|
337
|
+
readonly ScoreReport: {
|
|
338
|
+
readonly In_Game_Total_Score: "Timed Score";
|
|
339
|
+
readonly ScoreReport: "Score Report";
|
|
340
|
+
readonly Score: "Score:";
|
|
341
|
+
readonly ScoreReportTitle: "Score Report";
|
|
342
|
+
readonly ScoreCopylink: "copy link";
|
|
343
|
+
readonly DownloadDom: "Download the score report";
|
|
344
|
+
readonly ScoreReportButtonTip: "Visible after homework/exam";
|
|
345
|
+
readonly clipboardSuccessTip: "The link has been copied to the clipboard";
|
|
346
|
+
readonly CopyFail: "Copy failed, no permission to write to clipboard, refused to write to clipboard, please change browser.";
|
|
347
|
+
readonly Example_RANK: "Rank";
|
|
348
|
+
readonly Example_In_Game_Total_Score: "Timed Score";
|
|
349
|
+
readonly Example_PROGRAMMING_QUESTIONS: "Programming Problems";
|
|
350
|
+
readonly Example_Objective_Question: "Objective Problem";
|
|
351
|
+
readonly Example_Problem_Type: "Required";
|
|
352
|
+
readonly Example_Option_Problem: "Bonus";
|
|
353
|
+
readonly Example_USER: "User";
|
|
354
|
+
readonly Example_Class: "Class";
|
|
355
|
+
readonly Example_Paper: "Paper";
|
|
356
|
+
readonly Example_Time: "Time";
|
|
357
|
+
};
|
|
316
358
|
})[T][U];
|
|
317
359
|
};
|
|
318
360
|
export {};
|
package/dist/locales/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export var useLocale = function useLocale(slice) {
|
|
|
21
21
|
var message = ((_zh_CN$en_US$locale = {
|
|
22
22
|
zh_CN: zh_CN,
|
|
23
23
|
en_US: en_US
|
|
24
|
-
}[locale]) !== null && _zh_CN$en_US$locale !== void 0 ? _zh_CN$en_US$locale :
|
|
24
|
+
}[locale]) !== null && _zh_CN$en_US$locale !== void 0 ? _zh_CN$en_US$locale : en_US)[slice];
|
|
25
25
|
var messageLatest = useRef(message);
|
|
26
26
|
messageLatest.current = message;
|
|
27
27
|
var format = useRef(function (key) {
|
|
@@ -31,7 +31,7 @@ export var useLocale = function useLocale(slice) {
|
|
|
31
31
|
locale: {
|
|
32
32
|
zh_CN: zh_CN,
|
|
33
33
|
en_US: en_US
|
|
34
|
-
}[locale] ? locale : '
|
|
34
|
+
}[locale] ? locale : 'en_US',
|
|
35
35
|
format: format
|
|
36
36
|
};
|
|
37
37
|
};
|
package/dist/locales/zh_CN.d.ts
CHANGED
|
@@ -150,5 +150,26 @@ declare const _default: {
|
|
|
150
150
|
readonly ResourceRestriction: "限制资源访问";
|
|
151
151
|
readonly ResourceRestrictionDesc: "限制访问其他课件、学习空间、精品题库、论坛";
|
|
152
152
|
};
|
|
153
|
+
readonly ScoreReport: {
|
|
154
|
+
readonly In_Game_Total_Score: "赛中总分";
|
|
155
|
+
readonly ScoreReport: "成绩单";
|
|
156
|
+
readonly Score: "成绩:";
|
|
157
|
+
readonly ScoreReportTitle: "成绩报告单";
|
|
158
|
+
readonly ScoreCopylink: "复制链接";
|
|
159
|
+
readonly DownloadDom: "下载成绩报告单";
|
|
160
|
+
readonly ScoreReportButtonTip: "作业/考试结束后可见";
|
|
161
|
+
readonly clipboardSuccessTip: "已将链接复制到剪贴板";
|
|
162
|
+
readonly CopyFail: "复制失败,没有写入剪贴板的权限,拒绝写入剪切板,请更换浏览器。";
|
|
163
|
+
readonly Example_RANK: "名次";
|
|
164
|
+
readonly Example_In_Game_Total_Score: "赛中总分";
|
|
165
|
+
readonly Example_PROGRAMMING_QUESTIONS: "编程题";
|
|
166
|
+
readonly Example_Objective_Question: "客观题";
|
|
167
|
+
readonly Example_Problem_Type: "必做题";
|
|
168
|
+
readonly Example_Option_Problem: "选做题";
|
|
169
|
+
readonly Example_USER: "用户";
|
|
170
|
+
readonly Example_Class: "班级";
|
|
171
|
+
readonly Example_Paper: "试卷";
|
|
172
|
+
readonly Example_Time: "时间";
|
|
173
|
+
};
|
|
153
174
|
};
|
|
154
175
|
export default _default;
|
package/dist/locales/zh_CN.js
CHANGED
|
@@ -149,5 +149,26 @@ export default {
|
|
|
149
149
|
RestrictionsDuringHomeworkExam: '作业/考试结束前限制',
|
|
150
150
|
ResourceRestriction: '限制资源访问',
|
|
151
151
|
ResourceRestrictionDesc: '限制访问其他课件、学习空间、精品题库、论坛'
|
|
152
|
+
},
|
|
153
|
+
ScoreReport: {
|
|
154
|
+
In_Game_Total_Score: '赛中总分',
|
|
155
|
+
ScoreReport: '成绩单',
|
|
156
|
+
Score: '成绩:',
|
|
157
|
+
ScoreReportTitle: '成绩报告单',
|
|
158
|
+
ScoreCopylink: '复制链接',
|
|
159
|
+
DownloadDom: '下载成绩报告单',
|
|
160
|
+
ScoreReportButtonTip: '作业/考试结束后可见',
|
|
161
|
+
clipboardSuccessTip: '已将链接复制到剪贴板',
|
|
162
|
+
CopyFail: '复制失败,没有写入剪贴板的权限,拒绝写入剪切板,请更换浏览器。',
|
|
163
|
+
Example_RANK: '名次',
|
|
164
|
+
Example_In_Game_Total_Score: '赛中总分',
|
|
165
|
+
Example_PROGRAMMING_QUESTIONS: '编程题',
|
|
166
|
+
Example_Objective_Question: '客观题',
|
|
167
|
+
Example_Problem_Type: '必做题',
|
|
168
|
+
Example_Option_Problem: '选做题',
|
|
169
|
+
Example_USER: '用户',
|
|
170
|
+
Example_Class: '班级',
|
|
171
|
+
Example_Paper: '试卷',
|
|
172
|
+
Example_Time: '时间'
|
|
152
173
|
}
|
|
153
174
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TableProps } from 'antd';
|
|
3
|
+
export interface ScoreType {
|
|
4
|
+
requiredScore: number;
|
|
5
|
+
optionalScore: number;
|
|
6
|
+
requiredTotalScore: number;
|
|
7
|
+
optionalTotalScore: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ScoreMessage {
|
|
10
|
+
label: string | number | React.ReactNode;
|
|
11
|
+
value?: string | number | React.ReactNode;
|
|
12
|
+
render?: (item: ScoreMessage) => React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface ScoreReportDetail {
|
|
15
|
+
type: string;
|
|
16
|
+
rank: number;
|
|
17
|
+
username: string;
|
|
18
|
+
realname: string;
|
|
19
|
+
class: string;
|
|
20
|
+
paperZh: string;
|
|
21
|
+
paperEn: string;
|
|
22
|
+
startTime: number;
|
|
23
|
+
endTime: number;
|
|
24
|
+
totalScore: ScoreType;
|
|
25
|
+
programScore: ScoreType;
|
|
26
|
+
objectiveScore: ScoreType;
|
|
27
|
+
}
|
|
28
|
+
export interface ScoreReportProps {
|
|
29
|
+
tableProps: TableProps;
|
|
30
|
+
scoreMessage: ScoreMessage[];
|
|
31
|
+
scoreDetail: ScoreReportDetail;
|
|
32
|
+
fileName: string;
|
|
33
|
+
token: string;
|
|
34
|
+
isMobile: boolean;
|
|
35
|
+
tenant: 'XYD' | 'XCAMP';
|
|
36
|
+
toggleLang: () => void;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import { DownloadOutlined, ExportOutlined } from '@ant-design/icons';
|
|
5
|
+
import { useTitle } from 'ahooks';
|
|
6
|
+
import { Button, Col, Layout, QRCode, Row, Table, Tooltip, Typography, Watermark, message } from 'antd';
|
|
7
|
+
import html2canvas from 'html2canvas';
|
|
8
|
+
import React, { useRef } from 'react';
|
|
9
|
+
import xcampLogo from "../assets/score-report/xcamp-logo.png";
|
|
10
|
+
import xydLogo from "../assets/score-report/xyd-logo.png";
|
|
11
|
+
import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
12
|
+
import { useLocale } from "../locales";
|
|
13
|
+
import { prefix } from "../utils/global";
|
|
14
|
+
var Title = Typography.Title;
|
|
15
|
+
var Content = Layout.Content;
|
|
16
|
+
var scoreReportPrefix = "".concat(prefix, "-scoreReport");
|
|
17
|
+
var ScoreReport = function ScoreReport(_ref) {
|
|
18
|
+
var tableProps = _ref.tableProps,
|
|
19
|
+
scoreMessage = _ref.scoreMessage,
|
|
20
|
+
scoreDetail = _ref.scoreDetail,
|
|
21
|
+
fileName = _ref.fileName,
|
|
22
|
+
token = _ref.token,
|
|
23
|
+
isMobile = _ref.isMobile,
|
|
24
|
+
tenant = _ref.tenant,
|
|
25
|
+
toggleLang = _ref.toggleLang;
|
|
26
|
+
var _useLocale = useLocale('ScoreReport'),
|
|
27
|
+
lang = _useLocale.locale,
|
|
28
|
+
t = _useLocale.format;
|
|
29
|
+
var scoreReportdDOM = useRef(null);
|
|
30
|
+
useTitle(t('ScoreReportTitle'));
|
|
31
|
+
var handleDownloadDom = /*#__PURE__*/function () {
|
|
32
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
33
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
34
|
+
while (1) switch (_context.prev = _context.next) {
|
|
35
|
+
case 0:
|
|
36
|
+
html2canvas(scoreReportdDOM.current).then(function (canvas) {
|
|
37
|
+
// 下载图片
|
|
38
|
+
var link = document.createElement('a');
|
|
39
|
+
link.href = canvas.toDataURL('image/png');
|
|
40
|
+
link.download = fileName;
|
|
41
|
+
link.click();
|
|
42
|
+
});
|
|
43
|
+
case 1:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee);
|
|
48
|
+
}));
|
|
49
|
+
return function handleDownloadDom() {
|
|
50
|
+
return _ref2.apply(this, arguments);
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
return /*#__PURE__*/React.createElement(ConfigProviderWrapper, null, /*#__PURE__*/React.createElement(Content, {
|
|
54
|
+
className: "".concat(scoreReportPrefix, "-ContentStyles ").concat(scoreDetail.type === 'paper' && isMobile ? "".concat(scoreReportPrefix, "-overflowStyle") : '')
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "".concat(scoreReportPrefix, "-ContentContainer")
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
58
|
+
justify: "center",
|
|
59
|
+
align: "top",
|
|
60
|
+
style: {
|
|
61
|
+
margin: '10px'
|
|
62
|
+
},
|
|
63
|
+
className: "".concat(scoreReportPrefix, "-courseRow"),
|
|
64
|
+
gutter: 20,
|
|
65
|
+
wrap: false,
|
|
66
|
+
ref: scoreReportdDOM
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
68
|
+
flex: "auto",
|
|
69
|
+
style: isMobile ? {
|
|
70
|
+
paddingLeft: 0,
|
|
71
|
+
paddingRight: 0
|
|
72
|
+
} : {}
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Watermark, {
|
|
74
|
+
content: window.location.origin
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "".concat(scoreReportPrefix, "-ScoreMessageWrapper")
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "".concat(scoreReportPrefix, "-ScoreMessageTitle")
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
80
|
+
level: isMobile ? 2 : 1
|
|
81
|
+
}, t('ScoreReportTitle')), /*#__PURE__*/React.createElement(QRCode, {
|
|
82
|
+
className: "".concat(scoreReportPrefix, "-qrCode"),
|
|
83
|
+
value: window.location.href,
|
|
84
|
+
bordered: false,
|
|
85
|
+
size: isMobile ? 50 : 100
|
|
86
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: "".concat(scoreReportPrefix, "-ScoreMessage")
|
|
88
|
+
}, scoreMessage.map(function (item, index) {
|
|
89
|
+
if (item.render) return item.render(item);
|
|
90
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
key: index,
|
|
92
|
+
style: {
|
|
93
|
+
display: 'flex'
|
|
94
|
+
}
|
|
95
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
96
|
+
className: "".concat(scoreReportPrefix, "-messageLabel")
|
|
97
|
+
}, item.label, "\uFF1A"), /*#__PURE__*/React.createElement("span", {
|
|
98
|
+
className: "".concat(scoreReportPrefix, "-messageValue")
|
|
99
|
+
}, item.value));
|
|
100
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "".concat(scoreReportPrefix, "-ScoreMessageTable")
|
|
102
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
103
|
+
level: isMobile ? 3 : 2
|
|
104
|
+
}, t('Score')), /*#__PURE__*/React.createElement(Table, _extends({}, tableProps, {
|
|
105
|
+
style: {
|
|
106
|
+
marginTop: 20
|
|
107
|
+
}
|
|
108
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "".concat(scoreReportPrefix, "-ScoreMessageFooter")
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: "".concat(scoreReportPrefix, "-messageValue")
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
113
|
+
level: 4
|
|
114
|
+
}, "No.".concat(token))), /*#__PURE__*/React.createElement("div", null, tenant === 'XYD' ? /*#__PURE__*/React.createElement("img", {
|
|
115
|
+
"data-testid": "xydLogo",
|
|
116
|
+
src: xydLogo,
|
|
117
|
+
alt: ""
|
|
118
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
119
|
+
"data-testid": "xcampLogo",
|
|
120
|
+
src: xcampLogo,
|
|
121
|
+
alt: ""
|
|
122
|
+
}))))))), /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: "".concat(scoreReportPrefix, "-scoreDownload")
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
125
|
+
shape: 'circle',
|
|
126
|
+
type: 'primary',
|
|
127
|
+
ghost: true,
|
|
128
|
+
onClick: toggleLang
|
|
129
|
+
}, lang === 'zh_CN' ? 'EN' : 'ZH'), /*#__PURE__*/React.createElement(Tooltip, {
|
|
130
|
+
title: t('DownloadDom')
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
132
|
+
"data-testid": "downloadDom",
|
|
133
|
+
type: "primary",
|
|
134
|
+
shape: "circle",
|
|
135
|
+
icon: /*#__PURE__*/React.createElement(DownloadOutlined, null),
|
|
136
|
+
onClick: handleDownloadDom
|
|
137
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
138
|
+
title: t('ScoreCopylink')
|
|
139
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
140
|
+
"data-testid": "copyLink",
|
|
141
|
+
type: "primary",
|
|
142
|
+
shape: "circle",
|
|
143
|
+
icon: /*#__PURE__*/React.createElement(ExportOutlined, null),
|
|
144
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
145
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
146
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
147
|
+
case 0:
|
|
148
|
+
_context2.prev = 0;
|
|
149
|
+
_context2.next = 3;
|
|
150
|
+
return navigator.clipboard.writeText(window.location.href);
|
|
151
|
+
case 3:
|
|
152
|
+
message.success(t('clipboardSuccessTip'));
|
|
153
|
+
_context2.next = 9;
|
|
154
|
+
break;
|
|
155
|
+
case 6:
|
|
156
|
+
_context2.prev = 6;
|
|
157
|
+
_context2.t0 = _context2["catch"](0);
|
|
158
|
+
message.error(t('CopyFail'));
|
|
159
|
+
case 9:
|
|
160
|
+
case "end":
|
|
161
|
+
return _context2.stop();
|
|
162
|
+
}
|
|
163
|
+
}, _callee2, null, [[0, 6]]);
|
|
164
|
+
}))
|
|
165
|
+
}))))));
|
|
166
|
+
};
|
|
167
|
+
export default ScoreReport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
interface SortTableProps<RecordType> extends TableProps<RecordType> {
|
|
3
|
+
export interface SortTableProps<RecordType = any> extends TableProps<RecordType> {
|
|
4
4
|
onSortEnd?: (data: RecordType[]) => void;
|
|
5
5
|
}
|
|
6
6
|
declare const SortTable: <RecordType extends Record<string | number | symbol, any>>(props: SortTableProps<RecordType>) => React.JSX.Element;
|
package/dist/styles/index.css
CHANGED
|
@@ -621,3 +621,145 @@
|
|
|
621
621
|
.x-star-design-x-tabs-wrapper > .x-star-design-x-tabs > .x-star-design-tabs-content-holder > .x-star-design-tabs-content > .x-star-design-tabs-tabpane {
|
|
622
622
|
padding: 0 24px 24px;
|
|
623
623
|
}
|
|
624
|
+
|
|
625
|
+
.x-star-design-scoreReport-overflowStyle {
|
|
626
|
+
width: fit-content !important;
|
|
627
|
+
min-height: 850px !important;
|
|
628
|
+
background-color: #f5f5f5 !important;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.x-star-design-scoreReport-ContentStyles {
|
|
632
|
+
display: flex;
|
|
633
|
+
justify-content: center;
|
|
634
|
+
align-items: center;
|
|
635
|
+
padding: 20px 0;
|
|
636
|
+
width: 100%;
|
|
637
|
+
height: 100vh;
|
|
638
|
+
min-height: 860px;
|
|
639
|
+
}
|
|
640
|
+
@media (max-width: 576px) {
|
|
641
|
+
.x-star-design-scoreReport-ContentStyles {
|
|
642
|
+
min-height: 780px;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
@media (min-width: 576px) {
|
|
647
|
+
.x-star-design-scoreReport-ContentContainer {
|
|
648
|
+
width: 800px;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
.x-star-design-scoreReport-ContentContainer h1,
|
|
652
|
+
.x-star-design-scoreReport-ContentContainer h2,
|
|
653
|
+
.x-star-design-scoreReport-ContentContainer h3,
|
|
654
|
+
.x-star-design-scoreReport-ContentContainer h4 {
|
|
655
|
+
margin: 0 !important;
|
|
656
|
+
}
|
|
657
|
+
@media (min-width: 576px) {
|
|
658
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow {
|
|
659
|
+
max-width: 110rem;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-adv {
|
|
663
|
+
width: 100%;
|
|
664
|
+
border-radius: 6px;
|
|
665
|
+
}
|
|
666
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper {
|
|
667
|
+
padding: 24px;
|
|
668
|
+
width: 100%;
|
|
669
|
+
border-radius: 10px;
|
|
670
|
+
background-color: #fff;
|
|
671
|
+
}
|
|
672
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTitle {
|
|
673
|
+
position: relative;
|
|
674
|
+
display: flex;
|
|
675
|
+
justify-content: center;
|
|
676
|
+
margin: 30px 0 54px;
|
|
677
|
+
}
|
|
678
|
+
@media (max-width: 576px) {
|
|
679
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTitle {
|
|
680
|
+
margin: 30px 0;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTitle .x-star-design-scoreReport-qrCode {
|
|
684
|
+
position: absolute;
|
|
685
|
+
top: -26px;
|
|
686
|
+
right: 0;
|
|
687
|
+
}
|
|
688
|
+
@media (max-width: 576px) {
|
|
689
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTitle .x-star-design-scoreReport-qrCode {
|
|
690
|
+
top: -6px;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessage {
|
|
694
|
+
display: flex;
|
|
695
|
+
flex-direction: column;
|
|
696
|
+
gap: 30px;
|
|
697
|
+
font-size: 22px;
|
|
698
|
+
}
|
|
699
|
+
@media (max-width: 576px) {
|
|
700
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessage {
|
|
701
|
+
font-size: 16px;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessage .x-star-design-scoreReport-messageValue {
|
|
705
|
+
font-weight: bolder;
|
|
706
|
+
}
|
|
707
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTable {
|
|
708
|
+
margin-top: 60px;
|
|
709
|
+
}
|
|
710
|
+
@media (max-width: 576px) {
|
|
711
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageTable {
|
|
712
|
+
margin-top: 30px;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
@media (min-width: 576px) {
|
|
716
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter {
|
|
717
|
+
display: flex;
|
|
718
|
+
justify-content: space-between;
|
|
719
|
+
align-items: center;
|
|
720
|
+
margin: 50px 0 30px;
|
|
721
|
+
gap: 30px;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
@media (max-width: 576px) {
|
|
725
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter {
|
|
726
|
+
display: flex;
|
|
727
|
+
margin-top: 30px;
|
|
728
|
+
min-width: 300px;
|
|
729
|
+
flex-direction: column;
|
|
730
|
+
gap: 30px;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter h4 {
|
|
734
|
+
font-size: 16px !important;
|
|
735
|
+
color: #afafaf;
|
|
736
|
+
}
|
|
737
|
+
@media (max-width: 576px) {
|
|
738
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter {
|
|
739
|
+
gap: 20px;
|
|
740
|
+
}
|
|
741
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter h4 {
|
|
742
|
+
font-size: 12px !important;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter img {
|
|
746
|
+
width: 250px;
|
|
747
|
+
}
|
|
748
|
+
@media (max-width: 576px) {
|
|
749
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-courseRow .x-star-design-scoreReport-ScoreMessageWrapper .x-star-design-scoreReport-ScoreMessageFooter img {
|
|
750
|
+
width: 100px;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-scoreDownload {
|
|
754
|
+
display: flex;
|
|
755
|
+
justify-content: end;
|
|
756
|
+
margin: 30px 0;
|
|
757
|
+
padding-right: 16px;
|
|
758
|
+
gap: 10px;
|
|
759
|
+
}
|
|
760
|
+
@media (min-width: 576px) {
|
|
761
|
+
.x-star-design-scoreReport-ContentContainer .x-star-design-scoreReport-scoreDownload {
|
|
762
|
+
margin: 20px auto !important;
|
|
763
|
+
max-width: 110rem;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
@@ -19,7 +19,7 @@ export declare enum Status {
|
|
|
19
19
|
TimeLimitExceeded = "Time Limit Exceeded",
|
|
20
20
|
WrongAnswer = "Wrong Answer"
|
|
21
21
|
}
|
|
22
|
-
interface SubmissionStatusProps {
|
|
22
|
+
export interface SubmissionStatusProps {
|
|
23
23
|
className?: string;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
25
|
status: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ThemeConfig } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* 租户名称
|
|
5
|
+
*/
|
|
6
|
+
export type TenantName = 'xyd' | 'xcamp';
|
|
7
|
+
/**
|
|
8
|
+
* 租户配置
|
|
9
|
+
*/
|
|
10
|
+
export interface Tenant {
|
|
11
|
+
name: TenantName;
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 租户主题
|
|
16
|
+
*/
|
|
17
|
+
export interface TenantTheme {
|
|
18
|
+
primaryColor: string;
|
|
19
|
+
linkColor: string;
|
|
20
|
+
secondaryColor: string;
|
|
21
|
+
}
|
|
22
|
+
interface TenantContextValue {
|
|
23
|
+
tenant: Tenant;
|
|
24
|
+
theme: TenantTheme;
|
|
25
|
+
}
|
|
26
|
+
export interface TenantProviderProps {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
tenants: Record<TenantName, Tenant>;
|
|
29
|
+
rootElementId?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const TenantProvider: ({ children, tenants, rootElementId, }: TenantProviderProps) => React.JSX.Element;
|
|
32
|
+
export declare const useTenant: () => TenantContextValue;
|
|
33
|
+
/**
|
|
34
|
+
* 根据租户主题适配 antd 组件
|
|
35
|
+
*
|
|
36
|
+
* @param theme 租户主题
|
|
37
|
+
* @returns antd 主题配置
|
|
38
|
+
*/
|
|
39
|
+
export declare const getThemeConfig: ({ primaryColor, linkColor, secondaryColor, }: TenantTheme) => ThemeConfig;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 租户名称
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 租户配置
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 租户主题
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var tenantThemes = {
|
|
16
|
+
xyd: {
|
|
17
|
+
primaryColor: '#1990fe',
|
|
18
|
+
linkColor: '#1990fe',
|
|
19
|
+
secondaryColor: '#e6f4ff'
|
|
20
|
+
},
|
|
21
|
+
xcamp: {
|
|
22
|
+
primaryColor: '#ffad11',
|
|
23
|
+
linkColor: '#d46b13',
|
|
24
|
+
secondaryColor: '#fff3dc'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var TenantContext = /*#__PURE__*/React.createContext({
|
|
28
|
+
tenant: {
|
|
29
|
+
name: 'xyd'
|
|
30
|
+
},
|
|
31
|
+
theme: tenantThemes.xyd
|
|
32
|
+
});
|
|
33
|
+
export var TenantProvider = function TenantProvider(_ref) {
|
|
34
|
+
var children = _ref.children,
|
|
35
|
+
tenants = _ref.tenants,
|
|
36
|
+
_ref$rootElementId = _ref.rootElementId,
|
|
37
|
+
rootElementId = _ref$rootElementId === void 0 ? 'root' : _ref$rootElementId;
|
|
38
|
+
var tenantName = location.hostname.includes('.x-camp.') ? 'xcamp' : 'xyd';
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
var _document$getElementB;
|
|
41
|
+
var className = rootElementId.split('-').slice(0, -1).concat(tenantName).join('-');
|
|
42
|
+
(_document$getElementB = document.getElementById(rootElementId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(className);
|
|
43
|
+
}, []);
|
|
44
|
+
return /*#__PURE__*/React.createElement(TenantContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
tenant: tenants[tenantName],
|
|
47
|
+
theme: tenantThemes[tenantName]
|
|
48
|
+
}
|
|
49
|
+
}, children);
|
|
50
|
+
};
|
|
51
|
+
export var useTenant = function useTenant() {
|
|
52
|
+
return useContext(TenantContext);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 根据租户主题适配 antd 组件
|
|
57
|
+
*
|
|
58
|
+
* @param theme 租户主题
|
|
59
|
+
* @returns antd 主题配置
|
|
60
|
+
*/
|
|
61
|
+
export var getThemeConfig = function getThemeConfig(_ref2) {
|
|
62
|
+
var primaryColor = _ref2.primaryColor,
|
|
63
|
+
linkColor = _ref2.linkColor,
|
|
64
|
+
secondaryColor = _ref2.secondaryColor;
|
|
65
|
+
return {
|
|
66
|
+
token: {
|
|
67
|
+
borderRadius: 4,
|
|
68
|
+
colorLink: linkColor,
|
|
69
|
+
colorPrimary: primaryColor,
|
|
70
|
+
colorTextBase: '#444'
|
|
71
|
+
},
|
|
72
|
+
components: {
|
|
73
|
+
Table: {
|
|
74
|
+
headerBg: secondaryColor
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TableProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
export type VirtualTableProps<RecordType = any> = TableProps<RecordType>;
|
|
4
|
+
declare const VirtualTable: <RecordType extends Record<string | number | symbol, any>>(props: VirtualTableProps<RecordType>) => React.JSX.Element;
|
|
4
5
|
export default VirtualTable;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
export interface VisualDataConfigProps {
|
|
3
3
|
onConfirm: (value: string) => void;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
declare const VisualDataConfig: ({ onConfirm }: VisualDataConfigProps) => React.JSX.Element;
|
|
5
6
|
export default VisualDataConfig;
|
package/dist/x-tabs/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
type XTabsItem = Exclude<TabsProps['items'], undefined> extends (infer Item)[] ? Item & {
|
|
4
4
|
icon?: React.ReactNode;
|
|
5
5
|
} : never;
|
|
6
|
-
interface XTabsProps extends TabsProps {
|
|
6
|
+
export interface XTabsProps extends TabsProps {
|
|
7
7
|
items?: XTabsItem[];
|
|
8
8
|
}
|
|
9
9
|
declare const XTabs: ({ className, items, ...props }: XTabsProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-star-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"description": "A react component library developed by turingstar",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@uiw/react-codemirror": "^4.21.9",
|
|
64
64
|
"ahooks": "^3.8.0",
|
|
65
65
|
"classnames": "^2.3.2",
|
|
66
|
+
"html2canvas": "^1.4.1",
|
|
66
67
|
"qiankun": "^2.10.16",
|
|
67
68
|
"randomcolor": "^0.6.2",
|
|
68
69
|
"react-error-boundary": "^4.0.13",
|
|
File without changes
|
|
File without changes
|