@team-monolith/cds 1.78.6 → 1.79.1
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/patterns/LexicalEditor/nodes/ProblemInputNode/ProblemInputNode.d.ts +3 -3
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/ProblemInputNode.js +2 -2
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSegmentedControl.d.ts +5 -5
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSegmentedControl.js +4 -4
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +6 -5
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ export interface ProblemInputPayload {
|
|
|
11
11
|
* (ex: "코들 입니다" => "** ***") */
|
|
12
12
|
solutions: Solution[];
|
|
13
13
|
answer: string;
|
|
14
|
-
caseSensitive
|
|
15
|
-
ignoreWhitespace
|
|
14
|
+
caseSensitive?: boolean;
|
|
15
|
+
ignoreWhitespace?: boolean;
|
|
16
16
|
/** FE에서만 사용하는 값. 문제의 정오답 여부를 주입하여 스타일을 변경합니다. */
|
|
17
17
|
isCorrect?: boolean;
|
|
18
18
|
key?: NodeKey;
|
|
@@ -45,7 +45,7 @@ export declare class ProblemInputNode extends DecoratorNode<ReactNode> {
|
|
|
45
45
|
setCaseSensitive(caseSensitive: boolean): void;
|
|
46
46
|
setIgnoreWhitespace(ignoreWhitespace: boolean): void;
|
|
47
47
|
static clone(node: ProblemInputNode): ProblemInputNode;
|
|
48
|
-
constructor(showCharacterNumber: boolean, placeholder: string, solutions: Solution[], answer: string, caseSensitive
|
|
48
|
+
constructor(showCharacterNumber: boolean, placeholder: string, solutions: Solution[], answer: string, caseSensitive?: boolean, ignoreWhitespace?: boolean, isCorrect?: boolean, key?: NodeKey);
|
|
49
49
|
createDOM(config: EditorConfig): HTMLElement;
|
|
50
50
|
updateDOM(): boolean;
|
|
51
51
|
static importJSON(serializedNode: SerializedProblemInputNode): ProblemInputNode;
|
|
@@ -64,8 +64,8 @@ export class ProblemInputNode extends DecoratorNode {
|
|
|
64
64
|
this.__placeholder = placeholder;
|
|
65
65
|
this.__solutions = solutions;
|
|
66
66
|
this.__answer = answer;
|
|
67
|
-
this.__caseSensitive = caseSensitive;
|
|
68
|
-
this.__ignoreWhitespace = ignoreWhitespace;
|
|
67
|
+
this.__caseSensitive = caseSensitive !== null && caseSensitive !== void 0 ? caseSensitive : false;
|
|
68
|
+
this.__ignoreWhitespace = ignoreWhitespace !== null && ignoreWhitespace !== void 0 ? ignoreWhitespace : true;
|
|
69
69
|
this.__isCorrect = isCorrect;
|
|
70
70
|
}
|
|
71
71
|
createDOM(config) {
|
package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSegmentedControl.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Control,
|
|
1
|
+
import { Control, UseFormTrigger } from "react-hook-form";
|
|
2
2
|
import { ProblemInputPayload } from "../ProblemInputNode";
|
|
3
3
|
import React from "react";
|
|
4
|
-
export interface
|
|
4
|
+
export interface FormSegmentedControlProps {
|
|
5
5
|
control: Control<ProblemInputPayload>;
|
|
6
6
|
trigger: UseFormTrigger<ProblemInputPayload>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
name: "showCharacterNumber" | "ignoreWhitespace" | "caseSensitive";
|
|
8
|
+
items: {
|
|
9
9
|
value: boolean;
|
|
10
10
|
label: React.ReactNode;
|
|
11
11
|
}[];
|
|
12
12
|
}
|
|
13
|
-
export declare function FormSegmentedControl(props:
|
|
13
|
+
export declare function FormSegmentedControl(props: FormSegmentedControlProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSegmentedControl.js
CHANGED
|
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Controller } from "react-hook-form";
|
|
3
3
|
import { SegmentedControlButton, SegmentedControlGroup, } from "../../../../SegmentedControl";
|
|
4
4
|
export function FormSegmentedControl(props) {
|
|
5
|
-
const { control, trigger,
|
|
6
|
-
return (_jsx(Controller, { name:
|
|
5
|
+
const { control, trigger, name, items } = props;
|
|
6
|
+
return (_jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => {
|
|
7
7
|
return (_jsx(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: (value) => {
|
|
8
8
|
onChange(value);
|
|
9
9
|
trigger("solutions");
|
|
10
|
-
}, fullWidth: true }, { children:
|
|
11
|
-
return _jsx(SegmentedControlButton, { value:
|
|
10
|
+
}, fullWidth: true }, { children: items.map(item => {
|
|
11
|
+
return _jsx(SegmentedControlButton, { value: item.value, label: item.label }, item.value.toString());
|
|
12
12
|
}) })));
|
|
13
13
|
} }));
|
|
14
14
|
}
|
|
@@ -34,6 +34,7 @@ export function SettingForm(props) {
|
|
|
34
34
|
});
|
|
35
35
|
const onSettingSubmit = (data) => {
|
|
36
36
|
editor.update(() => {
|
|
37
|
+
var _a, _b;
|
|
37
38
|
const node = $getNodeByKey(nodeKey);
|
|
38
39
|
if (!$isProblemInputNode(node)) {
|
|
39
40
|
return;
|
|
@@ -41,8 +42,8 @@ export function SettingForm(props) {
|
|
|
41
42
|
node.setSolutions(data.solutions);
|
|
42
43
|
node.setShowCharacterNumber(data.showCharacterNumber);
|
|
43
44
|
node.setPlaceholder(data.placeholder);
|
|
44
|
-
node.setCaseSensitive(data.caseSensitive);
|
|
45
|
-
node.setIgnoreWhitespace(data.ignoreWhitespace);
|
|
45
|
+
node.setCaseSensitive((_a = data.caseSensitive) !== null && _a !== void 0 ? _a : false);
|
|
46
|
+
node.setIgnoreWhitespace((_b = data.ignoreWhitespace) !== null && _b !== void 0 ? _b : true);
|
|
46
47
|
});
|
|
47
48
|
onClose();
|
|
48
49
|
};
|
|
@@ -76,16 +77,16 @@ export function SettingForm(props) {
|
|
|
76
77
|
` }), _jsx(Label, { children: "\uAC00\uB2A5\uD55C \uC815\uB2F5\uC744 \uBAA8\uB450 \uCD94\uAC00\uD574\uC57C \uC6D0\uD65C\uD558\uAC8C \uC790\uB3D9 \uCC44\uC810\uD560 \uC218 \uC788\uC5B4\uC694." })] }))] }), _jsxs(Right, { children: [_jsxs(FormArea, { children: [_jsxs(Label, { children: ["\uC785\uB825 \uCE78", _jsx(Tooltip, Object.assign({ text: _jsxs("span", { children: [`예를 들어 정답이 '글자 수'이고`, _jsx("br", {}), _jsx("b", { children: "\uAE00\uC790 \uC218\uB300\uB85C" }), " \uC635\uC158\uC744 \uC120\uD0DD\uD588\uB2E4\uBA74", _jsx("br", {}), `입력 칸이 '☐☐ ☐' 처럼 표시됩니다.`] }), placement: "top" }, { children: _jsx(QuestionFillIcon, { css: css `
|
|
77
78
|
width: 12px;
|
|
78
79
|
height: 12px;
|
|
79
|
-
` }) }))] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger,
|
|
80
|
+
` }) }))] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "showCharacterNumber", items: [
|
|
80
81
|
{ value: false, label: "한 칸으로" },
|
|
81
82
|
{ value: true, label: "글자 수대로" }
|
|
82
83
|
] })] }), _jsxs(FormArea, { children: [_jsxs(Label, { children: ["\uC790\uB9AC \uD45C\uC2DC\uC790", _jsx(Tooltip, Object.assign({ text: _jsx("span", { children: "\uC785\uB825 \uCE78\uC5D0 \uAE30\uBCF8\uC73C\uB85C \uB178\uCD9C\uB418\uB294 \uD14D\uC2A4\uD2B8\uC785\uB2C8\uB2E4." }), placement: "top" }, { children: _jsx(QuestionFillIcon, { css: css `
|
|
83
84
|
width: 12px;
|
|
84
85
|
height: 12px;
|
|
85
|
-
` }) }))] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB744\uC5B4\uC4F0\uAE30" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger,
|
|
86
|
+
` }) }))] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB744\uC5B4\uC4F0\uAE30" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "ignoreWhitespace", items: [
|
|
86
87
|
{ value: true, label: "무시하기" },
|
|
87
88
|
{ value: false, label: "포함하기" }
|
|
88
|
-
] })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB300\uC18C\uBB38\uC790" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger,
|
|
89
|
+
] })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB300\uC18C\uBB38\uC790" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "caseSensitive", items: [
|
|
89
90
|
{ value: false, label: "무시하기" },
|
|
90
91
|
{ value: true, label: "포함하기" }
|
|
91
92
|
] })] })] })] }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: "\uB2EB\uAE30", onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: "\uC774\uB300\uB85C \uB123\uAE30", type: "submit" })] })] })));
|