okstra 0.87.0 → 0.87.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/package.json
CHANGED
package/runtime/BUILD.json
CHANGED
|
@@ -407,7 +407,8 @@ def _emit_table(lines: list[str], start: int, section_path: list[str]) -> tuple[
|
|
|
407
407
|
f"<td{_col_class(idx, narrow_cols)}>{_inline(cell)}</td>"
|
|
408
408
|
)
|
|
409
409
|
body_rows.append(
|
|
410
|
-
f'<tr
|
|
410
|
+
f'<tr id="{html.escape(meta.row_id.lower())}" '
|
|
411
|
+
f'data-response-id="{html.escape(meta.row_id)}" '
|
|
411
412
|
f'data-kind="{html.escape(meta.kind)}" '
|
|
412
413
|
f'data-status="{html.escape(meta.status)}">'
|
|
413
414
|
+ "".join(cells_html)
|
|
@@ -549,21 +550,14 @@ def _form_control(
|
|
|
549
550
|
"</select>"
|
|
550
551
|
)
|
|
551
552
|
other_html = (
|
|
552
|
-
f' <
|
|
553
|
-
f'placeholder="기타 응답"{disabled} hidden
|
|
553
|
+
f' <textarea data-other-for="{rid}" '
|
|
554
|
+
f'placeholder="기타 응답" rows="2"{disabled} hidden>'
|
|
555
|
+
f"{safe_value}</textarea>"
|
|
554
556
|
)
|
|
555
557
|
return select_html + other_html
|
|
556
558
|
|
|
557
|
-
# material/data-point
|
|
558
|
-
|
|
559
|
-
return (
|
|
560
|
-
f'<input type="text" name="{rid}" data-response-id="{rid}" '
|
|
561
|
-
f'data-kind="{html.escape(kind)}" '
|
|
562
|
-
f'placeholder="{html.escape(placeholder)}"{disabled} '
|
|
563
|
-
f'value="{safe_value}">'
|
|
564
|
-
)
|
|
565
|
-
|
|
566
|
-
# 그 외 (decision-without-enum 포함) — 자유 본문은 textarea 유지.
|
|
559
|
+
# 나머지 kind(material/data-point/decision-without-enum)는 모두 자유 입력.
|
|
560
|
+
# 한 줄 넘는 응답을 편하게 적도록 고정 높이 input 대신 textarea 로 렌더한다.
|
|
567
561
|
return (
|
|
568
562
|
f'<textarea name="{rid}" data-response-id="{rid}" '
|
|
569
563
|
f'data-kind="{html.escape(kind)}" rows="2" '
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* Responsibilities:
|
|
4
4
|
* 1. Collect entry values for every <tr data-response-id> whose
|
|
5
5
|
* Status is open/answered (disabled rows skipped automatically).
|
|
6
|
-
* Widgets: <select> (enum decision), <
|
|
7
|
-
* input revealed when select == "__other__"), <
|
|
8
|
-
* data-response-id> (
|
|
9
|
-
* (everything else / fallback).
|
|
6
|
+
* Widgets: <select> (enum decision), <textarea data-other-for>
|
|
7
|
+
* (기타 input revealed when select == "__other__"), <textarea
|
|
8
|
+
* data-response-id> (everything else / fallback).
|
|
10
9
|
* 2. Serialise the entries into markdown whose bytes are IDENTICAL
|
|
11
10
|
* to scripts/okstra_ctl/report_views.py serialize_user_response.
|
|
12
11
|
* 3. Write the result to <pre id="user-response-output">, offer a
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
if (picked === "") return "";
|
|
57
56
|
if (picked === "__other__") {
|
|
58
57
|
var rid = sel.getAttribute("data-response-id") || "";
|
|
59
|
-
var other = row.querySelector('
|
|
58
|
+
var other = row.querySelector('textarea[data-other-for="' + rid + '"]');
|
|
60
59
|
return other ? trimMultiline(other.value) : "";
|
|
61
60
|
}
|
|
62
61
|
var opt = sel.options[sel.selectedIndex];
|
|
@@ -69,11 +68,6 @@
|
|
|
69
68
|
if (ta.disabled) return "";
|
|
70
69
|
return trimMultiline(ta.value);
|
|
71
70
|
}
|
|
72
|
-
var inp = row.querySelector("input[data-response-id]");
|
|
73
|
-
if (inp) {
|
|
74
|
-
if (inp.disabled) return "";
|
|
75
|
-
return trimMultiline(inp.value);
|
|
76
|
-
}
|
|
77
71
|
return "";
|
|
78
72
|
}
|
|
79
73
|
|
|
@@ -119,7 +113,7 @@
|
|
|
119
113
|
for (var i = 0; i < selects.length; i++) {
|
|
120
114
|
(function (sel) {
|
|
121
115
|
var rid = sel.getAttribute("data-response-id") || "";
|
|
122
|
-
var other = document.querySelector('
|
|
116
|
+
var other = document.querySelector('textarea[data-other-for="' + rid + '"]');
|
|
123
117
|
if (!other) return;
|
|
124
118
|
var update = function () {
|
|
125
119
|
other.hidden = sel.value !== "__other__";
|